RustTip

OnSteamInventoryUpdated

OxideCarbonPlayer

Called when a steam inventory is updated.

void OnSteamInventoryUpdated(SteamInventory local1)
Works — the game method in this build is the one the hook was written for.

Parameters

local1
SteamInventory

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnSteamInventoryUpdated(SteamInventory local1)
{
    Puts("OnSteamInventoryUpdated");
}

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

Injection point

Rust.opj (Oxide)
void SteamInventory.<UpdateSteamInventory>d__9.MoveNext()

Passes: SteamInventory local1

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l1)Assembly-CSharp.dll

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

// …
	}
	else if (!result.BelongsTo(steamInventory.baseEntity.userID))
	{
		Debug.LogWarning($"UpdateSteamPlayer: inventory belongs to someone else (userID={steamInventory.baseEntity.userID.Get()})");
	}
	else if ((bool)steamInventory.gameObject)
	{
		steamInventory.SetItems(result.Items.ToArray());
		Interface.CallHook("OnSteamInventoryUpdated", steamInventory);
		result.Dispose();
	}
	end_IL_000e:;
}
catch (Exception exception)
{
	<>1__state = -2;
	<>t__builder.SetException(exception);
// …

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.