* Port the NET_PLAYERRESPONDING functions over to the new networking API

Patch #932 by Buginator with some stylistic changes by me


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3425 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-01-09 23:42:35 +00:00
parent 7560894e4c
commit 69f87c9bed
3 changed files with 24 additions and 14 deletions

View File

@ -2007,7 +2007,6 @@ static void processMultiopWidgets(UDWORD id)
void frontendMultiMessages(void)
{
NETMSG msg; // a blank msg.
UDWORD i;
while(NETrecv(&msg))
{
@ -2071,10 +2070,17 @@ void frontendMultiMessages(void)
break;
}
case NET_PLAYERRESPONDING: // remote player is now playing.
NetGet((&msg),0,i);
ingame.JoiningInProgress[i] = FALSE;
break;
{
uint32_t player_id;
NETbeginDecode();
// the player that has just responded
NETuint32_t(&player_id);
NETend();
ingame.JoiningInProgress[player_id] = FALSE;
break;
}
case NET_FIREUP: // campaign game started.. can fire the whole shebang up...
if(ingame.localOptionsReceived)
{

View File

@ -876,8 +876,6 @@ static BOOL campInit(void)
// say hi to everyone else....
void playerResponding(void)
{
NETMSG msg;
ingame.startTime = gameTime;
ingame.localJoiningInProgress = FALSE; // No longer joining.
ingame.JoiningInProgress[selectedPlayer] = FALSE;
@ -886,11 +884,9 @@ void playerResponding(void)
cameraToHome(selectedPlayer, FALSE);
// Tell the world we're here
NetAdd(msg,0,selectedPlayer);
msg.size = sizeof(UDWORD);
msg.type = NET_PLAYERRESPONDING;
NETbcast(&msg,TRUE);
NETbeginEncode(NET_PLAYERRESPONDING, NET_ALL_PLAYERS);
NETuint32_t(&selectedPlayer);
NETend();
}
// ////////////////////////////////////////////////////////////////////////////

View File

@ -615,7 +615,6 @@ Vector3i cameraToHome(UDWORD player,BOOL scroll)
BOOL recvMessage(void)
{
NETMSG msg;
UDWORD a;
while(NETrecv(&msg) == TRUE) // for all incoming messages.
{
@ -753,9 +752,18 @@ BOOL recvMessage(void)
recvVersionCheck(&msg);
break;
case NET_PLAYERRESPONDING: // remote player is now playing
NetGet((&msg),0,a);
ingame.JoiningInProgress[a] = FALSE; // player is with us!
{
uint32_t player_id;
NETbeginDecode();
// the player that has just responded
NETuint32_t(&player_id);
NETend();
// This player is now with us!
ingame.JoiningInProgress[player_id] = FALSE;
break;
}
case NET_COLOURREQUEST:
recvColourRequest(&msg);
break;