This site has been archived and made available for preservation purposes. No edits can be made.

OnClientAuthenticate

This is an old revision of this page, as edited 08-06-2012, 04:28 PM by foxtacles (contribs). It may differ significantly from the current revision.
Gets called when a client attempts to connect to the server.

[top]Declaration

Code cpp:
VAULTSCRIPT VAULTSPACE State OnClientAuthenticate(VAULTSPACE cRawString, VAULTSPACE cRawString) _CPP(noexcept);
Code c:
forward OnClientAuthenticate(const name{}, const pwd{});

[top]Parameters

This is what gets passed to the callbackThis is what gets passed to the callback

name - the name of the client (guaranteed to be at least 3 and at maximum MAX_PLAYER_NAME characters long)
pwd - the password of the client (guaranteed to be at maximum MAX_PASSWORD_SIZE characters long)

[top]Return value

When returned True, the client is allowed to connect and play on this server. When returned False, the client gets kicked (authentication denied).

[top]Usage example (C++)

Code cpp:
State VAULTSCRIPT OnClientAuthenticate(cRawString name, cRawString pwd)
{
    return True; // Everybody is allowed to connect
}