From 19810d5efc22b561d896d6ab36c3691d8c5e4676 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 21 Jun 2019 01:44:31 +0100 Subject: [PATCH] Add status field penguin data attribute --- houdini.sql | 2 ++ houdini/__init__.py | 12 ++++++++++++ houdini/data/penguin.py | 1 + houdini/handlers/play/navigation.py | 6 +++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/houdini.sql b/houdini.sql index d65a686..9a2103b 100644 --- a/houdini.sql +++ b/houdini.sql @@ -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'; diff --git a/houdini/__init__.py b/houdini/__init__.py index 6a3956c..bf68827 100644 --- a/houdini/__init__.py +++ b/houdini/__init__.py @@ -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 diff --git a/houdini/data/penguin.py b/houdini/data/penguin.py index 2cf25f0..f313cdc 100644 --- a/houdini/data/penguin.py +++ b/houdini/data/penguin.py @@ -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")) diff --git a/houdini/handlers/play/navigation.py b/houdini/handlers/play/navigation.py index d1957b2..33ef2a3 100644 --- a/houdini/handlers/play/navigation.py +++ b/houdini/handlers/play/navigation.py @@ -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)