Use network byte order for struct unpacking on the lobby server (rather than native byte ordering)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3666 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
4a77f3d8b0
commit
748adec208
|
@ -121,7 +121,7 @@ class Game:
|
||||||
def setData(self, d):
|
def setData(self, d):
|
||||||
""" decode the c-structure from the server into local varialbles"""
|
""" decode the c-structure from the server into local varialbles"""
|
||||||
(self.description, self.size, self.flags, self.host, self.maxPlayers, self.currentPlayers,
|
(self.description, self.size, self.flags, self.host, self.maxPlayers, self.currentPlayers,
|
||||||
self.user1, self.user2, self.user3, self.user4 ) = struct.unpack("64sII16sIIIIII", d)
|
self.user1, self.user2, self.user3, self.user4 ) = struct.unpack("!64sII16sIIIIII", d)
|
||||||
self.description=self.description.strip("\x00")
|
self.description=self.description.strip("\x00")
|
||||||
self.host=self.host.strip("\x00")
|
self.host=self.host.strip("\x00")
|
||||||
logging.debug("Game: %s %s %s %s" % ( self.host, self.description, self.maxPlayers, self.currentPlayers))
|
logging.debug("Game: %s %s %s %s" % ( self.host, self.description, self.maxPlayers, self.currentPlayers))
|
||||||
|
|
Loading…
Reference in New Issue