RustTip

OnFogOfWarImageUpdate

OxideCarbonPlayer
object OnFogOfWarImageUpdate(BasePlayer basePlayer, byte local0, byte local1, uint local2, uint local3, byte[] local5)
Works — the game method in this build is the one the hook was written for.

Parameters

basePlayer
BasePlayer
local0
byte
local1
byte
local2
uint
local3
uint
local5
byte[]

Return value

objectReturn non-null to cancel the game action.

Example

object — you can affect the game: return a value to change or cancel the action.

private object OnFogOfWarImageUpdate(BasePlayer basePlayer, byte local0, byte local1, uint local2, uint local3, byte[] local5)
{
    Puts("OnFogOfWarImageUpdate");

    // change nothing — the game continues as usual
    return null;

    // to affect the game:
    // return false; // non-null cancels the game action
}

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

Injection point

Rust.opj (Oxide)
void BasePlayer.FogImageUpdate(BaseEntity.RPCMessage)

Passes: BasePlayer basePlayer, byte local0, byte local1, uint local2, uint local3, byte[] local5

WorksReturnBehavior: ExitWhenNonNullArgumentBehavior: UseArgumentString (this, l0, l1, l2, l3, l5)Assembly-CSharp.dll

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

// …
		fogImageList.Add(0u);
	}
}
if (b != 0 || fogImageList[index] != num)
{
	byte[] array = msg.read.BytesWithSize(5000u);
	if (array != null)
	{
		if (Interface.CallHook("OnFogOfWarImageUpdate", this, b, index, num, num2, array) != null)
		{
			return;
		}
		FileStorage.server.RemoveEntityNum(net.ID, num2);
		uint value = FileStorage.server.Store(array, FileStorage.Type.png, net.ID, num2);
		fogImageList[index] = value;
		DirtyPlayerState();
	}
// …

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.