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

ui_startserver.c File Reference

#include "ui_local.h"

Include dependency graph for ui_startserver.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  botSelectInfo_t
struct  serveroptions_t
struct  startserver_t

Defines

#define BOTSELECT_ACCEPT0   "menu/art/accept_0"
#define BOTSELECT_ACCEPT1   "menu/art/accept_1"
#define BOTSELECT_ARROWS   "menu/art/gs_arrows_0"
#define BOTSELECT_ARROWSL   "menu/art/gs_arrows_l"
#define BOTSELECT_ARROWSR   "menu/art/gs_arrows_r"
#define BOTSELECT_BACK0   "menu/art/back_0"
#define BOTSELECT_BACK1   "menu/art/back_1"
#define BOTSELECT_SELECT   "menu/art/opponents_select"
#define BOTSELECT_SELECTED   "menu/art/opponents_selected"
#define GAMESERVER_ARROWS   "menu/art/gs_arrows_0"
#define GAMESERVER_ARROWSL   "menu/art/gs_arrows_l"
#define GAMESERVER_ARROWSR   "menu/art/gs_arrows_r"
#define GAMESERVER_BACK0   "menu/art/back_0"
#define GAMESERVER_BACK1   "menu/art/back_1"
#define GAMESERVER_FIGHT0   "menu/art/fight_0"
#define GAMESERVER_FIGHT1   "menu/art/fight_1"
#define GAMESERVER_FRAMEL   "menu/art/frame2_l"
#define GAMESERVER_FRAMER   "menu/art/frame1_r"
#define GAMESERVER_NEXT0   "menu/art/next_0"
#define GAMESERVER_NEXT1   "menu/art/next_1"
#define GAMESERVER_SELECT   "menu/art/maps_select"
#define GAMESERVER_SELECTED   "menu/art/maps_selected"
#define GAMESERVER_UNKNOWNMAP   "menu/art/unknownmap"
#define ID_BACK   24
#define ID_DEDICATED   22
#define ID_GAMETYPE   10
#define ID_GO   23
#define ID_MAXCLIENTS   21
#define ID_NEXTPAGE   16
#define ID_PICTURES   11
#define ID_PLAYER_TYPE   20
#define ID_PREVPAGE   15
#define ID_STARTSERVERBACK   17
#define ID_STARTSERVERNEXT   18
#define MAX_MAPCOLS   2
#define MAX_MAPROWS   2
#define MAX_MAPSPERPAGE   4
#define MAX_MODELSPERPAGE   (PLAYERGRID_ROWS * PLAYERGRID_COLS)
#define MAX_NAMELENGTH   16
#define MAX_SERVERMAPS   64
#define MAX_SERVERSTEXT   8192
#define OPTIONS_X   456
#define PLAYER_SLOTS   12
#define PLAYERGRID_COLS   4
#define PLAYERGRID_ROWS   4

Functions

qboolean BotAlreadySelected (const char *checkName)
int GametypeBits (char *string)
void PlayerName_Draw (void *item)
void ServerOptions_Cache (void)
void ServerOptions_Event (void *ptr, int event)
void ServerOptions_InitBotNames (void)
void ServerOptions_InitPlayerItems (void)
void ServerOptions_LevelshotDraw (void *self)
void ServerOptions_MenuInit (qboolean multiplayer)
void ServerOptions_PlayerNameEvent (void *ptr, int event)
void ServerOptions_SetMenuItems (void)
void ServerOptions_SetPlayerItems (void)
void ServerOptions_Start (void)
void ServerOptions_StatusBar (void *ptr)
void ServerPlayerIcon (const char *modelAndSkin, char *iconName, int iconNameMaxSize)
void StartServer_Cache (void)
void StartServer_GametypeEvent (void *ptr, int event)
void StartServer_LevelshotDraw (void *self)
void StartServer_MapEvent (void *ptr, int event)
void StartServer_MenuEvent (void *ptr, int event)
void StartServer_MenuInit (void)
void StartServer_Update (void)
void UI_BotSelectMenu (char *bot)
void UI_BotSelectMenu_BackEvent (void *ptr, int event)
void UI_BotSelectMenu_BotEvent (void *ptr, int event)
void UI_BotSelectMenu_BuildList (void)
void UI_BotSelectMenu_Cache (void)
void UI_BotSelectMenu_Default (char *bot)
void UI_BotSelectMenu_Init (char *bot)
void UI_BotSelectMenu_LeftEvent (void *ptr, int event)
void UI_BotSelectMenu_RightEvent (void *ptr, int event)
void UI_BotSelectMenu_SelectEvent (void *ptr, int event)
int QDECL UI_BotSelectMenu_SortCompare (const void *arg1, const void *arg2)
void UI_BotSelectMenu_UpdateGrid (void)
void UI_ServerOptionsMenu (qboolean multiplayer)
void UI_StartServerMenu (qboolean multiplayer)

