From f9e0e740d1ec5b5af3d212fa9859ae7e6c0d5331 Mon Sep 17 00:00:00 2001 From: replaymikey <40784301+replaymikey@users.noreply.github.com> Date: Wed, 29 Jul 2026 22:12:15 -0500 Subject: [PATCH 1/4] Update db_manager.py adding share_data to the validation checks is tested and working. creating share_data in intial db creation is UNTESTED --- entralinked/utility/db_manager.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/entralinked/utility/db_manager.py b/entralinked/utility/db_manager.py index b3e97c8..c004997 100644 --- a/entralinked/utility/db_manager.py +++ b/entralinked/utility/db_manager.py @@ -29,7 +29,8 @@ def __init__(self, db_path: Path): sleeping_pokemon TEXT, game_sync TEXT, crop_data TEXT, - chest_data TEXT + chest_data TEXT, + share_data TEXT )""") fix_ownership(self._db_path) @@ -55,7 +56,7 @@ def _conn(self) -> sqlite3.Connection: def _validate_column(self, column: str): valid_columns = [ "player_data", "sleeping_pokemon", "game_sync", - "wfc_profile", "crop_data", "chest_data" + "wfc_profile", "crop_data", "chest_data", "share_data" ] if column not in valid_columns: raise ValueError(f"Invalid column name: '{column}'") @@ -85,12 +86,21 @@ def write_gscd(self, gscd: str): ] } - query = "INSERT OR IGNORE INTO player_saves (gscd, crop_data, chest_data) VALUES (?, ?, ?)" + empty_share = { + "cnt": 0, + "list": [ + + ] + } + + + query = "INSERT OR IGNORE INTO player_saves (gscd, crop_data, chest_data, share_data) VALUES (?, ?, ?)" with self._conn: self._conn.execute(query, (str(gscd), json.dumps(empty_crop, indent=2), json.dumps(empty_chest, indent=2)) + json.dumps(empty_share, indent=2)) ) def write(self, gscd: str, column: str, data: dict): @@ -160,4 +170,4 @@ def close(self): Path(ROOT_DIR / "save_data").mkdir(exist_ok=True) fix_ownership(Path(ROOT_DIR / "save_data")) -db = DBManager(Path(ROOT_DIR / "save_data" / "pokemon_saves.db")) \ No newline at end of file +db = DBManager(Path(ROOT_DIR / "save_data" / "pokemon_saves.db")) From 93f5c18d19ca4da6060852c0a25eeb9a934918af Mon Sep 17 00:00:00 2001 From: replaymikey <40784301+replaymikey@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:02:26 -0500 Subject: [PATCH 2/4] Update db_manager.py tested with a new user. db creation works (and now you get an item from me) --- entralinked/utility/db_manager.py | 34 ++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/entralinked/utility/db_manager.py b/entralinked/utility/db_manager.py index c004997..a2647dd 100644 --- a/entralinked/utility/db_manager.py +++ b/entralinked/utility/db_manager.py @@ -87,19 +87,39 @@ def write_gscd(self, gscd: str): } empty_share = { - "cnt": 0, - "list": [ - - ] + "cnt": 1, + "share_list": [ + { + "material_id": "3011", + "item_id": 563, + "pokeitem": "Steel Gem", + "x": 1, + "y": 1, + "history_id": "", + "old_member_savedata_id": 3280335, + "pokemon_no": 585, + "form_no": 2, + "pokename": "Deerling", + "pgl_name": "Mikey", + "nickname": "Mikey", + "poke_nickname": "Deerling", + "field_line1": "A gem with an essence of steel. When", + "field_line2": "held, it strengthens the power of a", + "field_line3": "Steel-type move only once.", + "created_at": "2026-07-29 19:45", + "old_item_id": 563, + "new_item_id": "", + "old_item_name": "Steel Gem" + } + ] } - - query = "INSERT OR IGNORE INTO player_saves (gscd, crop_data, chest_data, share_data) VALUES (?, ?, ?)" + query = "INSERT OR IGNORE INTO player_saves (gscd, crop_data, chest_data, share_data) VALUES (?, ?, ?, ?)" with self._conn: self._conn.execute(query, (str(gscd), json.dumps(empty_crop, indent=2), - json.dumps(empty_chest, indent=2)) + json.dumps(empty_chest, indent=2), json.dumps(empty_share, indent=2)) ) From 1cbcc231cce64cc1eef0f674c3f414da3ef26904 Mon Sep 17 00:00:00 2001 From: replaymikey <40784301+replaymikey@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:11:28 -0500 Subject: [PATCH 3/4] Update db_manager.py --- entralinked/utility/db_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entralinked/utility/db_manager.py b/entralinked/utility/db_manager.py index a2647dd..4d06020 100644 --- a/entralinked/utility/db_manager.py +++ b/entralinked/utility/db_manager.py @@ -108,7 +108,7 @@ def write_gscd(self, gscd: str): "field_line3": "Steel-type move only once.", "created_at": "2026-07-29 19:45", "old_item_id": 563, - "new_item_id": "", + "new_item_id": "563", "old_item_name": "Steel Gem" } ] From 674f1ff75ac25e2a5722c2eee5e95e8cff5c94bf Mon Sep 17 00:00:00 2001 From: replaymikey <40784301+replaymikey@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:11:50 -0500 Subject: [PATCH 4/4] Update db_manager.py --- entralinked/utility/db_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entralinked/utility/db_manager.py b/entralinked/utility/db_manager.py index 4d06020..3f61376 100644 --- a/entralinked/utility/db_manager.py +++ b/entralinked/utility/db_manager.py @@ -108,7 +108,7 @@ def write_gscd(self, gscd: str): "field_line3": "Steel-type move only once.", "created_at": "2026-07-29 19:45", "old_item_id": 563, - "new_item_id": "563", + "new_item_id": 563, "old_item_name": "Steel Gem" } ]