2.9 KiB
2.9 KiB
Panel Agent Flow
Workspace reference: GSP-WORKSPACE.md
Overview
The Panel does not directly run servers. It prepares the request, sends it to the agent, and interprets the response.
User action
-> Panel module page
-> OGPRemoteLibrary in lib_remote.php
-> XML-RPC request to agent /RPC2
-> ogp_agent.pl method
-> local screen/process/port work
-> return status or payload
-> Panel renders result
Request Path
Important Panel files:
Panel/includes/lib_remote.phpPanel/modules/gamemanager/start_server.phpPanel/modules/gamemanager/stop_server.phpPanel/modules/gamemanager/restart_server.phpPanel/modules/gamemanager/server_monitor.phpPanel/modules/gamemanager/view_server_log.phpPanel/modules/gamemanager/get_server_log.phpPanel/modules/gamemanager/home_handling_functions.php
Start
- Panel loads the selected server home and game XML.
- Panel composes startup parameters from stored values and XML templates.
- Panel calls
universal_starton the agent. - Agent creates the
screensession and starts the server command. - Panel polls
remote_server_status. - When the agent reports that the process/session exists and the game port listens, the server is treated as ONLINE.
Stop
- Panel calls
remote_stop_server. - Agent sends the configured graceful stop command if one exists.
- Agent watches the session/process and required port.
- If the session/process does not exit in time, the agent escalates to screen quit or process kill.
- Panel treats the server as stopped only when the agent confirms it is actually gone.
Restart
Restart should be:
stop
-> wait
-> start
The wait period should be explicit and visible in logs. Restart should not depend on marker files or query success.
Status
- Panel calls
remote_server_status. - Agent checks:
- managed screen/session
- PID or process tree when available
- required game port
- optional query/RCON ports
- Agent returns a structured status object.
- Panel maps the result to the UI state.
Logs
- Panel calls
get_log. - Agent returns the latest screen or console log data.
- The log view updates via AJAX instead of full-page refresh.
- The UI should preserve scroll position and only auto-scroll when the user is already at the bottom.
Data Returned by Status
Recommended status fields:
statusreadyprocess_runningsession_runninggame_port_listeningquery_port_listeningrcon_port_listeningpidsession_nameipportquery_portlast_error- optional query metadata
Practical Notes
- The Panel should not mark a server failed only because query metadata was unavailable.
- The agent should be the source of truth.
- Marker files may exist, but they should be treated as hints only.
- The same high-level flow should work for Linux and Windows/Cygwin.