Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

server.h File Reference

#include "../game/q_shared.h"
#include "../qcommon/qcommon.h"
#include "../game/g_public.h"
#include "../game/bg_public.h"

Include dependency graph for server.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  challenge_t
struct  client_s
struct  clientSnapshot_t
struct  netchan_buffer_s
struct  server_t
struct  serverStatic_t
struct  svEntity_s

Defines

#define AUTHORIZE_TIMEOUT   5000
#define MAX_CHALLENGES   1024
#define MAX_ENT_CLUSTERS   16
#define MAX_MASTER_SERVERS   5
#define MAX_MASTERS   8
#define PERS_SCORE   0

Typedefs

typedef client_s client_t
typedef netchan_buffer_s netchan_buffer_t
typedef svEntity_s svEntity_t

Enumerations

enum  clientState_t {
  CS_FREE, CS_ZOMBIE, CS_CONNECTED, CS_PRIMED,
  CS_ACTIVE
}
enum  serverState_t { SS_DEAD, SS_LOADING, SS_GAME }

Functions

int BotImport_DebugPolygonCreate (int color, int numPoints, vec3_t *points)
void BotImport_DebugPolygonDelete (int id)
void SV_AddOperatorCommands (void)
void SV_AddServerCommand (client_t *client, const char *cmd)
int SV_AreaEntities (const vec3_t mins, const vec3_t maxs, int *entityList, int maxcount)
void SV_AuthorizeIpPacket (netadr_t from)
int SV_BotAllocateClient (void)
void SV_BotFrame (int time)
void SV_BotFreeClient (int clientNum)
int SV_BotGetConsoleMessage (int client, char *buf, int size)
int SV_BotGetSnapshotEntity (int client, int ent)
void SV_BotInitCvars (void)
int SV_BotLibSetup (void)
int SV_BotLibShutdown (void)
void SV_ChangeMaxClients (void)
void SV_ClearWorld (void)
void SV_ClientEnterWorld (client_t *client, usercmd_t *cmd)
void SV_ClientThink (client_t *cl, usercmd_t *cmd)
clipHandle_t SV_ClipHandleForEntity (const sharedEntity_t *ent)
void SV_ClipToEntity (trace_t *trace, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int entityNum, int contentmask, int capsule)
void SV_DirectConnect (netadr_t from)
void SV_DropClient (client_t *drop, const char *reason)
void SV_ExecuteClientCommand (client_t *cl, const char *s, qboolean clientOK)
void SV_ExecuteClientMessage (client_t *cl, msg_t *msg)
void SV_FinalMessage (char *message)
playerState_tSV_GameClientNum (int num)
sharedEntity_tSV_GEntityForSvEntity (svEntity_t *svEnt)
sharedEntity_tSV_GentityNum (int num)
void SV_GetChallenge (netadr_t from)
void SV_GetConfigstring (int index, char *buffer, int bufferSize)
void SV_GetUserinfo (int index, char *buffer, int bufferSize)
void SV_Heartbeat_f (void)
void SV_InitGameProgs (void)
qboolean SV_inPVS (const vec3_t p1, const vec3_t p2)
void SV_LinkEntity (sharedEntity_t *ent)
void SV_MasterHeartbeat (void)
void SV_MasterShutdown (void)
qboolean SV_Netchan_Process (client_t *client, msg_t *msg)
void SV_Netchan_Transmit (client_t *client, msg_t *msg)
void SV_Netchan_TransmitNextFragment (client_t *client)
int SV_NumForGentity (sharedEntity_t *ent)
int SV_PointContents (const vec3_t p, int passEntityNum)
void SV_RemoveOperatorCommands (void)
void SV_RestartGameProgs (void)
void SV_SectorList_f (void)
void SV_SendClientMessages (void)
void SV_SendClientSnapshot (client_t *client)
void SV_SendMessageToClient (msg_t *msg, client_t *client)
void QDECL SV_SendServerCommand (client_t *cl, const char *fmt,...)
void SV_SetConfigstring (int index, const char *val)
void SV_SetUserinfo (int index, const char *val)
void SV_ShutdownGameProgs (void)
void SV_SpawnServer (char *server, qboolean killBots)
svEntity_tSV_SvEntityForGentity (sharedEntity_t *gEnt)
void SV_Trace (trace_t *results, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask, int capsule)
void SV_UnlinkEntity (sharedEntity_t *ent)
void SV_UpdateServerCommandsToClient (client_t *client, msg_t *msg)
void SV_UserinfoChanged (client_t *cl)
void SV_WriteDownloadToClient (client_t *cl, msg_t *msg)
void SV_WriteFrameToClient (client_t *client, msg_t *msg)

