Agent update

This commit is contained in:
Frank Harris 2026-06-06 11:41:17 -05:00
parent c195c0930b
commit cc5f7bb90c
16 changed files with 474 additions and 85 deletions

View file

@ -34,11 +34,17 @@ Important references:
## Log Viewer Layout
`Panel/modules/gamemanager/log.php` keeps the AJAX refresh behavior and renders the log in a large textarea:
`Panel/modules/gamemanager/log.php` and `Panel/modules/gamemanager/view_server_log.php` keep the AJAX refresh behavior and render the log in a large dedicated `<pre>` block:
- desktop height around `55vh`
- element: `#live-server-log.gsp-live-log-panel`
- desktop minimum height around `500px`, with `55vh` viewport height
- mobile height around `45vh`
- monospace font
- preserved line breaks
- vertical scrolling inside the log panel
- long-line overflow remains usable without shrinking the panel to one line
- AJAX refresh updates `textContent` only; it does not reload the whole page
The live viewer intentionally avoids `<textarea>` and the generic `.log` class, because inherited theme styles can make the output appear like a one-line input.
If a future route shows a one-line log again, inspect the actual rendered element first. The fix should be applied to the route that emits the element, not as a broad theme override.

View file

@ -29,6 +29,23 @@ Panel display mapping:
LGSL/GameQ query failure is not enough to mark a server offline. Query success may add player/map/hostname metadata, but query failure should only show a small unavailable note when the agent says the server is otherwise active.
Current repaired Panel flow:
1. `Panel/modules/gamemanager/server_monitor.php` calls `get_agent_server_status`.
2. `get_agent_server_status` first asks for structured `remote_server_status` data when available.
3. If the structured response is missing or ambiguous, the Panel uses existing agent calls to check `is_screen_running`.
4. The Panel also asks the agent to test the configured game port with `ss` or `netstat`.
5. A confirmed managed session, process flag, or listening game port is enough to display `ONLINE`.
6. `UNKNOWN` is reserved for an unavailable or inconclusive agent status check.
The port fallback is deliberately cross-platform:
- Linux normally uses `ss -lntu`, then `netstat`.
- Cygwin/Windows normally uses `netstat -an`.
- The Panel-side fallback parses complete command output instead of assuming the listening address is always in the same column.
Agent behavior now treats a listening game port as `ONLINE` even if the managed screen/session cannot be found. The UI may still show the warning from `last_error`, but it must not show a false red/offline or gray/unknown state when the game port proves the server is running.
## Recommended State Model
| State | Meaning |
@ -50,6 +67,8 @@ The agent should check, in this order:
4. optional query/RCON port listening
5. optional query metadata
The Panel fallback does not replace a full agent-owned status model. It exists so existing running servers do not show false unknown/offline when the structured status RPC is missing, partial, or query metadata fails.
## Known Problems To Remember
- LGSL/GameQ may fail for supported games, blocked ports, or slow startups.