Variables

botSelectInfo_t botSelectInfo
const char * botSkill_list []
const char * dedicated_list []
const char * gametype_items []
int gametype_remap [] = {GT_FFA, GT_TEAM, GT_TOURNAMENT, GT_CTF}
int gametype_remap2 [] = {0, 2, 0, 1, 3}
const char * playerTeam_list []
const char * playerType_list []
const char * punkbuster_items []
serveroptions_t s_serveroptions
startserver_t s_startserver


Define Documentation

#define BOTSELECT_ACCEPT0   "menu/art/accept_0"
 

Definition at line 1512 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_ACCEPT1   "menu/art/accept_1"
 

Definition at line 1513 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_ARROWS   "menu/art/gs_arrows_0"
 

Definition at line 1516 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_ARROWSL   "menu/art/gs_arrows_l"
 

Definition at line 1517 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_ARROWSR   "menu/art/gs_arrows_r"
 

Definition at line 1518 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_BACK0   "menu/art/back_0"
 

Definition at line 1510 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_BACK1   "menu/art/back_1"
 

Definition at line 1511 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_SELECT   "menu/art/opponents_select"
 

Definition at line 1514 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define BOTSELECT_SELECTED   "menu/art/opponents_selected"
 

Definition at line 1515 of file ui_startserver.c.

Referenced by UI_BotSelectMenu_Cache().

#define GAMESERVER_ARROWS   "menu/art/gs_arrows_0"
 

Definition at line 46 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_ARROWSL   "menu/art/gs_arrows_l"
 

Definition at line 47 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_ARROWSR   "menu/art/gs_arrows_r"
 

Definition at line 48 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_BACK0   "menu/art/back_0"
 

Definition at line 35 of file ui_startserver.c.

Referenced by ServerOptions_Cache(), and StartServer_Cache().

#define GAMESERVER_BACK1   "menu/art/back_1"
 

Definition at line 36 of file ui_startserver.c.

Referenced by ServerOptions_Cache(), and StartServer_Cache().

#define GAMESERVER_FIGHT0   "menu/art/fight_0"
 

Definition at line 43 of file ui_startserver.c.

Referenced by ServerOptions_Cache().

#define GAMESERVER_FIGHT1   "menu/art/fight_1"
 

Definition at line 44 of file ui_startserver.c.

Referenced by ServerOptions_Cache().

#define GAMESERVER_FRAMEL   "menu/art/frame2_l"
 

Definition at line 39 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_FRAMER   "menu/art/frame1_r"
 

Definition at line 40 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_NEXT0   "menu/art/next_0"
 

Definition at line 37 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_NEXT1   "menu/art/next_1"
 

Definition at line 38 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_SELECT   "menu/art/maps_select"
 

Definition at line 41 of file ui_startserver.c.

Referenced by ServerOptions_Cache(), and StartServer_Cache().

#define GAMESERVER_SELECTED   "menu/art/maps_selected"
 

Definition at line 42 of file ui_startserver.c.

Referenced by StartServer_Cache().

#define GAMESERVER_UNKNOWNMAP   "menu/art/unknownmap"
 

Definition at line 45 of file ui_startserver.c.

Referenced by ServerOptions_Cache(), and StartServer_Cache().

#define ID_BACK   24
 

Definition at line 619 of file ui_startserver.c.

#define ID_DEDICATED   22
 

Definition at line 617 of file ui_startserver.c.

Referenced by ServerOptions_Event().

#define ID_GAMETYPE   10
 

Definition at line 59 of file ui_startserver.c.

#define ID_GO   23
 

Definition at line 618 of file ui_startserver.c.

#define ID_MAXCLIENTS   21
 

Definition at line 616 of file ui_startserver.c.

Referenced by ServerOptions_Event().

#define ID_NEXTPAGE   16
 

