perform endian swapping for MSG_PLAYER_INFO messages;

NOTE: reverting r3669 (or re-applying r3643) would be better, though unfortunately it doesn't work...

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3729 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-02-09 18:29:58 +00:00
parent e11b841e68
commit 65a3ff6a8b
1 changed files with 12 additions and 1 deletions

View File

@ -261,9 +261,15 @@ static void NET_InitPlayers(void)
static void NETBroadcastPlayerInfo(int dpid)
{
NET_PLAYER* player = (NET_PLAYER*)message.body;
message.type = MSG_PLAYER_INFO;
message.size = sizeof(NET_PLAYER);
memcpy(message.body, &players[dpid], sizeof(NET_PLAYER));
player->id = SDL_SwapBE32(player->id);
player->flags = SDL_SwapBE32(player->flags);
NETbcast(&message, TRUE);
}
@ -788,7 +794,12 @@ BOOL NETprocessSystemMessage(NETMSG * pMsg)
{
case MSG_PLAYER_INFO: {
NET_PLAYER* pi = (NET_PLAYER*)(pMsg->body);
int dpid = pi->id;
unsigned int dpid;
pi->id = SDL_SwapBE32(pi->id);
pi->flags = SDL_SwapBE32(pi->flags);
dpid = pi->id;
debug(LOG_NET, "NETprocessSystemMessage: Receiving MSG_PLAYER_INFO for player %d", dpid);