| name | cs16 |
| description | Control the Headshot Factory CS 1.6 game server. Use this skill whenever the user wants to manage their CS 1.6 server - changing maps, checking status, viewing logs, restarting, stopping, starting, adding/removing bots, checking who's playing, or running RCON commands. Trigger on phrases like 'change map', 'switch to dust2', 'who's playing', 'server status', 'restart server', 'server logs', 'stop the server', 'start cs', 'add bots', 'kick bots', or any CS 1.6 server management request. Also trigger when the user says /cs16. |
CS 1.6 Server Control
Manage the Headshot Factory CS 1.6 dedicated server from your terminal via AI.
Connection Info
Read these from the project root (the repo directory):
- Server IP:
grep "ansible_host=" ansible/inventory.ini | head -1 | sed 's/.*ansible_host=//' | awk '{print $1}'
- RCON password:
grep "^RCON_PASSWORD=" .env | head -1 | cut -d= -f2
- Port:
grep -m1 'port:' config.yml | awk '{print $2}'
- SSH user:
grep "ansible_user=" ansible/inventory.ini | tail -1 | sed 's/.*ansible_user=//' | awk '{print $1}' (default: root)
RCON (important!)
RCON requires challenge-response. Use this Python snippet via SSH on the server:
ssh -o StrictHostKeyChecking=no <USER>@<IP> "python3 -c \"
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(3)
sock.sendto(b'\xff\xff\xff\xffchallenge rcon\n', ('127.0.0.1', <PORT>))
resp = sock.recv(4096).decode('latin-1').strip('\x00').strip()
challenge = resp.split()[-1]
cmd = '\xff\xff\xff\xffrcon ' + challenge + ' <RCON_PASSWORD> <COMMAND>\n'
sock.sendto(cmd.encode(), ('127.0.0.1', <PORT>))
try:
r = sock.recv(4096)
print(r[4:].decode('latin-1', errors='ignore').strip())
except:
print('Command sent (no response)')
sock.close()
\""
Replace <IP>, <PORT>, <RCON_PASSWORD>, <COMMAND> with actual values.
Commands
Understand the user's intent and run the matching action.
status
ssh -o StrictHostKeyChecking=no <USER>@<IP> "cd /opt/headshot-factory && docker compose ps && echo '---' && docker compose logs --tail=15"
logs [N]
Default 50 lines.
ssh -o StrictHostKeyChecking=no <USER>@<IP> "cd /opt/headshot-factory && docker compose logs --tail=<N>"
map
Use RCON: changelevel <mapname>
Maps: de_dust2, de_inferno, de_nuke, de_train, de_dust, de_cbble, de_aztec, cs_office, cs_italy, cs_assault, de_chateau, de_piranesi, de_prodigy, de_vertigo, cs_militia, fy_iceworld, fy_pool_day, fy_snow, fy_buzzkill, aim_map, aim_headshot, aim_deagle, awp_map, awp_india, 35hp_2
Match partial names: "inferno" = de_inferno, "iceworld" = fy_iceworld. If ambiguous, ask.
bots add [N] / bots kick
Use RCON: yapb add (repeat N times) or yapb kick
For multiple bots, send the command N times in the same Python script using a loop.
players
Use RCON: status
restart
ssh -o StrictHostKeyChecking=no <USER>@<IP> "cd /opt/headshot-factory && docker compose restart"
stop / start
ssh ... "cd /opt/headshot-factory && docker compose down"
ssh ... "cd /opt/headshot-factory && docker compose up -d"
rcon
Send any raw RCON command using the challenge-response method above.
deploy
Run make deploy from the project root.
Output
Be concise. Summarize: running/stopped, current map, player count, errors if any.