Skip to main content
GamePanelX provides built-in console access to your game servers, allowing you to view real-time output and send commands directly to running servers through GNU Screen integration.

Understanding Console Access

The console feature provides:
  • Output Monitoring: View the last lines of server console output
  • Command Execution: Send commands to the running server
  • Screen Integration: Uses GNU Screen for process management
  • Real-time Updates: Refresh output on demand
Console access requires your server to be running with GNU Screen. GamePanelX automatically manages Screen sessions for all servers.

Accessing the Console

To open the console for a server:
1

Navigate to Server Info

Click on your server to open the management interface
2

Open Info Tab

Ensure you’re on the Info tab (default view)
3

Show Console Output

Click the “Click to show console output” link in the Output row
4

Console Loads

A textarea appears showing the server’s console output

Console Output Display

When you open the console, two new sections appear:

Output Box

┌─────────────────────────────────────────────┐
│ [Console Output Area]                       │
│                                             │
│ Server console output displays here...      │
│ Shows last ~100 lines from screen log      │
│ Monospace font preserves formatting        │
│ Read-only textarea                         │
│                                             │
│ Auto-scrolls to bottom on load/refresh     │
└─────────────────────────────────────────────┘

Command Input

Send CMD: [________________________] [Send]
  • Text input field for entering commands
  • Send button to execute the command
  • Press Enter key as alternative to clicking Send
The console automatically scrolls to the bottom when loaded, showing the most recent output. The page also scrolls down to bring the console into view.

Viewing Server Output

What You’ll See

The console displays:
  • Server startup messages
  • Player connection/disconnection events
  • Map changes
  • Plugin/mod loading information
  • Error messages and warnings
  • Game events (kills, objectives, etc.)
  • Admin command results

Output Details

// Console shows the tail of the screen log file
- Monospace font (Verdana, Arial fallback)
- 10pt font size
- 700px wide × 200px tall
- Gray border with rounded corners
- Read-only (cannot edit output)
- Auto-scroll to bottom

Refreshing Output

To see updated console output:
1

Send Any Command

Execute any command or empty command
2

Wait 1 Second

The output refreshes after command execution
3

Updated Output

Console displays the latest server output
Console output is not live-streamed. You must manually refresh by sending commands or reopening the console to see new output.

Sending Commands

The command input allows you to send commands directly to the running server through GNU Screen.

How to Send Commands

1

Type Command

Enter your command in the “Send CMD” input field
2

Execute

Click the Send button or press Enter
3

Processing

Info box shows “Sending…” indicator
4

Confirmation

Success message appears when command is sent
5

Output Refreshes

Console output updates after 1 second to show results

Command Examples

Depending on your game server, you can send various commands:

Source Engine Games (CS:S, TF2, etc.)

status              # Show player list and server status
changelevel de_dust2 # Change map
say Hello World     # Send message to all players
sm plugins list     # List SourceMod plugins (if installed)
kick PlayerName     # Kick a player
ban PlayerName 30   # Ban player for 30 minutes

Minecraft

list                # Show online players
op PlayerName       # Give operator permissions
kick PlayerName     # Kick a player
give PlayerName minecraft:diamond 64  # Give items
time set day        # Change time to day

Generic Commands

help                # Show available commands
version             # Show server version
status              # Show server status
config              # Show/reload configuration
Commands are sent directly to the game server console. Invalid commands may produce errors or no output. Refer to your game’s console command documentation.

GNU Screen Integration

GamePanelX uses GNU Screen to manage game server processes.

How Screen Works

# Each server runs in a named screen session
Screen Name: GPX_{SERVER_ID}
Example: GPX_42 for server ID 42

# Commands sent via: screen -S GPX_42 -p 0 -X stuff "command^M"
# Output read from screen log file

Screen Benefits

Persistent Sessions

Servers keep running if SSH disconnects

Output Capture

Screen logs all console output automatically

Command Injection

Send commands to running processes

Process Management

Easy server restart and monitoring

Screen Sessions

When a server starts:
  1. GamePanelX creates a new Screen session
  2. The game server runs inside the Screen session
  3. Screen logs output to a file
  4. Commands are “stuffed” into the Screen input
  5. Output is read from the Screen log file

Console Output Retrieval

Local Servers

For local servers, output is read directly:
// Reads screen log file
$log_file = "/home/user/.screen/GPX_{SERVER_ID}.log"
// Returns last ~100 lines

Remote Servers

