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 04-06-2012, 03:24 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 bool OnClientAuthenticate(std::string, std::string);
forward OnClientAuthenticate(const name{}, const pwd{});
</code>

[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 a non-zero value, the client is allowed to connect and play on this server. When returned zero, the client gets kicked (authentication denied).

[top]Usage example (C++)

<code cpp>
bool VAULTSCRIPT OnClientAuthenticate(std::string name, std::string pwd)
{
return true; // Everybody is allowed to connect
}
</code>