Skip to content

OnServerInitialized

Let plugins know server startup is complete

Usage

  • No return behavior

Example Autogenerated

csharp
private void OnServerInitialized( bool serverInitialized )
{
    Puts( "OnServerInitialized works!" );
}

Location

  • RustCore::IOnServerInitialized()
  • RustCore::OnPluginLoaded(Plugin plugin)
csharp
private void IOnServerInitialized()
{
	if (!serverInitialized)
	{
		Analytics.Collect();

		if (!Interface.Oxide.Config.Options.Modded)
		{
			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);
	}
}
csharp
private void OnPluginLoaded(Plugin plugin)
{
	if (serverInitialized)
	{
		// Call OnServerInitialized for hotloaded plugins
		plugin.CallHook("OnServerInitialized", false);
	}
}

Released under the MIT License.