Jump to content

Home

Linux admin tool using rcon and server output


pvc

Recommended Posts

Some people (including myself) wanted a tool to communicate with the server using rcon.

 

Digging the net, I found a perl module KKrcon.pm which was designed for the quake engine and almost fit jk2.

 

U might want 2 use the tools and enhance your server. (eg. greet players who enter the server or listen to commands the admin says using "say" or give people help on rcon-commands when they say "help" and so on...)

 

I basically use KKrcon.pm (which can be found at http://jk2.icf.net) and a perl-program, which reads the piped output of the serverprogram jk2ded.

 

 

My bash-command line for starting the server looks like:

su jk2user -c /usr/local/games/jk2.104/jk2 2>&1 | /usr/local/games/jk2.104/server.pl > /home/jk2user/jk2.log

 

 

and shell-script jk2 starts the server itself:

 

./jk2ded +set net_port 28002 +exec server.cfg

 

 

 

By doing so, the output of jk2ded is passed to the perl program server.pl. The output of server.pl is written to the log-file.

 

Easiest server.pl would be:

 

#!/usr/bin/perl

while ( $_=<stdin> )

{ print $_;

&check4playerenter;

&check4adminsay;

&check4usersay;

}

 

I hope the basic concept is understood. Have fun adding more power to your server and dont spam it with advertisment messages - its just a game and not real-life :-).

 

PVC

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...