OnServerInformationUpdated
OnServerInformationUpdated is called after the server refreshes the values it publishes to Steam (FPS, average FPS, entity count and build id), which happens periodically via ServerMgr.UpdateServerInformation. It takes no parameters.
void OnServerInformationUpdated()Return value
The hook's return value is ignored. The original method continues to run CrashSessionMarker.RefreshFromServerTags() after the hook call regardless of what your plugin returns.
How it works
The hook fires at the end of ServerMgr.UpdateServerInformation, right after the server writes its tags into SteamServer and before CrashSessionMarker.RefreshFromServerTags() runs. The game calls that method on its own schedule, so expect this hook to fire repeatedly for the whole lifetime of the server, not once. Because no values are passed in, the hook is only useful as a trigger: pull the current numbers yourself (for example Performance.report.frameRate, Performance.report.frameRateAverage or BaseNetworkable.serverEntities.Count) or use it to push your own data elsewhere. There is no object to narrow and no type check to exploit, so every plugin that declares this hook gets called on each refresh. Keep the body cheap and allocation-light, since it runs alongside a routine server update; do not put logging, file writes or heavy loops in it. Combine it with a minimum interval if you need to act on the data less often.
Example plugin: Report server FPS and entity count to chat on demand
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Server Info Reporter", "RustPluginGenerator", "1.0.0")]
[Description("Caches the server's published FPS values and shows them to permitted players on command")]
public class ServerInfoReporter : RustPlugin
{
private const string PermUse = "serverinforeporter.use";
private PluginConfig config;
private float lastFrameRate;
private float lastAverageFrameRate;
private class PluginConfig
{
[JsonProperty("Show FPS values")]
public bool ShowFps { get; set; } = true;
[JsonProperty("Show entity count")]
public bool ShowEntityCount { get; set; } = true;
[JsonProperty("Command cooldown in seconds")]
public float CommandCooldown { get; set; } = 10f;
}
protected override void LoadDefaultConfig() => config = new PluginConfig();
protected override void LoadConfig()
{
base.LoadConfig();
try
{
config = Config.ReadObject<PluginConfig>();
if (config == null) throw new Exception();
}
catch
{
PrintWarning("Configuration file is invalid, using defaults");
LoadDefaultConfig();
}
SaveConfig();
}
protected override void SaveConfig() => Config.WriteObject(config);
protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["Chat.Info"] = "<color=#ce422b>Server</color> FPS: {0} | Avg: {1} | Entities: {2}",
["Chat.NoPermission"] = "You do not have permission to use this command.",
["Chat.Cooldown"] = "Please wait {0} seconds before using this again."
}, this);
}
private string Msg(string key, string userId = null, params object[] args) =>
string.Format(lang.GetMessage(key, this, userId), args);
private void Init()
{
permission.RegisterPermission(PermUse, this);
}
private void OnServerInformationUpdated()
{
lastFrameRate = Performance.report.frameRate;
lastAverageFrameRate = Performance.report.frameRateAverage;
}
[ChatCommand("serverinfo")]
private void CmdServerInfo(BasePlayer player, string command, string[] args)
{
if (player == null) return;
if (!permission.UserHasPermission(player.UserIDString, PermUse))
{
player.ChatMessage(Msg("Chat.NoPermission", player.UserIDString));
return;
}
if (config.CommandCooldown > 0f)
{
double last = 0d;
_lastUse.TryGetValue(player.userID, out last);
double next = last + config.CommandCooldown;
double now = DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
if (now < next)
{
player.ChatMessage(Msg("Chat.Cooldown", player.UserIDString, Math.Ceiling(next - now)));
return;
}
_lastUse[player.userID] = now;
}
int entities = BaseNetworkable.serverEntities.Count;
player.ChatMessage(Msg("Chat.Info", player.UserIDString,
config.ShowFps ? lastFrameRate.ToString("0.0") : "-",
config.ShowFps ? lastAverageFrameRate.ToString("0.00") : "-",
config.ShowEntityCount ? entities.ToString() : "-"));
}
private readonly Dictionary<ulong, double> _lastUse = new Dictionary<ulong, double>();
}
}The plugin tracks the last values the server published by reading Performance.report.frameRate and Performance.report.frameRateAverage inside OnServerInformationUpdated, so it always reflects the most recent refresh. Players with the serverinforeporter.use permission can run /serverinfo to get a chat line with those numbers plus the live entity count from BaseNetworkable.serverEntities. The config controls which values are shown and how often /serverinfo may be used. All player-facing text goes through the language file, and no work is done in the hook beyond copying two floats, so the server update stays cheap.
Common use cases
Expose published FPS to admins
Store the latest frame rate values and show them via a chat command so staff can check performance without RCON.
Feed a status panel or Discord relay
Use the hook as a trigger to hand the current FPS and entity count to an external plugin through a plugin reference.
Warn on entity count growth
Compare the entity count against a configured threshold and print a warning to the console when it crosses it.
Pitfalls
Fires on the server's own schedule
You cannot control when ServerMgr.UpdateServerInformation runs, so the hook can fire often or at unpredictable intervals. Throttle any output.
No data is passed in
The hook has no parameters, so values must be read from Performance.report or other game statics; anything you cache is only as fresh as the last refresh.
Do not log inside the hook
Console output on every refresh will flood the log. Save values in fields and print only in response to a command or a threshold change.
Build a plugin with OnServerInformationUpdated
Describe what should happen and get a compiled plugin that uses this hook.
Edit the prompt on the next screen. 2 free plugins a month, no card.
Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.
Build a plugin with OnServerInformationUpdated
Generate