OnClientAuth
OxideCarbonPlayerCalled when client auth occurs.
void OnClientAuth(Network.Connection connection)Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.
Parameters
- connection
- Network.Connection
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnClientAuth(Network.Connection connection)
{
Puts("OnClientAuth");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void ServerMgr.OnGiveUserInformation(Network.Message)
Passes: Network.Connection connection
Method changed — checkReturnBehavior: ContinueArgumentBehavior: UseArgumentString (a0.connection)Assembly-CSharp.dll
Where it is called (this branch's game code)
// …
return;
}
string text = string.Empty;
string text2 = BuildInfo.Current?.Scm?.Branch ?? string.Empty;
if (packet.read.Unread >= 4)
{
text = packet.read.String(128);
}
Interface.CallHook("OnClientAuth", packet.connection);
if (!IsClientBranchAllowed(text2, text))
{
if (!DeveloperList.Contains(packet.connection.userid))
{
DebugEx.Log("Kicking " + packet.connection?.ToString() + " - their branch is '" + text + "' not '" + text2 + "'");
Net.sv.Kick(packet.connection, "Wrong Client Branch: Staging clients can't join release servers!");
return;
}
// …Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.