Open Breaking changes
This commit is contained in:
parent
2ae5f316dc
commit
94dafa3c55
|
@ -916,7 +916,7 @@ async def process_server_cmd(ctx: Context, cmd, args):
|
||||||
|
|
||||||
|
|
||||||
def get_tags(ctx: Context):
|
def get_tags(ctx: Context):
|
||||||
tags = ['Berserker']
|
tags = ['AP']
|
||||||
if ctx.found_items:
|
if ctx.found_items:
|
||||||
tags.append('FoundItems')
|
tags.append('FoundItems')
|
||||||
return tags
|
return tags
|
||||||
|
|
|
@ -102,7 +102,7 @@ class Context(Node):
|
||||||
self.auto_save_interval = 60 # in seconds
|
self.auto_save_interval = 60 # in seconds
|
||||||
self.auto_saver_thread = None
|
self.auto_saver_thread = None
|
||||||
self.save_dirty = False
|
self.save_dirty = False
|
||||||
self.tags = ['Berserker']
|
self.tags = ['AP']
|
||||||
|
|
||||||
def load(self, multidatapath: str, use_embedded_server_options: bool = False):
|
def load(self, multidatapath: str, use_embedded_server_options: bool = False):
|
||||||
with open(multidatapath, 'rb') as f:
|
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]
|
texts = [['Print', format_hint(ctx, team, hint)] for hint in hints]
|
||||||
for _, text in texts:
|
for _, text in texts:
|
||||||
logging.info("Notice (Team #%d): %s" % (team + 1, text))
|
logging.info("Notice (Team #%d): %s" % (team + 1, text))
|
||||||
texts = json.dumps(texts)
|
|
||||||
for client in ctx.endpoints:
|
for client in ctx.endpoints:
|
||||||
if client.auth and client.team == team:
|
if client.auth and client.team == team:
|
||||||
if "Berserker" in client.tags and client.version >= [2, 2, 1]:
|
asyncio.create_task(ctx.send_json_msgs(client, cmd))
|
||||||
payload = cmd
|
|
||||||
else:
|
|
||||||
payload = texts
|
|
||||||
asyncio.create_task(ctx.send_json_msgs(client, payload))
|
|
||||||
|
|
||||||
|
|
||||||
def update_aliases(ctx: Context, team: int, client: typing.Optional[Client] = None):
|
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.name = ctx.player_names[(team, slot)]
|
||||||
client.team = team
|
client.team = team
|
||||||
client.slot = slot
|
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')
|
errors.add('IncompatibleVersion')
|
||||||
elif ctx.compatibility == 0 and args.get('version', Client.version) != list(_version_tuple):
|
elif ctx.compatibility == 0 and args.get('version', Client.version) != list(_version_tuple):
|
||||||
errors.add('IncompatibleVersion')
|
errors.add('IncompatibleVersion')
|
||||||
|
|
2
Utils.py
2
Utils.py
|
@ -6,7 +6,7 @@ def tuplize_version(version: str) -> typing.Tuple[int, ...]:
|
||||||
return tuple(int(piece, 10) for piece in version.split("."))
|
return tuple(int(piece, 10) for piece in version.split("."))
|
||||||
|
|
||||||
|
|
||||||
__version__ = "3.2.1"
|
__version__ = "1.0.0"
|
||||||
_version_tuple = tuplize_version(__version__)
|
_version_tuple = tuplize_version(__version__)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -50,7 +50,7 @@ class WebHostContext(Context):
|
||||||
super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0, 2)
|
super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0, 2)
|
||||||
self.main_loop = asyncio.get_running_loop()
|
self.main_loop = asyncio.get_running_loop()
|
||||||
self.video = {}
|
self.video = {}
|
||||||
self.tags = ["Berserker", "WebHost"]
|
self.tags = ["AP", "WebHost"]
|
||||||
|
|
||||||
def listen_to_db_commands(self):
|
def listen_to_db_commands(self):
|
||||||
cmdprocessor = DBCommandProcessor(self)
|
cmdprocessor = DBCommandProcessor(self)
|
||||||
|
|
Loading…
Reference in New Issue