mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-11 23:54:52 +09:00
clusterio #1180 made controller.hosts a HostManager. The datastore with set and the update event now lives on controller.hosts.records. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ExpGaming - Server List
Shares the details of every instance with every other instance.
The controller keeps one record per instance with its name, mod pack, Factorio version, players online, status and address. The address is the public address of the host and the game port of the instance, the same one the web UI shows. Whether the server has a game password is sent, the password is not. Nothing is saved, the records are rebuilt from the instances when the controller starts.
Config
On the controller:
| Field | Default | Description |
|---|---|---|
exp_server_list.welcome |
Message shown on the welcome tab of the readme for instances without their own. |
On the instance:
| Field | Default | Description |
|---|---|---|
exp_server_list.display_name |
Name shown in the server list, the instance name when empty. | |
exp_server_list.description |
One line about the server shown in the server list, the description in factorio.settings when empty. |
|
exp_server_list.welcome |
Message shown on the welcome tab of the readme, the controller welcome when empty. | |
exp_server_list.reset_time |
When the map next resets, shown on the welcome tab of the readme. | |
exp_server_list.hidden |
false | Leave this instance out of the server list on other instances. |
exp_server_list.always_on_top |
false | List this instance before those without it. |
Lua
local ExpServerList = require("modules/exp_server_list")
ExpServerList.get_servers() -- Every server that is not hidden, always on top first then by name
ExpServerList.get_server(instance_id)
ExpServerList.is_synced() -- false until the controller has sent the list
ExpServerList.get_current() -- nil until the controller has sent the list
ExpServerList.find_servers("weekly") -- Matches name, display name or id
ExpServerList.is_online(server)
ExpServerList.request_connection(player, server_or_address, self_requested)
[ExpServerList.on_servers_updated] = function(event) end, -- { server_ids }
Node
ServerListRequest returns every record, hidden ones included. Web plugins and control connections can subscribe to ServerUpdatesEvent with the exp_server_list.list permission.