RustTip

OnServerInitialized

OxideCarbonGlobal

Called when the server finishes initializing networking and game services.

Provides access to the raw RCON message so you can log or modify behavior.

void OnServerInitialized(bool initialized)
Works — the game method in this build is the one the hook was written for.

Parameters

initialized
bool

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnServerInitialized(bool initialized)
{
    Puts("OnServerInitialized");
}

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

Where it is called

Oxide core (Oxide.Rust)
RustCore::OnPluginLoaded(Plugin plugin)

Oxide core code — the hook is called from here

private void OnPluginLoaded(Plugin plugin)
{
    if (serverInitialized)
    {
        // Call OnServerInitialized for hotloaded plugins
        plugin.CallHook("OnServerInitialized", false);
    }
}

Where it is called

Oxide core (Oxide.Rust)
RustCore::IOnServerInitialized()

Oxide core code — the hook is called from here

// …
        {
            Interface.Oxide.LogWarning("The server is currently listed under Community. Please be aware that Facepunch only allows admin tools" +
                " (that do not affect gameplay) under the Community section");
        }

        serverInitialized = true;

        // Let plugins know server startup is complete
        Interface.CallHook("OnServerInitialized", serverInitialized);
    }
}

Injection point

Carbon
void ServerMgr.OpenConnection(bool useSteamServer)
WorksAssembly-CSharp

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.