Remove last "gamespy" related code, and stop reloading the config file
so often (we keep it in memory, after all). git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1175 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
e7a58327cc
commit
94446216f2
|
@ -62,7 +62,7 @@ extern UBYTE sPlayer[128];
|
|||
extern void registry_clear(void); // from configfile.c
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
BOOL loadConfig(BOOL bResourceAvailable)
|
||||
BOOL loadConfig(void)
|
||||
{
|
||||
SDWORD val;
|
||||
char sBuf[255];
|
||||
|
@ -313,35 +313,26 @@ BOOL loadConfig(BOOL bResourceAvailable)
|
|||
// multiplayer stuff.
|
||||
// /////////////////////////
|
||||
|
||||
if(bResourceAvailable)
|
||||
// game name
|
||||
if (getWarzoneKeyString("gameName",(char*)&sBuf))
|
||||
{
|
||||
// game name
|
||||
if(!NetPlay.bLobbyLaunched && !gameSpy.bGameSpy)
|
||||
{
|
||||
if(getWarzoneKeyString("gameName",(char*)&sBuf))
|
||||
{
|
||||
strcpy(game.name, sBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(game.name, strresGetString(psStringRes, STR_GAME_NAME));
|
||||
setWarzoneKeyString("gameName", game.name);
|
||||
}
|
||||
}
|
||||
strcpy(game.name, sBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(game.name, strresGetString(psStringRes, STR_GAME_NAME));
|
||||
setWarzoneKeyString("gameName", game.name);
|
||||
}
|
||||
|
||||
// player name
|
||||
if(!NetPlay.bLobbyLaunched && !gameSpy.bGameSpy)// name will be set for us.
|
||||
{
|
||||
if(getWarzoneKeyString("playerName",(char*)&sBuf))
|
||||
{
|
||||
strcpy((char*)sPlayer, sBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy((char*)sPlayer, strresGetString(psStringRes, STR_PLAYER_NAME));
|
||||
setWarzoneKeyString("playerName",(char*)sPlayer);
|
||||
}
|
||||
}
|
||||
// player name
|
||||
if (getWarzoneKeyString("playerName",(char*)&sBuf))
|
||||
{
|
||||
strcpy((char*)sPlayer, sBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy((char*)sPlayer, strresGetString(psStringRes, STR_PLAYER_NAME));
|
||||
setWarzoneKeyString("playerName",(char*)sPlayer);
|
||||
}
|
||||
|
||||
// map name
|
||||
|
@ -355,19 +346,6 @@ BOOL loadConfig(BOOL bResourceAvailable)
|
|||
setWarzoneKeyString("mapName", game.map);
|
||||
}
|
||||
|
||||
|
||||
// modem to use.
|
||||
if(getWarzoneKeyNumeric("modemId", &val))
|
||||
{
|
||||
ingame.modem= val;
|
||||
}
|
||||
else
|
||||
{
|
||||
ingame.modem= 0;
|
||||
setWarzoneKeyNumeric("modemId", ingame.modem);
|
||||
}
|
||||
|
||||
|
||||
// power
|
||||
if(getWarzoneKeyNumeric("power", &val))
|
||||
{
|
||||
|
@ -602,7 +580,6 @@ BOOL saveConfig(void)
|
|||
setWarzoneKeyNumeric("maxPlay", game.maxPlayers); // max no of players
|
||||
setWarzoneKeyNumeric("compPlay", game.bComputerPlayers); // allow pc players
|
||||
setWarzoneKeyNumeric("alliance", game.alliance); // allow alliances
|
||||
setWarzoneKeyNumeric("modemId", ingame.modem); // modem to use.
|
||||
setWarzoneKeyString("forceName", sForceName); // force
|
||||
setWarzoneKeyString("playerName",(char*)sPlayer); // player name
|
||||
setWarzoneKeyString("phrase0", ingame.phrases[0]); // phrases
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* load and save favourites to the registry.
|
||||
*/
|
||||
|
||||
extern BOOL loadConfig (BOOL bResourceAvailable);
|
||||
extern BOOL loadRenderMode (void);
|
||||
extern BOOL saveConfig (void);
|
||||
extern BOOL loadConfig(void);
|
||||
extern BOOL loadRenderMode(void);
|
||||
extern BOOL saveConfig(void);
|
||||
extern void closeConfig( void );
|
||||
|
|
|
@ -1231,8 +1231,6 @@ BOOL frontendInitialise(const char *ResourceFile)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
loadConfig(TRUE);// get favourite settings from the registry
|
||||
|
||||
// keymappings
|
||||
// clear out any existing mappings
|
||||
keyClearMappings();
|
||||
|
|
|
@ -456,7 +456,7 @@ init://jump here from the end if re_initialising
|
|||
|
||||
bDisableLobby = FALSE;
|
||||
|
||||
loadConfig(FALSE);
|
||||
loadConfig();
|
||||
atexit( closeConfig );
|
||||
|
||||
// parse the command line
|
||||
|
|
|
@ -2795,7 +2795,6 @@ BOOL startMultiOptions(BOOL bReenter)
|
|||
|
||||
if(!bReenter)
|
||||
{
|
||||
loadConfig(TRUE); // get favourite options
|
||||
initPlayerColours(); // force a colour clearout.
|
||||
|
||||
for(i=0;i<MAX_PLAYERS;i++)
|
||||
|
|
|
@ -77,8 +77,6 @@ SDWORD player2dpid[MAX_PLAYERS] ={0,0,0,0,0,0,0,0}; //stores dpids of each
|
|||
BOOL openchannels[MAX_PLAYERS]={TRUE};
|
||||
UBYTE bDisplayMultiJoiningStatus;
|
||||
|
||||
GAMESPY gameSpy;
|
||||
|
||||
MULTIPLAYERGAME game; //info to describe game.
|
||||
MULTIPLAYERINGAME ingame;
|
||||
|
||||
|
|
|
@ -91,15 +91,6 @@ typedef enum _msgtype
|
|||
|
||||
} MESSAGE_TYPES;
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// holder for gamespy info.
|
||||
typedef struct {
|
||||
BOOL bGameSpy;
|
||||
|
||||
} GAMESPY, *LPGAMESPY;
|
||||
|
||||
extern GAMESPY gameSpy;
|
||||
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Game Options Structure. Enough info to completely describe the static stuff in amultiplay game.
|
||||
|
|
|
@ -160,31 +160,6 @@ TITLECODE titleLoop(void)
|
|||
|
||||
changeTitleMode(QUIT);
|
||||
}
|
||||
else if(gameSpy.bGameSpy)
|
||||
{
|
||||
// set host
|
||||
if (NetPlay.bHost)
|
||||
{
|
||||
ingame.bHostSetup = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ingame.bHostSetup = FALSE;
|
||||
}
|
||||
// set protocol
|
||||
// set address
|
||||
// if host goto options.
|
||||
// if client goto game find.
|
||||
if(NetPlay.bHost)
|
||||
{
|
||||
changeTitleMode(MULTIOPTION);
|
||||
}
|
||||
else
|
||||
{
|
||||
changeTitleMode(GAMEFIND);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch(titleMode) // run relevant title screen code.
|
||||
|
|
Loading…
Reference in New Issue