class CompanyStats(Packet): pid = 118 company_id = packets.UInt8Field(ordering=1) vehicles = packets.GroupedField(ordering=2, 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=3, 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), })
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 Protocol(Packet): pid = 103 version = packets.UInt8Field(ordering=1, is_version_identifier=True) settings = packets.DictField(ordering=2, key=packets.UInt16Field(ordering=1), value=packets.UInt16Field(ordering=2), is_next=packets.BooleanField(ordering=3, is_next=True))
class ServerList(Packet): pid = 7 ip_type = packets.IPAddrPrefixField(ordering=1) addresses = packets.RepeatingField(ordering=2, count = packets.UInt16Field(ordering=-1), fields = { "ip" : packets.IPAddrField(ordering=1), "port" : packets.UInt16Field(ordering=2), })
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 CmdNames(Packet): pid = 122 commands = packets.DictField(ordering=1, key=packets.UInt16Field(ordering=1), value=packets.StringField(ordering=2), is_next=packets.BooleanField(ordering=3, is_next=True))
class CompanyEconomy(Packet): pid = 117 company_id = packets.UInt8Field(ordering=1) money = packets.Int64Field(ordering=2) current_loan = packets.Int64Field(ordering=3) income = packets.Int64Field(ordering=4) delivered = packets.UInt16Field(ordering=5) history = packets.RepeatingField(ordering=6, count=2, fields={ 'value': packets.Int64Field(ordering=1), 'performance': packets.UInt16Field(ordering=2), 'delivered': packets.UInt16Field(ordering=3), })
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 Register(Packet): pid = 4 welcome_message = packets.StringField( default=constants.NETWORK_MASTER_SERVER_WELCOME_MESSAGE) version = packets.UInt8Field( default=constants.NETWORK_MASTER_SERVER_VERSION, is_version_identifier=True) server_port = packets.UInt16Field(default=constants.NETWORK_DEFAULT_PORT) session_key = packets.UInt64Field()
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 UpdateFrequency(Packet): pid = 2 update_type = packets.UInt16Field(ordering=1, validators=[enums.UpdateType.is_valid]) update_freq = packets.UInt16Field( ordering=2, validators=[enums.UpdateFrequency.is_valid])
class Rcon(Packet): pid = 120 colour = packets.UInt16Field(ordering=1) result = packets.StringField(ordering=2)
class Unregister(Packet): pid = 8 version = packets.UInt8Field( default=constants.NETWORK_MASTER_SERVER_VERSION, is_version_identifier=True) server_port = packets.UInt16Field(default=constants.NETWORK_DEFAULT_PORT)