Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Send RCON Commands to Quake Based Games

3.11/5 (6 votes)
6 Dec 2007GPL3 1   999  
This project sends RCON commands to Quake based games.
Screenshot -

Introduction

This is my first article on CodeProject.

RCON (Remote Console) is used to manage game servers remotely. RCON commands can be sent through games. But in my recent project, I had to send RCON commands through software. After doing a lot of R&D, I was able to find a way in which Quake based games send RCON commands to the server.

RCON command syntax is as follows:

plain
0xFF 0xFF 0xFF 0xFF 0x02 rcon password command

The first five characters are special and should be sent before any RCON command. Every RCON command should contain the RCON password. I set the RCON password for MOHAA by executing the following command in the console:

set rconpassword 123456

I test the code on MOHAA and Medal of Honor SpearHead. But I think it will work fine on other games which are based on Quake Engine.

Using the Code

I have written a class with the name RCON. It has one method, sendCommand. Pass it a game server IP, port, password and RCON command and this method returns a response from the server.

I use this method for Mohaa as follows:

C#
rcon.sendCommand(txtCommand.Text, txtGameServerIP.Text, "123456", 12203);

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)