# Garry's Mod PropHunt Server

## 📋 Overview

A dedicated Garry's Mod server running the PropHunt gamemode, where players hide as props while others try to find and eliminate them.

## 🔧 Service Details

| Property | Value |
|----------|-------|
| **Game** | Garry's Mod |
| **Gamemode** | PropHunt |
| **Server Port** | 27015 |
| **RCON Port** | 39903 |
| **Max Players** | 24 |
| **Tickrate** | 66 |
| **Map** | ph_office |
| **Process User** | `gmod` |

## 🌐 Network Access

- **Game Server**: `YOUR_WAN_IP:27015`
- **RCON**: `127.0.0.1:39903` (localhost only)
- **Steam Server Account**: Configured with Steam Game Server Token

## 📁 Directory Structure

```
/home/gmod/gmod-prophunt-server/
├── srcds_run              # Server startup script
├── srcds_linux           # Server binary
├── garrysmod/            # Game files
│   ├── addons/          # Server addons/plugins
│   ├── gamemodes/       # PropHunt gamemode
│   ├── maps/            # Server maps
│   └── cfg/             # Configuration files
└── docker/              # Docker configuration
    └── docker-compose.yml
```

## 🚀 Management Commands

### Direct Server Control
```bash
# Switch to gmod user
sudo su - gmod

# Navigate to server directory
cd /home/gmod/gmod-prophunt-server/

# Start server (manual)
./srcds_run -game garrysmod -console -port 27015 +ip 0.0.0.0 +maxplayers 24 +map ph_office +gamemode prop_hunt -tickrate 66 +hostname "PropHunt Server" +sv_setsteamaccount YOUR_TOKEN -disableluarefresh -nohltv

# Check if server is running
ps aux | grep srcds_linux
```

### Process Management
```bash
# Find server process
ps aux | grep srcds_linux

# Kill server (if needed)
pkill -f srcds_linux

# Check server logs
tail -f /home/gmod/gmod-prophunt-server/garrysmod/console.log
```

### Docker Management (Alternative)
```bash
# Using Docker Compose
cd /opt/gmod-prophunt/docker/
docker-compose up -d
docker-compose logs -f
docker-compose down
```

## ⚙️ Configuration

### Server Configuration
- **server.cfg**: Located in `/home/gmod/gmod-prophunt-server/garrysmod/cfg/`
- **Steam Token**: Required for public server listing
- **RCON Password**: Set in server configuration

### PropHunt Gamemode
- **Gamemode Files**: Located in `garrysmod/gamemodes/prop_hunt/`
- **Maps**: PropHunt-specific maps in `garrysmod/maps/`
- **Addons**: Additional functionality in `garrysmod/addons/`

## 🎮 Server Features

### PropHunt Gameplay
- **Props Team**: Hide as objects in the map
- **Hunters Team**: Find and eliminate props
- **Round-based**: Automatic team switching
- **Map Rotation**: Multiple PropHunt maps

### Server Settings
- **Friendly Fire**: Disabled
- **Voice Chat**: Enabled
- **Admin System**: ULX/ULib (if installed)
- **Anti-Cheat**: VAC enabled

## 🔧 Maintenance

### Regular Tasks
```bash
# Update server files
cd /home/gmod/gmod-prophunt-server/
./steamcmd.sh +login anonymous +force_install_dir . +app_update 4020 validate +quit

# Backup server data
tar -czf gmod-backup-$(date +%Y%m%d).tar.gz garrysmod/

# Clean old logs
find garrysmod/logs/ -name "*.log" -mtime +30 -delete
```

### Performance Monitoring
```bash
# Check server performance
htop -p $(pgrep srcds_linux)

# Monitor network connections
ss -tuln | grep 27015

# Check disk usage
du -sh /home/gmod/gmod-prophunt-server/
```

## 🔒 Security Considerations

- **RCON**: Bound to localhost only (127.0.0.1:39903)
- **User Isolation**: Runs under dedicated `gmod` user
- **File Permissions**: Proper ownership and permissions
- **Steam VAC**: Anti-cheat protection enabled
- **Firewall**: Only game port (27015) exposed publicly

## 🐛 Troubleshooting

### Common Issues
```bash
# Server won't start
- Check if port 27015 is already in use: ss -tlnp | grep 27015
- Verify Steam token is valid
- Check file permissions: ls -la /home/gmod/gmod-prophunt-server/

# Players can't connect
- Verify firewall allows port 27015
- Check server is listening: ss -tlnp | grep 27015
- Test connectivity: telnet YOUR_WAN_IP 27015

# Performance issues
- Monitor CPU/RAM usage: htop
- Check for addon conflicts
- Review server logs for errors
```

### Log Locations
- **Console Output**: `/home/gmod/gmod-prophunt-server/garrysmod/console.log`
- **Error Logs**: `/home/gmod/gmod-prophunt-server/garrysmod/logs/`
- **System Logs**: `journalctl -u gmod-server` (if systemd service)

## 🔗 Related Services

- **PufferPanel**: Can manage this server through web interface
- **Steam**: Requires Steam Game Server Account
- **Nginx**: May proxy web-based admin interfaces

## 📚 External Resources

- [Garry's Mod Wiki](https://wiki.facepunch.com/gmod/)
- [PropHunt Gamemode](https://steamcommunity.com/sharedfiles/filedetails/?id=135509255)
- [Server Administration Guide](https://wiki.facepunch.com/gmod/Server_Administration)
- [Steam Game Server Account Management](https://steamcommunity.com/dev/managegameservers)