Variables

vm_tgvm
server_t sv
cvar_tsv_allowDownload
cvar_tsv_floodProtect
cvar_tsv_fps
cvar_tsv_gametype
cvar_tsv_hostname
cvar_tsv_killserver
cvar_tsv_lanForceRate
cvar_tsv_mapChecksum
cvar_tsv_mapname
cvar_tsv_master [MAX_MASTER_SERVERS]
cvar_tsv_maxclients
cvar_tsv_maxPing
cvar_tsv_maxRate
cvar_tsv_minPing
cvar_tsv_padPackets
cvar_tsv_privateClients
cvar_tsv_privatePassword
cvar_tsv_pure
cvar_tsv_rconPassword
cvar_tsv_reconnectlimit
cvar_tsv_serverid
cvar_tsv_showloss
cvar_tsv_strictAuth
cvar_tsv_timeout
cvar_tsv_zombietime
serverStatic_t svs


Define Documentation

#define AUTHORIZE_TIMEOUT   5000
 

Definition at line 178 of file server.h.

#define MAX_CHALLENGES   1024
 

Definition at line 176 of file server.h.

#define MAX_ENT_CLUSTERS   16
 

Definition at line 34 of file server.h.

#define MAX_MASTER_SERVERS   5
 

Definition at line 218 of file server.h.

#define MAX_MASTERS   8
 

Definition at line 190 of file server.h.

#define PERS_SCORE   0
 

Definition at line 31 of file server.h.

Referenced by CalculateRanks(), CG_DrawOldScoreboard(), CG_GetGameStatusText(), CG_Obituary(), DeathmatchScoreboardMessage(), LogExit(), SV_Status_f(), SVC_Status(), and UpdateTournamentInfo().


Typedef Documentation

typedef struct client_s client_t
 

Referenced by SV_AddServerCommand(), SV_Ban_f(), SV_BanNum_f(), SV_BeginDownload_f(), SV_BotAllocateClient(), SV_BotFreeClient(), SV_BotGetConsoleMessage(), SV_BotGetSnapshotEntity(), SV_BuildClientSnapshot(), SV_CalcPings(), SV_ChangeMaxClients(), SV_CheckPaused(), SV_CheckTimeouts(), SV_ClientCommand(), SV_ClientEnterWorld(), SV_ClientThink(), SV_CloseDownload(), SV_DirectConnect(), SV_Disconnect_f(), SV_DoneDownload_f(), SV_DropClient(), SV_DumpUser_f(), SV_ExecuteClientCommand(), SV_ExecuteClientMessage(), SV_FinalMessage(), SV_GetPlayerByName(), SV_GetPlayerByNum(), SV_Kick_f(), SV_KickNum_f(), SV_MapRestart_f(), SV_Netchan_Decode(), SV_Netchan_Encode(), SV_Netchan_Process(), SV_Netchan_Transmit(), SV_Netchan_TransmitNextFragment(), SV_NextDownload_f(), SV_PacketEvent(), SV_RateMsec(), SV_ReplacePendingServerCommands(), SV_ResetPureClient_f(), SV_SendClientGameState(), SV_SendClientMessages(), SV_SendClientSnapshot(), SV_SendMessageToClient(), SV_SendServerCommand(), SV_SetConfigstring(), SV_SpawnServer(), SV_Startup(), SV_Status_f(), SV_StopDownload_f(), SV_UpdateServerCommandsToClient(), SV_UpdateUserinfo_f(), SV_UserinfoChanged(), SV_UserMove(), SV_VerifyPaks_f(), SV_WriteDownloadToClient(), SV_WriteSnapshotToClient(), and SVC_Status().

