Pages: [1]
  Print  
Author Topic: Totally random Skirmish server!  (Read 9232 times)
TyTiger
Nub


Cakes 1
Posts: 10



WWW
« on: February 10, 2014, 08:54:47 AM »

Hi all

I've been tinkering away quietly and have successfully managed to set up a dedicated server with a properly random set of game types (within reason..)

In essence, and due to limitations of the dedicated server, i've got a set of 10 clean config files (literally numbered 1 to 10), 2 additional "current" configs, a master config, and a bash script that does all the magic.

The bash script uses random number generation, to pick a random number between 1 and 10, and uses this number to copy the contents of one of the 10 pre-configured game type files, in to the current#.cfg game files, which the OADED server is executing in a contentious cycle using the vstr rotation mechanism built in to the server.

i've attached a few examples, if anyone's interested in trying this out for themselves, also i welcome any suggestions.  Cool

[server.cfg]
Code:
//sudo -H -u ron bash -c "screen -S OpenArena -d -m /home/ron/Openarena-pc/oa_ded.i386 +set fs_game baseoa +set dedicated 1  +set net_port 27960 +exec

sets sv_pure 1
sets sv_allowDownload 1
sets sv_hostname "^1Gaming.^5Cool^7MediaTech^7.com ^2Open server"
sets sv_fps 25
// Clients with ping higher than this cannot connect.
sets sv_maxPing 400
// sv_maxclients should be set from command line
//sets sv_maxclients 16

seta g_voteMaxTimelimit 25
seta g_voteMinTimelimit 15
seta g_voteMaxFraglimit 1050
seta g_voteMinFraglimit 20

// Max amount of non-spectators in the game
set g_maxgameclients 16

set g_delaghitscan 1 // Eats CPU, probably

set g_voteGametypes "/0/"
//set g_autonextmap 1 // This breaks map rotation script
// We have map rotation, g_autonextmap breaks it
//set g_autonextmap 0

set capturelimit 3
set timelimit 10
set fraglimit 10

// Slowpoke server
set timescale 1

// Two bots
set bot_minplayers 4
set g_spskill 3
set g_motd "Totally Random Skirmish"
set cg_smoothclients 1
exec games.cfg


Subdir of baseoa called games
[1-10.cfg]
Code:
//Game 1 1FCTF
map oacmpctf2
set g_gametype 5
set capturelimit 6
set timelimit 20
set fraglimit 6

[current1/2.cfg]
Code:
filled in by the script

[games.cfg]
Code:
set d1 "exec /games/current1.cfg"
set d2 "exec /games/current2.cfg"
vstr d1

[gamerotate.sh]
Code:
#!/bin/bash
cd /path/to/openarena/baseoa/games
for (( ; ; ))
do
NUM=$(grep -m1 -ao '[0-9]' /dev/urandom | sed s/0/10/ | head -n1)
#echo $NUM
cp ./$NUM.cfg ./current1.cfg
cp ./$NUM.cfg ./current2.cfg
sleep 30
done

Ps. if you want to connect to this server, its at 82.44.160.86 port 27960
Logged

In a life without Walls, who needs Windows and Gates?
Pages: [1]
  Print  
 
Jump to: