bumb network version for new command processing
This commit is contained in:
parent
69535d78ca
commit
d9e4bd1ab0
|
@ -765,7 +765,7 @@ async def server_auth(ctx: Context, password_requested):
|
|||
ctx.awaiting_rom = False
|
||||
ctx.auth = ctx.rom.copy()
|
||||
await send_msgs(ctx.socket, [['Connect', {
|
||||
'password': ctx.password, 'rom': ctx.auth, 'version': [1, 2, 0], 'tags': get_tags(ctx)
|
||||
'password': ctx.password, 'rom': ctx.auth, 'version': [1, 3, 0], 'tags': get_tags(ctx)
|
||||
}]])
|
||||
|
||||
async def console_input(ctx : Context):
|
||||
|
|
|
@ -173,7 +173,7 @@ async def on_client_connected(ctx: Context, client: Client):
|
|||
# tags are for additional features in the communication.
|
||||
# Name them by feature or fork, as you feel is appropriate.
|
||||
'tags': ['Berserker'],
|
||||
'version': [1, 2, 0]
|
||||
'version': [1, 3, 0]
|
||||
}]])
|
||||
|
||||
async def on_client_disconnected(ctx: Context, client: Client):
|
||||
|
@ -354,6 +354,7 @@ class CommandProcessor(metaclass=CommandMeta):
|
|||
def __call__(self, raw: str):
|
||||
if not raw:
|
||||
return
|
||||
try:
|
||||
command = raw.split()
|
||||
basecommand = command[0]
|
||||
if basecommand[0] == self.marker:
|
||||
|
@ -364,6 +365,8 @@ class CommandProcessor(metaclass=CommandMeta):
|
|||
method(self, *command[1:])
|
||||
else:
|
||||
self.default(raw)
|
||||
except Exception as e:
|
||||
self._error_parsing_command(e)
|
||||
|
||||
def get_help_text(self) -> str:
|
||||
s = ""
|
||||
|
@ -395,6 +398,9 @@ class CommandProcessor(metaclass=CommandMeta):
|
|||
def _error_unknown_command(self, raw: str):
|
||||
self.output(f"Could not find command {raw}. Known commands: {', '.join(self.commands)}")
|
||||
|
||||
def _error_parsing_command(self, exception: Exception):
|
||||
self.output(str(exception))
|
||||
|
||||
|
||||
class ClientMessageProcessor(CommandProcessor):
|
||||
marker = "!"
|
||||
|
|
Loading…
Reference in New Issue