RustTip

OnCentralizedBanCheck

OxideCarbonPlayer

Called when centralized ban check occurs.

object OnCentralizedBanCheck(Network.Connection connection)
Works — the game method in this build is the one the hook was written for.

Parameters

connection
Network.Connection

Return value

objectThe result is checked in a special way — see the call code below.

Example

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

private object OnCentralizedBanCheck(Network.Connection connection)
{
    Puts("OnCentralizedBanCheck");

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

    // to affect the game:
    // return null; // null — the game continues as usual
}

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

Injection point

Rust.opj (Oxide)
bool Auth_CentralizedBans.<Run>d__0.MoveNext()

Passes: Network.Connection connection

WorksReturnBehavior: CustomAssembly-CSharp.dll

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

private bool MoveNext()
{
	string uri2;
	object result = Interface.CallHook("OnCentralizedBanCheck", this.connection);
	// … проверка результата (Modify-хук, см. Rust.opj)
	switch (<>1__state)
	{
	default:
		return false;
	case 0:
		<>1__state = -1;
		connection.authStatusCentralizedBans = string.Empty;
// …

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.