Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Cipher implementation responsible for packet encryption. CryptoSession CryptoSession // Account associated with the player. Account *proto.Account // Client information shared amongst most Backend implementations. Config ClientConfig Flag uint32 TeamID uint32 IsGm bool // The slot corresponding to the currently active character. ActiveSlot uint32 // Guildcard linked to the account. Guildcard uint32 GuildcardData []byte // File list used exclusively by the Data server for tracking which // files need updating. TODO: This ought to be expressed more gracefully // but we have very little information by which we can identify a unique // PSO client in the patch phase and this is easy so...here we are. FilesToUpdate map[int]interface{} // Debugging information used for logging purposes. Debug bool DebugTags map[string]debug.Tag // contains filtered or unexported fields }
Client represents a user connected through a PSOBB game client.
func (*Client) Send ¶
Send converts a packet struct to bytes and encrypts it before using the server's session key before sending the data to the client.
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 CryptoSession ¶
type CryptoSession interface { // HeaderSize returns the length of the header of all client packets. HeaderSize() uint16 // Encrypt encrypts bytes in place with the encryption key for the server. Encrypt(bytes []byte, length uint32) // Decrypt decrypts bytes in place with the encryption key for the client. Decrypt(bytes []byte, length uint32) // ServerVector returns the key used to initialize the server's block cipher. ServerVector() []byte // ClientVector returns the key used to initialize the client's's block cipher. ClientVector() []byte }
CryptoSession is an interface for the cryptographic operations required to exchange packets between a PSO game client and the server. It consists of one or more ciphers that handle encrypting packets from the server and decrypting packets from the client.
func NewBlueBurstCryptoSession ¶
func NewBlueBurstCryptoSession() CryptoSession
NewBlueBurstCryptoSession returns a CryptoSession with newly initialized ciphers that can be used to communicate with a PSO Blue Burst client.
func NewPCCryptoSession ¶
func NewPCCryptoSession() CryptoSession
NewPCCryptoSession returns a CryptoSession with newly initialized ciphers that can be used to communicate with either a PSO PC client or the patch protocol used by the PSO Blue Burst client.