Correct marshalling of peers

This commit is contained in:
simon.kagstrom 2009-03-28 11:32:59 +00:00
parent 2536022038
commit 61108c59a0
2 changed files with 6 additions and 1 deletions

View File

@ -704,6 +704,11 @@ bool Network::DeMarshalData(NetworkUpdate *p)
case STOP:
/* Nothing to do, just bytes */
break;
case SELECT_PEER:
{
NetworkUpdateSelectPeer *sp = (NetworkUpdateSelectPeer *)p->data;
sp->server_id = ntohl(sp->server_id);
} break;
case LIST_PEERS:
{
NetworkUpdateListPeers *lp = (NetworkUpdateListPeers *)p->data;

View File

@ -66,7 +66,7 @@ class SelectPeerPacket(Packet):
def demarshal_from_data(self, data):
"""Create a new packet from raw data."""
Packet.demarshal_from_data(self, data)
self.server_id = struct.unpack("<L", data[8:12])[0]
self.server_id = struct.unpack(">L", data[8:12])[0]
def get_id(self):
return self.server_id