Add status field penguin data attribute

This commit is contained in:
Ben 2019-06-21 01:44:31 +01:00
parent 596bde74fb
commit 19810d5efc
4 changed files with 18 additions and 3 deletions

View File

@ -421,6 +421,7 @@ CREATE TABLE penguin (
rainbow_adoptability SMALLINT NOT NULL DEFAULT 0,
has_dug BOOLEAN NOT NULL DEFAULT FALSE,
nuggets SMALLINT NOT NULL DEFAULT 0,
status_field INT NOT NULL DEFAULT 0,
timer_active BOOLEAN NOT NULL DEFAULT FALSE,
timer_start TIME NOT NULL DEFAULT '00:00:00',
timer_end TIME NOT NULL DEFAULT '23:59:59',
@ -505,6 +506,7 @@ COMMENT ON COLUMN penguin.water_matches_won IS 'JitsuWater matces won';
COMMENT ON COLUMN penguin.rainbow_adoptability IS 'Rainbow puffle adoptability status';
COMMENT ON COLUMN penguin.has_dug IS 'Puffle digging boolean';
COMMENT ON COLUMN penguin.nuggets IS 'Golden puffle nuggets';
COMMENT ON COLUMN penguin.status_field IS 'New player status field';
COMMENT ON COLUMN penguin.timer_active IS 'Is egg-timer active?';
COMMENT ON COLUMN penguin.timer_start IS 'Egg-timer start time';
COMMENT ON COLUMN penguin.timer_end IS 'Egg-timer end time';

View File

@ -9,6 +9,18 @@ import logging
import copy
class StatusField(enum.IntEnum):
OpenedIglooViewer = 1
ActiveIglooLayoutOpenFlag = 2
PuffleTreasureInfographic = 512
PlayerOptInAbTestDayZero = 1024
PlayerSwapPuffle = 2048
MoreThanTenPufflesBackyardMessage = 4096
VisitBackyardFirstTime = 8192
HasWalkedPuffleFirstTime = 65536
HasWalkedPuffleSecondTime = 131072
class ConflictResolution(enum.Enum):
Silent = 0
Append = 1

View File

@ -60,6 +60,7 @@ class Penguin(db.Model):
rainbow_adoptability = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
has_dug = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
nuggets = db.Column(db.SmallInteger, nullable=False, server_default=db.text("0"))
status_field = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
timer_active = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
timer_start = db.Column(db.Time, nullable=False, server_default=db.text("'00:00:00'::time without time zone"))
timer_end = db.Column(db.Time, nullable=False, server_default=db.text("'23:59:59'::time without time zone"))

View File

@ -26,10 +26,10 @@ async def handle_join_server(p, penguin_id: int, login_key: str, lang: str):
penguin_standard_time = current_time * 1000
server_time_offset = 7
await p.send_xt('lp', await p.string, p.data.coins, p.data.safe_chat, 1440,
await p.send_xt('lp', await p.string, p.data.coins, int(p.data.safe_chat), 1440,
penguin_standard_time, p.data.age, 0, p.data.minutes_played,
"membership_days", server_time_offset, "has_opened_player_card",
"map_category", "StatusField")
"membership_days", server_time_offset, int(p.data.opened_playercard),
p.data.map_category, p.data.status_field)
spawn = random.choice(p.server.spawn_rooms)
await spawn.add_penguin(p)