Struct netcode::ConnectToken [] [src]

pub struct ConnectToken {
    pub protocol: u64,
    pub create_utc: u64,
    pub expire_utc: u64,
    pub sequence: u64,
    pub private_data: [u8; 1024],
    pub hosts: HostList,
    pub client_to_server_key: [u8; 32],
    pub server_to_client_key: [u8; 32],
    pub timeout_sec: u32,
}

Token used by clients to connect and authenticate to a netcode Server

Fields

Protocol ID for messages relayed by netcode.

Token creation time in ms from unix epoch.

Token expire time in ms from unix epoch.

Nonce sequence for decoding private data.

Private data encryped with server's private key(separate from client <-> server keys).

List of hosts this token supports connecting to.

Private key for client -> server communcation.

Private key for server -> client communcation.

Time in seconds connection should wait before disconnecting

Methods

impl ConnectToken
[src]

Generates a new connection token.

Arguments

addrs: List of allowed hosts to connect to in From form.

private_key: Server private key that will be used to authenticate requests.

expire_sec: How long this token is valid for in seconds.

sequence: Sequence nonce to use, this should always be unique per server, per token. Use a continously incrementing counter should be sufficient for most cases.

protocol: Client specific protocol.

client_id: Unique client identifier.

user_data: Client specific userdata.

Generates a new connection token.

Arguments

addrs: List of allowed hosts to connect to.

private_key: Server private key that will be used to authenticate requests.

expire_sec: How long this token is valid for in seconds.

sequence: Sequence nonce to use, this should always be unique per server, per token. Use a continously incrementing counter should be sufficient for most cases.

protocol: Client specific protocol.

client_id: Unique client identifier.

user_data: Client specific userdata.

Decodes the private data stored by this connection token. private_key - Server's private key used to generate this token. sequence - Nonce sequence used to generate this token.

Encodes a ConnectToken into a io::Write.

Decodes a ConnectToken from an io::Read.

Trait Implementations

impl Clone for ConnectToken
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more