pub struct Handshake {
    pub network_version: u32,
    pub service_id: ServiceId,
}
Expand description

Completes a version handshake initiated by the client.

Trigger

Receipt of a client-sent Handshake packet that was acceptable to the server.

Handling

Optionally check if the server’s network_version matches your own. You can usually assume that the server will check this itself and disconnect if it doesn’t match, but you can check again to be sure.

Response

If the server’s service_id is ServiceId::Auth, respond with a LoginRequest with your username and password. If it is ServiceId::World, send a ClientValidation with your username and the session key provided by auth.

Notes

As the version confirm process was designed with more than just client-server in mind, it sends the server’s network version and service id as well, even though this isn’t really needed by the client (even the service id isn’t needed, since you usually only connect to auth once, and it’s the very first connection). This could be simplified if the protocol is ever revised.

Fields

network_version: u32

The network protocol version of the server. For servers compatible with live, this is 171022. This was relevant mainly back when LU was actively updated. Server projects making modifications to the network protocol should set this to a different value.

service_id: ServiceId

Service ID of the server, ServiceId::Auth for auth servers, ServiceId::World for world servers.

Trait Implementations

Formats the value using the given formatter. Read more
Deserializes the type by reading from the reader.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serializes the type by writing to the writer.

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.