OnUserConnected
OxideCarbonPlayerCalled when a remote RCON command is received.
Provides access to the raw RCON message so you can log or modify behavior.
void OnUserConnected(Oxide.Core.Libraries.Covalence.IPlayer player)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
- player
- Oxide.Core.Libraries.Covalence.IPlayer
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnUserConnected(Oxide.Core.Libraries.Covalence.IPlayer player)
{
Puts("OnUserConnected");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Where it is called
Oxide core (Oxide.Rust)
RustCore::IOnPlayerConnected(BasePlayer basePlayer)
Oxide core code — the hook is called from here
// …
basePlayer.SendEntitySnapshot(CommunityEntity.ServerInstance);
// Let covalence know
Covalence.PlayerManager.PlayerConnected(basePlayer);
IPlayer player = Covalence.PlayerManager.FindPlayerById(basePlayer.UserIDString);
if (player != null)
{
basePlayer.IPlayer = player;
Interface.CallHook("OnUserConnected", player);
}
Interface.Oxide.CallHook("OnPlayerConnected", basePlayer);
}Injection point
Rust.opj (Oxide)
void BasePlayer.PlayerInit(Network.Connection)
Injected internal hook IOnPlayerConnected — this hook is called by its handler in the Oxide/Carbon core
Method changed — checkReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll
Where it is called (this branch's game code)
// …
if ((bool)BaseGameMode.GetActiveGameMode(serverside: true))
{
BaseGameMode.GetActiveGameMode(serverside: true).OnPlayerConnected(this);
}
if (net != null)
{
EACServer.OnStartLoading(net.connection);
}
Interface.CallHook("IOnPlayerConnected", this);
if (IsAdmin)
{
if (ConVar.AntiHack.noclip_protection <= 0)
{
ChatMessage("antihack.noclip_protection is disabled!");
}
if (ConVar.AntiHack.speedhack_protection <= 0)
{
// …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.