Click here to Skip to main content
15,888,527 members
Articles / Programming Languages / C#
Article

Send RCON Commands to Quake Based Games

Rate me:
Please Sign up or sign in to vote.
3.11/5 (6 votes)
6 Dec 2007GPL3 59.6K   998   11   12
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)


Written By
Software Developer (Senior) EBusiness
Pakistan Pakistan
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionNot receive all response (COD2) Pin
asdfaf325-Mar-12 0:02
asdfaf325-Mar-12 0:02 
Generalput these value's in a table Pin
theunynck21-Jul-09 9:48
theunynck21-Jul-09 9:48 
GeneralNumbers Pin
3thr10-Jun-09 0:26
3thr10-Jun-09 0:26 
GeneralNicely done :P Pin
John4313-Apr-09 11:02
John4313-Apr-09 11:02 
GeneralThanks Pin
Mr_Adder19-Dec-08 1:03
Mr_Adder19-Dec-08 1:03 
GeneralThank you! Pin
Wubbo12-Nov-08 4:01
Wubbo12-Nov-08 4:01 
Thank you very much! This code works beautifully! I searched high and low for some functional rcon code in C#. Whoever voted 1 star on this article is a tool; you definitely get 5 stars from me!

- Wubbo
GeneralRCON Commands Pin
Member 320218714-Dec-07 2:51
Member 320218714-Dec-07 2:51 
GeneralRe: RCON Commands Pin
Waqas Badar31-Jan-08 1:09
Waqas Badar31-Jan-08 1:09 
GeneralRe: RCON Commands Pin
klopfer122-Oct-08 5:20
klopfer122-Oct-08 5:20 
GeneralRe: RCON Commands Pin
Waqas Badar22-Oct-08 21:15
Waqas Badar22-Oct-08 21:15 
GeneralRe: RCON Commands Pin
sandaasu24-Sep-14 21:38
sandaasu24-Sep-14 21:38 
GeneralRe: RCON Commands Pin
Waqas Badar25-Sep-14 20:35
Waqas Badar25-Sep-14 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.