From 94dafa3c55e00792c748f0fa835e2d364c344276 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 18 Oct 2020 23:07:48 +0200 Subject: [PATCH] Open Breaking changes --- MultiClient.py | 2 +- MultiServer.py | 12 ++++-------- Utils.py | 2 +- WebHostLib/customserver.py | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 520e5c86..acc1b892 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -916,7 +916,7 @@ async def process_server_cmd(ctx: Context, cmd, args): def get_tags(ctx: Context): - tags = ['Berserker'] + tags = ['AP'] if ctx.found_items: tags.append('FoundItems') return tags diff --git a/MultiServer.py b/MultiServer.py index 44b221f3..6ab19720 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -102,7 +102,7 @@ class Context(Node): self.auto_save_interval = 60 # in seconds self.auto_saver_thread = None self.save_dirty = False - self.tags = ['Berserker'] + self.tags = ['AP'] def load(self, multidatapath: str, use_embedded_server_options: bool = False): with open(multidatapath, 'rb') as f: @@ -302,14 +302,10 @@ def notify_hints(ctx: Context, team: int, hints: typing.List[Utils.Hint]): texts = [['Print', format_hint(ctx, team, hint)] for hint in hints] for _, text in texts: logging.info("Notice (Team #%d): %s" % (team + 1, text)) - texts = json.dumps(texts) + for client in ctx.endpoints: if client.auth and client.team == team: - if "Berserker" in client.tags and client.version >= [2, 2, 1]: - payload = cmd - else: - payload = texts - asyncio.create_task(ctx.send_json_msgs(client, payload)) + asyncio.create_task(ctx.send_json_msgs(client, cmd)) def update_aliases(ctx: Context, team: int, client: typing.Optional[Client] = None): @@ -979,7 +975,7 @@ async def process_client_cmd(ctx: Context, client: Client, cmd, args): client.name = ctx.player_names[(team, slot)] client.team = team client.slot = slot - if ctx.compatibility == 1 and "Berserker" not in args.get('tags', Client.tags): + if "AP" not in args.get('tags', Client.tags): errors.add('IncompatibleVersion') elif ctx.compatibility == 0 and args.get('version', Client.version) != list(_version_tuple): errors.add('IncompatibleVersion') diff --git a/Utils.py b/Utils.py index 45722761..48739e22 100644 --- a/Utils.py +++ b/Utils.py @@ -6,7 +6,7 @@ def tuplize_version(version: str) -> typing.Tuple[int, ...]: return tuple(int(piece, 10) for piece in version.split(".")) -__version__ = "3.2.1" +__version__ = "1.0.0" _version_tuple = tuplize_version(__version__) import os diff --git a/WebHostLib/customserver.py b/WebHostLib/customserver.py index 4a6ffc36..d755894d 100644 --- a/WebHostLib/customserver.py +++ b/WebHostLib/customserver.py @@ -50,7 +50,7 @@ class WebHostContext(Context): super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0, 2) self.main_loop = asyncio.get_running_loop() self.video = {} - self.tags = ["Berserker", "WebHost"] + self.tags = ["AP", "WebHost"] def listen_to_db_commands(self): cmdprocessor = DBCommandProcessor(self)