Definition at line 62 of file ui_startserver.c.

#define ID_PICTURES   11
 

Definition at line 60 of file ui_startserver.c.

Referenced by StartServer_MenuInit().

#define ID_PLAYER_TYPE   20
 

Definition at line 615 of file ui_startserver.c.

Referenced by ServerOptions_Event().

#define ID_PREVPAGE   15
 

Definition at line 61 of file ui_startserver.c.

#define ID_STARTSERVERBACK   17
 

Definition at line 63 of file ui_startserver.c.

Referenced by StartServer_MenuEvent().

#define ID_STARTSERVERNEXT   18
 

Definition at line 64 of file ui_startserver.c.

Referenced by ServerOptions_Event(), and StartServer_MenuEvent().

#define MAX_MAPCOLS   2
 

Definition at line 51 of file ui_startserver.c.

#define MAX_MAPROWS   2
 

Definition at line 50 of file ui_startserver.c.

#define MAX_MAPSPERPAGE   4
 

Definition at line 52 of file ui_startserver.c.

Referenced by StartServer_Cache(), StartServer_GametypeEvent(), and StartServer_LevelshotDraw().

#define MAX_MODELSPERPAGE   (PLAYERGRID_ROWS * PLAYERGRID_COLS)
 

Definition at line 1522 of file ui_startserver.c.

#define MAX_NAMELENGTH   16
 

Definition at line 57 of file ui_startserver.c.

#define MAX_SERVERMAPS   64
 

Definition at line 56 of file ui_startserver.c.

#define MAX_SERVERSTEXT   8192
 

Definition at line 54 of file ui_startserver.c.

#define OPTIONS_X   456
 

Definition at line 1226 of file ui_startserver.c.

#define PLAYER_SLOTS   12
 

Definition at line 621 of file ui_startserver.c.

Referenced by ServerOptions_InitPlayerItems().

#define PLAYERGRID_COLS   4
 

Definition at line 1520 of file ui_startserver.c.

#define PLAYERGRID_ROWS   4
 

Definition at line 1521 of file ui_startserver.c.


Function Documentation

qboolean BotAlreadySelected const char *  checkName  )  [static]
 

Definition at line 699 of file ui_startserver.c.

References menulist_s::curvalue, serveroptions_t::gametype, n, serveroptions_t::newBotIndex, serveroptions_t::playerNameBuffers, serveroptions_t::playerTeam, serveroptions_t::playerType, Q_stricmp(), qboolean, and s_serveroptions.

Referenced by UI_BotSelectMenu_UpdateGrid().

00699                                                             {
00700     int     n;
00701 
00702     for( n = 1; n < PLAYER_SLOTS; n++ ) {
00703         if( s_serveroptions.playerType[n].curvalue != 1 ) {
00704             continue;
00705         }
00706         if( (s_serveroptions.gametype >= GT_TEAM) &&
00707             (s_serveroptions.playerTeam[n].curvalue != s_serveroptions.playerTeam[s_serveroptions.newBotIndex].curvalue ) ) {
00708             continue;
00709         }
00710         if( Q_stricmp( checkName, s_serveroptions.playerNameBuffers[n] ) == 0 ) {
00711             return qtrue;
00712         }
00713     }
00714 
00715     return qfalse;
00716 }

Here is the call graph for this function:

int GametypeBits char *  string  )  [static]
 

Definition at line 118 of file ui_startserver.c.

References bits, COM_ParseExt(), p, Q_stricmp(), qfalse, and token.

Referenced by StartServer_Cache(), and StartServer_GametypeEvent().

00118                                         {
00119     int     bits;
00120     char    *p;
00121     char    *token;
00122 
00123     bits = 0;
00124     p = string;
00125     while( 1 ) {
00126         token = COM_ParseExt( &p, qfalse );
00127         if( token[0] == 0 ) {
00128             break;
00129         }
00130 
00131         if( Q_stricmp( token, "ffa" ) == 0 ) {
00132             bits |= 1 << GT_FFA;
00133             continue;
00134         }
00135 
00136         if( Q_stricmp( token, "tourney" ) == 0 ) {
00137             bits |= 1 << GT_TOURNAMENT;
00138             continue;
00139         }
00140 
00141         if( Q_stricmp( token, "single" ) == 0 ) {
00142             bits |= 1 << GT_SINGLE_PLAYER;
00143             continue;
00144         }
00145 
00146         if( Q_stricmp( token, "team" ) == 0 ) {
00147             bits |= 1 << GT_TEAM;
00148             continue;
00149         }
00150 
00151         if( Q_stricmp( token, "ctf" ) == 0 ) {
00152             bits |= 1 << GT_CTF;
00153             continue;
00154         }
00155     }
00156 
00157     return bits;
00158 }

