Fix comment too long
This commit is contained in:
parent
044e17b6e6
commit
760d8bce1f
|
@ -296,9 +296,9 @@ def generate_msg(msg: NetMessageJson, game: Literal['game', 'system']) -> None:
|
|||
# TODO: unpacker should not crash on missing optional fields
|
||||
# check how tw code does it and be smart here
|
||||
if member['type']['inner']['kind'] == 'string': # TODO: sanitize cc
|
||||
unpacker = 'str() # TODO: warning this can fail because it is an optional field'
|
||||
unpacker = 'str() # TODO: this can fail for optionals'
|
||||
elif member['type']['inner']['kind'] in ('int32', 'tick'):
|
||||
unpacker = 'int() # TODO: warning this can fail because it is an optional field'
|
||||
unpacker = 'int() # TODO: this can fail for optionals'
|
||||
else:
|
||||
raise ValueError(f"Error: unknown type {member['type']}")
|
||||
name = name_to_snake(member["name"])
|
||||
|
|
|
@ -26,8 +26,8 @@ class MsgInfo(PrettyPrint):
|
|||
def unpack(self, data: bytes) -> bool:
|
||||
unpacker = Unpacker(data)
|
||||
self.version = unpacker.get_str()
|
||||
self.password = unpacker.get_str() # TODO: warning this can fail because it is an optional field
|
||||
self.client_version = unpacker.get_int() # TODO: warning this can fail because it is an optional field
|
||||
self.password = unpacker.get_str() # TODO: this can fail for optionals
|
||||
self.client_version = unpacker.get_int() # TODO: this can fail for optionals
|
||||
return True
|
||||
|
||||
def pack(self) -> bytes:
|
||||
|
|
Loading…
Reference in a new issue