4.4 KiB
GameManager
Role
Panel/modules/gamemanager is the core customer server control module. It owns:
- start
- stop
- restart
- logs
- server monitor
- update flow hooks
- RCON integration
- status display
Important Files
Panel/modules/gamemanager/module.phpPanel/modules/gamemanager/home_handling_functions.phpPanel/modules/gamemanager/server_monitor.phpPanel/modules/gamemanager/start_server.phpPanel/modules/gamemanager/stop_server.phpPanel/modules/gamemanager/restart_server.phpPanel/modules/gamemanager/log.phpPanel/modules/gamemanager/view_server_log.phpPanel/modules/gamemanager/get_server_log.phpPanel/modules/gamemanager/update_server.php
Start / Stop / Restart
The module calls the agent through Panel/includes/lib_remote.php.
Current shape:
- start ->
universal_start - stop ->
remote_stop_server - restart ->
remote_restart_server
The right behavior is:
- start shows
STARTINGas soon as the managed session exists - online status requires the process/session plus the game port
- restart should be stop, wait, start
- stop should not be treated as complete until the session/process is actually gone
Status Reporting
The current flow now points toward agent-truth status reporting via:
remote_server_statusget_agent_server_statusinhome_handling_functions.phpserver_status_without_decryptin both agents- fallback
is_screen_runningchecks when structured status is unavailable or ambiguous - fallback agent-side
ss/netstatport listening checks throughexec
Useful state labels:
OFFLINESTARTINGONLINESTOPPINGUNRESPONSIVEUNKNOWN
Query checks should remain optional metadata only.
Current Panel fallback behavior:
- Try the structured
remote_server_statusresponse. - Check the managed screen/session with
is_screen_running. - Check whether the configured game port is listening from the agent host using
ssornetstat. - Treat a confirmed session, process, or game port as
ONLINE. - Treat query failure as missing metadata only, not as offline or unknown.
- Show
UNKNOWNonly when the Panel cannot complete a reliable agent status check.
Repair note:
Panel/modules/gamemanager/home_handling_functions.phpcontains the status fallback.- The port fallback intentionally parses full
ss/netstatoutput instead of relying on one fixed field, because Cygwin and Linux output differ. - The port fallback sends a generated command through the existing agent
execRPC. The grep expression must contain the numeric port directly, for example[:.]2302([[:space:]]|$), not a shell-quoted value. If the regex contains quotes around the port, running servers can remainUNKNOWNafterserver_statusis unavailable. - The Windows and Linux agents report
ONLINEwhen the configured game port is listening even if the managed screen/session is missing, with a warning inlast_error.
Game Monitor Display Rules
Panel/modules/gamemanager/server_monitor.php should display state from the agent status response, not from LGSL/GameQ query success alone.
Current display mapping:
ONLINE-> green online indicatorSTARTING,STOPPING,UNRESPONSIVE-> yellow active/starting indicatorOFFLINE-> red offline indicatorUNKNOWNor agent unavailable -> gray unknown indicator
Query metadata remains optional. A running process/session or listening game port must not be shown as red/offline only because query details are unavailable.
Log Viewer
Relevant files:
Panel/modules/gamemanager/log.phpPanel/modules/gamemanager/view_server_log.phpPanel/modules/gamemanager/get_server_log.php
The log view should be treated as live, AJAX-updated output rather than a full page reload workflow.
log.php and view_server_log.php now render the live log as a dedicated <pre id="live-server-log" class="gsp-live-log-panel"> block. They intentionally do not use the generic log class or a textarea, because theme styles can collapse textarea/log elements into one-line controls.
The live panel uses viewport-based height, preserved line breaks, vertical scrolling, long-line overflow handling, and mobile sizing.
What This Module Depends On
config_gamesfor startup parameters and protocol definitionslib_remote.phpfor agent callsuser_gamesfor server home recordsrconfor command support where availableaddonsmanagerfor content/mod interactions