Here is the call graph for this function:

void PlayerName_Draw void *  item  )  [static]
 

Definition at line 1179 of file ui_startserver.c.

References menucommon_s::bottom, _tag_menuframework::cursor, menucommon_s::flags, menutext_s::generic, menucommon_s::left, listbar_color, menucommon_s::menuPosition, menucommon_s::name, menucommon_s::parent, qboolean, menucommon_s::right, s, SMALLCHAR_WIDTH, menutext_s::string, menucommon_s::top, UI_BLINK, UI_CENTER, UI_DrawChar(), UI_DrawString(), UI_FillRect(), UI_LEFT, UI_RIGHT, UI_SMALLFONT, menucommon_s::x, x, menucommon_s::y, and y.

01179                                           {
01180     menutext_s  *s;
01181     float       *color;
01182     int         x, y;
01183     int         style;
01184     qboolean    focus;
01185 
01186     s = (menutext_s *)item;
01187 
01188     x = s->generic.x;
01189     y = s->generic.y;
01190 
01191     style = UI_SMALLFONT;
01192     focus = (s->generic.parent->cursor == s->generic.menuPosition);
01193 
01194     if ( s->generic.flags & QMF_GRAYED )
01195         color = text_color_disabled;
01196     else if ( focus )
01197     {
01198         color = text_color_highlight;
01199         style |= UI_PULSE;
01200     }
01201     else if ( s->generic.flags & QMF_BLINK )
01202     {
01203         color = text_color_highlight;
01204         style |= UI_BLINK;
01205     }
01206     else
01207         color = text_color_normal;
01208 
01209     if ( focus )
01210     {
01211         // draw cursor
01212         UI_FillRect( s->generic.left, s->generic.top, s->generic.right-s->generic.left+1, s->generic.bottom-s->generic.top+1, listbar_color ); 
01213         UI_DrawChar( x, y, 13, UI_CENTER|UI_BLINK|UI_SMALLFONT, color);
01214     }
01215 
01216     UI_DrawString( x - SMALLCHAR_WIDTH, y, s->generic.name, style|UI_RIGHT, color );
01217     UI_DrawString( x + SMALLCHAR_WIDTH, y, s->string, style|UI_LEFT, color );
01218 }

Here is the call graph for this function:

void ServerOptions_Cache void   ) 
 

Definition at line 1479 of file ui_startserver.c.

References GAMESERVER_BACK0, GAMESERVER_BACK1, GAMESERVER_FIGHT0, GAMESERVER_FIGHT1, GAMESERVER_SELECT, GAMESERVER_UNKNOWNMAP, and trap_R_RegisterShaderNoMip().

01479                                  {
01480     trap_R_RegisterShaderNoMip( GAMESERVER_BACK0 );
01481     trap_R_RegisterShaderNoMip( GAMESERVER_BACK1 );
01482     trap_R_RegisterShaderNoMip( GAMESERVER_FIGHT0 );
01483     trap_R_RegisterShaderNoMip( GAMESERVER_FIGHT1 );
01484     trap_R_RegisterShaderNoMip( GAMESERVER_SELECT );
01485     trap_R_RegisterShaderNoMip( GAMESERVER_UNKNOWNMAP );
01486 }

Here is the call graph for this function:

void ServerOptions_Event void *  ptr,
int  event
[static]
 

Definition at line 933 of file ui_startserver.c.

References ID_BACK, ID_DEDICATED, ID_GO, ID_MAXCLIENTS, ID_PLAYER_TYPE, ID_STARTSERVERNEXT, ServerOptions_SetPlayerItems(), ServerOptions_Start(), and UI_PopMenu().

