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

OnClientAuthenticate

Gets called when a client attempts to connect to the server.

[top]Declaration

Code cpp:
VAULTSCRIPT VAULTSPACE State OnClientAuthenticate(VAULTSPACE cRawString, VAULTSPACE cRawString) VAULTCPP(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

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

[top]Return value

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

[top]Usage examples

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