class CmdLogging(Packet): pid = 123 client_id = packets.UInt32Field(ordering=1) company_id = packets.UInt8Field(ordering=2) command_id = packets.UInt16Field(ordering=3) params = packets.UInt32Field(ordering=4, count=2) tile = packets.UInt32Field(ordering=5) text = packets.StringField(ordering=6) frame = packets.UInt32Field(ordering=7)
class GameInformation(Packet): pid = 1 version = packets.UInt8Field(ordering=1, is_version_identifier=True) grfinfo = packets.RepeatingField(ordering=2, count=packets.UInt8Field(ordering=-1), fields={ "id": packets.UInt32Field(ordering=1), "md5": packets.MD5Field(ordering=2), }) game_date = packets.DateField(ordering=3) start_date = packets.DateField(ordering=4) companies_max = packets.UInt8Field(ordering=5) companies_on = packets.UInt8Field(ordering=6) spectators_max = packets.UInt8Field(ordering=7) name = packets.StringField(ordering=8, trim_length=constants.NETWORK_NAME_LENGTH) revision = packets.StringField( ordering=9, trim_length=constants.NETWORK_REVISION_LENGTH) language = packets.UInt8Field(ordering=10) passworded = packets.BooleanField(ordering=11) clients_max = packets.UInt8Field(ordering=12) clients_on = packets.UInt8Field(ordering=13) spectators_on = packets.UInt8Field(ordering=14) map_name = packets.StringField(ordering=15) map_width = packets.UInt16Field(ordering=16) map_height = packets.UInt16Field(ordering=17) map_set = packets.UInt8Field(ordering=18) dedicated = packets.UInt8Field(ordering=19)
class Chat(Packet): pid = 119 action = packets.UInt8Field(ordering=1) dest_type = packets.UInt8Field(ordering=2) client_id = packets.UInt32Field(ordering=3) message = packets.StringField(ordering=4) data = packets.UInt64Field(ordering=5)
class ClientInfo(Packet): pid = 109 client_id = packets.UInt32Field(ordering=1) hostname = packets.StringField(ordering=2) name = packets.StringField(ordering=3) language = packets.UInt8Field(ordering=4) joindate = packets.DateField(ordering=5) play_as = packets.UInt8Field(ordering=6)
class GetNewGRFList(Packet): pid = 9 newgrfs = packets.RepeatingField(ordering=1, count=packets.UInt8Field(ordering=-1), fields={ "id": packets.UInt32Field(ordering=1), "md5": packets.MD5Field(ordering=2), })
class NewGRF(Packet): pid = 10 newgrfs = packets.RepeatingField(ordering=1, count=packets.UInt8Field(ordering=-1), fields={ "id": packets.UInt32Field(ordering=1), "md5": packets.MD5Field(ordering=2), "name": packets.StringField(ordering=3), })
class Chat(Packet): pid = 4 action = packets.UInt8Field(ordering=1, validators=[enums.Action.is_valid_admin_chat]) dest_type = packets.UInt8Field(ordering=2, validators=[enums.DestType.is_valid]) client_id = packets.UInt32Field(ordering=3) message = packets.StringField( ordering=4, validators=[validators.MaxLength(constants.NETWORK_CHAT_LENGTH)])
class CompanyInfo(Packet): pid = 114 company_id = packets.UInt8Field(ordering=1) name = packets.StringField(ordering=2) manager_name = packets.StringField(ordering=3) colour = packets.UInt8Field(ordering=4) passworded = packets.BooleanField(ordering=5) startyear = packets.UInt32Field(ordering=6) is_ai = packets.BooleanField(ordering=7) bankrupcy_counter = packets.UInt8Field(ordering=8) shareholder = packets.UInt8Field(ordering=9, count=4)
class Welcome(Packet): pid = 104 name = packets.StringField(ordering=1) version = packets.StringField(ordering=2) dedicated = packets.BooleanField(ordering=3) map_name = packets.StringField(ordering=4) seed = packets.UInt32Field(ordering=5) landscape = packets.UInt8Field(ordering=6) startyear = packets.DateField(ordering=7) size_x = packets.UInt16Field(ordering=8) size_y = packets.UInt16Field(ordering=9)
class TestPacket(packets.Packet): testa = packets.UInt16Field(ordering=1) testb = packets.UInt32Field(ordering=2) testc = packets.UInt16Field( ordering=100) # Set to highest to ensure last packet field. testd = packets.Int16Field(ordering=3) teste = packets.StringField(ordering=4) testf = packets.StringField(ordering=5) testg = packets.UInt8Field(ordering=6) testh = packets.StringField(ordering=90) class Meta: virtual = True
class DetailInformation(Packet): pid = 3 company_info_version = packets.UInt8Field(ordering=1) companies = packets.RepeatingField( ordering=2, count=packets.UInt8Field(ordering=-1), fields={ "index": packets.UInt8Field(ordering=1), "name": packets.StringField(ordering=2), "inaugurated_year": packets.UInt32Field(ordering=3), "value": packets.Int64Field(ordering=4), "money": packets.Int64Field(ordering=5), "income": packets.Int64Field(ordering=6), "performance": packets.UInt16Field(ordering=7), "passworded": packets.BooleanField(ordering=8), "vehicles": packets.GroupedField(ordering=9, fields={ 'train': packets.UInt16Field(ordering=1), 'lorry': packets.UInt16Field(ordering=2), 'bus': packets.UInt16Field(ordering=3), 'plane': packets.UInt16Field(ordering=4), 'ship': packets.UInt16Field(ordering=5), }), "stations": packets.GroupedField(ordering=10, fields={ 'train': packets.UInt16Field(ordering=1), 'lorry': packets.UInt16Field(ordering=2), 'bus': packets.UInt16Field(ordering=3), 'plane': packets.UInt16Field(ordering=4), 'ship': packets.UInt16Field(ordering=5), }), "is_ai": packets.BooleanField(ordering=11), })
class ClientQuit(Packet): pid = 111 client_id = packets.UInt32Field(ordering=1)
class Pong(Packet): pid = 126 payload = packets.UInt32Field(ordering=1)
class Ping(Packet): pid = 7 payload = packets.UInt32Field(ordering=1)
class Poll(Packet): pid = 3 poll_type = packets.UInt8Field(ordering=1, validators=[enums.UpdateType.is_valid]) poll_extra = packets.UInt32Field(ordering=2)
class ClientError(Packet): pid = 112 client_id = packets.UInt32Field(ordering=1) errorcode = packets.UInt8Field(ordering=2)
class ClientUpdate(Packet): pid = 110 client_id = packets.UInt32Field(ordering=1) name = packets.StringField(ordering=2) play_as = packets.UInt8Field(ordering=3)
class ClientJoin(Packet): pid = 108 client_id = packets.UInt32Field(ordering=1)