OnPlayerUnvanished
OxideCarbonPlayerobject OnPlayerUnvanished(BasePlayer local0)
object OnPlayerUnvanished()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
- local0
- BasePlayer
Return value
objectThe result is checked in a special way — see the call code below.
Example
object — you can affect the game: return a value to change or cancel the action.
private object OnPlayerUnvanished(BasePlayer local0)
{
Puts("OnPlayerUnvanished");
// change nothing — the game continues as usual
return null;
// to affect the game:
// return null; // null — the game continues as usual
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point 1
Rust.opj (Oxide)
void ConVar.Debugging.invis(ConsoleSystem.Arg)
Passes: BasePlayer local0
Method changed — checkReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l0)Assembly-CSharp.dll
Where it is called (this branch's game code)
// …
}
}
SimpleAIMemory.RemoveIgnorePlayer(basePlayer);
BaseEntity.Query.Server.RemovePlayer(basePlayer);
BaseEntity.Query.Server.AddPlayer(basePlayer);
}
arg.ReplyWith("Invis: " + basePlayer.isInvisible);
basePlayer.Command("debug.setinvis_ui", basePlayer.isInvisible);
Interface.CallHook("OnPlayerUnvanished", basePlayer);
basePlayer.SendVoiceMutedByInvisibility();
}Injection point 2
Rust.opj (Oxide)
void ConVar.Debugging.invis(ConsoleSystem.Arg)
Passes: —
Method changed — checkReturnBehavior: CustomAssembly-CSharp.dll
Where it is called (this branch's game code)
// …
BasePlayer.invisPlayers.Add(basePlayer);
basePlayer.DisablePlayerCollider();
SimpleAIMemory.AddIgnorePlayer(basePlayer);
BaseEntity.Query.Server.RemovePlayer(basePlayer);
}
else if (!flag && basePlayer.isInvisible)
{
basePlayer.isInvisible = false;
object result = Interface.CallHook("OnPlayerUnvanished");
// … проверка результата (Modify-хук, см. Rust.opj)
BasePlayer.invisPlayers.Remove(basePlayer);
basePlayer.EnablePlayerCollider();
if (!ServerOcclusion.OcclusionEnabled)
{
foreach (Connection subscriber2 in basePlayer.net.group.subscribers)
{
BasePlayer player = subscriber2.player as BasePlayer;
// …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.