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 CompanyUpdate(Packet): pid = 115 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) bankrupcy_counter = packets.UInt8Field(ordering=8) shareholder = packets.UInt8Field(ordering=9, count=4)
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 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 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 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 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 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 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 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 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 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 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 ServerList(Packet): pid = 6 version = packets.UInt8Field( default=constants.NETWORK_MASTER_SERVER_VERSION, is_version_identifier=True) server_types = packets.UInt8Field(default=enums.ServerListType.AUTODETECT)
class Poll(Packet): pid = 3 poll_type = packets.UInt8Field(ordering=1, validators=[enums.UpdateType.is_valid]) poll_extra = packets.UInt32Field(ordering=2)
class CompanyNew(Packet): pid = 113 company_id = packets.UInt8Field(ordering=1)
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 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)
class Error(Packet): pid = 102 errorcode = packets.UInt8Field(ordering=1)
class CompanyRemove(Packet): pid = 116 company_id = packets.UInt8Field(ordering=1) reason = packets.UInt8Field(ordering=2)