typedef struct netchan_buffer_s netchan_buffer_t
 

Referenced by SV_Netchan_Transmit(), and SV_Netchan_TransmitNextFragment().

typedef struct svEntity_s svEntity_t
 

Referenced by SV_AddEntitiesVisibleFromPoint(), SV_AddEntToSnapshot(), SV_AdjustAreaPortalState(), SV_AreaEntities_r(), SV_BuildClientSnapshot(), SV_GEntityForSvEntity(), SV_LinkEntity(), SV_SectorList_f(), SV_SvEntityForGentity(), and SV_UnlinkEntity().


Enumeration Type Documentation

enum clientState_t
 

Enumeration values:
CS_FREE 
CS_ZOMBIE 
CS_CONNECTED 
CS_PRIMED 
CS_ACTIVE 

Definition at line 100 of file server.h.

00100              {
00101     CS_FREE,        // can be reused for a new connection
00102     CS_ZOMBIE,      // client has been disconnected, but don't reuse
00103                     // connection for a couple seconds
00104     CS_CONNECTED,   // has been assigned to a client_t, but no gamestate yet
00105     CS_PRIMED,      // gamestate has been sent, but client hasn't sent a usercmd
00106     CS_ACTIVE       // client is fully in game
00107 } clientState_t;

enum serverState_t
 

Enumeration values:
SS_DEAD 
SS_LOADING 
SS_GAME 

Definition at line 48 of file server.h.

00048              {
00049     SS_DEAD,            // no map loaded
00050     SS_LOADING,         // spawning level entities
00051     SS_GAME             // actively running
00052 } serverState_t;


Function Documentation

int BotImport_DebugPolygonCreate int  color,
int  numPoints,
vec3_t points
 

Definition at line 317 of file sv_bot.c.

References bot_debugpoly_t, bot_debugpoly_s::color, Com_Memcpy(), debugpolygons, i, bot_debugpoly_s::inuse, bot_debugpoly_s::numPoints, bot_debugpoly_s::points, points, and vec3_t.

Referenced by BotImport_DebugLineCreate(), and SV_GameSystemCalls().

00317                                                                            {
00318     bot_debugpoly_t *poly;
00319     int i;
00320 
00321     if (!debugpolygons)
00322         return 0;
00323 
00324     for (i = 1; i < bot_maxdebugpolys; i++)     {
00325         if (!debugpolygons[i].inuse)
00326             break;
00327     }
00328     if (i >= bot_maxdebugpolys)
00329         return 0;
00330     poly = &debugpolygons[i];
00331     poly->inuse = qtrue;
00332     poly->color = color;
00333     poly->numPoints = numPoints;
00334     Com_Memcpy(poly->points, points, numPoints * sizeof(vec3_t));
00335     //
00336     return i;
00337 }

Here is the call graph for this function:

void BotImport_DebugPolygonDelete int  id  ) 
 

Definition at line 360 of file sv_bot.c.

References debugpolygons, and bot_debugpoly_s::inuse.

Referenced by BotImport_DebugLineDelete(), and SV_GameSystemCalls().

00361 {
00362     if (!debugpolygons) return;
00363     debugpolygons[id].inuse = qfalse;
00364 }

void SV_AddOperatorCommands void   ) 
 

Definition at line 710 of file sv_ccmds.c.

References Cmd_AddCommand(), com_dedicated, cvar_s::integer, qboolean, SV_Ban_f(), SV_BanNum_f(), SV_ConSay_f(), SV_DumpUser_f(), SV_Heartbeat_f(), SV_Kick_f(), SV_KickNum_f(), SV_KillServer_f(), SV_Map_f(), SV_MapRestart_f(), SV_SectorList_f(), SV_Serverinfo_f(), SV_Status_f(), and SV_Systeminfo_f().

