pub struct GameplaySocket {
    pub debug_max_message_length: usize,
    /* private fields */
}
Expand description

Wrapper around UDP and TCP sockets for communicating with the game server.

Implementation details

TCP is only used for the initial login, which is encrypted with TLS. The root certificate is built into the client. The following gameplay updates are sent over UDP, encrypted with ChaCha20-Poly1305, using a secret shared during the login process. The UDP messages are processed with MessageOrderer to make sure they arrive, and that are processed in order.

Fields

debug_max_message_length: usize

Implementations

Connects to the game’s login servers and sets up the communication channel. GameplaySocket::transport should be called periodically (many times a second) afterwards, to transport sent messages, as well as keepalive messages.

Returns true after it’s been common::protocol::DISCONNECT_THRESHOLD since the last packet from the server.

Sends and receives all pending messages on the UDP socket.

Queues the ClientAction for sending during the next GameplaySocket::transport.

Returns any ServerActions received during previously called GameplaySocket::transports.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.