def _unpack(self): self.victim_id = Packet.unpack_uint8(self.buffer) self.killer_id = Packet.unpack_uint8(self.buffer) self.reason = Packet.unpack_uint16(self.buffer) self.shot_id = Packet.unpack_uint16(self.buffer) self.flag = Packet.unpack_flag(self.buffer) if self.reason == code_from_chars('pd'): self.physics_driver_id = Packet.unpack_uint32(self.buffer)
def _unpack(self): count: int = Packet.unpack_uint8(self.buffer) for i in range(0, count): Packet.unpack_uint8(self.buffer) p_info: PlayerInfo = PlayerInfo() p_info.player_index = Packet.unpack_uint8(self.buffer) p_info.ip_address = Packet.unpack_ip_address(self.buffer) self.players.append(p_info)
def _unpack(self): count: int = Packet.unpack_uint8(self.buffer) for i in range(0, count): data: ScoreData = ScoreData() data.player_id = Packet.unpack_uint8(self.buffer) data.wins = Packet.unpack_uint16(self.buffer) data.losses = Packet.unpack_uint16(self.buffer) data.team_kills = Packet.unpack_uint16(self.buffer) self.scores.append(data)
def _unpack(self): count: int = Packet.unpack_uint16(self.buffer) for i in range(0, count): setting: BZDBSetting = BZDBSetting() name_len: int = Packet.unpack_uint8(self.buffer) setting.name = Packet.unpack_string(self.buffer, name_len) value_len: int = Packet.unpack_uint8(self.buffer) setting.value = Packet.unpack_string(self.buffer, value_len) self.settings.append(setting)
def _unpack(self): count: int = Packet.unpack_uint8(self.buffer) for i in range(0, count): player = PlayerData() player.player_id = Packet.unpack_uint8(self.buffer) properties: int = Packet.unpack_uint8(self.buffer) player.is_registered = properties & IsRegistered == IsRegistered player.is_verified = properties & IsVerified == IsVerified player.is_admin = properties & IsAdmin == IsAdmin self.players.append(player)
def _unpack(self): # Discard this value; I'm not sure why this value comes out to a weird # float. We have the timestamp of the raw packet, so just that instead _ = Packet.unpack_float(self.buffer) self.player_id = Packet.unpack_uint8(self.buffer) self.state = Packet.unpack_player_state(self.buffer, self.packet.code)
def _unpack(self): self.player_index = Packet.unpack_uint8(self.buffer) self.player_type = Packet.unpack_uint16(self.buffer) self.team_value = Packet.unpack_uint16(self.buffer) self.score.wins = Packet.unpack_uint16(self.buffer) self.score.losses = Packet.unpack_uint16(self.buffer) self.score.team_kills = Packet.unpack_uint16(self.buffer) self.callsign = Packet.unpack_string(self.buffer, NetworkProtocol.CALLSIGN_LEN) self.motto = Packet.unpack_string(self.buffer, NetworkProtocol.MOTTO_LEN)
def _unpack(self): count: int = Packet.unpack_uint8(self.buffer) for i in range(0, count): data: TeamData = TeamData() data.team = Packet.unpack_uint16(self.buffer) data.size = Packet.unpack_uint16(self.buffer) data.wins = Packet.unpack_uint16(self.buffer) data.losses = Packet.unpack_uint16(self.buffer) self.teams.append(data)
def _unpack(self): self.player_id = Packet.unpack_uint8(self.buffer) self.paused = Packet.unpack_uint8(self.buffer)
def _unpack(self): self.player_id = Packet.unpack_uint8(self.buffer) self.flag = Packet.unpack_flag(self.buffer)
def _unpack(self): self.player_id = Packet.unpack_uint8(self.buffer) self.from_ = Packet.unpack_uint16(self.buffer) self.to = Packet.unpack_uint16(self.buffer)
def _unpack(self): self.player_id = Packet.unpack_uint8(self.buffer) self.position = Packet.unpack_vector(self.buffer) self.azimuth = Packet.unpack_float(self.buffer)
def _unpack(self): self.player_from_id = Packet.unpack_uint8(self.buffer) self.player_to_id = Packet.unpack_uint8(self.buffer) self.message = Packet.unpack_string(self.buffer, -1)
def _unpack(self): self.player_id = Packet.unpack_uint8(self.buffer) self.flag_id = Packet.unpack_uint16(self.buffer) self.team = Packet.unpack_uint16(self.buffer)
def _unpack(self): self.target = Packet.unpack_uint8(self.buffer) self.shot = Packet.unpack_shot(self.buffer)
def _unpack(self): self.from_ = Packet.unpack_uint8(self.buffer) self.to = Packet.unpack_uint8(self.buffer) self.flag = Packet.unpack_flag(self.buffer)