Referenced by SV_Init().

00710                                     {
00711     static qboolean initialized;
00712 
00713     if ( initialized ) {
00714         return;
00715     }
00716     initialized = qtrue;
00717 
00718     Cmd_AddCommand ("heartbeat", SV_Heartbeat_f);
00719     Cmd_AddCommand ("kick", SV_Kick_f);
00720     Cmd_AddCommand ("banUser", SV_Ban_f);
00721     Cmd_AddCommand ("banClient", SV_BanNum_f);
00722     Cmd_AddCommand ("clientkick", SV_KickNum_f);
00723     Cmd_AddCommand ("status", SV_Status_f);
00724     Cmd_AddCommand ("serverinfo", SV_Serverinfo_f);
00725     Cmd_AddCommand ("systeminfo", SV_Systeminfo_f);
00726     Cmd_AddCommand ("dumpuser", SV_DumpUser_f);
00727     Cmd_AddCommand ("map_restart", SV_MapRestart_f);
00728     Cmd_AddCommand ("sectorlist", SV_SectorList_f);
00729     Cmd_AddCommand ("map", SV_Map_f);
00730 #ifndef PRE_RELEASE_DEMO
00731     Cmd_AddCommand ("devmap", SV_Map_f);
00732     Cmd_AddCommand ("spmap", SV_Map_f);
00733     Cmd_AddCommand ("spdevmap", SV_Map_f);
00734 #endif
00735     Cmd_AddCommand ("killserver", SV_KillServer_f);
00736     if( com_dedicated->integer ) {
00737         Cmd_AddCommand ("say", SV_ConSay_f);
00738     }
00739 }

Here is the call graph for this function:

void SV_AddServerCommand client_t client,
const char *  cmd
 

Definition at line 128 of file sv_main.c.

References client_t, Com_Printf(), i, MAX_RELIABLE_COMMANDS, Q_strncpyz(), client_s::reliableAcknowledge, client_s::reliableCommands, client_s::reliableSequence, and SV_DropClient().

Referenced by SV_MapRestart_f(), and SV_SendServerCommand().

00128                                                               {
00129     int     index, i;
00130 
00131     // this is very ugly but it's also a waste to for instance send multiple config string updates
00132     // for the same config string index in one snapshot
00133 //  if ( SV_ReplacePendingServerCommands( client, cmd ) ) {
00134 //      return;
00135 //  }
00136 
00137     client->reliableSequence++;
00138     // if we would be losing an old command that hasn't been acknowledged,
00139     // we must drop the connection
00140     // we check == instead of >= so a broadcast print added by SV_DropClient()
00141     // doesn't cause a recursive drop client
00142     if ( client->reliableSequence - client->reliableAcknowledge == MAX_RELIABLE_COMMANDS + 1 ) {
00143         Com_Printf( "===== pending server commands =====\n" );
00144         for ( i = client->reliableAcknowledge + 1 ; i <= client->reliableSequence ; i++ ) {
00145             Com_Printf( "cmd %5d: %s\n", i, client->reliableCommands[ i & (MAX_RELIABLE_COMMANDS-1) ] );
00146         }
00147         Com_Printf( "cmd %5d: %s\n", i, cmd );
00148         SV_DropClient( client, "Server command overflow" );
00149         return;
00150     }
00151     index = client->reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
00152     Q_strncpyz( client->reliableCommands[ index ], cmd, sizeof( client->reliableCommands[ index ] ) );
00153 }

Here is the call graph for this function:

int SV_AreaEntities const vec3_t  mins,
const vec3_t  maxs,
int *  entityList,
int  maxcount
 

Definition at line 430 of file sv_world.c.

References areaParms_t::count, areaParms_t::list, areaParms_t::maxcount, areaParms_t::maxs, areaParms_t::mins, SV_AreaEntities_r(), and sv_worldSectors.

