Fix infinite loop when joining a game. An encode was supposed to be a decode.
Also remove some excess logging calls. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3755 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
eead0d470a
commit
d484e2bc98
|
@ -214,8 +214,6 @@ static BOOL NET_recvMessage(NETBUFSOCKET* bs, NETMSG* pMsg)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(LOG_NET, "NETrecvMessage: received message of type %i and size %i.", message->type, message->size);
|
|
||||||
|
|
||||||
memcpy(pMsg, message, size);
|
memcpy(pMsg, message, size);
|
||||||
bs->buffer_start += size;
|
bs->buffer_start += size;
|
||||||
bs->bytes -= size;
|
bs->bytes -= size;
|
||||||
|
@ -732,8 +730,6 @@ BOOL NETbcast(NETMSG *msg, BOOL guarantee)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(LOG_NET, "NETbcast");
|
|
||||||
|
|
||||||
msg->destination = NET_ALL_PLAYERS;
|
msg->destination = NET_ALL_PLAYERS;
|
||||||
msg->source = selectedPlayer;
|
msg->source = selectedPlayer;
|
||||||
|
|
||||||
|
@ -772,8 +768,6 @@ BOOL NETbcast(NETMSG *msg, BOOL guarantee)
|
||||||
// Check if a message is a system message
|
// Check if a message is a system message
|
||||||
BOOL NETprocessSystemMessage(NETMSG * pMsg)
|
BOOL NETprocessSystemMessage(NETMSG * pMsg)
|
||||||
{
|
{
|
||||||
debug(LOG_NET, "NETprocessSystemMessage with packet of type %hhu", pMsg->type);
|
|
||||||
|
|
||||||
switch (pMsg->type)
|
switch (pMsg->type)
|
||||||
{
|
{
|
||||||
case MSG_PLAYER_INFO: {
|
case MSG_PLAYER_INFO: {
|
||||||
|
@ -833,7 +827,7 @@ BOOL NETprocessSystemMessage(NETMSG * pMsg)
|
||||||
{
|
{
|
||||||
debug(LOG_NET, "NETprocessSystemMessage: Receiving game flags");
|
debug(LOG_NET, "NETprocessSystemMessage: Receiving game flags");
|
||||||
|
|
||||||
NETbeginEncode(MSG_GAME_FLAGS, NET_ALL_PLAYERS);
|
NETbeginDecode();
|
||||||
{
|
{
|
||||||
static unsigned int max_flags = sizeof(NetGameFlags) / sizeof(*NetGameFlags);
|
static unsigned int max_flags = sizeof(NetGameFlags) / sizeof(*NetGameFlags);
|
||||||
// Retrieve the amount of game flags that we should receive
|
// Retrieve the amount of game flags that we should receive
|
||||||
|
@ -1404,6 +1398,8 @@ BOOL NEThostGame(const char* SessionName, const char* PlayerName,
|
||||||
|
|
||||||
NETregisterServer(0);
|
NETregisterServer(0);
|
||||||
|
|
||||||
|
debug(LOG_NET, "Hosting a server. We are player %d.", NetPlay.dpidPlayer);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1587,7 +1583,8 @@ BOOL NETjoinGame(UDWORD gameNumber, const char* playername)
|
||||||
NETend();
|
NETend();
|
||||||
|
|
||||||
NetPlay.dpidPlayer = dpid;
|
NetPlay.dpidPlayer = dpid;
|
||||||
debug(LOG_NET, "NETjoinGame: I'm player %u", (unsigned int)NetPlay.dpidPlayer);
|
debug(LOG_NET, "NETjoinGame: MSG_ACCEPTED received. Accepted into the game - I'm player %u",
|
||||||
|
(unsigned int)NetPlay.dpidPlayer);
|
||||||
NetPlay.bHost = FALSE;
|
NetPlay.bHost = FALSE;
|
||||||
|
|
||||||
if (NetPlay.dpidPlayer >= MAX_CONNECTED_PLAYERS)
|
if (NetPlay.dpidPlayer >= MAX_CONNECTED_PLAYERS)
|
||||||
|
|
Loading…
Reference in New Issue