diff --git a/scripts/generate_messages.py b/scripts/generate_messages.py index 1fe65a8..41b3afd 100755 --- a/scripts/generate_messages.py +++ b/scripts/generate_messages.py @@ -115,17 +115,33 @@ def name_to_snake(name_list: list[str]) -> str: name = '_'.join(name_list) return fix_name_conflict(name) -def gen_iter(messages: list[NetMessageMemberJson]) -> str: - lines: list[str] = [] - lines.append(' def __iter__(self):') - lines.append(" yield 'message_type', self.message_type") - lines.append(" yield 'message_name', self.message_name") - lines.append(" yield 'message_id', self.message_id") +def gen_yield(messages: list[NetMessageMemberJson]) -> list[str]: + lines = [] if len(messages) > 0: lines.append("") for msg in messages: name = name_to_snake(msg['name']) lines.append(f" yield '{name}', self.{name}") + return lines + +def gen_iter(messages: list[NetMessageMemberJson]) -> str: + lines: list[str] = [] + lines.append(' def __iter__(self):') + lines.append(" yield 'message_type', self.message_type") + lines.append(" yield 'message_name', self.message_name") + lines.append(" yield 'system_message', self.system_message") + lines.append(" yield 'message_id', self.message_id") + lines.append(" yield 'header', dict(self.header)") + lines += gen_yield(messages) + return '\n'.join(lines) + +def gen_iter_connless(messages: list[NetMessageMemberJson]) -> str: + lines: list[str] = [] + lines.append(' def __iter__(self):') + lines.append(" yield 'message_type', self.message_type") + lines.append(" yield 'message_name', self.message_name") + lines.append(" yield 'message_id', self.message_id") + lines += gen_yield(messages) return '\n'.join(lines) def gen_unpack_members_connless7(msg: NetConnlessJson) -> str: @@ -928,7 +944,7 @@ def match_connless{self.protocol_version}(msg_id: bytes, data: bytes) -> Connles else: out_file.write(f" self.{name}{ftype} = {name}\n") out_file.write('\n') - out_file.write(gen_iter(msg['members'])) + out_file.write(gen_iter_connless(msg['members'])) out_file.write('\n') out_file.write('\n') out_file.write(' # first byte of data\n') @@ -1056,6 +1072,9 @@ def match_connless{self.protocol_version}(msg_id: bytes, data: bytes) -> Connles out_file.write('\n') self.generate_field_assignments_in_initialize(msg, out_file) out_file.write('\n') + out_file.write(gen_iter(msg['members'])) + out_file.write('\n') + out_file.write('\n') out_file.write(' # first byte of data\n') out_file.write(' # has to be the first byte of the message payload\n') out_file.write(' # NOT the chunk header and NOT the message id\n') diff --git a/twnet_parser/messages6/game/cl_call_vote.py b/twnet_parser/messages6/game/cl_call_vote.py index 48204dc..7b58c03 100644 --- a/twnet_parser/messages6/game/cl_call_vote.py +++ b/twnet_parser/messages6/game/cl_call_vote.py @@ -26,6 +26,17 @@ class MsgClCallVote(PrettyPrint): self.value: str = value self.reason: str = reason + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'type', self.type + yield 'value', self.value + yield 'reason', self.reason + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_change_info.py b/twnet_parser/messages6/game/cl_change_info.py index 61ede7a..ec65dab 100644 --- a/twnet_parser/messages6/game/cl_change_info.py +++ b/twnet_parser/messages6/game/cl_change_info.py @@ -34,6 +34,21 @@ class MsgClChangeInfo(PrettyPrint): self.color_body: int = color_body self.color_feet: int = color_feet + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'clan', self.clan + yield 'country', self.country + yield 'skin', self.skin + yield 'use_custom_color', self.use_custom_color + yield 'color_body', self.color_body + yield 'color_feet', self.color_feet + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_emoticon.py b/twnet_parser/messages6/game/cl_emoticon.py index 06698ba..8209337 100644 --- a/twnet_parser/messages6/game/cl_emoticon.py +++ b/twnet_parser/messages6/game/cl_emoticon.py @@ -23,6 +23,15 @@ class MsgClEmoticon(PrettyPrint): self.emoticon: int = emoticon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'emoticon', self.emoticon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_kill.py b/twnet_parser/messages6/game/cl_kill.py index e226c41..7dc941e 100644 --- a/twnet_parser/messages6/game/cl_kill.py +++ b/twnet_parser/messages6/game/cl_kill.py @@ -18,6 +18,13 @@ class MsgClKill(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_say.py b/twnet_parser/messages6/game/cl_say.py index a8fffc8..340934e 100644 --- a/twnet_parser/messages6/game/cl_say.py +++ b/twnet_parser/messages6/game/cl_say.py @@ -24,6 +24,16 @@ class MsgClSay(PrettyPrint): self.team: bool = team self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'team', self.team + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_set_spectator_mode.py b/twnet_parser/messages6/game/cl_set_spectator_mode.py index 2032683..22f878b 100644 --- a/twnet_parser/messages6/game/cl_set_spectator_mode.py +++ b/twnet_parser/messages6/game/cl_set_spectator_mode.py @@ -22,6 +22,15 @@ class MsgClSetSpectatorMode(PrettyPrint): self.spectator_id: int = spectator_id + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'spectator_id', self.spectator_id + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_set_team.py b/twnet_parser/messages6/game/cl_set_team.py index 11d1b57..82d9d68 100644 --- a/twnet_parser/messages6/game/cl_set_team.py +++ b/twnet_parser/messages6/game/cl_set_team.py @@ -23,6 +23,15 @@ class MsgClSetTeam(PrettyPrint): self.team: int = team + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'team', self.team + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_start_info.py b/twnet_parser/messages6/game/cl_start_info.py index 3b627e5..d0f09cb 100644 --- a/twnet_parser/messages6/game/cl_start_info.py +++ b/twnet_parser/messages6/game/cl_start_info.py @@ -34,6 +34,21 @@ class MsgClStartInfo(PrettyPrint): self.color_body: int = color_body self.color_feet: int = color_feet + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'clan', self.clan + yield 'country', self.country + yield 'skin', self.skin + yield 'use_custom_color', self.use_custom_color + yield 'color_body', self.color_body + yield 'color_feet', self.color_feet + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/cl_vote.py b/twnet_parser/messages6/game/cl_vote.py index a486812..c3702e7 100644 --- a/twnet_parser/messages6/game/cl_vote.py +++ b/twnet_parser/messages6/game/cl_vote.py @@ -22,6 +22,15 @@ class MsgClVote(PrettyPrint): self.vote: int = vote + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'vote', self.vote + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_broadcast.py b/twnet_parser/messages6/game/sv_broadcast.py index e22498c..424b1c5 100644 --- a/twnet_parser/messages6/game/sv_broadcast.py +++ b/twnet_parser/messages6/game/sv_broadcast.py @@ -22,6 +22,15 @@ class MsgSvBroadcast(PrettyPrint): self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_chat.py b/twnet_parser/messages6/game/sv_chat.py index 9e3e322..37cad20 100644 --- a/twnet_parser/messages6/game/sv_chat.py +++ b/twnet_parser/messages6/game/sv_chat.py @@ -26,6 +26,17 @@ class MsgSvChat(PrettyPrint): self.client_id: int = client_id self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'team', self.team + yield 'client_id', self.client_id + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_emoticon.py b/twnet_parser/messages6/game/sv_emoticon.py index f88ee19..72416db 100644 --- a/twnet_parser/messages6/game/sv_emoticon.py +++ b/twnet_parser/messages6/game/sv_emoticon.py @@ -25,6 +25,16 @@ class MsgSvEmoticon(PrettyPrint): self.client_id: int = client_id self.emoticon: int = emoticon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'emoticon', self.emoticon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_extra_projectile.py b/twnet_parser/messages6/game/sv_extra_projectile.py index 387791a..22570ae 100644 --- a/twnet_parser/messages6/game/sv_extra_projectile.py +++ b/twnet_parser/messages6/game/sv_extra_projectile.py @@ -24,6 +24,15 @@ class MsgSvExtraProjectile(PrettyPrint): projectile = ObjProjectile() self.projectile: ObjProjectile = projectile + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'projectile', self.projectile + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_kill_msg.py b/twnet_parser/messages6/game/sv_kill_msg.py index 98098f0..108ded8 100644 --- a/twnet_parser/messages6/game/sv_kill_msg.py +++ b/twnet_parser/messages6/game/sv_kill_msg.py @@ -28,6 +28,18 @@ class MsgSvKillMsg(PrettyPrint): self.weapon: int = weapon self.mode_special: int = mode_special + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'killer', self.killer + yield 'victim', self.victim + yield 'weapon', self.weapon + yield 'mode_special', self.mode_special + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_motd.py b/twnet_parser/messages6/game/sv_motd.py index 70e00d5..d205704 100644 --- a/twnet_parser/messages6/game/sv_motd.py +++ b/twnet_parser/messages6/game/sv_motd.py @@ -22,6 +22,15 @@ class MsgSvMotd(PrettyPrint): self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_ready_to_enter.py b/twnet_parser/messages6/game/sv_ready_to_enter.py index 4b307dd..7b610e0 100644 --- a/twnet_parser/messages6/game/sv_ready_to_enter.py +++ b/twnet_parser/messages6/game/sv_ready_to_enter.py @@ -18,6 +18,13 @@ class MsgSvReadyToEnter(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_sound_global.py b/twnet_parser/messages6/game/sv_sound_global.py index 9a996c9..f4fbdd1 100644 --- a/twnet_parser/messages6/game/sv_sound_global.py +++ b/twnet_parser/messages6/game/sv_sound_global.py @@ -23,6 +23,15 @@ class MsgSvSoundGlobal(PrettyPrint): self.sound_id: int = sound_id + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'sound_id', self.sound_id + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_tune_params.py b/twnet_parser/messages6/game/sv_tune_params.py index a4af96e..e95a3f1 100644 --- a/twnet_parser/messages6/game/sv_tune_params.py +++ b/twnet_parser/messages6/game/sv_tune_params.py @@ -86,6 +86,47 @@ class MsgSvTuneParams(PrettyPrint): self.player_collision: float = player_collision self.player_hooking: float = player_hooking + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'ground_control_speed', self.ground_control_speed + yield 'ground_control_accel', self.ground_control_accel + yield 'ground_friction', self.ground_friction + yield 'ground_jump_impulse', self.ground_jump_impulse + yield 'air_jump_impulse', self.air_jump_impulse + yield 'air_control_speed', self.air_control_speed + yield 'air_control_accel', self.air_control_accel + yield 'air_friction', self.air_friction + yield 'hook_length', self.hook_length + yield 'hook_fire_speed', self.hook_fire_speed + yield 'hook_drag_accel', self.hook_drag_accel + yield 'hook_drag_speed', self.hook_drag_speed + yield 'gravity', self.gravity + yield 'velramp_start', self.velramp_start + yield 'velramp_range', self.velramp_range + yield 'velramp_curvature', self.velramp_curvature + yield 'gun_curvature', self.gun_curvature + yield 'gun_speed', self.gun_speed + yield 'gun_lifetime', self.gun_lifetime + yield 'shotgun_curvature', self.shotgun_curvature + yield 'shotgun_speed', self.shotgun_speed + yield 'shotgun_speeddiff', self.shotgun_speeddiff + yield 'shotgun_lifetime', self.shotgun_lifetime + yield 'grenade_curvature', self.grenade_curvature + yield 'grenade_speed', self.grenade_speed + yield 'grenade_lifetime', self.grenade_lifetime + yield 'laser_reach', self.laser_reach + yield 'laser_bounce_delay', self.laser_bounce_delay + yield 'laser_bounce_num', self.laser_bounce_num + yield 'laser_bounce_cost', self.laser_bounce_cost + yield 'laser_damage', self.laser_damage + yield 'player_collision', self.player_collision + yield 'player_hooking', self.player_hooking + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_clear_options.py b/twnet_parser/messages6/game/sv_vote_clear_options.py index 5c1a9e5..cce279d 100644 --- a/twnet_parser/messages6/game/sv_vote_clear_options.py +++ b/twnet_parser/messages6/game/sv_vote_clear_options.py @@ -18,6 +18,13 @@ class MsgSvVoteClearOptions(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_option_add.py b/twnet_parser/messages6/game/sv_vote_option_add.py index 8d896eb..9efff07 100644 --- a/twnet_parser/messages6/game/sv_vote_option_add.py +++ b/twnet_parser/messages6/game/sv_vote_option_add.py @@ -22,6 +22,15 @@ class MsgSvVoteOptionAdd(PrettyPrint): self.description: str = description + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'description', self.description + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_option_list_add.py b/twnet_parser/messages6/game/sv_vote_option_list_add.py index 4203005..f671f5f 100644 --- a/twnet_parser/messages6/game/sv_vote_option_list_add.py +++ b/twnet_parser/messages6/game/sv_vote_option_list_add.py @@ -25,6 +25,16 @@ class MsgSvVoteOptionListAdd(PrettyPrint): self.num_options: int = num_options self.description = description + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'num_options', self.num_options + yield 'description', self.description + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_option_remove.py b/twnet_parser/messages6/game/sv_vote_option_remove.py index 2d3c0f9..6afe741 100644 --- a/twnet_parser/messages6/game/sv_vote_option_remove.py +++ b/twnet_parser/messages6/game/sv_vote_option_remove.py @@ -22,6 +22,15 @@ class MsgSvVoteOptionRemove(PrettyPrint): self.description: str = description + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'description', self.description + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_set.py b/twnet_parser/messages6/game/sv_vote_set.py index a4038f1..d4d8b8b 100644 --- a/twnet_parser/messages6/game/sv_vote_set.py +++ b/twnet_parser/messages6/game/sv_vote_set.py @@ -26,6 +26,17 @@ class MsgSvVoteSet(PrettyPrint): self.description: str = description self.reason: str = reason + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'timeout', self.timeout + yield 'description', self.description + yield 'reason', self.reason + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_vote_status.py b/twnet_parser/messages6/game/sv_vote_status.py index e77daa0..93978d4 100644 --- a/twnet_parser/messages6/game/sv_vote_status.py +++ b/twnet_parser/messages6/game/sv_vote_status.py @@ -28,6 +28,18 @@ class MsgSvVoteStatus(PrettyPrint): self.pass_: int = pass_ self.total: int = total + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'yes', self.yes + yield 'no', self.no + yield 'pass_', self.pass_ + yield 'total', self.total + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/game/sv_weapon_pickup.py b/twnet_parser/messages6/game/sv_weapon_pickup.py index fddd2d9..5646f21 100644 --- a/twnet_parser/messages6/game/sv_weapon_pickup.py +++ b/twnet_parser/messages6/game/sv_weapon_pickup.py @@ -23,6 +23,15 @@ class MsgSvWeaponPickup(PrettyPrint): self.weapon: int = weapon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'weapon', self.weapon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/con_ready.py b/twnet_parser/messages6/system/con_ready.py index 342f375..b650095 100644 --- a/twnet_parser/messages6/system/con_ready.py +++ b/twnet_parser/messages6/system/con_ready.py @@ -18,6 +18,13 @@ class MsgConReady(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/enter_game.py b/twnet_parser/messages6/system/enter_game.py index 6a1d423..7569230 100644 --- a/twnet_parser/messages6/system/enter_game.py +++ b/twnet_parser/messages6/system/enter_game.py @@ -18,6 +18,13 @@ class MsgEnterGame(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/info.py b/twnet_parser/messages6/system/info.py index bcfca5e..01d1241 100644 --- a/twnet_parser/messages6/system/info.py +++ b/twnet_parser/messages6/system/info.py @@ -24,6 +24,16 @@ class MsgInfo(PrettyPrint): self.version: str = version self.password: Optional[str] = password + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'version', self.version + yield 'password', self.password + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/input.py b/twnet_parser/messages6/system/input.py index 898bd40..c7fd367 100644 --- a/twnet_parser/messages6/system/input.py +++ b/twnet_parser/messages6/system/input.py @@ -31,6 +31,18 @@ class MsgInput(PrettyPrint): input = ObjPlayerInput() self.input: ObjPlayerInput = input + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'ack_snapshot', self.ack_snapshot + yield 'intended_tick', self.intended_tick + yield 'input_size', self.input_size + yield 'input', self.input + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/input_timing.py b/twnet_parser/messages6/system/input_timing.py index c4690f0..5e4b8b9 100644 --- a/twnet_parser/messages6/system/input_timing.py +++ b/twnet_parser/messages6/system/input_timing.py @@ -24,6 +24,16 @@ class MsgInputTiming(PrettyPrint): self.input_pred_tick: int = input_pred_tick self.time_left: int = time_left + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'input_pred_tick', self.input_pred_tick + yield 'time_left', self.time_left + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/map_change.py b/twnet_parser/messages6/system/map_change.py index 4336013..3144623 100644 --- a/twnet_parser/messages6/system/map_change.py +++ b/twnet_parser/messages6/system/map_change.py @@ -26,6 +26,17 @@ class MsgMapChange(PrettyPrint): self.crc: int = crc self.size: int = size + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'crc', self.crc + yield 'size', self.size + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/map_data.py b/twnet_parser/messages6/system/map_data.py index 731a7f5..7594e60 100644 --- a/twnet_parser/messages6/system/map_data.py +++ b/twnet_parser/messages6/system/map_data.py @@ -30,6 +30,18 @@ class MsgMapData(PrettyPrint): self.data_size: int = data_size if data_size else len(data) self.data: bytes = data + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'last', self.last + yield 'crc', self.crc + yield 'chunk', self.chunk + yield 'data', self.data + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/ping.py b/twnet_parser/messages6/system/ping.py index 51fc5f4..0f2d50c 100644 --- a/twnet_parser/messages6/system/ping.py +++ b/twnet_parser/messages6/system/ping.py @@ -18,6 +18,13 @@ class MsgPing(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/ping_reply.py b/twnet_parser/messages6/system/ping_reply.py index 1adb7e8..8b4b3b9 100644 --- a/twnet_parser/messages6/system/ping_reply.py +++ b/twnet_parser/messages6/system/ping_reply.py @@ -18,6 +18,13 @@ class MsgPingReply(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_auth.py b/twnet_parser/messages6/system/rcon_auth.py index 8713182..fb316a4 100644 --- a/twnet_parser/messages6/system/rcon_auth.py +++ b/twnet_parser/messages6/system/rcon_auth.py @@ -26,6 +26,17 @@ class MsgRconAuth(PrettyPrint): self.password: str = password self.request_commands: Optional[int] = request_commands + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield '_unused', self._unused + yield 'password', self.password + yield 'request_commands', self.request_commands + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_auth_status.py b/twnet_parser/messages6/system/rcon_auth_status.py index ed65e26..237d78c 100644 --- a/twnet_parser/messages6/system/rcon_auth_status.py +++ b/twnet_parser/messages6/system/rcon_auth_status.py @@ -24,6 +24,16 @@ class MsgRconAuthStatus(PrettyPrint): self.auth_level: Optional[int] = auth_level self.receive_commands: Optional[int] = receive_commands + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'auth_level', self.auth_level + yield 'receive_commands', self.receive_commands + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_cmd.py b/twnet_parser/messages6/system/rcon_cmd.py index 5b84b8e..18f5884 100644 --- a/twnet_parser/messages6/system/rcon_cmd.py +++ b/twnet_parser/messages6/system/rcon_cmd.py @@ -22,6 +22,15 @@ class MsgRconCmd(PrettyPrint): self.cmd: str = cmd + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'cmd', self.cmd + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_cmd_add.py b/twnet_parser/messages6/system/rcon_cmd_add.py index adc8616..ccd77fc 100644 --- a/twnet_parser/messages6/system/rcon_cmd_add.py +++ b/twnet_parser/messages6/system/rcon_cmd_add.py @@ -26,6 +26,17 @@ class MsgRconCmdAdd(PrettyPrint): self.help: str = help self.params: str = params + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'help', self.help + yield 'params', self.params + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_cmd_remove.py b/twnet_parser/messages6/system/rcon_cmd_remove.py index 63180f7..7bccb55 100644 --- a/twnet_parser/messages6/system/rcon_cmd_remove.py +++ b/twnet_parser/messages6/system/rcon_cmd_remove.py @@ -22,6 +22,15 @@ class MsgRconCmdRemove(PrettyPrint): self.name: str = name + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/rcon_line.py b/twnet_parser/messages6/system/rcon_line.py index 7ace959..b119d38 100644 --- a/twnet_parser/messages6/system/rcon_line.py +++ b/twnet_parser/messages6/system/rcon_line.py @@ -22,6 +22,15 @@ class MsgRconLine(PrettyPrint): self.line: str = line + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'line', self.line + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/ready.py b/twnet_parser/messages6/system/ready.py index 9c4b6ce..22deb1b 100644 --- a/twnet_parser/messages6/system/ready.py +++ b/twnet_parser/messages6/system/ready.py @@ -18,6 +18,13 @@ class MsgReady(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/request_map_data.py b/twnet_parser/messages6/system/request_map_data.py index 650afb2..0897544 100644 --- a/twnet_parser/messages6/system/request_map_data.py +++ b/twnet_parser/messages6/system/request_map_data.py @@ -22,6 +22,15 @@ class MsgRequestMapData(PrettyPrint): self.chunk: int = chunk + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'chunk', self.chunk + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/snap_empty.py b/twnet_parser/messages6/system/snap_empty.py index 3df97b1..92dc50c 100644 --- a/twnet_parser/messages6/system/snap_empty.py +++ b/twnet_parser/messages6/system/snap_empty.py @@ -24,6 +24,16 @@ class MsgSnapEmpty(PrettyPrint): self.tick: int = tick self.delta_tick: int = delta_tick + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'tick', self.tick + yield 'delta_tick', self.delta_tick + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages6/system/snap_single.py b/twnet_parser/messages6/system/snap_single.py index 36a6019..29b914c 100644 --- a/twnet_parser/messages6/system/snap_single.py +++ b/twnet_parser/messages6/system/snap_single.py @@ -30,6 +30,18 @@ class MsgSnapSingle(PrettyPrint): self.data_size: int = data_size if data_size else len(data) self.data: bytes = data + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'tick', self.tick + yield 'delta_tick', self.delta_tick + yield 'crc', self.crc + yield 'data', self.data + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_call_vote.py b/twnet_parser/messages7/game/cl_call_vote.py index 2bc57ed..695174b 100644 --- a/twnet_parser/messages7/game/cl_call_vote.py +++ b/twnet_parser/messages7/game/cl_call_vote.py @@ -28,6 +28,18 @@ class MsgClCallVote(PrettyPrint): self.reason: str = reason self.force: bool = force + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'type', self.type + yield 'value', self.value + yield 'reason', self.reason + yield 'force', self.force + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_command.py b/twnet_parser/messages7/game/cl_command.py index 14a02cc..7f62e13 100644 --- a/twnet_parser/messages7/game/cl_command.py +++ b/twnet_parser/messages7/game/cl_command.py @@ -24,6 +24,16 @@ class MsgClCommand(PrettyPrint): self.name: str = name self.arguments: str = arguments + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'arguments', self.arguments + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_emoticon.py b/twnet_parser/messages7/game/cl_emoticon.py index 7cd4f3e..1bc2909 100644 --- a/twnet_parser/messages7/game/cl_emoticon.py +++ b/twnet_parser/messages7/game/cl_emoticon.py @@ -23,6 +23,15 @@ class MsgClEmoticon(PrettyPrint): self.emoticon: int = emoticon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'emoticon', self.emoticon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_kill.py b/twnet_parser/messages7/game/cl_kill.py index 3f2313c..358bd1e 100644 --- a/twnet_parser/messages7/game/cl_kill.py +++ b/twnet_parser/messages7/game/cl_kill.py @@ -18,6 +18,13 @@ class MsgClKill(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_ready_change.py b/twnet_parser/messages7/game/cl_ready_change.py index b15dbf1..274695b 100644 --- a/twnet_parser/messages7/game/cl_ready_change.py +++ b/twnet_parser/messages7/game/cl_ready_change.py @@ -18,6 +18,13 @@ class MsgClReadyChange(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_say.py b/twnet_parser/messages7/game/cl_say.py index 2284698..bc4b7dc 100644 --- a/twnet_parser/messages7/game/cl_say.py +++ b/twnet_parser/messages7/game/cl_say.py @@ -27,6 +27,17 @@ class MsgClSay(PrettyPrint): self.target: int = target self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'mode', self.mode + yield 'target', self.target + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_set_spectator_mode.py b/twnet_parser/messages7/game/cl_set_spectator_mode.py index d9328c5..0408730 100644 --- a/twnet_parser/messages7/game/cl_set_spectator_mode.py +++ b/twnet_parser/messages7/game/cl_set_spectator_mode.py @@ -25,6 +25,16 @@ class MsgClSetSpectatorMode(PrettyPrint): self.spec_mode: int = spec_mode self.spectator_id: int = spectator_id + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'spec_mode', self.spec_mode + yield 'spectator_id', self.spectator_id + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_set_team.py b/twnet_parser/messages7/game/cl_set_team.py index 2998db4..92281eb 100644 --- a/twnet_parser/messages7/game/cl_set_team.py +++ b/twnet_parser/messages7/game/cl_set_team.py @@ -23,6 +23,15 @@ class MsgClSetTeam(PrettyPrint): self.team: int = team + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'team', self.team + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_skin_change.py b/twnet_parser/messages7/game/cl_skin_change.py index 5abb0a5..12ced8d 100644 --- a/twnet_parser/messages7/game/cl_skin_change.py +++ b/twnet_parser/messages7/game/cl_skin_change.py @@ -29,6 +29,17 @@ class MsgClSkinChange(PrettyPrint): self.use_custom_colors = use_custom_colors self.skin_part_colors = skin_part_colors + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'skin_part_names', self.skin_part_names + yield 'use_custom_colors', self.use_custom_colors + yield 'skin_part_colors', self.skin_part_colors + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_start_info.py b/twnet_parser/messages7/game/cl_start_info.py index b41e5c8..678a3ab 100644 --- a/twnet_parser/messages7/game/cl_start_info.py +++ b/twnet_parser/messages7/game/cl_start_info.py @@ -35,6 +35,20 @@ class MsgClStartInfo(PrettyPrint): self.use_custom_colors = use_custom_colors self.skin_part_colors = skin_part_colors + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'clan', self.clan + yield 'country', self.country + yield 'skin_part_names', self.skin_part_names + yield 'use_custom_colors', self.use_custom_colors + yield 'skin_part_colors', self.skin_part_colors + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/cl_vote.py b/twnet_parser/messages7/game/cl_vote.py index 6bcacbc..28a502f 100644 --- a/twnet_parser/messages7/game/cl_vote.py +++ b/twnet_parser/messages7/game/cl_vote.py @@ -22,6 +22,15 @@ class MsgClVote(PrettyPrint): self.vote: int = vote + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'vote', self.vote + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/de_client_enter.py b/twnet_parser/messages7/game/de_client_enter.py index ad4320f..c187b4f 100644 --- a/twnet_parser/messages7/game/de_client_enter.py +++ b/twnet_parser/messages7/game/de_client_enter.py @@ -27,6 +27,17 @@ class MsgDeClientEnter(PrettyPrint): self.client_id: int = client_id self.team: int = team + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'client_id', self.client_id + yield 'team', self.team + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/de_client_leave.py b/twnet_parser/messages7/game/de_client_leave.py index 38f6956..74e40b7 100644 --- a/twnet_parser/messages7/game/de_client_leave.py +++ b/twnet_parser/messages7/game/de_client_leave.py @@ -26,6 +26,17 @@ class MsgDeClientLeave(PrettyPrint): self.client_id: int = client_id self.reason: str = reason + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'client_id', self.client_id + yield 'reason', self.reason + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_broadcast.py b/twnet_parser/messages7/game/sv_broadcast.py index 4338a22..2c2d868 100644 --- a/twnet_parser/messages7/game/sv_broadcast.py +++ b/twnet_parser/messages7/game/sv_broadcast.py @@ -22,6 +22,15 @@ class MsgSvBroadcast(PrettyPrint): self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_chat.py b/twnet_parser/messages7/game/sv_chat.py index d5669b0..8d12d54 100644 --- a/twnet_parser/messages7/game/sv_chat.py +++ b/twnet_parser/messages7/game/sv_chat.py @@ -29,6 +29,18 @@ class MsgSvChat(PrettyPrint): self.target_id: int = target_id self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'mode', self.mode + yield 'client_id', self.client_id + yield 'target_id', self.target_id + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_checkpoint.py b/twnet_parser/messages7/game/sv_checkpoint.py index b0b0134..9530fe1 100644 --- a/twnet_parser/messages7/game/sv_checkpoint.py +++ b/twnet_parser/messages7/game/sv_checkpoint.py @@ -22,6 +22,15 @@ class MsgSvCheckpoint(PrettyPrint): self.diff: int = diff + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'diff', self.diff + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_client_drop.py b/twnet_parser/messages7/game/sv_client_drop.py index c8f03b7..ab1eff8 100644 --- a/twnet_parser/messages7/game/sv_client_drop.py +++ b/twnet_parser/messages7/game/sv_client_drop.py @@ -26,6 +26,17 @@ class MsgSvClientDrop(PrettyPrint): self.reason: str = reason self.silent: bool = silent + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'reason', self.reason + yield 'silent', self.silent + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_client_info.py b/twnet_parser/messages7/game/sv_client_info.py index 6b6e82f..80fc937 100644 --- a/twnet_parser/messages7/game/sv_client_info.py +++ b/twnet_parser/messages7/game/sv_client_info.py @@ -44,6 +44,24 @@ class MsgSvClientInfo(PrettyPrint): self.skin_part_colors = skin_part_colors self.silent: bool = silent + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'local', self.local + yield 'team', self.team + yield 'name', self.name + yield 'clan', self.clan + yield 'country', self.country + yield 'skin_part_names', self.skin_part_names + yield 'use_custom_colors', self.use_custom_colors + yield 'skin_part_colors', self.skin_part_colors + yield 'silent', self.silent + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_command_info.py b/twnet_parser/messages7/game/sv_command_info.py index 67bb864..78054aa 100644 --- a/twnet_parser/messages7/game/sv_command_info.py +++ b/twnet_parser/messages7/game/sv_command_info.py @@ -26,6 +26,17 @@ class MsgSvCommandInfo(PrettyPrint): self.args_format: str = args_format self.help_text: str = help_text + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'args_format', self.args_format + yield 'help_text', self.help_text + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_command_info_remove.py b/twnet_parser/messages7/game/sv_command_info_remove.py index e8cfbd8..97cd35c 100644 --- a/twnet_parser/messages7/game/sv_command_info_remove.py +++ b/twnet_parser/messages7/game/sv_command_info_remove.py @@ -22,6 +22,15 @@ class MsgSvCommandInfoRemove(PrettyPrint): self.name: str = name + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_emoticon.py b/twnet_parser/messages7/game/sv_emoticon.py index 08a9b04..ec3a812 100644 --- a/twnet_parser/messages7/game/sv_emoticon.py +++ b/twnet_parser/messages7/game/sv_emoticon.py @@ -25,6 +25,16 @@ class MsgSvEmoticon(PrettyPrint): self.client_id: int = client_id self.emoticon: int = emoticon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'emoticon', self.emoticon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_extra_projectile.py b/twnet_parser/messages7/game/sv_extra_projectile.py index 2fd1273..ee9f541 100644 --- a/twnet_parser/messages7/game/sv_extra_projectile.py +++ b/twnet_parser/messages7/game/sv_extra_projectile.py @@ -24,6 +24,15 @@ class MsgSvExtraProjectile(PrettyPrint): projectile = ObjProjectile() self.projectile: ObjProjectile = projectile + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'projectile', self.projectile + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_game_info.py b/twnet_parser/messages7/game/sv_game_info.py index 950b73b..769a989 100644 --- a/twnet_parser/messages7/game/sv_game_info.py +++ b/twnet_parser/messages7/game/sv_game_info.py @@ -30,6 +30,19 @@ class MsgSvGameInfo(PrettyPrint): self.match_num: int = match_num self.match_current: int = match_current + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'game_flags', self.game_flags + yield 'score_limit', self.score_limit + yield 'time_limit', self.time_limit + yield 'match_num', self.match_num + yield 'match_current', self.match_current + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_game_msg.py b/twnet_parser/messages7/game/sv_game_msg.py index e360ba0..2f85534 100644 --- a/twnet_parser/messages7/game/sv_game_msg.py +++ b/twnet_parser/messages7/game/sv_game_msg.py @@ -18,6 +18,13 @@ class MsgSvGameMsg(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_kill_msg.py b/twnet_parser/messages7/game/sv_kill_msg.py index 032f462..fa75d19 100644 --- a/twnet_parser/messages7/game/sv_kill_msg.py +++ b/twnet_parser/messages7/game/sv_kill_msg.py @@ -28,6 +28,18 @@ class MsgSvKillMsg(PrettyPrint): self.weapon: int = weapon self.mode_special: int = mode_special + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'killer', self.killer + yield 'victim', self.victim + yield 'weapon', self.weapon + yield 'mode_special', self.mode_special + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_motd.py b/twnet_parser/messages7/game/sv_motd.py index 848c50e..9c7bea9 100644 --- a/twnet_parser/messages7/game/sv_motd.py +++ b/twnet_parser/messages7/game/sv_motd.py @@ -22,6 +22,15 @@ class MsgSvMotd(PrettyPrint): self.message: str = message + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'message', self.message + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_race_finish.py b/twnet_parser/messages7/game/sv_race_finish.py index 945978f..9bc6b7f 100644 --- a/twnet_parser/messages7/game/sv_race_finish.py +++ b/twnet_parser/messages7/game/sv_race_finish.py @@ -30,6 +30,19 @@ class MsgSvRaceFinish(PrettyPrint): self.record_personal: bool = record_personal self.record_server: bool = record_server + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'time', self.time + yield 'diff', self.diff + yield 'record_personal', self.record_personal + yield 'record_server', self.record_server + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_ready_to_enter.py b/twnet_parser/messages7/game/sv_ready_to_enter.py index 049b7df..597ece1 100644 --- a/twnet_parser/messages7/game/sv_ready_to_enter.py +++ b/twnet_parser/messages7/game/sv_ready_to_enter.py @@ -18,6 +18,13 @@ class MsgSvReadyToEnter(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_server_settings.py b/twnet_parser/messages7/game/sv_server_settings.py index 2183821..69ea8f5 100644 --- a/twnet_parser/messages7/game/sv_server_settings.py +++ b/twnet_parser/messages7/game/sv_server_settings.py @@ -32,6 +32,20 @@ class MsgSvServerSettings(PrettyPrint): self.team_balance: bool = team_balance self.player_slots: int = player_slots + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'kick_vote', self.kick_vote + yield 'kick_min', self.kick_min + yield 'spec_vote', self.spec_vote + yield 'team_lock', self.team_lock + yield 'team_balance', self.team_balance + yield 'player_slots', self.player_slots + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_skin_change.py b/twnet_parser/messages7/game/sv_skin_change.py index 8a568c7..251798a 100644 --- a/twnet_parser/messages7/game/sv_skin_change.py +++ b/twnet_parser/messages7/game/sv_skin_change.py @@ -31,6 +31,18 @@ class MsgSvSkinChange(PrettyPrint): self.use_custom_colors = use_custom_colors self.skin_part_colors = skin_part_colors + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'skin_part_names', self.skin_part_names + yield 'use_custom_colors', self.use_custom_colors + yield 'skin_part_colors', self.skin_part_colors + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_team.py b/twnet_parser/messages7/game/sv_team.py index 6eeede8..7d560b4 100644 --- a/twnet_parser/messages7/game/sv_team.py +++ b/twnet_parser/messages7/game/sv_team.py @@ -29,6 +29,18 @@ class MsgSvTeam(PrettyPrint): self.silent: bool = silent self.cooldown_tick: int = cooldown_tick + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'team', self.team + yield 'silent', self.silent + yield 'cooldown_tick', self.cooldown_tick + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_tune_params.py b/twnet_parser/messages7/game/sv_tune_params.py index af78cd9..c5346b1 100644 --- a/twnet_parser/messages7/game/sv_tune_params.py +++ b/twnet_parser/messages7/game/sv_tune_params.py @@ -84,6 +84,46 @@ class MsgSvTuneParams(PrettyPrint): self.player_collision: float = player_collision self.player_hooking: float = player_hooking + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'ground_control_speed', self.ground_control_speed + yield 'ground_control_accel', self.ground_control_accel + yield 'ground_friction', self.ground_friction + yield 'ground_jump_impulse', self.ground_jump_impulse + yield 'air_jump_impulse', self.air_jump_impulse + yield 'air_control_speed', self.air_control_speed + yield 'air_control_accel', self.air_control_accel + yield 'air_friction', self.air_friction + yield 'hook_length', self.hook_length + yield 'hook_fire_speed', self.hook_fire_speed + yield 'hook_drag_accel', self.hook_drag_accel + yield 'hook_drag_speed', self.hook_drag_speed + yield 'gravity', self.gravity + yield 'velramp_start', self.velramp_start + yield 'velramp_range', self.velramp_range + yield 'velramp_curvature', self.velramp_curvature + yield 'gun_curvature', self.gun_curvature + yield 'gun_speed', self.gun_speed + yield 'gun_lifetime', self.gun_lifetime + yield 'shotgun_curvature', self.shotgun_curvature + yield 'shotgun_speed', self.shotgun_speed + yield 'shotgun_speeddiff', self.shotgun_speeddiff + yield 'shotgun_lifetime', self.shotgun_lifetime + yield 'grenade_curvature', self.grenade_curvature + yield 'grenade_speed', self.grenade_speed + yield 'grenade_lifetime', self.grenade_lifetime + yield 'laser_reach', self.laser_reach + yield 'laser_bounce_delay', self.laser_bounce_delay + yield 'laser_bounce_num', self.laser_bounce_num + yield 'laser_bounce_cost', self.laser_bounce_cost + yield 'player_collision', self.player_collision + yield 'player_hooking', self.player_hooking + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_clear_options.py b/twnet_parser/messages7/game/sv_vote_clear_options.py index 5475380..f3e8ff3 100644 --- a/twnet_parser/messages7/game/sv_vote_clear_options.py +++ b/twnet_parser/messages7/game/sv_vote_clear_options.py @@ -18,6 +18,13 @@ class MsgSvVoteClearOptions(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_option_add.py b/twnet_parser/messages7/game/sv_vote_option_add.py index a561239..94a0d69 100644 --- a/twnet_parser/messages7/game/sv_vote_option_add.py +++ b/twnet_parser/messages7/game/sv_vote_option_add.py @@ -22,6 +22,15 @@ class MsgSvVoteOptionAdd(PrettyPrint): self.description: str = description + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'description', self.description + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_option_list_add.py b/twnet_parser/messages7/game/sv_vote_option_list_add.py index ab2a07e..2f0fa96 100644 --- a/twnet_parser/messages7/game/sv_vote_option_list_add.py +++ b/twnet_parser/messages7/game/sv_vote_option_list_add.py @@ -18,6 +18,13 @@ class MsgSvVoteOptionListAdd(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_option_remove.py b/twnet_parser/messages7/game/sv_vote_option_remove.py index 9c86af7..1820cda 100644 --- a/twnet_parser/messages7/game/sv_vote_option_remove.py +++ b/twnet_parser/messages7/game/sv_vote_option_remove.py @@ -22,6 +22,15 @@ class MsgSvVoteOptionRemove(PrettyPrint): self.description: str = description + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'description', self.description + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_set.py b/twnet_parser/messages7/game/sv_vote_set.py index acb578a..8251963 100644 --- a/twnet_parser/messages7/game/sv_vote_set.py +++ b/twnet_parser/messages7/game/sv_vote_set.py @@ -31,6 +31,19 @@ class MsgSvVoteSet(PrettyPrint): self.description: str = description self.reason: str = reason + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'client_id', self.client_id + yield 'type', self.type + yield 'timeout', self.timeout + yield 'description', self.description + yield 'reason', self.reason + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_vote_status.py b/twnet_parser/messages7/game/sv_vote_status.py index df9adbe..e152d1d 100644 --- a/twnet_parser/messages7/game/sv_vote_status.py +++ b/twnet_parser/messages7/game/sv_vote_status.py @@ -28,6 +28,18 @@ class MsgSvVoteStatus(PrettyPrint): self.pass_: int = pass_ self.total: int = total + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'yes', self.yes + yield 'no', self.no + yield 'pass_', self.pass_ + yield 'total', self.total + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/game/sv_weapon_pickup.py b/twnet_parser/messages7/game/sv_weapon_pickup.py index 9c0b43b..ca495f9 100644 --- a/twnet_parser/messages7/game/sv_weapon_pickup.py +++ b/twnet_parser/messages7/game/sv_weapon_pickup.py @@ -23,6 +23,15 @@ class MsgSvWeaponPickup(PrettyPrint): self.weapon: int = weapon + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'weapon', self.weapon + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/con_ready.py b/twnet_parser/messages7/system/con_ready.py index e0d54b9..b55c607 100644 --- a/twnet_parser/messages7/system/con_ready.py +++ b/twnet_parser/messages7/system/con_ready.py @@ -18,6 +18,13 @@ class MsgConReady(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/enter_game.py b/twnet_parser/messages7/system/enter_game.py index a18360e..7c9d559 100644 --- a/twnet_parser/messages7/system/enter_game.py +++ b/twnet_parser/messages7/system/enter_game.py @@ -18,6 +18,13 @@ class MsgEnterGame(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/info.py b/twnet_parser/messages7/system/info.py index 95946c7..383253a 100644 --- a/twnet_parser/messages7/system/info.py +++ b/twnet_parser/messages7/system/info.py @@ -26,6 +26,17 @@ class MsgInfo(PrettyPrint): self.password: Optional[str] = password self.client_version: Optional[int] = client_version + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'version', self.version + yield 'password', self.password + yield 'client_version', self.client_version + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/input.py b/twnet_parser/messages7/system/input.py index c42864d..2245df7 100644 --- a/twnet_parser/messages7/system/input.py +++ b/twnet_parser/messages7/system/input.py @@ -31,6 +31,18 @@ class MsgInput(PrettyPrint): input = ObjPlayerInput() self.input: ObjPlayerInput = input + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'ack_snapshot', self.ack_snapshot + yield 'intended_tick', self.intended_tick + yield 'input_size', self.input_size + yield 'input', self.input + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/input_timing.py b/twnet_parser/messages7/system/input_timing.py index 77666a7..1e1fae1 100644 --- a/twnet_parser/messages7/system/input_timing.py +++ b/twnet_parser/messages7/system/input_timing.py @@ -24,6 +24,16 @@ class MsgInputTiming(PrettyPrint): self.input_pred_tick: int = input_pred_tick self.time_left: int = time_left + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'input_pred_tick', self.input_pred_tick + yield 'time_left', self.time_left + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/map_change.py b/twnet_parser/messages7/system/map_change.py index fe05df4..1a870ba 100644 --- a/twnet_parser/messages7/system/map_change.py +++ b/twnet_parser/messages7/system/map_change.py @@ -32,6 +32,20 @@ class MsgMapChange(PrettyPrint): self.chunk_size: int = chunk_size self.sha256: Annotated[bytes, 32] = sha256 + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'crc', self.crc + yield 'size', self.size + yield 'num_response_chunks_per_request', self.num_response_chunks_per_request + yield 'chunk_size', self.chunk_size + yield 'sha256', self.sha256 + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/map_data.py b/twnet_parser/messages7/system/map_data.py index 81e7529..e53da44 100644 --- a/twnet_parser/messages7/system/map_data.py +++ b/twnet_parser/messages7/system/map_data.py @@ -21,6 +21,15 @@ class MsgMapData(PrettyPrint): self.data: bytes = data + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'data', self.data + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/maplist_entry_add.py b/twnet_parser/messages7/system/maplist_entry_add.py index 52f10aa..f139b73 100644 --- a/twnet_parser/messages7/system/maplist_entry_add.py +++ b/twnet_parser/messages7/system/maplist_entry_add.py @@ -22,6 +22,15 @@ class MsgMaplistEntryAdd(PrettyPrint): self.name: str = name + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/maplist_entry_rem.py b/twnet_parser/messages7/system/maplist_entry_rem.py index 16f33b4..8df6ed4 100644 --- a/twnet_parser/messages7/system/maplist_entry_rem.py +++ b/twnet_parser/messages7/system/maplist_entry_rem.py @@ -22,6 +22,15 @@ class MsgMaplistEntryRem(PrettyPrint): self.name: str = name + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/ping.py b/twnet_parser/messages7/system/ping.py index 782a69a..9ab96cd 100644 --- a/twnet_parser/messages7/system/ping.py +++ b/twnet_parser/messages7/system/ping.py @@ -18,6 +18,13 @@ class MsgPing(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/ping_reply.py b/twnet_parser/messages7/system/ping_reply.py index a8078e0..5bfba78 100644 --- a/twnet_parser/messages7/system/ping_reply.py +++ b/twnet_parser/messages7/system/ping_reply.py @@ -18,6 +18,13 @@ class MsgPingReply(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_auth.py b/twnet_parser/messages7/system/rcon_auth.py index 112a487..10eb428 100644 --- a/twnet_parser/messages7/system/rcon_auth.py +++ b/twnet_parser/messages7/system/rcon_auth.py @@ -22,6 +22,15 @@ class MsgRconAuth(PrettyPrint): self.password: str = password + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'password', self.password + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_auth_off.py b/twnet_parser/messages7/system/rcon_auth_off.py index 0bf0cea..6f69136 100644 --- a/twnet_parser/messages7/system/rcon_auth_off.py +++ b/twnet_parser/messages7/system/rcon_auth_off.py @@ -18,6 +18,13 @@ class MsgRconAuthOff(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_auth_on.py b/twnet_parser/messages7/system/rcon_auth_on.py index d08e0be..9ab3d44 100644 --- a/twnet_parser/messages7/system/rcon_auth_on.py +++ b/twnet_parser/messages7/system/rcon_auth_on.py @@ -18,6 +18,13 @@ class MsgRconAuthOn(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_cmd.py b/twnet_parser/messages7/system/rcon_cmd.py index e0f1c12..4e2adb3 100644 --- a/twnet_parser/messages7/system/rcon_cmd.py +++ b/twnet_parser/messages7/system/rcon_cmd.py @@ -22,6 +22,15 @@ class MsgRconCmd(PrettyPrint): self.cmd: str = cmd + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'cmd', self.cmd + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_cmd_add.py b/twnet_parser/messages7/system/rcon_cmd_add.py index fb67e64..3cc3edf 100644 --- a/twnet_parser/messages7/system/rcon_cmd_add.py +++ b/twnet_parser/messages7/system/rcon_cmd_add.py @@ -26,6 +26,17 @@ class MsgRconCmdAdd(PrettyPrint): self.help: str = help self.params: str = params + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + yield 'help', self.help + yield 'params', self.params + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_cmd_rem.py b/twnet_parser/messages7/system/rcon_cmd_rem.py index ebd4795..a51d03c 100644 --- a/twnet_parser/messages7/system/rcon_cmd_rem.py +++ b/twnet_parser/messages7/system/rcon_cmd_rem.py @@ -22,6 +22,15 @@ class MsgRconCmdRem(PrettyPrint): self.name: str = name + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'name', self.name + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/rcon_line.py b/twnet_parser/messages7/system/rcon_line.py index eff343b..305a810 100644 --- a/twnet_parser/messages7/system/rcon_line.py +++ b/twnet_parser/messages7/system/rcon_line.py @@ -22,6 +22,15 @@ class MsgRconLine(PrettyPrint): self.line: str = line + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'line', self.line + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/ready.py b/twnet_parser/messages7/system/ready.py index 46aa1f6..e06082c 100644 --- a/twnet_parser/messages7/system/ready.py +++ b/twnet_parser/messages7/system/ready.py @@ -18,6 +18,13 @@ class MsgReady(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/request_map_data.py b/twnet_parser/messages7/system/request_map_data.py index e5ef82f..0914d68 100644 --- a/twnet_parser/messages7/system/request_map_data.py +++ b/twnet_parser/messages7/system/request_map_data.py @@ -18,6 +18,13 @@ class MsgRequestMapData(PrettyPrint): self.header: ChunkHeader = chunk_header + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/server_info.py b/twnet_parser/messages7/system/server_info.py index e48eb24..c693997 100644 --- a/twnet_parser/messages7/system/server_info.py +++ b/twnet_parser/messages7/system/server_info.py @@ -21,6 +21,15 @@ class MsgServerInfo(PrettyPrint): self.data: bytes = data + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'data', self.data + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/snap_empty.py b/twnet_parser/messages7/system/snap_empty.py index 1c068ee..d239421 100644 --- a/twnet_parser/messages7/system/snap_empty.py +++ b/twnet_parser/messages7/system/snap_empty.py @@ -24,6 +24,16 @@ class MsgSnapEmpty(PrettyPrint): self.tick: int = tick self.delta_tick: int = delta_tick + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'tick', self.tick + yield 'delta_tick', self.delta_tick + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id diff --git a/twnet_parser/messages7/system/snap_single.py b/twnet_parser/messages7/system/snap_single.py index 8147768..ec3fa3d 100644 --- a/twnet_parser/messages7/system/snap_single.py +++ b/twnet_parser/messages7/system/snap_single.py @@ -30,6 +30,18 @@ class MsgSnapSingle(PrettyPrint): self.data_size: int = data_size if data_size else len(data) self.data: bytes = data + def __iter__(self): + yield 'message_type', self.message_type + yield 'message_name', self.message_name + yield 'system_message', self.system_message + yield 'message_id', self.message_id + yield 'header', dict(self.header) + + yield 'tick', self.tick + yield 'delta_tick', self.delta_tick + yield 'crc', self.crc + yield 'data', self.data + # first byte of data # has to be the first byte of the message payload # NOT the chunk header and NOT the message id