Referenced by SV_ClipMoveToEntities(), SV_GameSystemCalls(), and SV_PointContents().

00430                                                                                            {
00431     areaParms_t     ap;
00432 
00433     ap.mins = mins;
00434     ap.maxs = maxs;
00435     ap.list = entityList;
00436     ap.count = 0;
00437     ap.maxcount = maxcount;
00438 
00439     SV_AreaEntities_r( sv_worldSectors, &ap );
00440 
00441     return ap.count;
00442 }

Here is the call graph for this function:

void SV_AuthorizeIpPacket netadr_t  from  ) 
 

Definition at line 147 of file sv_client.c.

References challenge_t::adr, atoi, serverStatic_t::authorizeAddress, challenge_t::challenge, serverStatic_t::challenges, Cmd_Argv(), Com_Memset(), Com_Printf(), Cvar_VariableValue(), i, NET_CompareBaseAdr(), NET_OutOfBandPrint(), NS_SERVER, challenge_t::pingTime, Q_stricmp(), r, s, sprintf(), svs, and serverStatic_t::time.

Referenced by SV_ConnectionlessPacket().

00147                                            {
00148     int     challenge;
00149     int     i;
00150     char    *s;
00151     char    *r;
00152     char    ret[1024];
00153 
00154     if ( !NET_CompareBaseAdr( from, svs.authorizeAddress ) ) {
00155         Com_Printf( "SV_AuthorizeIpPacket: not from authorize server\n" );
00156         return;
00157     }
00158 
00159     challenge = atoi( Cmd_Argv( 1 ) );
00160 
00161     for (i = 0 ; i < MAX_CHALLENGES ; i++) {
00162         if ( svs.challenges[i].challenge == challenge ) {
00163             break;
00164         }
00165     }
00166     if ( i == MAX_CHALLENGES ) {
00167         Com_Printf( "SV_AuthorizeIpPacket: challenge not found\n" );
00168         return;
00169     }
00170 
00171     // send a packet back to the original client
00172     svs.challenges[i].pingTime = svs.time;
00173     s = Cmd_Argv( 2 );
00174     r = Cmd_Argv( 3 );          // reason
00175 
00176     if ( !Q_stricmp( s, "demo" ) ) {
00177         if ( Cvar_VariableValue( "fs_restrict" ) ) {
00178             // a demo client connecting to a demo server
00179             NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, 
00180                 "challengeResponse %i", svs.challenges[i].challenge );
00181             return;
00182         }
00183         // they are a demo client trying to connect to a real server
00184         NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nServer is not a demo server\n" );
00185         // clear the challenge record so it won't timeout and let them through
00186         Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) );
00187         return;
00188     }
00189     if ( !Q_stricmp( s, "accept" ) ) {
00190         NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, 
00191             "challengeResponse %i", svs.challenges[i].challenge );
00192         return;
00193     }
00194     if ( !Q_stricmp( s, "unknown" ) ) {
00195         if (!r) {
00196             NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nAwaiting CD key authorization\n" );
00197         } else {
00198             sprintf(ret, "print\n%s\n", r);
00199             NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, ret );
00200         }
00201         // clear the challenge record so it won't timeout and let them through
00202         Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) );
00203         return;
00204     }
00205 
00206     // authorization failed
00207     if (!r) {
00208         NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "print\nSomeone is using this CD Key\n" );
00209     } else {
00210         sprintf(ret, "print\n%s\n", r);
00211         NET_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, ret );
00212     }
00213 
00214     // clear the challenge record so it won't timeout and let them through
00215     Com_Memset( &svs.challenges[i], 0, sizeof( svs.challenges[i] ) );
00216 }

Here is the call graph for this function:

int SV_BotAllocateClient void   ) 
 

Definition at line 47 of file sv_bot.c.

References cl, client_t, serverStatic_t::clients, i, cvar_s::integer, SV_GentityNum(), sv_maxclients, svs, and serverStatic_t::time.

Referenced by SV_GameSystemCalls().

00047                                {
00048     int         i;
00049     client_t    *cl;
00050 
00051     // find a client slot
00052     for ( i = 0, cl = svs.clients; i < sv_maxclients->integer; i++, cl++ ) {
00053         if ( cl->state == CS_FREE ) {
00054             break;
00055         }
00056     }
00057 
00058     if ( i == sv_maxclients->integer ) {
00059         return -1;
00060     }
00061 
00062     cl->gentity = SV_GentityNum( i );
00063     cl->gentity->s.number = i;
00064     cl->state = CS_ACTIVE;
00065     cl->lastPacketTime = svs.time;
00066     cl->netchan.remoteAddress.type = NA_BOT;
00067     cl->rate = 16384;
00068 
00069     return i;
00070 }

Here is the call graph for this function:

void SV_BotFrame int  time  ) 
 

Definition at line 432 of file sv_bot.c.

References BOTAI_START_FRAME, gvm, time(), and VM_Call().

Referenced by SV_Frame(), and SV_SpawnServer().

00432                              {
00433     if (!bot_enable) return;
00434     //NOTE: maybe the game is already shutdown
00435     if (!gvm) return;
00436     VM_Call( gvm, BOTAI_START_FRAME, time );
00437 }

Here is the call graph for this function:

void SV_BotFreeClient int  clientNum  ) 
 

Definition at line 77 of file sv_bot.c.

References cl, client_t, serverStatic_t::clients, Com_Error(), ERR_DROP, cvar_s::integer, sv_maxclients, and svs.

Referenced by SV_DropClient(), and SV_GameSystemCalls().

00077                                        {
00078     client_t    *cl;
00079 
00080     if ( clientNum < 0 || clientNum >= sv_maxclients->integer ) {
00081         Com_Error( ERR_DROP, "SV_BotFreeClient: bad clientNum: %i", clientNum );
00082     }
00083     cl = &svs.clients[clientNum];
00084     cl->state = CS_FREE;
00085     cl->name[0] = 0;
00086     if ( cl->gentity ) {
00087         cl->gentity->r.svFlags &= ~SVF_BOT;
00088     }
00089 }

Here is the call graph for this function:

int SV_BotGetConsoleMessage int  client,
char *  buf,
int  size
 

Definition at line 574 of file sv_bot.c.

References cl, client_t, serverStatic_t::clients, MAX_RELIABLE_COMMANDS, Q_strncpyz(), svs, and serverStatic_t::time.

Referenced by SV_GameSystemCalls().

00575 {
00576     client_t    *cl;
00577     int         index;
00578 
00579     cl = &svs.clients[client];
00580     cl->lastPacketTime = svs.time;
00581 
00582     if ( cl->reliableAcknowledge == cl->reliableSequence ) {
00583         return qfalse;
00584     }
00585 
00586     cl->reliableAcknowledge++;
00587     index = cl->reliableAcknowledge & ( MAX_RELIABLE_COMMANDS - 1 );
00588 
00589     if ( !cl->reliableCommands[index][0] ) {
00590         return qfalse;
00591     }
00592 
00593     Q_strncpyz( buf, cl->reliableCommands[index], size );
00594     return qtrue;
00595 }

Here is the call graph for this function:

int SV_BotGetSnapshotEntity int  client,
int  ent
 

Definition at line 624 of file sv_bot.c.

References cl, client_t, serverStatic_t::clients, clientSnapshot_t::first_entity, clientSnapshot_t::num_entities, entityState_s::number, serverStatic_t::numSnapshotEntities, serverStatic_t::snapshotEntities, and svs.

Referenced by SV_GameSystemCalls().

00624                                                         {
00625     client_t            *cl;
00626     clientSnapshot_t    *frame;
00627 
00628     cl = &svs.clients[client];
00629     frame = &cl->frames[cl->netchan.outgoingSequence & PACKET_MASK];
00630     if (sequence < 0 || sequence >= frame->num_entities) {
00631         return -1;
00632     }
00633     return svs.snapshotEntities[(frame->first_entity + sequence) % svs.numSnapshotEntities].number;
00634 }

