* 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-861f7616d084master
parent
7560894e4c
commit
69f87c9bed
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue