UrT0 Mandingo Bot 1.0

UrT0 Bot (aka Mandingo) is a bot for the Urban Terror chat system.
UrT0 Bot (aka Mandingo) is a bot for the Urban Terror chat system.

Here are some key features of "UrT0 Bot":

· Advertising Purpose
· Administration Purpose
· Statistical Purpose

ADVERTISING PURPOSE

Mandingo is able to warn the following events:

· Headshots
· Lemmings
· Flags Captures
· Flags Recover
· Killing Spree
· Top Players (End Match Players Top Skils)
· On Join Welcome (whith GeoIp support)

It's also possible to request useful info by UrT "say" command line.

Normal players are allowed to the following commands:

· [T|t]eams - Mandingo do a teams balance (an useless Teams request will be punished by a players Advise, after a predefined number of Advises players will be kick)
· [S|s]tats - Mandingo display personal player statistics

N.B.: [T|t]eams syntax mean thath "teams" command can be typed with capital or lower case first digit (Teams or teams will be considered valid, TEAMS or TeAmS will be ignored);

ADMINISTRATION PURPOSE

The most useful Mandingo feature is the Master/Protection list. Player will be able to authenticate himself as a Master with an authentication sequence.

Master are able to type following commands:

· [A|a]uth - Authentication command! (es.: Auth:aAdf) N.B.: How to get an authentication token will be discussed later
· [L|l]oadconf - Mandingo will load preexistent UrT-Rcon formatted directives filled files presents on a predefined fs directory (es.:> Loadconf:prova.cfg)
· [R|r]eload - Server will be reloaded (es.:> Reload)
· [V|v]etovote - Veto an active vote (es.:> Vetovote)
· [A|a]dvise - Admin are able to increment players advise counter (es.:> Advise:1)
· [K|k]ick - Admins are able to kick a player (es.> Kick:1)
· [S|s]lap - Admins are able to Slap a player (es.:> Slap:1)
· [N|n]uke - Players Nuke! (es.: Nuke:1)
· [F|f]loodslap - Start a 10 slaps sequence, 1 per sec, against a player (es.:> Floodslap:1)
· [F|f]loodnuke - Start a 10 nuke sequence, 1 per sec, against a player (es.:> Floodnuke:1)

STATISTICAL PURPOSE

Actually Mandingo is able to store event-triggered statsistics (DSTATS) to a file (this is useful for all players that would to follow a CW/PCW scoring without connect to the server).

DStats will be stored in HTML files. Every Round an HTML file will be generated!

Installation

Source Code:

Source code installation could be a little bit tricky depending on hosting distro! You need a set of library that you can find on cpan mirror (http://search.cpan.org) or on apt repository (if your distro is debian based). You can find a list of all packages needed at the following links (some can be shipped directly with your perl distribution)

http://urbanterror.techfusion.it/Modules-Requirements

N.B.: Modules Installation depending on you distribution method or by cpan method

bash:# perl -MCPAN -e shell

When all module dependencies will be resolved you can start Mandingo by:

bash:# perl UrtBot.pl urtoconfig.cfg

Binary Chroot:

UrT0-Mandingo deploy pack contain a CHROOT filesystem for the following reasons:
Security. UrT0 will open a listening socket (authentication backend); I don't want to generate hipotetical buffer overflow on m8 servers!
Maintainance. UrT0 will be deployed as a precompiled binary (ELF 32bit) dinamically linked, then he need some library. Admin will not looking for missing libraries on theri systems.

For these reason Urt0 deploy pack will be a little bit oversized (9 megs)!
Installation Steps:

Uncompress:

bash:# tar jxpvf UrT0-Mandingo-18012008.tar.bz2

A folder will be created (UrT0), in this folder you'll be found a chroot (UrT0-env) and Manding startup script (UrT0-Mandingo).

Chdir to the base directory:

bash:# cd UrT0

At this point you sould to configure UrT0 by editing urtoconfig.cfg present in the chroot:

(use your preferred text editor)
bash:# vi UrT0-env/etc/urtoconfig.cfg

UrtoConfig is very verbose (aid comment), you shouldn't have problem to undestand it (pay attention, wrong value may compromise bot functionality)

Now let configure Urban Terror Server.

For a full log players hits description (head, arms, legs, torso, etc etc) we must increase log hits verbosity. Set CVAR to do that:

seta g_loghits "1"

Now we need unbuffered logs:

seta g_logsync "1"

Now we should to configure something a little bit hard, first of all, where UrT Server will write log file
With the following syntax:

seta g_log "ioUrTserver.log"

Così we instruct Urban Terror server to write file ioUrTserver.log in .q3a/q3ut4 directory located in the urbanterror server owner home directory (.. so crap!).

Let me show some exemples. If parantido launch urban terror server log file will be created in

/home/parantido/.q3a/q3ut4/ioUrTserver.log

Rather if we start server with root privileges log file will be located in

/root/.q3a/q3ut4/ioUrTserver.log

You can also find your home directory:

bash:# echo $HOME

This is useful because: Host system (where Urban Terror server works) and UrT0 env (il chroot) ARE SEPARATED ENVIRONMENT.
Then we should to import Urban Terror Server Log in UrT0 environment.

To do that we only need to rebind .q3a folder in UrT0/UrT0-env/root così:

Nel Caso dell'utente root:
bash:# mount --bind /root/.q3a UrT0/UrT0-env/root
folder
parantido user:
bash:# mount --bind /home/parantido/.q3a UrT0/UrT0-env/root

In this case we can set logfile variable (in urtoconfig.cfg file) like this:

logfile = "/root/.q3a/q3ut4/ioUrTserver.log"

Now all configuration were donw and we can fire up Manding:

bash:# ./UrT-Mandingo start

If all works fine we should to have the following situation (and Mandingo should begin to blab in your Urban Terror server):

bash:# ps aufx | grep urt0
root 8846 0.0 2.7 15992 12464 pts/2 S+ Jan21 0:00 _ urt0-par urtoconfig.cfg
root 8847 0.0 2.6 16348 11872 pts/2 S+ Jan21 0:07 _ urt0-dat urtoconfig.cfg
root 8848 0.0 2.4 15992 10944 pts/2 S+ Jan21 0:00 _ urt0-aut urtoconfig.cfg

UrT0 show himself as a fork of 3 processes (every process do a different work),if only one of these results to be missed, Mandingo wouldn't works.

N.B.: In the latest Urban Terror Server release was introduced a protection Against Command Flood (you can send a command every 3 seconds). UrT0-Mandingo do a sequence of rcon send to do it's works. Probably Mandingo would miss to alert some events (in case of events overload). To resolve this problem you can configure urban terror server as following:

seta sv_floodprotect "0"
(Many tnx to Woekele)

Obviously this setting expose your players to possible flooding stuff (fuckin' bind radio)
Top

Authentication

To be recognized as Master you should to follow an authentication sequence.
Compatibly with your urtoconfig.cfg configuration do a telnet terminal connection to ip address (authip variable) and porta (authport variable):

Es.:
bash:# telnet urt.techfusion.it 8998

Bot will show you welcome banner and authentication username/password request (mymastername e mymasterpassword variables).

Just authenticated bot will wait for your commands:

Es.:

Command>

Available commands are:

· [H|h]elp - Show all available commands
· [L|l]ist [ | players ] - Show all authenticated ips (without arguments) or authentication parameter for a specific ip (if ip argument passed). Show players list (in case of players agroument passed).
· [A|a]uth - Map an authentication token with your ip address
· [R|r]emove [ip] - Remove ip address/authentication token mapping
· [K|k]ick [uid] - Kicka a player from server (you can get uid list by List players)
· [Q|q]uit - Quit authentication backend

Then to authenticate yourself do following steps:

Command> Auth

Il bot risponderà con qualcosa del genere:

urt0-authserver>
Welcome Home My Master
-> InGame Authentication Token: 4z2M
-> You can log in with the following ipaddress: 192.168.16.31

ATTENTION: 4z2M (CASE SENSITIVE) authentication token is valido only for connection originated from 192.168.16.31 ip address!!!!

Now you should only enter the game and with a say command type:

say Auth:4z2M

In case of correct authentication sequence bot will declame in big test "Jhon Doe is my Master" (if ther's an events overloading you wouldn't se big text ... however you're a Master).

ATTENTION: Every Match End, for security issue, players stats will be resetted (Master flag too). Every match begin you can do

say Auth:4z2M

bot will recognize you. Mandingo use a persistent authentication map, then, for security issue avoiding, remember to deallocate your authentication token. Reconnect yourself on authentication backend and type:

Command> Remove 192.168.16.31

Now you've been removed 4z2M token map with 192.168.16.31 ip address.

last updated on:
February 29th, 2008, 0:03 GMT
price:
FREE!
developed by:
Parantido
homepage:
urbanterror.techfusion.it
license type:
GPL (GNU General Public License) 
category:
ROOT \ Games \ FPS
UrT0 Mandingo Bot
Download Button

In a hurry? Add it to your Download Basket!

user rating 18

2.9/5
 

0/5

Rate it!

Add your review!

SUBMIT