From 7a3511e1ef8c0146aa41d2b135590a8af8385206 Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Mon, 27 Apr 2020 23:49:46 -0700 Subject: [PATCH 1/7] Update messages that get sent to client with aliases. --- MultiServer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 1b0ce789..e7ba9231 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -263,7 +263,7 @@ async def on_client_joined(ctx: Context, client: Client): client.tags)) async def on_client_left(ctx: Context, client: Client): - notify_all(ctx, "%s (Team #%d) has left the game" % (client.name, client.team + 1)) + notify_all(ctx, "%s (Team #%d) has left the game" % (ctx.get_aliased_name(client.team, client.slot), client.team + 1)) async def countdown(ctx: Context, timer): notify_all(ctx, f'[Server]: Starting countdown of {timer}s') @@ -638,7 +638,7 @@ class ClientMessageProcessor(CommandProcessor): if usable: new_item = ReceivedItem(Items.item_table[item_name][3], -1, self.client.slot) get_received_items(self.ctx, self.client.team, self.client.slot).append(new_item) - notify_all(self.ctx, 'Cheat console: sending "' + item_name + '" to ' + self.client.name) + notify_all(self.ctx, 'Cheat console: sending "' + item_name + '" to ' + self.ctx.get_aliased_name(self.client.team, self.client.slot)) send_new_items(self.ctx) return True else: @@ -798,7 +798,7 @@ async def process_client_cmd(ctx: Context, client: Client, cmd, args): elif cmd == 'GameFinished': if ctx.client_game_state[client.team, client.slot] != CLIENT_GOAL: - finished_msg = f'{client.name} (Team #{client.team + 1}) has found the triforce.' + finished_msg = f'{ctx.get_aliased_name(client.team, client.slot)} (Team #{client.team + 1}) has found the triforce.' notify_all(ctx, finished_msg) print(finished_msg) ctx.client_game_state[client.team, client.slot] = CLIENT_GOAL @@ -835,7 +835,7 @@ class ServerCommandProcessor(CommandProcessor): for client in self.ctx.clients: if client.auth and client.name.lower() == player_name.lower() and client.socket and not client.socket.closed: asyncio.create_task(client.socket.close()) - self.output(f"Kicked {client.name}") + self.output(f"Kicked {self.ctx.get_aliased_name(client.team, client.slot)}") return True self.output(f"Could not find player {player_name} to kick") @@ -911,7 +911,7 @@ class ServerCommandProcessor(CommandProcessor): if client.name == seeked_player: new_item = ReceivedItem(Items.item_table[item][3], -1, client.slot) get_received_items(self.ctx, client.team, client.slot).append(new_item) - notify_all(self.ctx, 'Cheat console: sending "' + item + '" to ' + client.name) + notify_all(self.ctx, 'Cheat console: sending "' + item + '" to ' + self.ctx.get_aliased_name(client.team, client.slot)) send_new_items(self.ctx) return True else: From ce7b843618ac827577dbce107af8620216a4cc8e Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Tue, 28 Apr 2020 00:06:50 -0700 Subject: [PATCH 2/7] Honk. --- Text.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Text.py b/Text.py index d673e2da..62d27ba7 100644 --- a/Text.py +++ b/Text.py @@ -66,6 +66,7 @@ Uncle_texts = [ "Get to the\nchop...\ncastle!", "Come with me\nif you want\nto live", "I must go\nmy planet\nneeds me", + "\n Honk.", ] Triforce_texts = [ 'Product has Hole in center. Bad seller, 0 out of 5.', @@ -171,6 +172,7 @@ Ganon1_texts = [ "When I conquer\nthe Light\nWorld, I'll\nhold a parade\nof all my\nmonsters to\ndemonstrate my\nmight to the\npeople!", "Life, dreams,\nhope...\nWhere'd they\ncome from? And\nwhere are they\nheaded? These\nthings... I am\ngoing to\ndestroy!", "My minions all\nfailed to\nguard those\nitems?!\n\nWhy am I\nsurrounded by\nincompetent\nfools?!", + "\n Honk.", ] TavernMan_texts = [ "What do you\ncall a blind\ndinosaur?\na doyouthink-\nhesaurus.", @@ -248,7 +250,8 @@ junk_texts = [ "{C:GREEN}\n> race roms\ndon’t have\nspoiler logs", "{C:GREEN}\nI bet a nice\ncup of tea\nwould help! >", "{C:GREEN}\nI bet you\nexpected help,\ndidn't you? >", - "{C:GREEN}\nLearn to make\nplogues, easy\nand yummy! >" + "{C:GREEN}\nLearn to make\nplogues, easy\nand yummy! >", + "{C:GREEN}\n \n Honk.\n >" ] KingsReturn_texts = [ From 0b0c5778d14d6a216f5c2fc568bddff4ae7b17fc Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Wed, 29 Apr 2020 21:59:19 -0700 Subject: [PATCH 3/7] Ganon fact about geese --- Text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Text.py b/Text.py index 62d27ba7..71da6810 100644 --- a/Text.py +++ b/Text.py @@ -172,7 +172,7 @@ Ganon1_texts = [ "When I conquer\nthe Light\nWorld, I'll\nhold a parade\nof all my\nmonsters to\ndemonstrate my\nmight to the\npeople!", "Life, dreams,\nhope...\nWhere'd they\ncome from? And\nwhere are they\nheaded? These\nthings... I am\ngoing to\ndestroy!", "My minions all\nfailed to\nguard those\nitems?!\n\nWhy am I\nsurrounded by\nincompetent\nfools?!", - "\n Honk.", + "Goose is\nactually the\nterm for\nfemale geese,\nmale geese are\ncalled\nganders.", ] TavernMan_texts = [ "What do you\ncall a blind\ndinosaur?\na doyouthink-\nhesaurus.", From c225662c71ed961fa187cd52668c29de68fd41ff Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Wed, 29 Apr 2020 22:39:22 -0700 Subject: [PATCH 4/7] Keep goose/honk to just ganon/triforce --- Text.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Text.py b/Text.py index 71da6810..7b75c486 100644 --- a/Text.py +++ b/Text.py @@ -66,7 +66,6 @@ Uncle_texts = [ "Get to the\nchop...\ncastle!", "Come with me\nif you want\nto live", "I must go\nmy planet\nneeds me", - "\n Honk.", ] Triforce_texts = [ 'Product has Hole in center. Bad seller, 0 out of 5.', @@ -251,7 +250,6 @@ junk_texts = [ "{C:GREEN}\nI bet a nice\ncup of tea\nwould help! >", "{C:GREEN}\nI bet you\nexpected help,\ndidn't you? >", "{C:GREEN}\nLearn to make\nplogues, easy\nand yummy! >", - "{C:GREEN}\n \n Honk.\n >" ] KingsReturn_texts = [ From d4be3387cf6be4b7f6d75ab5708bae7663603786 Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Wed, 29 Apr 2020 22:42:26 -0700 Subject: [PATCH 5/7] Fix issue when a zero byte _persistent_storage.yaml exists. --- Utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Utils.py b/Utils.py index 6ed5df29..8ad710c1 100644 --- a/Utils.py +++ b/Utils.py @@ -231,6 +231,8 @@ def persistent_load() -> typing.Dict[dict]: except Exception as e: import logging logging.debug(f"Could not read store: {e}") + if storage is None: + storage = {} return storage From 9beaff93a15c33bf1fb24265429cc49bf35f3490 Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Wed, 29 Apr 2020 23:54:57 -0700 Subject: [PATCH 6/7] ignore _persistent_storage.yaml --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index de385a79..ba59b0e7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ weights/ /Players/ /QUsb2Snes/ /options.yaml +_persistent_storage.yaml From b4ce00da5798d26cc10a8ec53bc96add0f7567b0 Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Wed, 29 Apr 2020 23:56:51 -0700 Subject: [PATCH 7/7] ignore mystery_result_*.yaml --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ba59b0e7..7d4e4751 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ weights/ /QUsb2Snes/ /options.yaml _persistent_storage.yaml +mystery_result_*.yaml