Remove some unused code from netplay.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3744 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
d5e7f01ef6
commit
160afd4e7a
|
@ -104,7 +104,6 @@ typedef struct
|
||||||
#define HOST_DPID 1
|
#define HOST_DPID 1
|
||||||
|
|
||||||
#define PLAYER_HOST 1
|
#define PLAYER_HOST 1
|
||||||
#define PLAYER_SPECTATOR 2
|
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
// Variables
|
// Variables
|
||||||
|
@ -312,7 +311,6 @@ UDWORD NETplayerInfo(void)
|
||||||
{
|
{
|
||||||
NetPlay.playercount = 1;
|
NetPlay.playercount = 1;
|
||||||
NetPlay.players[0].bHost = TRUE;
|
NetPlay.players[0].bHost = TRUE;
|
||||||
NetPlay.players[0].bSpectator = FALSE;
|
|
||||||
NetPlay.players[0].dpid = 1;
|
NetPlay.players[0].dpid = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -335,15 +333,6 @@ UDWORD NETplayerInfo(void)
|
||||||
NetPlay.players[NetPlay.playercount].bHost = FALSE;
|
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++;
|
NetPlay.playercount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,10 +513,6 @@ BOOL NETinit(BOOL bFirstCall)
|
||||||
NetPlay.bHost = 0;
|
NetPlay.bHost = 0;
|
||||||
NetPlay.bComms = TRUE;
|
NetPlay.bComms = TRUE;
|
||||||
|
|
||||||
NetPlay.bAllowCaptureRecord = FALSE;
|
|
||||||
NetPlay.bAllowCapturePlay = FALSE;
|
|
||||||
NetPlay.bCaptureInUse = FALSE;
|
|
||||||
|
|
||||||
for(i=0;i<MaxNumberOfPlayers;i++)
|
for(i=0;i<MaxNumberOfPlayers;i++)
|
||||||
{
|
{
|
||||||
memset(&NetPlay.players[i], 0, sizeof(PLAYER));
|
memset(&NetPlay.players[i], 0, sizeof(PLAYER));
|
||||||
|
@ -1416,7 +1401,6 @@ BOOL NEThostGame(const char* SessionName, const char* PlayerName,
|
||||||
NET_InitPlayers();
|
NET_InitPlayers();
|
||||||
NetPlay.dpidPlayer = NET_CreatePlayer(PlayerName, PLAYER_HOST);
|
NetPlay.dpidPlayer = NET_CreatePlayer(PlayerName, PLAYER_HOST);
|
||||||
NetPlay.bHost = TRUE;
|
NetPlay.bHost = TRUE;
|
||||||
NetPlay.bSpectator = FALSE;
|
|
||||||
|
|
||||||
MultiPlayerJoin(NetPlay.dpidPlayer);
|
MultiPlayerJoin(NetPlay.dpidPlayer);
|
||||||
|
|
||||||
|
@ -1609,7 +1593,6 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
|
||||||
NetPlay.dpidPlayer = dpid;
|
NetPlay.dpidPlayer = dpid;
|
||||||
debug(LOG_NET, "NETjoinGame: I'm player %u", (unsigned int)NetPlay.dpidPlayer);
|
debug(LOG_NET, "NETjoinGame: I'm player %u", (unsigned int)NetPlay.dpidPlayer);
|
||||||
NetPlay.bHost = FALSE;
|
NetPlay.bHost = FALSE;
|
||||||
NetPlay.bSpectator = FALSE;
|
|
||||||
|
|
||||||
if (NetPlay.dpidPlayer >= MAX_CONNECTED_PLAYERS)
|
if (NetPlay.dpidPlayer >= MAX_CONNECTED_PLAYERS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,7 +85,6 @@ typedef struct {
|
||||||
// The problem is however that these where previously declared as BOOL,
|
// 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.
|
// which is typedef'd as int, which on most platforms is equal to uint32_t.
|
||||||
uint32_t bHost;
|
uint32_t bHost;
|
||||||
uint32_t bSpectator;
|
|
||||||
} PLAYER;
|
} PLAYER;
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -101,12 +100,6 @@ typedef struct {
|
||||||
uint32_t bComms; // actually do the comms?
|
uint32_t bComms; // actually do the comms?
|
||||||
uint32_t bHost; // TRUE if we are hosting the session
|
uint32_t bHost; // TRUE if we are hosting the session
|
||||||
uint32_t bLobbyLaunched; // true if app launched by a lobby
|
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;
|
} NETPLAY;
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////
|
||||||
|
|
23
src/game.c
23
src/game.c
|
@ -530,15 +530,17 @@ static bool serializePlayer(PHYSFS_file* fileHandle, const PLAYER* serializePlay
|
||||||
return (PHYSFS_writeUBE32(fileHandle, serializePlayer->dpid)
|
return (PHYSFS_writeUBE32(fileHandle, serializePlayer->dpid)
|
||||||
&& PHYSFS_write(fileHandle, serializePlayer->name, StringSize, 1) == 1
|
&& PHYSFS_write(fileHandle, serializePlayer->name, StringSize, 1) == 1
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializePlayer->bHost)
|
&& PHYSFS_writeUBE32(fileHandle, serializePlayer->bHost)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializePlayer->bSpectator));
|
&& PHYSFS_writeUBE32(fileHandle, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool deserializePlayer(PHYSFS_file* fileHandle, PLAYER* serializePlayer)
|
static bool deserializePlayer(PHYSFS_file* fileHandle, PLAYER* serializePlayer)
|
||||||
{
|
{
|
||||||
|
uint32_t dummy;
|
||||||
|
|
||||||
return (PHYSFS_readUBE32(fileHandle, &serializePlayer->dpid)
|
return (PHYSFS_readUBE32(fileHandle, &serializePlayer->dpid)
|
||||||
&& PHYSFS_read(fileHandle, serializePlayer->name, StringSize, 1) == 1
|
&& PHYSFS_read(fileHandle, serializePlayer->name, StringSize, 1) == 1
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializePlayer->bHost)
|
&& PHYSFS_readUBE32(fileHandle, &serializePlayer->bHost)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializePlayer->bSpectator));
|
&& PHYSFS_readUBE32(fileHandle, &dummy));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool serializeNetPlay(PHYSFS_file* fileHandle, const NETPLAY* serializeNetPlay)
|
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)
|
return (PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bComms)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bHost)
|
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bHost)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bLobbyLaunched)
|
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bLobbyLaunched)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bSpectator)
|
&& PHYSFS_writeUBE32(fileHandle, 0)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bCaptureInUse)
|
&& PHYSFS_writeUBE32(fileHandle, 0)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bAllowCaptureRecord)
|
&& PHYSFS_writeUBE32(fileHandle, 0)
|
||||||
&& PHYSFS_writeUBE32(fileHandle, serializeNetPlay->bAllowCapturePlay));
|
&& PHYSFS_writeUBE32(fileHandle, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPlay)
|
static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPlay)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
uint32_t dummy;
|
||||||
|
|
||||||
for (i = 0; i < MaxGames; ++i)
|
for (i = 0; i < MaxGames; ++i)
|
||||||
{
|
{
|
||||||
|
@ -585,10 +588,10 @@ static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPla
|
||||||
return (PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bComms)
|
return (PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bComms)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bHost)
|
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bHost)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bLobbyLaunched)
|
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bLobbyLaunched)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bSpectator)
|
&& PHYSFS_readUBE32(fileHandle, &dummy)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bCaptureInUse)
|
&& PHYSFS_readUBE32(fileHandle, &dummy)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bAllowCaptureRecord)
|
&& PHYSFS_readUBE32(fileHandle, &dummy)
|
||||||
&& PHYSFS_readUBE32(fileHandle, &serializeNetPlay->bAllowCapturePlay));
|
&& PHYSFS_readUBE32(fileHandle, &dummy));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GAME_SAVE_V7 \
|
#define GAME_SAVE_V7 \
|
||||||
|
|
Loading…
Reference in New Issue