RustTip

OnFogOfWarCleared

OxideCarbonPlayer
void OnFogOfWarCleared(BasePlayer basePlayer, bool mainland, bool deepSea)
Works — the game method in this build is the one the hook was written for.

Parameters

basePlayer
BasePlayer
mainland
bool
deepSea
bool

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnFogOfWarCleared(BasePlayer basePlayer, bool mainland, bool deepSea)
{
    Puts("OnFogOfWarCleared");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Rust.opj (Oxide)
void BasePlayer.ServerClearFog(bool, bool)

Passes: BasePlayer basePlayer, bool mainland, bool deepSea

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, a0, a1)Assembly-CSharp.dll

Where it is called (this branch's game code)

// …
if (mainland)
{
	ClearFogList(ref State.fogImagesMainland);
}
if (deepSea)
{
	ClearFogList(ref State.fogImagesDeepSea);
}
Interface.CallHook("OnFogOfWarCleared", this, mainland, deepSea);
DirtyPlayerState();
SendFogImagesToClient();
void ClearFogList(ref List<uint> fog)
{
	if (fog == null || fog.Count != 16)
	{
		fog = Pool.Get<PooledList<uint>>();
		for (int i = 0; i < 16; i++)
// …

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.