RustTip

IOnEntitySaved

OxideEntity
void IOnEntitySaved(BaseNetworkable baseNetworkable, BaseNetworkable.SaveInfo saveInfo)
Works — the game method in this build is the one the hook was written for.

Parameters

baseNetworkable
BaseNetworkable
saveInfo
BaseNetworkable.SaveInfo

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void IOnEntitySaved(BaseNetworkable baseNetworkable, BaseNetworkable.SaveInfo saveInfo)
{
    Puts("IOnEntitySaved");
}

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

Injection point

Rust.opj (Oxide)
void BaseNetworkable.ToStream(System.IO.Stream, BaseNetworkable.SaveInfo)

Passes: BaseNetworkable baseNetworkable, BaseNetworkable.SaveInfo saveInfo

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

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

// …
		if (saveInfo.msg.baseEntity == null)
		{
			Debug.LogError(this?.ToString() + ": ToStream - no BaseEntity!?");
		}
		if (saveInfo.msg.baseNetworkable == null)
		{
			Debug.LogError(this?.ToString() + ": ToStream - no baseNetworkable!?");
		}
		Interface.CallHook("IOnEntitySaved", this, saveInfo);
		saveInfo.msg.WriteToStream(stream);
		PostSave(saveInfo);
	}
}

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.