Server Heartbeats
gokz-top-servers is the SourceMod plugin that pushes live server status into the GOKZ.TOP API. It sends richer data than A2S alone can provide, including per-player GOKZ timer state.
Requirements
gokz-top-coremust already be installed and configured.cfg/sourcemod/gokz-top/gokz-top-core.cfgmust contain a validgokz_top_server_group_key.- The server must push from its real public IPv4 and
hostport.
Configuration
gokz-top-servers adds one server-side cvar:
gokz_top_servers_push_interval- Default:
4.0 - Minimum:
2.0 - Maximum:
10.0
Generated config files live under cfg/sourcemod/gokz-top/:
gokz-top-core.cfggokz-top-servers.cfg
The plugin sends periodic heartbeats on that interval and also queues immediate pushes on map start plus player connect and disconnect events.
On the first accepted heartbeat for a server-group key, the API will automatically:
- create a missing server row for that
(ip, port)endpoint, or - claim an existing unassigned discovered row for that endpoint.
Explicitly disabled servers and endpoints already assigned to a different server group are still rejected.
Public IP Cache
The plugin stores its public-IP cache at addons/sourcemod/data/gokz-top/public_ip_cache.json.
Cached fields:
public_iplast_refresh
Refresh behavior:
- If the cache is less than 24 hours old, the cached IP is reused.
- Otherwise the plugin requests
http://ip-api.com/jsonwith an approximately 3 second timeout and readsquery. - If that fails, it requests
https://myip.wtf/jsonwith an approximately 3 second timeout and readsYourFuckingIPAddress. - If both fail, public IP remains unset and
/v1/servers/statuspushes are skipped until a later refresh succeeds.
This avoids pushing private or stale endpoints to the API.
Heartbeat Payload
Each heartbeat includes the server endpoint and a player list:
ipportobserved_athostnamemapplayer_countmax_playersplayers
Each player row includes:
tagmodenamescorestatusduration_secondsis_pausedsteamid64teleportstimer_timestage
status values:
not_startedin_progressfinishedaborted
Pause state is sent separately in is_paused; paused players still report status: "in_progress".
Troubleshooting
- If the server never appears online, confirm the GOKZ.TOP server entry uses the same public IPv4 and
hostportthe plugin resolves. - If player-session events work but server heartbeats do not, check that the server-group key is still valid and that the public-IP cache is not empty after both providers fail.
- If status updates look delayed, verify
gokz_top_servers_push_intervalis not set above the default and check for repeated public-IP refresh failures in the SourceMod logs.