void SV_BotInitCvars void   ) 
 

Definition at line 479 of file sv_bot.c.

References CVAR_CHEAT, and Cvar_Get().

Referenced by SV_Init().

00479                            {
00480 
00481     Cvar_Get("bot_enable", "1", 0);                     //enable the bot
00482     Cvar_Get("bot_developer", "0", CVAR_CHEAT);         //bot developer mode
00483     Cvar_Get("bot_debug", "0", CVAR_CHEAT);             //enable bot debugging
00484     Cvar_Get("bot_maxdebugpolys", "2", 0);              //maximum number of debug polys
00485     Cvar_Get("bot_groundonly", "1", 0);                 //only show ground faces of areas
00486     Cvar_Get("bot_reachability", "0", 0);               //show all reachabilities to other areas
00487     Cvar_Get("bot_visualizejumppads", "0", CVAR_CHEAT); //show jumppads
00488     Cvar_Get("bot_forceclustering", "0", 0);            //force cluster calculations
00489     Cvar_Get("bot_forcereachability", "0", 0);          //force reachability calculations
00490     Cvar_Get("bot_forcewrite", "0", 0);                 //force writing aas file
00491     Cvar_Get("bot_aasoptimize", "0", 0);                //no aas file optimisation
00492     Cvar_Get("bot_saveroutingcache", "0", 0);           //save routing cache
00493     Cvar_Get("bot_thinktime", "100", CVAR_CHEAT);       //msec the bots thinks
00494     Cvar_Get("bot_reloadcharacters", "0", 0);           //reload the bot characters each time
00495     Cvar_Get("bot_testichat", "0", 0);                  //test ichats
00496     Cvar_Get("bot_testrchat", "0", 0);                  //test rchats
00497     Cvar_Get("bot_testsolid", "0", CVAR_CHEAT);         //test for solid areas
00498     Cvar_Get("bot_testclusters", "0", CVAR_CHEAT);      //test the AAS clusters
00499     Cvar_Get("bot_fastchat", "0", 0);                   //fast chatting bots
00500     Cvar_Get("bot_nochat", "0", 0);                     //disable chats
00501     Cvar_Get("bot_pause", "0", CVAR_CHEAT);             //pause the bots thinking
00502     Cvar_Get("bot_report", "0", CVAR_CHEAT);            //get a full report in ctf
00503     Cvar_Get("bot_grapple", "0", 0);                    //enable grapple
00504     Cvar_Get("bot_rocketjump", "1", 0);                 //enable rocket jumping
00505     Cvar_Get("bot_challenge", "0", 0);                  //challenging bot
00506     Cvar_Get("bot_minplayers", "0", 0);                 //minimum players in a team or the game
00507     Cvar_Get("bot_interbreedchar", "", CVAR_CHEAT);     //bot character used for interbreeding
00508     Cvar_Get("bot_interbreedbots", "10", CVAR_CHEAT);   //number of bots used for interbreeding
00509     Cvar_Get("bot_interbreedcycle", "20", CVAR_CHEAT);  //bot interbreeding cycle
00510     Cvar_Get("bot_interbreedwrite", "", CVAR_CHEAT);    //write interbreeded bots to this file
00511 }

Here is the call graph for this function:

int SV_BotLibSetup void   ) 
 

Definition at line 444 of file sv_bot.c.

References botlib_export, botlib_export_s::BotLibSetup, Com_Printf(), and S_COLOR_RED.

Referenced by SV_GameSystemCalls().

00444                            {
00445     if (!bot_enable) {
00446         return 0;
00447     }
00448 
00449     if ( !botlib_export ) {
00450         Com_Printf( S_COLOR_RED "Error: SV_BotLibSetup without SV_BotInitBotLib\n" );
00451         return -1;
00452     }
00453 
00454     return botlib_export->BotLibSetup();
00455 }

Here is the call graph for this function:

