Dedicated Server Guide

Locked
Qr7
Posts: 184
Joined: Mon Apr 09, 2001 7:00 am

Dedicated Server Guide

Post by Qr7 »

Perhaps we can compile all dedicated server info / cfgs in one place?

... and then maybe sticky it if people actually contribute?


PS. What ports does quake 4 use as a dedicated server (connecting to the master server, pb, ect?)
-xXx-MoFo
Posts: 32
Joined: Thu Oct 20, 2005 3:20 am

Simple Dedicated Server CFG

Post by -xXx-MoFo »

//Server
seta si_name " ----===^1YouServerSucks===----"
Seta net_serverRemoteConsolePassword "suckup"
seta g_password ""
seta net_master0 "q4master.idsoftware.com:27650"
seta net_master4 ""

//Settings
seta net_serverAllowServerMod "1"
seta si_tourneyLimit "3"
seta si_captureLimit "5"
seta si_minPlayers "1"
seta si_maxPlayers "20"
seta si_fragLimit "20"
seta si_timeLimit "20"
seta si_gameType "DM"
seta si_warmup "0"
seta si_teamDamage "0"
seta net_allowCheats "1"

//Map
seta si_map "mp/q4dm1"
seta g_mapCycle "mapcycle"


//Extras
seta sv_punkbuster "0"
seta net_serverMaxClientRate "0"
seta net_clientDownload "1"
seta si_pure "0"


//Serverstart
spawnserver


...............................................
Seperate map cycle mapcycle.scriptcfg


/*
map cycling script sample - select with g_mapCycle

the script is purged and reloaded at each map restart
which happens on map change, but also when hitting GAMEON
for persistance, you need to use the {get,set}Persistant functions

files with .scriptcfg extension can be loaded outside of pure paks
*/

namespace mapcycle {

void cycle() {
// config
float cycle_maps = 1; // 1 = cycle through maps in the current game type, 0 = keep the same map
float cycle_gametypes = 0; // 1 = cycle through game types, 0 = keep the same game type

// cycle maps and game types
float replay_count = sys.getPersistantFloat( "replay_count" );
string si_gameType = sys.getcvar( "si_gameType" );
string si_map = sys.getcvar( "si_map" );

sys.println( "cycle: replay_count = " + replay_count );

if ( replay_count <= 0 ) {
// restart n times before next map
replay_count = 2;

// add in custom replay counts here for current game type
if ( si_gameType == "DM" ) {
;
} else if ( si_gameType == "Tourney" ) {
;
} else if ( si_gameType == "Team DM" ) {
;
} else if ( si_gameType == "CTF" ) {
;
} else if ( si_gameType == "Arena CTF" ) {
;
}

}

replay_count--;
sys.setPersistantArg( "replay_count", replay_count );
if ( replay_count <= 0 ) {
// restart n times before next map

if ( cycle_gametypes > 0 ) {

cycle_maps = 1; // we want to make sure that we transition to a proper map for the new gametype

if ( si_gameType == "DM" ) {
sys.setcvar( "si_gameType", "Tourney" );
} else if ( si_gameType == "Tourney" ) {
sys.setcvar( "si_gameType", "Team DM" );
} else if ( si_gameType == "Team DM" ) {
sys.setcvar( "si_gameType", "CTF" );
} else if ( si_gameType == "CTF" ) {
sys.setcvar( "si_gameType", "Arena CTF" );
} else if ( si_gameType == "Arena CTF" ) {
sys.setcvar( "si_gameType", "DM" );
} else {
sys.setcvar( "si_gameType", "DM" );
}

}

if ( cycle_maps > 0 ) {

if ( si_gameType == "DM" || si_gameType == "Team DM" ) {

if ( si_map == "mp/q4dm1" ) {
sys.setcvar( "si_map", "mp/q4dm2" );
} else if ( si_map == "mp/q4dm2" ) {
sys.setcvar( "si_map", "mp/q4dm3" );
} else if ( si_map == "mp/q4dm3" ) {
sys.setcvar( "si_map", "mp/q4dm4" );
} else if ( si_map == "mp/q4dm4" ) {
sys.setcvar( "si_map", "mp/q4dm5" );
} else if ( si_map == "mp/q4dm5" ) {
sys.setcvar( "si_map", "mp/q4dm6" );
} else if ( si_map == "mp/q4dm6" ) {
sys.setcvar( "si_map", "mp/q4dm7" );
} else if ( si_map == "mp/q4dm7" ) {
sys.setcvar( "si_map", "mp/q4dm8" );
} else if ( si_map == "mp/q4dm8" ) {
sys.setcvar( "si_map", "mp/q4ctf5" );
} else {
sys.setcvar( "si_map", "mp/q4dm1" );
}

} else if ( si_gameType == "Tourney" ) {

if ( si_map == "mp/q4dm11v1" ) {
sys.setcvar( "si_map", "mp/q4dm8" );
} else if ( si_map == "mp/q4dm8" ) {
sys.setcvar( "si_map", "mp/q4dm3" );
} else if ( si_map == "mp/q4dm3" ) {
sys.setcvar( "si_map", "mp/q4dm6" );
} else if ( si_map == "mp/q4dm6" ) {
sys.setcvar( "si_map", "mp/q4dm7" );
} else if ( si_map == "mp/q4dm7" ) {
sys.setcvar( "si_map", "mp/q4ctf5" );
} else {
sys.setcvar( "si_map", "mp/q4dm11v1" );
}

} else if ( si_gameType == "CTF" || si_gameType == "Arena CTF" ) {

if ( si_map == "mp/q4ctf1" ) {
sys.setcvar( "si_map", "mp/q4ctf2" );
} else if ( si_map == "mp/q4ctf2" ) {
sys.setcvar( "si_map", "mp/q4ctf3" );
} else if ( si_map == "mp/q4ctf3" ) {
sys.setcvar( "si_map", "mp/q4ctf4" );
} else if ( si_map == "mp/q4ctf4" ) {
sys.setcvar( "si_map", "mp/q4ctf5" );
} else {
sys.setcvar( "si_map", "mp/q4ctf1" );
}

}
}
} else {
sys.say( "map cycle: restarting current map " + replay_count + " more time(s)" );
}
}
}



Command line

Quake4Ded.exe +set net_ip 66.66.666.666 +exec server.cfg

Mp cfg is already generate for you drop all this in the base directory
PieceMaker
Posts: 899
Joined: Tue Jan 25, 2005 4:43 pm

Post by PieceMaker »

*prints server cfg for later viewing.* ;)

Question though. Where did you get the info for the server cfg?

Did it come with the game? Do you have a site you got this info from?
Did you convert a D3 cfg to Q4?

Just curious :D
-xXx-MoFo
Posts: 32
Joined: Thu Oct 20, 2005 3:20 am

Post by -xXx-MoFo »

PieceMaker wrote:*prints server cfg for later viewing.* ;)

Question though. Where did you get the info for the server cfg?

Did it come with the game? Do you have a site you got this info from?
Did you convert a D3 cfg to Q4?

Just curious :D
I run a server company
When the linux stuff comes out ill post a linux and a windows how to here http://gameservernews.com/
PieceMaker
Posts: 899
Joined: Tue Jan 25, 2005 4:43 pm

Post by PieceMaker »

-xXx-MoFo wrote:I run a server company
When the linux stuff comes out ill post a linux and a windows how to here http://gameservernews.com/
Thanks for the reply and link. :icon25:-:icon14:
Locked