This site has been archived and made available for preservation purposes. No edits can be made.
OnClientAuthenticate
(Difference between revisions)
Return to current revision
-
-
Gets called when a client attempts to connect to the server.
== Declaration ==
<code cpp>
VAULTSCRIPT bool OnClientAuthenticate(std::string, std::string);
forward OnClientAuthenticate(const name{}, const pwd{});
</code>
== Parameters ==
[[File:Authenticate.png|right|thumb|This 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)
== Return value ==
The C++ version returns a std::string containing the name. The PAWN version has no return value.
== Usage example (C++) ==
<code cpp>
std::string name;
name = GetName(object);
</code>
== Usage example (PAWN) ==
<code c>
new name{MAX_PLAYER_NAME};
GetName(player, name);
</code>