00933                                                         {
00934     switch( ((menucommon_s*)ptr)->id ) {
00935     
00936     //if( event != QM_ACTIVATED && event != QM_LOSTFOCUS) {
00937     //  return;
00938     //}
00939     case ID_PLAYER_TYPE:
00940         if( event != QM_ACTIVATED ) {
00941             break;
00942         }
00943         ServerOptions_SetPlayerItems();
00944         break;
00945 
00946     case ID_MAXCLIENTS:
00947     case ID_DEDICATED:
00948         ServerOptions_SetPlayerItems();
00949         break;
00950     case ID_GO:
00951         if( event != QM_ACTIVATED ) {
00952             break;
00953         }
00954         ServerOptions_Start();
00955         break;
00956 
00957     case ID_STARTSERVERNEXT:
00958         if( event != QM_ACTIVATED ) {
00959             break;
00960         }
00961         break;
00962     case ID_BACK:
00963         if( event != QM_ACTIVATED ) {
00964             break;
00965         }
00966         UI_PopMenu();
00967         break;
00968     }
00969 }

Here is the call graph for this function:

void ServerOptions_InitBotNames void   )  [static]
 

Definition at line 1031 of file ui_startserver.c.

References count, menulist_s::curvalue, serveroptions_t::gametype, Info_ValueForKey(), serveroptions_t::mapnamebuffer, n, p, serveroptions_t::playerNameBuffers, serveroptions_t::playerType, Q_strncpyz(), s_serveroptions, strcpy(), UI_GetArenaInfoByMap(), and UI_GetBotInfoByName().

Referenced by ServerOptions_SetMenuItems().

01031                                                {
01032     int         count;
01033     int         n;
01034     const char  *arenaInfo;
01035     const char  *botInfo;
01036     char        *p;
01037     char        *bot;
01038     char        bots[MAX_INFO_STRING];
01039 
01040     if( s_serveroptions.gametype >= GT_TEAM ) {
01041         Q_strncpyz( s_serveroptions.playerNameBuffers[1], "grunt", 16 );
01042         Q_strncpyz( s_serveroptions.playerNameBuffers[2], "major", 16 );
01043         if( s_serveroptions.gametype == GT_TEAM ) {
01044             Q_strncpyz( s_serveroptions.playerNameBuffers[3], "visor", 16 );
01045         }
01046         else {
01047             s_serveroptions.playerType[3].curvalue = 2;
01048         }
01049         s_serveroptions.playerType[4].curvalue = 2;
01050         s_serveroptions.playerType[5].curvalue = 2;
01051 
01052         Q_strncpyz( s_serveroptions.playerNameBuffers[6], "sarge", 16 );
01053         Q_strncpyz( s_serveroptions.playerNameBuffers[7], "grunt", 16 );
01054         Q_strncpyz( s_serveroptions.playerNameBuffers[8], "major", 16 );
01055         if( s_serveroptions.gametype == GT_TEAM ) {
01056             Q_strncpyz( s_serveroptions.playerNameBuffers[9], "visor", 16 );
01057         }
01058         else {
01059             s_serveroptions.playerType[9].curvalue = 2;
01060         }
01061         s_serveroptions.playerType[10].curvalue = 2;
01062         s_serveroptions.playerType[11].curvalue = 2;
01063 
01064         return;
01065     }
01066 
01067     count = 1;  // skip the first slot, reserved for a human
01068 
01069     // get info for this map
01070     arenaInfo = UI_GetArenaInfoByMap( s_serveroptions.mapnamebuffer );
01071 
01072     // get the bot info - we'll seed with them if any are listed
01073     Q_strncpyz( bots, Info_ValueForKey( arenaInfo, "bots" ), sizeof(bots) );
01074     p = &bots[0];
01075     while( *p && count < PLAYER_SLOTS ) {
01076         //skip spaces
01077         while( *p && *p == ' ' ) {
01078             p++;
01079         }
01080         if( !p ) {
01081             break;
01082         }
01083 
01084         // mark start of bot name
01085         bot = p;
01086 
01087         // skip until space of null
01088         while( *p && *p != ' ' ) {
01089             p++;
01090         }
01091         if( *p ) {
01092             *p++ = 0;
01093         }
01094 
01095         botInfo = UI_GetBotInfoByName( bot );
01096         bot = Info_ValueForKey( botInfo, "name" );
01097 
01098         Q_strncpyz( s_serveroptions.playerNameBuffers[count], bot, sizeof(s_serveroptions.playerNameBuffers[count]) );
01099         count++;
01100     }
01101 
01102     // set the rest of the bot slots to "---"
01103     for( n = count; n < PLAYER_SLOTS; n++ ) {
01104         strcpy( s_serveroptions.playerNameBuffers[n], "--------" );
01105     }
01106 
01107     // pad up to #8 as open slots
01108     for( ;count < 8; count++ ) {
01109         s_serveroptions.playerType[count].curvalue = 0;
01110     }
01111 
01112     // close off the rest by default
01113     for( ;count < PLAYER_SLOTS; count++ ) {
01114         if( s_serveroptions.playerType[count].curvalue == 1 ) {
01115             s_serveroptions.playerType[count].curvalue = 2;
01116         }
01117     }
01118 }

