Documentation ¶
Overview ¶
Packets used by multiple server types.
* Packet constants and structures. All functions return 0 on success, * negative int on db error, and a positive int for any other errors.
Packets specific to the patch and data servers.
Index ¶
- Constants
- type BBHeader
- type BBLoginError
- type BankItem
- type Block
- type BlockList
- type ChangeDir
- type CharacterAck
- type CharacterPreview
- type CharacterSelection
- type CharacterSummary
- type CheckFile
- type ChecksumAck
- type ClientConfig
- type FileChunk
- type FileHeader
- type FileStatus
- type FullCharacter
- type GuildcardChunk
- type GuildcardChunkRequest
- type GuildcardHeader
- type InventoryItem
- type InventorySlot
- type LobbyList
- type LobbyListEntry
- type Login
- type LoginClientMessage
- type LoginPhase
- type MenuSelection
- type Options
- type PCHeader
- type ParameterChunk
- type ParameterHeader
- type PatchRedirect
- type PatchWelcome
- type PatchWelcomeMessage
- type Redirect
- type ScrollMessagePacket
- type Security
- type SetFlag
- type ShipList
- type ShipListEntry
- type StartFileUpdate
- type Timestamp
- type Welcome
Constants ¶
const ( LobbyListType = 0x83 BlockListType = 0x07 FullCharacterType = 0xE7 FullCharacterEndType = 0x95 )
const ( PCHeaderSize = 0x04 BBHeaderSize = 0x08 )
const ( BBLoginErrorNone = iota BBLoginErrorUnknown BBLoginErrorPassword BBLoginErrorPassword2 // Same as password BBLoginErrorMaintenance BBLoginErrorUserInUse BBLoginErrorBanned BBLoginErrorBanned2 // Same as banned BBLoginErrorUnregistered BBLoginErrorExpiredSub BBLoginErrorLocked BBLoginErrorPatch BBLoginErrorDisconnect )
const ( DisconnectType = 0x05 RedirectType = 0x19 MenuSelectType = 0x10 )
Packet types common to multiple servers.
const ( LoginWelcomeType = 0x03 LoginType = 0x93 LoginSecurityType = 0xE6 LoginClientMessageType = 0x1A LoginOptionsRequestType = 0xE0 LoginOptionsType = 0xE2 LoginCharSelectType = 0xE3 LoginCharAckType = 0xE4 LoginCharPreviewType = 0xE5 LoginChecksumType = 0x01E8 LoginChecksumAckType = 0x02E8 LoginGuildcardReqType = 0x03E8 LoginGuildcardHeaderType = 0x01DC LoginGuildcardChunkType = 0x02DC LoginGuildcardChunkReqType = 0x03DC LoginParameterHeaderType = 0x01EB LoginParameterChunkType = 0x02EB LoginParameterChunkReqType = 0x03EB LoginParameterHeaderReqType = 0x04EB LoginSetFlagType = 0xEC LoginTimestampType = 0xB1 LoginShipListType = 0xA0 LoginScrollMessageType = 0xEE )
Packet types for packets sent to and from the login and character servers.
const ( PatchWelcomeType = 0x02 PatchHandshakeType = 0x04 PatchMessageType = 0x13 PatchRedirectType = 0x14 PatchDataAckType = 0x0B PatchDirAboveType = 0x0A PatchChangeDirType = 0x09 PatchCheckFileType = 0x0C PatchFileListDoneType = 0x0D PatchFileStatusType = 0x0F PatchClientListDoneType = 0x10 PatchUpdateFilesType = 0x11 PatchFileHeaderType = 0x06 PatchFileChunkType = 0x07 PatchFileCompleteType = 0x08 PatchUpdateCompleteType = 0x12 )
Packet types handled by the patch and data servers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BBLoginError ¶
type BBLoginError uint32
Error codes used by the 0xE6 security/auth response packet.
type BlockList ¶
type BlockList struct { Header BBHeader Padding [10]byte ShipName [32]byte Unknown uint32 Blocks []Block }
List containing the available blocks on a ship.
type CharacterAck ¶
Acknowledge a character selection from the client or indicate an error.
type CharacterPreview ¶
type CharacterPreview struct { Experience uint32 Level uint32 GuildcardStr [16]byte Unknown [2]uint32 NameColor uint32 Model byte Padding [15]byte NameColorChksm uint32 SectionID byte Class byte V2Flags byte Version byte V1Flags uint32 Costume uint16 Skin uint16 Face uint16 Head uint16 Hair uint16 HairRed uint16 HairGreen uint16 HairBlue uint16 PropX float32 PropY float32 // In reality this is [16]uint16 but []uint8 is more convenient to work with. Name [32]uint8 Playtime uint32 }
CharacterSummary is the common intermediate representation of a Character as it gets passed around various servers and/or stored.
type CharacterSelection ¶
type CharacterSummary ¶
type CharacterSummary struct { Header BBHeader Slot uint32 Character CharacterPreview }
Sent to the client for the selection menu and received for updating a character.
type ChecksumAck ¶
Sent in response to 0x01E8 to acknowledge a checksum (really it's just ignored).
type ClientConfig ¶
type ClientConfig struct { // The rest of this holds various portions of client state to represent // the client's progression through the login process. Magic uint32 // Must be set to 0x48615467 CharSelected uint8 // Has a character been selected? SlotNum uint8 // Slot number of selected Character Flags uint16 Ports [4]uint16 Unused [4]uint32 Unused2 [2]uint32 }
type FileHeader ¶
File header for a series of file chunks.
type FileStatus ¶
Response to CheckFile from the client with the properties of a file.
type FullCharacter ¶
type FullCharacter struct { Header BBHeader NumInventoryItems uint8 HPMaterials uint8 // TODO: Is this total HP materials consumed (i.e. for the limit)? TPMaterials uint8 // TODO: Is this total HP materials consumed (i.e. for the limit)? Language uint8 Inventory [30]InventorySlot ATP uint16 MST uint16 EVP uint16 HP uint16 DFP uint16 ATA uint16 LCK uint16 Unknown [30]byte Level uint16 Unknown2 uint16 Experience uint32 Meseta uint32 GuildcardStr [10]byte Unknown3 [10]uint8 NameColorBlue uint8 NameColorGreen uint8 NameColorRed uint8 NameColorTransparency uint8 SkinID uint16 Unknown4 [18]byte SectionID uint8 Class uint8 SkinFlag uint8 Unknown5 [5]byte Costume uint16 Skin uint16 Face uint16 Head uint16 Hair uint16 HairColorRed uint16 HairColorBlue uint16 HairColorGreen uint16 ProportionX uint32 ProportionY uint32 Name [24]byte PlayTime uint32 Unknown6 [4]byte KeyConfig [232]uint8 Techniques [20]uint8 Unknown7 [16]uint8 Options [4]uint8 Reserved4 uint32 QuestData [512]uint8 Reserved5 uint32 BankUse uint32 BankMeseta uint32 BankInventory [200]BankItem Guildcard uint32 Name2 [24]uint8 Unknown9 [56]byte GuildcardText [176]uint8 Reserved1 uint8 Reserved2 uint8 SectionID2 uint8 Class2 uint8 Unknown10 [4]uint8 SymbolChats [1248]uint8 Shortcuts [2624]uint8 AutoReply [344]uint8 GCBoard [172]uint8 Unknown12 [200]uint8 ChallengeData [320]uint8 TechConfig [40]uint8 Unknown13 [40]uint8 QuestData2 [92]uint8 Unknown14 [276]uint8 KeyConfigGlobal [364]uint8 JoystickConfigGlobal [56]uint8 Guildcard2 uint32 TeamID uint32 TeamInformation [8]uint8 PrivilegeLevel uint16 Reserved3 uint16 TeamName [28]uint8 Unknown15 uint32 TeamFlag [2048]uint8 TeamRewards [8]uint8 }
FullCharacter is the full dataset for one character.
type GuildcardChunk ¶
type GuildcardChunkRequest ¶
type GuildcardChunkRequest struct { Header BBHeader Unknown uint32 ChunkRequested uint32 Continue uint32 }
Received from the client to request a guildcard data chunk.
type GuildcardHeader ¶
type GuildcardHeader struct { Header BBHeader Unknown uint32 Length uint16 Padding uint16 Checksum uint32 }
Chunk header with info about the guildcard data we're about to send.
type InventoryItem ¶
type InventorySlot ¶
type InventorySlot struct { InUse uint8 // 0x01 for in use, 0xFF is unused Unknown [3]byte Flags uint32 Item InventoryItem }
type LobbyList ¶
type LobbyList struct { Header BBHeader Lobbies []LobbyListEntry }
LobbyList is the list of available lobbies in a block.
type LobbyListEntry ¶
type Login ¶
type Login struct { Header BBHeader Unknown [8]byte ClientVersion uint16 Slot uint32 Phase LoginPhase Unknown4 uint8 // It's not clear yet if this field is part of/related to the Phase field but it can take either 0 or e value on different clients TeamID uint32 Username [16]byte Padding [32]byte Password [16]byte Unknown3 [40]byte HardwareInfo [8]byte Security [40]byte Padding2 uint32 }
Login Packet (0x93) sent to both the login and character servers.
type LoginClientMessage ¶
Message in a large text box, usually sent right before a disconnect.
type LoginPhase ¶
type LoginPhase uint8
LoginPhase is an identifier set by the client to distinguish the "phases" it passes though with the Character server. The client disconnects and then reconnects between each phase.
const ( // Initialize represents the first connection with the Character server. The // client expects to authenticate, download the parameter files, and get the // previews of the account's characters. Initialize LoginPhase = iota // CharacterSelect is the second connection with the Character server and // all the client seems to do is to set a flag indicating that the user is // choosing a character. CharacterSelect // CharacterCreate is an optional connection with the Character server and indicates // that the user has either created a new character or recreated an existing one. CharacterCreate // CharacterUpdate is another optional connection with the Character server and // only appears when the user selects the Dressing Room during character selection. CharacterUpdate // ShipSelection is the final connection with the Character server. The client expects // to receive the ship list and the IP address of the selected Ship server. ShipSelection )
type MenuSelection ¶
MenuSelection is a client packet indicating a player's selection from one of the various menus, such as the ship or block list.
type Options ¶
type Options struct { Header BBHeader // Based on the key config structure from sylverant and newserv. KeyConfig // and JoystickConfig are saved in the database. // // Note: This packet is shortened by dropping 4 bytes from TeamFlag in order // to align it with tethealla. Sylverant and Newserv do not do this and this // may not actually be right. PlayerKeyConfig struct { Unknown [0x114]uint8 KeyConfig [0x16C]uint8 JoystickConfig [0x38]uint8 Guildcard uint32 TeamID uint32 TeamInfo [2]uint32 TeamPrivilegeLevel uint16 Reserved uint16 Teamname [0x10]uint16 TeamFlag [0x7FC]uint8 TeamRewards [2]uint32 } }
Options packet containing keyboard and joystick config, team options, etc.
type PCHeader ¶
Blueburst, PC, and Gamecube clients all use a 4 byte header to communicate with the patch server instead of the 8 byte one used by Blueburst for the other servers.
type ParameterChunk ¶
type ParameterHeader ¶
Parameter header containing details about the param files we're about to send.
type PatchRedirect ¶
Redirect packet for patch to send character server IP.
type PatchWelcome ¶
type PatchWelcome struct { Header PCHeader Copyright [44]byte Padding [20]byte ServerVector [4]byte ClientVector [4]byte }
Welcome packet with encryption vectors sent to the client upon initial connection.
type PatchWelcomeMessage ¶
Packet containing the patch server welcome message.
type ScrollMessagePacket ¶
Scroll message the client should display on the ship select screen.
type Security ¶
type Security struct { Header BBHeader ErrorCode uint32 PlayerTag uint32 Guildcard uint32 TeamID uint32 Config ClientConfig Capabilities uint32 }
Security packet (0xE6) sent to the client to indicate the state of client login.
type ShipList ¶
type ShipList struct { Header BBHeader Padding uint16 Unknown uint16 // Always 0x20 Unknown2 uint32 // Always 0xFFFFFFF4 Unknown3 uint16 // Always 0x04 ServerName [32]byte Padding2 uint32 ShipEntries []ShipListEntry }
The list of menu items to display to the client.
type ShipListEntry ¶
type StartFileUpdate ¶
Size and number of files that need to be updated.