From 160afd4e7a10b65284e6036ea27584fa1e1263b9 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Sun, 10 Feb 2008 20:08:39 +0000 Subject: [PATCH] Remove some unused code from netplay. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3744 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/netplay/netplay.c | 17 ----------------- lib/netplay/netplay.h | 7 ------- src/game.c | 23 +++++++++++++---------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/lib/netplay/netplay.c b/lib/netplay/netplay.c index f4fa6e730..42e105e2f 100644 --- a/lib/netplay/netplay.c +++ b/lib/netplay/netplay.c @@ -104,7 +104,6 @@ typedef struct #define HOST_DPID 1 #define PLAYER_HOST 1 -#define PLAYER_SPECTATOR 2 // //////////////////////////////////////////////////////////////////////// // Variables @@ -312,7 +311,6 @@ UDWORD NETplayerInfo(void) { NetPlay.playercount = 1; NetPlay.players[0].bHost = TRUE; - NetPlay.players[0].bSpectator = FALSE; NetPlay.players[0].dpid = 1; return 1; } @@ -335,15 +333,6 @@ UDWORD NETplayerInfo(void) NetPlay.players[NetPlay.playercount].bHost = FALSE; } - if (players[i].flags & PLAYER_SPECTATOR) - { - NetPlay.players[NetPlay.playercount].bSpectator = TRUE; - } - else - { - NetPlay.players[NetPlay.playercount].bSpectator = FALSE; - } - NetPlay.playercount++; } } @@ -524,10 +513,6 @@ BOOL NETinit(BOOL bFirstCall) NetPlay.bHost = 0; NetPlay.bComms = TRUE; - NetPlay.bAllowCaptureRecord = FALSE; - NetPlay.bAllowCapturePlay = FALSE; - NetPlay.bCaptureInUse = FALSE; - for(i=0;i= MAX_CONNECTED_PLAYERS) { diff --git a/lib/netplay/netplay.h b/lib/netplay/netplay.h index ed1a1c6b8..1ccca79ba 100644 --- a/lib/netplay/netplay.h +++ b/lib/netplay/netplay.h @@ -85,7 +85,6 @@ typedef struct { // The problem is however that these where previously declared as BOOL, // which is typedef'd as int, which on most platforms is equal to uint32_t. uint32_t bHost; - uint32_t bSpectator; } PLAYER; // //////////////////////////////////////////////////////////////////////// @@ -101,12 +100,6 @@ typedef struct { uint32_t bComms; // actually do the comms? uint32_t bHost; // TRUE if we are hosting the session uint32_t bLobbyLaunched; // true if app launched by a lobby - uint32_t bSpectator; // true if just spectating - - // booleans - uint32_t bCaptureInUse; // true if someone is speaking. - uint32_t bAllowCaptureRecord; // true if speech can be recorded. - uint32_t bAllowCapturePlay; // true if speech can be played. } NETPLAY; // //////////////////////////////////////////////////////////////////////// diff --git a/src/game.c b/src/game.c index 50e10a19c..0800d2bcc 100644 --- a/src/game.c +++ b/src/game.c @@ -530,15 +530,17 @@ static bool serializePlayer(PHYSFS_file* fileHandle, const PLAYER* serializePlay return (PHYSFS_writeUBE32(fileHandle, serializePlayer->dpid) && PHYSFS_write(fileHandle, serializePlayer->name, StringSize, 1) == 1 && PHYSFS_writeUBE32(fileHandle, serializePlayer->bHost) - && PHYSFS_writeUBE32(fileHandle, serializePlayer->bSpectator)); + && PHYSFS_writeUBE32(fileHandle, 0)); } static bool deserializePlayer(PHYSFS_file* fileHandle, PLAYER* serializePlayer) { + uint32_t dummy; + return (PHYSFS_readUBE32(fileHandle, &serializePlayer->dpid) && PHYSFS_read(fileHandle, serializePlayer->name, StringSize, 1) == 1 && PHYSFS_readUBE32(fileHandle, &serializePlayer->bHost) - && PHYSFS_readUBE32(fileHandle, &serializePlayer->bSpectator)); + && PHYSFS_readUBE32(fileHandle, &dummy)); } static bool serializeNetPlay(PHYSFS_file* fileHandle, const NETPLAY* serializeNetPlay) @@ -560,15 +562,16 @@ static bool serializeNetPlay(PHYSFS_file* fileHandle, const NETPLAY* serializeNe return (PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bComms) && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bHost) && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bLobbyLaunched) - && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bSpectator) - && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bCaptureInUse) - && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bAllowCaptureRecord) - && PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bAllowCapturePlay)); + && PHYSFS_writeUBE32(fileHandle, 0) + && PHYSFS_writeUBE32(fileHandle, 0) + && PHYSFS_writeUBE32(fileHandle, 0) + && PHYSFS_writeUBE32(fileHandle, 0)); } static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPlay) { unsigned int i; + uint32_t dummy; for (i = 0; i < MaxGames; ++i) { @@ -585,10 +588,10 @@ static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPla return (PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bComms) && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bHost) && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bLobbyLaunched) - && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bSpectator) - && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bCaptureInUse) - && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bAllowCaptureRecord) - && PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bAllowCapturePlay)); + && PHYSFS_readUBE32(fileHandle, &dummy) + && PHYSFS_readUBE32(fileHandle, &dummy) + && PHYSFS_readUBE32(fileHandle, &dummy) + && PHYSFS_readUBE32(fileHandle, &dummy)); } #define GAME_SAVE_V7 \