Quake3 Server Commander (v0.2)

By Gamall
Date: 01-06-2008
Version: v0.2

Download

Readme

*****************************************************************
** JEDI KNIGHT: Jedi Academy & Outcast **
*****************************************************************

#-----------------------------------------------------------#
# TITLE : Quake3 Server Commander #
# VERSION : 0.2 #
# #
# AUTHOR : Gamall Wednesday Ida #
# E-MAIL : gamall.ida@gmail.com #
# WEBSITE : http://gamall-ida.com #
# RELEASE DATE : January 2008 #
# OS : Windows && GNU/Linux #
#-----------------------------------------------------------#



+ READ ME! (CONTACT)
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

Should you want to contact me, please do NOT jump on my email,
you won't get an answer. Read the "CONTACT" section near the
end of that file instead ;-).

NOTE: I usually write extensive documentation for my programs
in their readmes. I don't have time to do that anymore. The
documentation here is minimalist, you'll have to figure most
things for yourself. If you run into trouble, then contact me
and I'll help. (again, see "CONTACT" section).


+ WHAT IS THIS ? (in a few words)
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

This command-line program is a small set of server tools, here
called "modes".


- THE MESSENGER MODE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -

You can broadcast messages in a server, even without having the
game installed. This is done by connecting and renaming a fake
player generated by the program. Useful to alert your friends
if you can't enter a server because of a bug, or just to say
"hi".

My initial intent was to have "real" fake players enter the
game and chat using /say, but I didn't find enough info on the
protocol to do that yet.

Admins can protect a given number N of slots on their server by
adding the following line in the server's configuration file. I
advise N = 3.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sets qcmd_perms 3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is an example session in messenger mode: (use !q to quit).


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> qcmd +msg host.conseiljedi.com 29070

** Quake3 Commander v0.2
** by Gamall Wednesday Ida
** email: gamall.ida@gmail.com
** web : gamall-ida.com

infoResponse

-> fdisable: 163837
-> wdisable: 524279
-> truejedi: 0
-> needpass: 0
-> gametype: 0
-> sv_maxclients: 24
-> clients: 0
-> mapname: mp/ffa3
-> hostname: ^1Dragon's Lair ^3Base
-> protocol: 26

PERMISSIONS = ''
+ There is no restriction on this server +
[Sending identification message...]
connectResponse
________________________________
signature# Gamall
[Sending signature...]
connectResponse
_______________________________
# This is a message...
connectResponse
_______________________________
# and this another one
connectResponse
_______________________________
# !status
statusResponse

-> version: JAmp: v1.0.1.1 linux-i386 Nov 10 2003
-> dmflags: 0
[...]
-> ga_allowBlackInNames: 1
-> ga_closeServer: 0
-> ga_doNotAllowDualKataSpin: 0
-> ga_nameLengthLimit: -1
-> g_noSpecMove: 0
-> gamename: basejka: Gamall's Fix v1.1a
-> g_maxGameClients: 0
-> g_siegeRespawn: 20
-> g_saberWallDamageScale: 0.4
-> bg_fighterAltControl: 0
-> g_siegeTeam1: none
-> g_siegeTeam2: none
-> g_showDuelHealths: 0
0 999 "MS# ^5and this another one"

_______________________________
# !info
infoResponse

-> fdisable: 163837
-> wdisable: 524279
-> truejedi: 0
-> needpass: 0
-> gametype: 0
-> sv_maxclients: 24
-> clients: 1
-> mapname: mp/ffa3
-> hostname: ^1Dragon's Lair ^3Base
-> protocol: 26

_______________________________
# !sig
________________________________
signature# Gamall
[Sending signature...]
connectResponse
_______________________________
# !q
[Sending identification message...]
connectResponse
Goodbye !

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


- THE MONITOR MODE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -

You can generate a graph of the number of players in a given
server.

The following example session generated the graph of the number
of players every 10 minutes in the file serv_logs.txt,
displaying the current time every 6 requests (= one hour).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> qcmd -wait 600 -timetag 6 +monitor 66.29.77.35 29071 >> serv_logs.txt

** Quake3 Commander v0.2
** by Gamall Wednesday Ida
** email: gamall.ida@gmail.com
** web : gamall-ida.com

Monitoring server 66.29.77.35:29071 every 600 seconds...
infoResponse

-> game: japlus
-> fdisable: 0
-> wdisable: 0
-> truejedi: 0
-> needpass: 0
-> gametype: 8
-> sv_maxclients: 24
-> clients: 12
-> mapname: mp/ctf3
-> hostname: ���������^5JA+ Official n°1 CTF ^7Get JA+ Plugin & Maps at www.japlus.net, ^5USA
-> protocol: 26

#============ # 12 mp/ctf3 Sun Dec 30 16:13:04 2007
#============ # 12 mp/ctf3
#============ # 12 mp/ctf4
#============ # 12 mp/ctf4
#============= # 13 mp/ctf1
#============ # 12 mp/ctf1
#============== # 14 mp/ctf2 Sun Dec 30 17:13:05 2007
#=========== # 11 mp/ctf2
#============== # 14 mp/ctf3
#============ # 12 mp/ctf3
#========== # 10 mp/ctf3

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


- THE GET_CVAR MODE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -

Gets the value of a public cvar on a server. Useful with the
direct query mode for embedding into BASH or PERL scripts, for
instance. See documentation of QCmd 0.1.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> qcmd +get_cvar host.conseiljedi.com 29080 s sv_hostname
sv_hostname = '^4R^7D^1H^3/^5SF ^2S^7erver'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The third parameter, with value Status or Info, specifies
whether the cvar is found in getStatus or getInfo.


- THE DIRECT QUERY MODE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -

Send a quake3 query directly. Useful for controling the server
through a PERL script or cronjob or or or... Again, read the
documentation of QCmd 0.1.

This example session sends the order to change map:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> qcmd +q host.conseiljedi.com 29070 rcon mypassismine map mp/ffa5
print
ShutdownGame:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


- THE RCON MODE
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o -

This is a classic RCon console. (use !q to quit) Session
example:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>qcmd +rcon host.conseiljedi.com 29070 mypassisnotyours

** Quake3 Commander v0.2
** by Gamall Wednesday Ida
** email: gamall.ida@gmail.com
** web : gamall-ida.com

infoResponse

-> fdisable: 163837
-> wdisable: 524279
-> truejedi: 0
-> needpass: 0
-> gametype: 0
-> sv_maxclients: 24
-> clients: 0
-> mapname: mp/ffa5
-> hostname: ^1Dragon's Lair ^3Base
-> protocol: 26

print
"version" is:"JAmp: v1.0.1.1 linux-i386 Nov 10 2003^7" default:"JAmp: v1.0.1.1 l
inux-i386 Nov 10 2003^7"
print
"gamename" is:"basejka: Gamall's Fix v1.1a^7" default:"basejka: Gamall's Fix v1.
1a^7"
________________________________________________________

# !status
statusResponse

-> version: JAmp: v1.0.1.1 linux-i386 Nov 10 2003
-> dmflags: 0
[...]
-> g_showDuelHealths: 0

________________________________________________________

# map mp/duel1
print
ShutdownGame:
________________________________________________________

# map mp/duel1337
print
Can't find map maps/mp/duel1337.bsp
________________________________________________________

# Blah blah
print
broadcast: print "^1[^7SERVER^1]^7: Blah blah\n"
________________________________________________________

# status
print
map: mp/duel1
________________________________________________________

# status is buggy, will be fixed in later versions, I hope.
print
map: mp/duel1
________________________________________________________

# clientkick 10
print
Client 10 is not active
________________________________________________________

# !ad
[Sending identification message...]
connectResponse
________________________________________________________

# !status
statusResponse

-> version: JAmp: v1.0.1.1 linux-i386 Nov 10 2003
[...]
-> g_siegeTeam2: none
-> g_showDuelHealths: 0
0 999 "^6# ^1QCmd MSG - Gamall-Ida.com"

________________________________________________________

# clientkick 0
print
broadcast: print "^6# ^1QCmd MSG - Gamall-Ida.com^7 @@@WAS_KICKED\n"
________________________________________________________

# !q
Goodbye !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


+ GENERAL USE
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

Launching the program without any argument will display the
help page and exit:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** Quake3 Commander v0.2
** by Gamall Wednesday Ida
** email: gamall.ida@gmail.com
** web : gamall-ida.com


Usage: qcmd <-option 1>...<-option N> <+mode>

Modes:
=======================================================
+get_cvar <host> <port> <(i/s)> <cvar>
+monitor <host> <port>
+msg <host> <port>
+q <host> <port> <query>
+rcon <host> <port> <password>

Options (general):
=======================================================
-timeout <seconds> : socket timeout (def 2.5 sec)

Options +get_cvar:
=======================================================
-se : silent extraction. Display result only

Options +monitor:
=======================================================
-nobar : do not display players number progress bar
-nomap : do not display current map in graph
-nonum : do not display number of players explicitely
-timetag <int> : display current time every <int> request (def 24)
-wait <seconds> : wait for <seconds> between each request (def 3600)

Options +msg:
=======================================================
-color <int 1-7> : force message color (def 5)
-len <int> : maximum message length (def 29)
-pass <password> : server password (def none)
-nick <name> : automatic signature
-rc : random color for messages

Options +q:
=======================================================
-format : pretty print for getinfo and getstatus
-repeat <int> : repeat command <int> times (def 1)
-wait <seconds> : repeat every <seconds> (def 0)

Options +rcon:
=======================================================
All out of options ;-P

Toplevel commands (modes +rcon and +msg)
=======================================================
!ad : send a QCmd identification message
!info : display limited server info (from getInfo query)
!sig (+msg only) : send another signature manually
!status : display detailed server status (from getStatus query)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It is up to the user to play with the different options to
figure out what they do exactly. If you have questions you
can't answer by yourself, ask me on the program's support
topic. (see next section)


+ CONTACT / SUPPORT
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

If you need help or have suggestions, comments, insults, praise
or in general, anything to say about this program that you
expect me to read and answer to, please post on the program's
topic on my website:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://gamall-ida.com/f/viewtopic.php?f=3&t=359
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The only circumstance in which my personal email is the proper
way to contact me is when my website is down for maintenance
for a long time, which is very infrequent.


+ TECHNICAL INFO
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

This program is written in Objective Caml, with a small part in
C (because I need to use the exact same Huffman encoding the
Quake3 protocol does, and the code was available in C)

Two files are shipped for each OS: qcmd is the executable,
qcmd_bc is an OCaml bytecode executable. If the first doesn't
work on your system, intall the OCaml runtime and perhaps the
second will...


+ CREDITS:
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-o +

I got the "messenger" idea a long time ago from Luigi
Auriemma's q3fill program, and learned quite a bit about socket
programming and the Quake3 protocol by reading his code. Thanks
to him :)

THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY
ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC.
ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS
LICENSORS.



+-----------------------------+
| File generated with 'GaTeX',|
| an ASCII typesetting system |
| by Gamall Wednesday Ida. |
| http://gamall-ida.com |
+-----------------------------+
Build: Wed Jan 02 21:20:14 2008
File : readme.GaTeX.source