Here is the call graph for this function:

void ServerOptions_InitPlayerItems void   )  [static]
 

Definition at line 829 of file ui_startserver.c.

References menulist_s::curvalue, serveroptions_t::dedicated, menucommon_s::flags, serveroptions_t::gametype, menulist_s::generic, serveroptions_t::multiplayer, n, PLAYER_SLOTS, serveroptions_t::playerNameBuffers, serveroptions_t::playerTeam, serveroptions_t::playerType, Q_CleanStr(), QMF_INACTIVE, s_serveroptions, trap_Cvar_VariableStringBuffer(), and v.

Referenced by ServerOptions_SetMenuItems().

00829                                                   {
00830     int     n;
00831     int     v;
00832 
00833     // init types
00834     if( s_serveroptions.multiplayer ) {
00835         v = 0;  // open
00836     }
00837     else {
00838         v = 1;  // bot
00839     }
00840     
00841     for( n = 0; n < PLAYER_SLOTS; n++ ) {
00842         s_serveroptions.playerType[n].curvalue = v;
00843     }
00844 
00845     if( s_serveroptions.multiplayer && (s_serveroptions.gametype < GT_TEAM) ) {
00846         for( n = 8; n < PLAYER_SLOTS; n++ ) {
00847             s_serveroptions.playerType[n].curvalue = 2;
00848         }
00849     }
00850 
00851     // if not a dedicated server, first slot is reserved for the human on the server
00852     if( s_serveroptions.dedicated.curvalue == 0 ) {
00853         // human
00854         s_serveroptions.playerType[0].generic.flags |= QMF_INACTIVE;
00855         s_serveroptions.playerType[0].curvalue = 0;
00856         trap_Cvar_VariableStringBuffer( "name", s_serveroptions.playerNameBuffers[0], sizeof(s_serveroptions.playerNameBuffers[0]) );
00857         Q_CleanStr( s_serveroptions.playerNameBuffers[0] );
00858     }
00859 
00860     // init teams
00861     if( s_serveroptions.gametype >= GT_TEAM ) {
00862         for( n = 0; n < (PLAYER_SLOTS / 2); n++ ) {
00863             s_serveroptions.playerTeam[n].curvalue = 0;
00864         }
00865         for( ; n < PLAYER_SLOTS; n++ ) {
00866             s_serveroptions.playerTeam[n].curvalue = 1;
00867         }
00868     }
00869     else {
00870         for( n = 0; n < PLAYER_SLOTS; n++ ) {
00871             s_serveroptions.playerTeam[n].generic.flags |= (QMF_INACTIVE|QMF_HIDDEN);
00872         }
00873     }
00874 }

Here is the call graph for this function:

void ServerOptions_LevelshotDraw void *  self  )  [static]
 

Definition at line 1003 of file ui_startserver.c.

References b, Bitmap_Draw(), color_orange, colorBlack, serveroptions_t::gametype, gametype_items, gametype_remap2, menubitmap_s::generic, menubitmap_s::height, serveroptions_t::mapnamebuffer, serveroptions_t::newBot, serveroptions_t::newBotIndex, serveroptions_t::newBotName, serveroptions_t::playerNameBuffers, Q_strncpyz(), s_serveroptions, UI_CENTER, UI_DrawString(), UI_FillRect(), UI_SMALLFONT, menubitmap_s::width, menucommon_s::x, x, menucommon_s::y, and y.

