feat: do not call ChunkHeader constructor if not needed

Also stays consistent with the code in the PacketHeader
7a367acef3
This commit is contained in:
ChillerDragon 2024-02-17 13:22:31 +08:00
parent c4af1fb8f8
commit 240c605ec3
107 changed files with 321 additions and 321 deletions

View file

@ -1023,9 +1023,9 @@ def match_connless{self.protocol_version}(msg_id: bytes, data: bytes) -> Connles
sys: str = 'True' if game == 'system' else 'False'
out_file.write(f" self.system_message: bool = {sys}\n")
out_file.write(f" self.message_id: int = {msg['id']}\n")
out_file.write(" self.header: ChunkHeader = ChunkHeader()\n")
out_file.write(" if chunk_header:\n")
out_file.write(" self.header = chunk_header\n")
out_file.write(" if not chunk_header:\n")
out_file.write(" chunk_header = ChunkHeader()\n")
out_file.write(" self.header: ChunkHeader = chunk_header\n")
out_file.write('\n')
self.generate_field_assignments_in_initialize(msg, out_file)
out_file.write('\n')

View file

@ -18,9 +18,9 @@ class MsgClCallVote(PrettyPrint):
self.message_name: str = 'cl_call_vote'
self.system_message: bool = False
self.message_id: int = 25
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.type: str = type
self.value: str = value

View file

@ -22,9 +22,9 @@ class MsgClChangeInfo(PrettyPrint):
self.message_name: str = 'cl_change_info'
self.system_message: bool = False
self.message_id: int = 21
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.clan: str = clan

View file

@ -17,9 +17,9 @@ class MsgClEmoticon(PrettyPrint):
self.message_name: str = 'cl_emoticon'
self.system_message: bool = False
self.message_id: int = 23
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.emoticon: int = emoticon

View file

@ -13,9 +13,9 @@ class MsgClKill(PrettyPrint):
self.message_name: str = 'cl_kill'
self.system_message: bool = False
self.message_id: int = 22
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -17,9 +17,9 @@ class MsgClSay(PrettyPrint):
self.message_name: str = 'cl_say'
self.system_message: bool = False
self.message_id: int = 17
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.team: bool = team
self.message: str = message

View file

@ -16,9 +16,9 @@ class MsgClSetSpectatorMode(PrettyPrint):
self.message_name: str = 'cl_set_spectator_mode'
self.system_message: bool = False
self.message_id: int = 19
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.spectator_id: int = spectator_id

View file

@ -17,9 +17,9 @@ class MsgClSetTeam(PrettyPrint):
self.message_name: str = 'cl_set_team'
self.system_message: bool = False
self.message_id: int = 18
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.team: int = team

View file

@ -22,9 +22,9 @@ class MsgClStartInfo(PrettyPrint):
self.message_name: str = 'cl_start_info'
self.system_message: bool = False
self.message_id: int = 20
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.clan: str = clan

View file

@ -16,9 +16,9 @@ class MsgClVote(PrettyPrint):
self.message_name: str = 'cl_vote'
self.system_message: bool = False
self.message_id: int = 24
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.vote: int = vote

View file

@ -16,9 +16,9 @@ class MsgSvBroadcast(PrettyPrint):
self.message_name: str = 'sv_broadcast'
self.system_message: bool = False
self.message_id: int = 2
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.message: str = message

View file

@ -18,9 +18,9 @@ class MsgSvChat(PrettyPrint):
self.message_name: str = 'sv_chat'
self.system_message: bool = False
self.message_id: int = 3
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.team: bool = team
self.client_id: int = client_id

View file

@ -18,9 +18,9 @@ class MsgSvEmoticon(PrettyPrint):
self.message_name: str = 'sv_emoticon'
self.system_message: bool = False
self.message_id: int = 10
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.emoticon: int = emoticon

View file

@ -16,9 +16,9 @@ class MsgSvExtraProjectile(PrettyPrint):
self.message_name: str = 'sv_extra_projectile'
self.system_message: bool = False
self.message_id: int = 7
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
if not projectile:
projectile = ObjProjectile()

View file

@ -19,9 +19,9 @@ class MsgSvKillMsg(PrettyPrint):
self.message_name: str = 'sv_kill_msg'
self.system_message: bool = False
self.message_id: int = 4
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.killer: int = killer
self.victim: int = victim

View file

@ -16,9 +16,9 @@ class MsgSvMotd(PrettyPrint):
self.message_name: str = 'sv_motd'
self.system_message: bool = False
self.message_id: int = 1
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.message: str = message

View file

@ -13,9 +13,9 @@ class MsgSvReadyToEnter(PrettyPrint):
self.message_name: str = 'sv_ready_to_enter'
self.system_message: bool = False
self.message_id: int = 8
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -17,9 +17,9 @@ class MsgSvSoundGlobal(PrettyPrint):
self.message_name: str = 'sv_sound_global'
self.system_message: bool = False
self.message_id: int = 5
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.sound_id: int = sound_id

View file

@ -48,9 +48,9 @@ class MsgSvTuneParams(PrettyPrint):
self.message_name: str = 'sv_tune_params'
self.system_message: bool = False
self.message_id: int = 6
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.ground_control_speed: float = ground_control_speed
self.ground_control_accel: float = ground_control_accel

View file

@ -13,9 +13,9 @@ class MsgSvVoteClearOptions(PrettyPrint):
self.message_name: str = 'sv_vote_clear_options'
self.system_message: bool = False
self.message_id: int = 11
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgSvVoteOptionAdd(PrettyPrint):
self.message_name: str = 'sv_vote_option_add'
self.system_message: bool = False
self.message_id: int = 13
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.description: str = description

View file

@ -18,9 +18,9 @@ class MsgSvVoteOptionListAdd(PrettyPrint):
self.message_name: str = 'sv_vote_option_list_add'
self.system_message: bool = False
self.message_id: int = 12
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.num_options: int = num_options
self.description = description

View file

@ -16,9 +16,9 @@ class MsgSvVoteOptionRemove(PrettyPrint):
self.message_name: str = 'sv_vote_option_remove'
self.system_message: bool = False
self.message_id: int = 14
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.description: str = description

View file

@ -18,9 +18,9 @@ class MsgSvVoteSet(PrettyPrint):
self.message_name: str = 'sv_vote_set'
self.system_message: bool = False
self.message_id: int = 15
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.timeout: int = timeout
self.description: str = description

View file

@ -19,9 +19,9 @@ class MsgSvVoteStatus(PrettyPrint):
self.message_name: str = 'sv_vote_status'
self.system_message: bool = False
self.message_id: int = 16
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.yes: int = yes
self.no: int = no

View file

@ -17,9 +17,9 @@ class MsgSvWeaponPickup(PrettyPrint):
self.message_name: str = 'sv_weapon_pickup'
self.system_message: bool = False
self.message_id: int = 9
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.weapon: int = weapon

View file

@ -13,9 +13,9 @@ class MsgConReady(PrettyPrint):
self.message_name: str = 'con_ready'
self.system_message: bool = True
self.message_id: int = 4
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgEnterGame(PrettyPrint):
self.message_name: str = 'enter_game'
self.system_message: bool = True
self.message_id: int = 15
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -17,9 +17,9 @@ class MsgInfo(PrettyPrint):
self.message_name: str = 'info'
self.system_message: bool = True
self.message_id: int = 1
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.version: str = version
self.password: Optional[str] = password

View file

@ -20,9 +20,9 @@ class MsgInput(PrettyPrint):
self.message_name: str = 'input'
self.system_message: bool = True
self.message_id: int = 16
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.ack_snapshot: int = ack_snapshot
self.intended_tick: int = intended_tick

View file

@ -17,9 +17,9 @@ class MsgInputTiming(PrettyPrint):
self.message_name: str = 'input_timing'
self.system_message: bool = True
self.message_id: int = 9
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.input_pred_tick: int = input_pred_tick
self.time_left: int = time_left

View file

@ -18,9 +18,9 @@ class MsgMapChange(PrettyPrint):
self.message_name: str = 'map_change'
self.system_message: bool = True
self.message_id: int = 2
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.crc: int = crc

View file

@ -20,9 +20,9 @@ class MsgMapData(PrettyPrint):
self.message_name: str = 'map_data'
self.system_message: bool = True
self.message_id: int = 3
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.last: int = last
self.crc: int = crc

View file

@ -13,9 +13,9 @@ class MsgPing(PrettyPrint):
self.message_name: str = 'ping'
self.system_message: bool = True
self.message_id: int = 20
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgPingReply(PrettyPrint):
self.message_name: str = 'ping_reply'
self.system_message: bool = True
self.message_id: int = 21
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -18,9 +18,9 @@ class MsgRconAuth(PrettyPrint):
self.message_name: str = 'rcon_auth'
self.system_message: bool = True
self.message_id: int = 18
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self._unused: str = _unused
self.password: str = password

View file

@ -17,9 +17,9 @@ class MsgRconAuthStatus(PrettyPrint):
self.message_name: str = 'rcon_auth_status'
self.system_message: bool = True
self.message_id: int = 10
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.auth_level: Optional[int] = auth_level
self.receive_commands: Optional[int] = receive_commands

View file

@ -16,9 +16,9 @@ class MsgRconCmd(PrettyPrint):
self.message_name: str = 'rcon_cmd'
self.system_message: bool = True
self.message_id: int = 17
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.cmd: str = cmd

View file

@ -18,9 +18,9 @@ class MsgRconCmdAdd(PrettyPrint):
self.message_name: str = 'rcon_cmd_add'
self.system_message: bool = True
self.message_id: int = 25
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.help: str = help

View file

@ -16,9 +16,9 @@ class MsgRconCmdRemove(PrettyPrint):
self.message_name: str = 'rcon_cmd_remove'
self.system_message: bool = True
self.message_id: int = 26
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name

View file

@ -16,9 +16,9 @@ class MsgRconLine(PrettyPrint):
self.message_name: str = 'rcon_line'
self.system_message: bool = True
self.message_id: int = 11
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.line: str = line

View file

@ -13,9 +13,9 @@ class MsgReady(PrettyPrint):
self.message_name: str = 'ready'
self.system_message: bool = True
self.message_id: int = 14
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgRequestMapData(PrettyPrint):
self.message_name: str = 'request_map_data'
self.system_message: bool = True
self.message_id: int = 19
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.chunk: int = chunk

View file

@ -17,9 +17,9 @@ class MsgSnapEmpty(PrettyPrint):
self.message_name: str = 'snap_empty'
self.system_message: bool = True
self.message_id: int = 6
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.tick: int = tick
self.delta_tick: int = delta_tick

View file

@ -20,9 +20,9 @@ class MsgSnapSingle(PrettyPrint):
self.message_name: str = 'snap_single'
self.system_message: bool = True
self.message_id: int = 7
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.tick: int = tick
self.delta_tick: int = delta_tick

View file

@ -19,9 +19,9 @@ class MsgClCallVote(PrettyPrint):
self.message_name: str = 'cl_call_vote'
self.system_message: bool = False
self.message_id: int = 32
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.type: str = type
self.value: str = value

View file

@ -17,9 +17,9 @@ class MsgClCommand(PrettyPrint):
self.message_name: str = 'cl_command'
self.system_message: bool = False
self.message_id: int = 39
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.arguments: str = arguments

View file

@ -17,9 +17,9 @@ class MsgClEmoticon(PrettyPrint):
self.message_name: str = 'cl_emoticon'
self.system_message: bool = False
self.message_id: int = 30
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.emoticon: int = emoticon

View file

@ -13,9 +13,9 @@ class MsgClKill(PrettyPrint):
self.message_name: str = 'cl_kill'
self.system_message: bool = False
self.message_id: int = 28
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgClReadyChange(PrettyPrint):
self.message_name: str = 'cl_ready_change'
self.system_message: bool = False
self.message_id: int = 29
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -19,9 +19,9 @@ class MsgClSay(PrettyPrint):
self.message_name: str = 'cl_say'
self.system_message: bool = False
self.message_id: int = 24
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.mode: int = mode
self.target: int = target

View file

@ -18,9 +18,9 @@ class MsgClSetSpectatorMode(PrettyPrint):
self.message_name: str = 'cl_set_spectator_mode'
self.system_message: bool = False
self.message_id: int = 26
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.spec_mode: int = spec_mode
self.spectator_id: int = spectator_id

View file

@ -17,9 +17,9 @@ class MsgClSetTeam(PrettyPrint):
self.message_name: str = 'cl_set_team'
self.system_message: bool = False
self.message_id: int = 25
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.team: int = team

View file

@ -21,9 +21,9 @@ class MsgClSkinChange(PrettyPrint):
self.message_name: str = 'cl_skin_change'
self.system_message: bool = False
self.message_id: int = 34
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.skin_part_names = skin_part_names
self.use_custom_colors = use_custom_colors

View file

@ -24,9 +24,9 @@ class MsgClStartInfo(PrettyPrint):
self.message_name: str = 'cl_start_info'
self.system_message: bool = False
self.message_id: int = 27
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.clan: str = clan

View file

@ -16,9 +16,9 @@ class MsgClVote(PrettyPrint):
self.message_name: str = 'cl_vote'
self.system_message: bool = False
self.message_id: int = 31
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.vote: int = vote

View file

@ -19,9 +19,9 @@ class MsgDeClientEnter(PrettyPrint):
self.message_name: str = 'de_client_enter'
self.system_message: bool = False
self.message_id: int = 22
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.client_id: int = client_id

View file

@ -18,9 +18,9 @@ class MsgDeClientLeave(PrettyPrint):
self.message_name: str = 'de_client_leave'
self.system_message: bool = False
self.message_id: int = 23
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.client_id: int = client_id

View file

@ -16,9 +16,9 @@ class MsgSvBroadcast(PrettyPrint):
self.message_name: str = 'sv_broadcast'
self.system_message: bool = False
self.message_id: int = 2
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.message: str = message

View file

@ -20,9 +20,9 @@ class MsgSvChat(PrettyPrint):
self.message_name: str = 'sv_chat'
self.system_message: bool = False
self.message_id: int = 3
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.mode: int = mode
self.client_id: int = client_id

View file

@ -16,9 +16,9 @@ class MsgSvCheckpoint(PrettyPrint):
self.message_name: str = 'sv_checkpoint'
self.system_message: bool = False
self.message_id: int = 36
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.diff: int = diff

View file

@ -18,9 +18,9 @@ class MsgSvClientDrop(PrettyPrint):
self.message_name: str = 'sv_client_drop'
self.system_message: bool = False
self.message_id: int = 20
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.reason: str = reason

View file

@ -29,9 +29,9 @@ class MsgSvClientInfo(PrettyPrint):
self.message_name: str = 'sv_client_info'
self.system_message: bool = False
self.message_id: int = 18
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.local: bool = local

View file

@ -18,9 +18,9 @@ class MsgSvCommandInfo(PrettyPrint):
self.message_name: str = 'sv_command_info'
self.system_message: bool = False
self.message_id: int = 37
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.args_format: str = args_format

View file

@ -16,9 +16,9 @@ class MsgSvCommandInfoRemove(PrettyPrint):
self.message_name: str = 'sv_command_info_remove'
self.system_message: bool = False
self.message_id: int = 38
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name

View file

@ -18,9 +18,9 @@ class MsgSvEmoticon(PrettyPrint):
self.message_name: str = 'sv_emoticon'
self.system_message: bool = False
self.message_id: int = 10
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.emoticon: int = emoticon

View file

@ -16,9 +16,9 @@ class MsgSvExtraProjectile(PrettyPrint):
self.message_name: str = 'sv_extra_projectile'
self.system_message: bool = False
self.message_id: int = 7
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
if not projectile:
projectile = ObjProjectile()

View file

@ -20,9 +20,9 @@ class MsgSvGameInfo(PrettyPrint):
self.message_name: str = 'sv_game_info'
self.system_message: bool = False
self.message_id: int = 19
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.game_flags: int = game_flags
self.score_limit: int = score_limit

View file

@ -13,9 +13,9 @@ class MsgSvGameMsg(PrettyPrint):
self.message_name: str = 'sv_game_msg'
self.system_message: bool = False
self.message_id: int = 21
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -19,9 +19,9 @@ class MsgSvKillMsg(PrettyPrint):
self.message_name: str = 'sv_kill_msg'
self.system_message: bool = False
self.message_id: int = 5
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.killer: int = killer
self.victim: int = victim

View file

@ -16,9 +16,9 @@ class MsgSvMotd(PrettyPrint):
self.message_name: str = 'sv_motd'
self.system_message: bool = False
self.message_id: int = 1
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.message: str = message

View file

@ -20,9 +20,9 @@ class MsgSvRaceFinish(PrettyPrint):
self.message_name: str = 'sv_race_finish'
self.system_message: bool = False
self.message_id: int = 35
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.time: int = time

View file

@ -13,9 +13,9 @@ class MsgSvReadyToEnter(PrettyPrint):
self.message_name: str = 'sv_ready_to_enter'
self.system_message: bool = False
self.message_id: int = 8
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -21,9 +21,9 @@ class MsgSvServerSettings(PrettyPrint):
self.message_name: str = 'sv_server_settings'
self.system_message: bool = False
self.message_id: int = 17
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.kick_vote: bool = kick_vote
self.kick_min: int = kick_min

View file

@ -22,9 +22,9 @@ class MsgSvSkinChange(PrettyPrint):
self.message_name: str = 'sv_skin_change'
self.system_message: bool = False
self.message_id: int = 33
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.skin_part_names = skin_part_names

View file

@ -20,9 +20,9 @@ class MsgSvTeam(PrettyPrint):
self.message_name: str = 'sv_team'
self.system_message: bool = False
self.message_id: int = 4
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.team: int = team

View file

@ -47,9 +47,9 @@ class MsgSvTuneParams(PrettyPrint):
self.message_name: str = 'sv_tune_params'
self.system_message: bool = False
self.message_id: int = 6
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.ground_control_speed: float = ground_control_speed
self.ground_control_accel: float = ground_control_accel

View file

@ -13,9 +13,9 @@ class MsgSvVoteClearOptions(PrettyPrint):
self.message_name: str = 'sv_vote_clear_options'
self.system_message: bool = False
self.message_id: int = 11
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgSvVoteOptionAdd(PrettyPrint):
self.message_name: str = 'sv_vote_option_add'
self.system_message: bool = False
self.message_id: int = 13
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.description: str = description

View file

@ -13,9 +13,9 @@ class MsgSvVoteOptionListAdd(PrettyPrint):
self.message_name: str = 'sv_vote_option_list_add'
self.system_message: bool = False
self.message_id: int = 12
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgSvVoteOptionRemove(PrettyPrint):
self.message_name: str = 'sv_vote_option_remove'
self.system_message: bool = False
self.message_id: int = 14
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.description: str = description

View file

@ -21,9 +21,9 @@ class MsgSvVoteSet(PrettyPrint):
self.message_name: str = 'sv_vote_set'
self.system_message: bool = False
self.message_id: int = 15
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.client_id: int = client_id
self.type: int = type

View file

@ -19,9 +19,9 @@ class MsgSvVoteStatus(PrettyPrint):
self.message_name: str = 'sv_vote_status'
self.system_message: bool = False
self.message_id: int = 16
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.yes: int = yes
self.no: int = no

View file

@ -17,9 +17,9 @@ class MsgSvWeaponPickup(PrettyPrint):
self.message_name: str = 'sv_weapon_pickup'
self.system_message: bool = False
self.message_id: int = 9
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.weapon: int = weapon

View file

@ -13,9 +13,9 @@ class MsgConReady(PrettyPrint):
self.message_name: str = 'con_ready'
self.system_message: bool = True
self.message_id: int = 5
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgEnterGame(PrettyPrint):
self.message_name: str = 'enter_game'
self.system_message: bool = True
self.message_id: int = 19
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -18,9 +18,9 @@ class MsgInfo(PrettyPrint):
self.message_name: str = 'info'
self.system_message: bool = True
self.message_id: int = 1
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.version: str = version
self.password: Optional[str] = password

View file

@ -20,9 +20,9 @@ class MsgInput(PrettyPrint):
self.message_name: str = 'input'
self.system_message: bool = True
self.message_id: int = 20
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.ack_snapshot: int = ack_snapshot
self.intended_tick: int = intended_tick

View file

@ -17,9 +17,9 @@ class MsgInputTiming(PrettyPrint):
self.message_name: str = 'input_timing'
self.system_message: bool = True
self.message_id: int = 10
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.input_pred_tick: int = input_pred_tick
self.time_left: int = time_left

View file

@ -21,9 +21,9 @@ class MsgMapChange(PrettyPrint):
self.message_name: str = 'map_change'
self.system_message: bool = True
self.message_id: int = 2
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.crc: int = crc

View file

@ -15,9 +15,9 @@ class MsgMapData(PrettyPrint):
self.message_name: str = 'map_data'
self.system_message: bool = True
self.message_id: int = 3
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.data: bytes = data

View file

@ -16,9 +16,9 @@ class MsgMaplistEntryAdd(PrettyPrint):
self.message_name: str = 'maplist_entry_add'
self.system_message: bool = True
self.message_id: int = 29
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name

View file

@ -16,9 +16,9 @@ class MsgMaplistEntryRem(PrettyPrint):
self.message_name: str = 'maplist_entry_rem'
self.system_message: bool = True
self.message_id: int = 30
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name

View file

@ -13,9 +13,9 @@ class MsgPing(PrettyPrint):
self.message_name: str = 'ping'
self.system_message: bool = True
self.message_id: int = 26
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgPingReply(PrettyPrint):
self.message_name: str = 'ping_reply'
self.system_message: bool = True
self.message_id: int = 27
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgRconAuth(PrettyPrint):
self.message_name: str = 'rcon_auth'
self.system_message: bool = True
self.message_id: int = 22
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.password: str = password

View file

@ -13,9 +13,9 @@ class MsgRconAuthOff(PrettyPrint):
self.message_name: str = 'rcon_auth_off'
self.system_message: bool = True
self.message_id: int = 12
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -13,9 +13,9 @@ class MsgRconAuthOn(PrettyPrint):
self.message_name: str = 'rcon_auth_on'
self.system_message: bool = True
self.message_id: int = 11
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
# first byte of data

View file

@ -16,9 +16,9 @@ class MsgRconCmd(PrettyPrint):
self.message_name: str = 'rcon_cmd'
self.system_message: bool = True
self.message_id: int = 21
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.cmd: str = cmd

View file

@ -18,9 +18,9 @@ class MsgRconCmdAdd(PrettyPrint):
self.message_name: str = 'rcon_cmd_add'
self.system_message: bool = True
self.message_id: int = 14
self.header: ChunkHeader = ChunkHeader()
if chunk_header:
self.header = chunk_header
if not chunk_header:
chunk_header = ChunkHeader()
self.header: ChunkHeader = chunk_header
self.name: str = name
self.help: str = help

Some files were not shown because too many files have changed in this diff Show more