int SV_BotLibShutdown void   ) 
 

Definition at line 465 of file sv_bot.c.

References botlib_export, and botlib_export_s::BotLibShutdown.

Referenced by SV_GameSystemCalls().

00465                               {
00466 
00467     if ( !botlib_export ) {
00468         return -1;
00469     }
00470 
00471     return botlib_export->BotLibShutdown();
00472 }

void SV_ChangeMaxClients void   ) 
 

Definition at line 243 of file sv_init.c.

References client_t, serverStatic_t::clients, com_dedicated, Com_Memset(), count, Hunk_AllocateTempMemory(), Hunk_FreeTempMemory(), i, cvar_s::integer, serverStatic_t::numSnapshotEntities, PACKET_BACKUP, client_s::state, SV_BoundMaxClients(), sv_maxclients, svs, Z_Free(), and Z_Malloc().

Referenced by SV_SpawnServer().

00243                                  {
00244     int     oldMaxClients;
00245     int     i;
00246     client_t    *oldClients;
00247     int     count;
00248 
00249     // get the highest client number in use
00250     count = 0;
00251     for ( i = 0 ; i < sv_maxclients->integer ; i++ ) {
00252         if ( svs.clients[i].state >= CS_CONNECTED ) {
00253             if (i > count)
00254                 count = i;
00255         }
00256     }
00257     count++;
00258 
00259     oldMaxClients = sv_maxclients->integer;
00260     // never go below the highest client number in use
00261     SV_BoundMaxClients( count );
00262     // if still the same
00263     if ( sv_maxclients->integer == oldMaxClients ) {
00264         return;
00265     }
00266 
00267     oldClients = Hunk_AllocateTempMemory( count * sizeof(client_t) );
00268     // copy the clients to hunk memory
00269     for ( i = 0 ; i < count ; i++ ) {
00270         if ( svs.clients[i].state >= CS_CONNECTED ) {
00271             oldClients[i] = svs.clients[i];
00272         }
00273         else {
00274             Com_Memset(&oldClients[i], 0, sizeof(client_t));
00275         }
00276     }
00277 
00278     // free old clients arrays
00279     Z_Free( svs.clients );
00280 
00281     // allocate new clients
00282     svs.clients = Z_Malloc ( sv_maxclients->integer * sizeof(client_t) );
00283     Com_Memset( svs.clients, 0, sv_maxclients->integer * sizeof(client_t) );
00284 
00285     // copy the clients over
00286     for ( i = 0 ; i < count ; i++ ) {
00287         if ( oldClients[i].state >= CS_CONNECTED ) {
00288             svs.clients[i] = oldClients[i];
00289         }
00290     }
00291 
00292     // free the old clients on the hunk
00293     Hunk_FreeTempMemory( oldClients );
00294     
00295     // allocate new snapshot entities
00296     if ( com_dedicated->integer ) {
00297         svs.numSnapshotEntities = sv_maxclients->integer * PACKET_BACKUP * 64;
00298     } else {
00299         // we don't need nearly as many when playing locally
00300         svs.numSnapshotEntities = sv_maxclients->integer * 4 * 64;
00301     }
00302 }

Here is the call graph for this function:

void SV_ClearWorld void   ) 
 

Definition at line 147 of file sv_world.c.

References clipHandle_t, CM_InlineModel(), CM_ModelBounds(), Com_Memset(), h(), SV_CreateworldSector(), sv_numworldSectors, sv_worldSectors, and vec3_t.

Referenced by SV_SpawnServer().

00147                            {
00148     clipHandle_t    h;
00149     vec3_t          mins, maxs;
00150 
00151     Com_Memset( sv_worldSectors, 0, sizeof(sv_worldSectors) );
00152     sv_numworldSectors = 0;
00153 
00154     // get world map bounds
00155     h = CM_InlineModel( 0 );
00156     CM_ModelBounds( h, mins, maxs );
00157     SV_CreateworldSector( 0, mins, maxs );
00158 }

Here is the call graph for this function: