pub struct LoginRequest {
    pub username: LuWString33,
    pub password: LuWString41,
    pub locale_id: u16,
    pub client_os: ClientOs,
    pub computer_stats: ComputerStats,
}
Expand description

Provides username and password to authenticate the client.

Also provides system stats for analytics.

Trigger

Receipt of Handshake with a service_id of ServiceId::Auth.

Handling

Look up the username and a hashed form of the password in the database. If there is a match, generate a session key to be used as an auth token when the client connects to world servers, and save it to DB. Generate session keys in a way that makes it impossible for an attacker to guess a session key with non-neglible probability. Specifically, this means that using an incrementing number or a non-cryptographically-secure pseudo-random number generator for session keys is not secure.

In addition, determine the address of a char server to redirect the client to.

Response

Respond with LoginResponse, using an appropriate variant to indicate the lookup status, passing the session key and redirect address if successful.

Notes

The password is provided in plain text. Don’t save this password to the database unprocessed, as this constitutes a security hazard. Hash and salt it using a strong cryptographic hash function before saving it.

Fields

username: LuWString33

The client’s user name.

password: LuWString41

The client’s password.

locale_id: u16

The client’s locale.

client_os: ClientOs

The client’s operating system.

computer_stats: ComputerStats

Stats about the computer the client is running on.

Trait Implementations

Formats the value using the given formatter. Read more
Deserializes the type by reading from the reader.
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.