From 474882ae27fc7155ba83b851578575406428ae4b Mon Sep 17 00:00:00 2001 From: Chrezm Date: Sun, 4 Dec 2022 20:09:21 -0800 Subject: [PATCH 1/5] Fix /randommusic failing halfway through --- CHANGELOG.md | 3 +++ server/commands.py | 2 +- server/tsuserver.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a7d056..533c083d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -882,3 +882,6 @@ ## 221204a (5.0.0-post1) * Fixed players being unable to play a track via the music list if it is a track of their hub music list but not of their personal music list + +## (5.0.0-post2) +* Fixed /randommusic failing halfway through diff --git a/server/commands.py b/server/commands.py index 401ed1e2..2126058e 100644 --- a/server/commands.py +++ b/server/commands.py @@ -7476,7 +7476,7 @@ def ooc_cmd_randommusic(client: ClientManager.Client, arg: str): # Find all music tracks music_names = list() - music_list = client.music_manager.get_music_data() + music_list = client.music_manager.get_music() for item in music_list: songs = item['songs'] diff --git a/server/tsuserver.py b/server/tsuserver.py index 02d15324..6fb7c591 100644 --- a/server/tsuserver.py +++ b/server/tsuserver.py @@ -67,8 +67,8 @@ def __init__(self, client_manager_type: Type[ClientManager] = None): self.release = 5 self.major_version = 0 self.minor_version = 0 - self.segment_version = 'post1' - self.internal_version = '221204a' + self.segment_version = 'post2' + self.internal_version = 'p221204a' version_string = self.get_version_string() self.software = 'TsuserverDR {}'.format(version_string) self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version) From a11bef9c2612ec2e18ad1bdcf80c4fd2104fd8ac Mon Sep 17 00:00:00 2001 From: Chrezm Date: Sun, 4 Dec 2022 20:31:21 -0800 Subject: [PATCH 2/5] Fixed games not asserting properties of player groups after mutator calls --- CHANGELOG.md | 1 + server/game_manager.py | 3 +++ server/tsuserver.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 533c083d..1e3bba5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -885,3 +885,4 @@ ## (5.0.0-post2) * Fixed /randommusic failing halfway through +* Fixed games not asserting properties of player groups after mutator calls diff --git a/server/game_manager.py b/server/game_manager.py index 59c36bf9..3331e175 100644 --- a/server/game_manager.py +++ b/server/game_manager.py @@ -1863,6 +1863,9 @@ def _check_structure(self): self._timer_manager._check_structure() self._team_manager._check_structure() + # 5. + super()._check_structure() + def __str__(self): """ Return a string representation of this game. diff --git a/server/tsuserver.py b/server/tsuserver.py index 6fb7c591..2ece2839 100644 --- a/server/tsuserver.py +++ b/server/tsuserver.py @@ -68,7 +68,7 @@ def __init__(self, client_manager_type: Type[ClientManager] = None): self.major_version = 0 self.minor_version = 0 self.segment_version = 'post2' - self.internal_version = 'p221204a' + self.internal_version = 'p221204b' version_string = self.get_version_string() self.software = 'TsuserverDR {}'.format(version_string) self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version) From 697f1d055b184028098027b5fabb65dbadc4d4fb Mon Sep 17 00:00:00 2001 From: Chrezm Date: Sun, 4 Dec 2022 20:40:38 -0800 Subject: [PATCH 3/5] Fixed trials being internally initialized incorrectly, which prevented commands such as /nsd_accept and /nsd_reject from running properly --- CHANGELOG.md | 1 + server/hub_manager.py | 2 +- server/tsuserver.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3bba5d..66d8ed72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -886,3 +886,4 @@ ## (5.0.0-post2) * Fixed /randommusic failing halfway through * Fixed games not asserting properties of player groups after mutator calls +* Fixed trials being internally initialized incorrectly, which prevented commands such as /nsd_accept and /nsd_reject from running properly diff --git a/server/hub_manager.py b/server/hub_manager.py index fb681d28..5700d47b 100644 --- a/server/hub_manager.py +++ b/server/hub_manager.py @@ -1898,7 +1898,7 @@ def __init__( self.area_manager = AreaManager(server, hub=self) self.load_areas() - self.trial_manager = TrialManager(self) + self.trial_manager = TrialManager(server) self._password = str(secrets.randbelow(9000) + 1000) # Cute trick to get 4-digit number diff --git a/server/tsuserver.py b/server/tsuserver.py index 2ece2839..d32f9c9b 100644 --- a/server/tsuserver.py +++ b/server/tsuserver.py @@ -68,7 +68,7 @@ def __init__(self, client_manager_type: Type[ClientManager] = None): self.major_version = 0 self.minor_version = 0 self.segment_version = 'post2' - self.internal_version = 'p221204b' + self.internal_version = 'p221204c' version_string = self.get_version_string() self.software = 'TsuserverDR {}'.format(version_string) self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version) From 588ccab42cdd855a49e627b76a6154db449d881f Mon Sep 17 00:00:00 2001 From: Chrezm Date: Tue, 6 Dec 2022 21:55:21 -0800 Subject: [PATCH 4/5] Fixed players using clients that do not have a HIDE_CHARACTER argument in inbound IC messages (e.g. AO 2.10) occassionally failing to receive messages if they are in first person mode or not in forward sprites mode --- CHANGELOG.md | 1 + server/client_manager.py | 12 +++++++----- server/clients.py | 3 +++ server/tsuserver.py | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d8ed72..bc4a282e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -887,3 +887,4 @@ * Fixed /randommusic failing halfway through * Fixed games not asserting properties of player groups after mutator calls * Fixed trials being internally initialized incorrectly, which prevented commands such as /nsd_accept and /nsd_reject from running properly +* Fixed players using clients that do not have a HIDE_CHARACTER argument in inbound IC messages (e.g. AO 2.10) occassionally failing to receive messages if they are in first person mode or not in forward sprites mode diff --git a/server/client_manager.py b/server/client_manager.py index 4e2ba54f..7aecdcbd 100644 --- a/server/client_manager.py +++ b/server/client_manager.py @@ -324,8 +324,8 @@ def send_ooc_others( def send_ic( self, - params: List = None, - sender: ClientManager.Client = None, + params: Dict[str, Any] = None, + sender: Union[ClientManager.Client, None] = None, bypass_text_replace: bool = False, bypass_deafened_starters: bool = False, use_last_received_sprites: bool = False, @@ -509,7 +509,9 @@ def pop_if_there(dictionary, argument): pargs['pos'] = last_args['pos'] pargs['anim_type'] = last_args['anim_type'] pargs['flip'] = last_args['flip'] - pargs['hide_character'] = last_args['hide_character'] + # Only DRO 1.1.0+ has this + if self.packet_handler.HAS_HIDE_CHARACTER_AS_MS_ARGUMENT: + pargs['hide_character'] = last_args['hide_character'] # Regardless of anything, pairing is visually canceled while in first person # so set them to default values @@ -644,8 +646,8 @@ def pop_if_there(dictionary, argument): def send_ic_others( self, - params: List = None, - sender: ClientManager.Client = None, + params: Dict[str, Any] = None, + sender: Union[ClientManager.Client, None] = None, bypass_text_replace: bool = False, bypass_deafened_starters: bool = False, use_last_received_sprites: bool = False, diff --git a/server/clients.py b/server/clients.py index 7161c43e..3cbae931 100644 --- a/server/clients.py +++ b/server/clients.py @@ -40,6 +40,7 @@ def __eq__(self, other): ALLOWS_INVISIBLE_BLANKPOSTS = True REPLACES_BASE_OPUS_FOR_MP3 = False ALLOWS_CHAR_LIST_RELOAD = True + HAS_HIDE_CHARACTER_AS_MS_ARGUMENT = True DECRYPTOR_OUTBOUND = [ ('key', 34), # 0 @@ -359,6 +360,7 @@ class ClientDRO1d0d0(DefaultDROProtocol): HAS_JOINED_AREA = False REPLACES_BASE_OPUS_FOR_MP3 = True ALLOWS_CHAR_LIST_RELOAD = False + HAS_HIDE_CHARACTER_AS_MS_ARGUMENT = False MS_INBOUND = [ ('msg_type', ArgType.STR), # 0 @@ -411,6 +413,7 @@ class ClientAO2d10(DefaultDROProtocol): ALLOWS_INVISIBLE_BLANKPOSTS = False REPLACES_BASE_OPUS_FOR_MP3 = True ALLOWS_CHAR_LIST_RELOAD = True + HAS_HIDE_CHARACTER_AS_MS_ARGUMENT = False MS_INBOUND = [ ('msg_type', ArgType.STR), # 0 diff --git a/server/tsuserver.py b/server/tsuserver.py index d32f9c9b..77b2e878 100644 --- a/server/tsuserver.py +++ b/server/tsuserver.py @@ -68,7 +68,7 @@ def __init__(self, client_manager_type: Type[ClientManager] = None): self.major_version = 0 self.minor_version = 0 self.segment_version = 'post2' - self.internal_version = 'p221204c' + self.internal_version = 'p221206a' version_string = self.get_version_string() self.software = 'TsuserverDR {}'.format(version_string) self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version) From c3084c491b64083dbd8bf6237de0ed1c610d286d Mon Sep 17 00:00:00 2001 From: Chrezm Date: Thu, 8 Dec 2022 19:33:49 -0800 Subject: [PATCH 5/5] 5.0.0-post2 --- CHANGELOG.md | 2 +- server/tsuserver.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc4a282e..999353ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -883,7 +883,7 @@ ## 221204a (5.0.0-post1) * Fixed players being unable to play a track via the music list if it is a track of their hub music list but not of their personal music list -## (5.0.0-post2) +## 221208a (5.0.0-post2) * Fixed /randommusic failing halfway through * Fixed games not asserting properties of player groups after mutator calls * Fixed trials being internally initialized incorrectly, which prevented commands such as /nsd_accept and /nsd_reject from running properly diff --git a/server/tsuserver.py b/server/tsuserver.py index 77b2e878..1d354415 100644 --- a/server/tsuserver.py +++ b/server/tsuserver.py @@ -68,7 +68,7 @@ def __init__(self, client_manager_type: Type[ClientManager] = None): self.major_version = 0 self.minor_version = 0 self.segment_version = 'post2' - self.internal_version = 'p221206a' + self.internal_version = '221208a' version_string = self.get_version_string() self.software = 'TsuserverDR {}'.format(version_string) self.version = 'TsuserverDR {} ({})'.format(version_string, self.internal_version)