01003                                                       {
01004     menubitmap_s    *b;
01005     int             x;
01006     int             y;
01007 
01008     // strange place for this, but it works
01009     if( s_serveroptions.newBot ) {
01010         Q_strncpyz( s_serveroptions.playerNameBuffers[s_serveroptions.newBotIndex], s_serveroptions.newBotName, 16 );
01011         s_serveroptions.newBot = qfalse;
01012     }
01013 
01014     b = (menubitmap_s *)self;
01015 
01016     Bitmap_Draw( b );
01017 
01018     x = b->generic.x;
01019     y = b->generic.y + b->height;
01020     UI_FillRect( x, y, b->width, 40, colorBlack );
01021 
01022     x += b->width / 2;
01023     y += 4;
01024     UI_DrawString( x, y, s_serveroptions.mapnamebuffer, UI_CENTER|UI_SMALLFONT, color_orange );
01025 
01026     y += SMALLCHAR_HEIGHT;
01027     UI_DrawString( x, y, gametype_items[gametype_remap2[s_serveroptions.gametype]], UI_CENTER|UI_SMALLFONT, color_orange );
01028 }

Here is the call graph for this function:

void ServerOptions_MenuInit qboolean  multiplayer  )  [static]
 

Definition at line 1228 of file ui_startserver.c.

References serveroptions_t::back, serveroptions_t::banner, BIGCHAR_HEIGHT, serveroptions_t::botSkill, menucommon_s::bottom, menucommon_s::callback, menutext_s::color, Com_Clamp(), menulist_s::curvalue, serveroptions_t::dedicated, menubitmap_s::errorpic, menufield_s::field, serveroptions_t::flaglimit, menucommon_s::flags, menubitmap_s::focuspic, serveroptions_t::fraglimit, serveroptions_t::friendlyfire, _tag_menuframework::fullscreen, serveroptions_t::gametype, menulist_s::generic, menuradiobutton_s::generic, menufield_s::generic, menubitmap_s::generic, menutext_s::generic, serveroptions_t::go, menubitmap_s::height, serveroptions_t::hostname, menucommon_s::id, menulist_s::itemnames, menucommon_s::left, serveroptions_t::mappic, mfield_t::maxchars, memset(), serveroptions_t::menu, Menu_AddItem(), serveroptions_t::multiplayer, n, menucommon_s::name, serveroptions_t::next, menucommon_s::ownerdraw, serveroptions_t::picframe, serveroptions_t::player0, serveroptions_t::playerName, serveroptions_t::playerNameBuffers, serveroptions_t::playerTeam, serveroptions_t::playerType, serveroptions_t::punkbuster, serveroptions_t::pure, QMF_GRAYED, QMF_INACTIVE, QMF_LEFT_JUSTIFY, QMF_NUMBERSONLY, QMF_PULSEIFFOCUS, QMF_RIGHT_JUSTIFY, menucommon_s::right, s_serveroptions, ServerOptions_Cache(), ServerOptions_SetMenuItems(), SMALLCHAR_HEIGHT, menucommon_s::statusbar, menutext_s::string, strlen(), menutext_s::style, serveroptions_t::timelimit, menucommon_s::top, trap_Cvar_VariableValue(), menucommon_s::type, UI_LEFT, menubitmap_s::width, mfield_t::widthInChars, _tag_menuframework::wrapAround, menucommon_s::x, y, and menucommon_s::y.

Referenced by UI_ServerOptionsMenu().

01228                                                            {
01229     int     y;
01230     int     n;
01231 
01232     memset( &s_serveroptions, 0 ,sizeof(serveroptions_t) );
01233     s_serveroptions.multiplayer = multiplayer;
01234     s_serveroptions.gametype = (int)Com_Clamp( 0, 5, trap_Cvar_VariableValue( "g_gameType" ) );
01235     s_serveroptions.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "sv_punkbuster" ) );
01236 
01237     ServerOptions_Cache();
01238 
01239     s_serveroptions.menu.wrapAround = qtrue;
01240     s_serveroptions.menu.fullscreen = qtrue;
01241 
01242     s_serveroptions.banner.generic.type         = MTYPE_BTEXT;
01243     s_serveroptions.banner.generic.x            = 320;
01244     s_serveroptions.banner.generic.y            = 16;
01245     s_serveroptions.banner.string               = "GAME SERVER";
01246     s_serveroptions.banner.color                = color_white;
01247     s_serveroptions.banner.style                = UI_CENTER;
01248 
01249     s_serveroptions.mappic.generic.type         = MTYPE_BITMAP;
01250     s_serveroptions.mappic.generic.flags        = QMF_LEFT_JUSTIFY|QMF_INACTIVE;
01251     s_serveroptions.