For remote servers via SSH:
// Uses SSH to run GetOutput command
$command = "GetOutput -s {SERVER_ID}"
// SSH connection retrieves screen log
// Returns output over secure connection
Output retrieval uses the network class’s runcmd() method for remote servers, ensuring proper authentication and SSO user context.

Command Security

Command Validation

All commands are validated before execution:
// Security checks:
- Server ID must be valid
- User must own the server
- Command cannot be empty
- Command cannot contain: . (periods)
- Command cannot contain: ; & / | (shell operators)
- No path traversal allowed

Prevented Actions

The following patterns are blocked for security:
  • ./script.sh (period in command)
  • cmd1; cmd2 (command chaining)
  • cmd1 && cmd2 (conditional execution)
  • cmd1 | cmd2 (piping)
  • cmd1 & (backgrounding)

Safe Command Execution

Commands are safely injected into the Screen session:
# Screen stuff command format
screen -S GPX_{ID} -p 0 -X stuff "command\015"

# The \015 is a carriage return (simulates Enter key)
# Commands execute in the game server's context
# No shell interpretation occurs

Console Workflow Example

Changing Server Map

Here’s a complete workflow for changing the map:
1

Open Console

Navigate to Info tab and click “Click to show console output”
2

Check Current Map

View console output to see current map and player status
3

Send Change Command

Type changelevel de_dust2 (or your game’s map change command)
4

Wait for Send

Click Send and wait for “Sending…” confirmation
5

Verify Output

After 1 second, console refreshes showing map change output
6

Check Server Status

Verify server is still online and responding to queries

JavaScript Console Integration

Auto-Focus and Enter Key

The console includes JavaScript enhancements:
$(document).ready(function(){
    // Focus command input when console opens
    $('#send_cmd').focus();
    
    // Send command on Enter key press
    $('#send_cmd').keypress(function(e) {
        if (e.keyCode == 13) {
            server_send_screen_cmd(server_id);
        }
    });
});

AJAX Command Sending

Commands are sent via AJAX:
// Sends to: ajax/ajax.php?a=server_actions&do=sendscreencmd
// Parameters: id={server_id}&cmd={command}
// Response: 'success' or error message
// Auto-refreshes output after 1 second on success

Limitations and Considerations

Output Is Not Live

The console does not provide real-time streaming:
  • Output must be manually refreshed
  • Send a command to trigger refresh
  • No automatic polling or updates
  • Limited to last ~100 lines

Screen Log Size

Screen logs can grow large over time:
  • Logs are not automatically rotated by GamePanelX
  • Consider manual log cleanup for long-running servers
  • Screen log location: ~/.screen/GPX_{ID}.log

Command Limitations

  • Only game console commands work (no shell commands)
  • No interactive commands supported
  • No output confirmation for silent commands
  • Some games buffer output (delayed display)
For advanced server management, consider using direct SSH access to the server’s Screen session for full interactive console access.

Troubleshooting

Console Output Is Empty

Possible Causes:
  • Server is not running
  • Screen session is not active
  • Screen logging is disabled
  • Server just started (no output yet)
Solutions:
  1. Verify server status shows “Online”
  2. Try restarting the server
  3. Check Screen session exists via SSH: screen -ls

Commands Don’t Work

Possible Causes:
  • Wrong command syntax for your game
  • Server not responding to input
  • Screen session disconnected
  • Command blocked by validation
Solutions:
  1. Verify command syntax in game documentation
  2. Check for special characters or shell operators
  3. Try a simple command like status or help
  4. Restart the server if Screen session is broken

Output Not Refreshing

Possible Causes:
  • Screen log file not updating
  • Permissions issue on log file
  • Screen session closed
Solutions:
  1. Send a test command to trigger refresh
  2. Check server is still running
  3. Restart server to recreate Screen session

Advanced Usage

Direct Screen Access

For advanced users with SSH access:
# Connect to server via SSH
ssh [email protected]

# List screen sessions
screen -ls

# Attach to server console
screen -r GPX_42

# Detach from screen: Ctrl+A, then D

Monitoring Multiple Servers

To check multiple servers:
  1. Open each server in separate browser tabs
  2. Open console on each server’s Info tab
  3. Switch between tabs to monitor output
  4. Use browser tab titles to identify servers

Next Steps

Managing Servers

Learn about server control and configuration

File Management

Edit configuration files and manage server files

Client Portal Overview

Return to client portal overview

Build docs developers (and LLMs) love