RustTip

OnBookmarkControlEnded

OxideCarbonBookmark

Called when a bookmark control ends.

void OnBookmarkControlEnded(ComputerStation computerStation, BasePlayer ply, BaseEntity local0)
void OnBookmarkControlEnded(ComputerStation computerStation, BasePlayer basePlayer, IRemoteControllable iRemoteControllable)
Works — the game method in this build is the one the hook was written for.

Parameters

computerStation
ComputerStation
ply
BasePlayer
local0
BaseEntity

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnBookmarkControlEnded(ComputerStation computerStation, BasePlayer ply, BaseEntity local0)
{
    Puts("OnBookmarkControlEnded");
}

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

Injection point 1

Rust.opj (Oxide)
void ComputerStation.StopControl(BasePlayer)

Passes: ComputerStation computerStation, BasePlayer ply, BaseEntity local0

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

Injection point 2

Rust.opj (Oxide)
void ComputerStation.BeginControllingBookmark(BaseEntity.RPCMessage)

Passes: ComputerStation computerStation, BasePlayer basePlayer, IRemoteControllable iRemoteControllable

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l0, l6)Assembly-CSharp.dll

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

// …
else if (remoteControllable.CanControl(player.userID) && !(Vector3.Distance(transform.position, ent.transform.position) >= remoteControllable.MaxRange))
{
	BaseEntity baseEntity = currentlyControllingEnt.Get(serverside: true);
	if ((bool)baseEntity)
	{
		baseEntity.GetComponent<IRemoteControllable>()?.StopControl(new CameraViewerId(currentPlayerID, 0L));
	}
	player.net.SwitchSecondaryGroup(ent.net.group);
	Interface.CallHook("OnBookmarkControlEnded", this, player, V_6);
	currentlyControllingEnt.uid = ent.net.ID;
	currentPlayerID = player.userID;
	if (!controllingStations.Contains(this))
	{
		controllingStations.Add(this);
	}
	bool b = remoteControllable.InitializeControl(new CameraViewerId(currentPlayerID, 0L));
	SetFlagLocal(Flags.Reserved2, b);
// …

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.