Exemplo n.º 1
0
 def _load(self, data):
     (self.playerId,
     self.channelId,
     self.masterId,
     playerNameSize) = unpack_from('<IIII', data)
     self.playerName = unpack_string(data, playerNameSize, 16)
     offset = 16 + playerNameSize
     playerIpSize, = unpack_from('<I', data, offset)
     offset += 4
     self.playerIp = unpack_string(data, playerIpSize, offset)
     offset += playerIpSize
     return offset
Exemplo n.º 2
0
 def _load(self, data):
     (self.playerId,
     playerNameSize) = unpack_from('<II', data)
     self.playerName = unpack_string(data, playerNameSize, 8)
     offset = 8 + playerNameSize
     otherPlayerId, otherNameSize = unpack_from('<II', data, offset)
     offset += 8
     otherPlayerName = unpack_string(data, otherNameSize, offset)
     offset += otherNameSize
     if (self.playerName != otherPlayerName or
         self.playerId != otherPlayerId):
         raise NotImplementedError
         
     return offset
Exemplo n.º 3
0
 def _load(self, data):
     (self.subchannel,
     self.channelId,
     self.playerId,
     messageSize) = unpack_from('<HIII', data)
     
     message = Message(**self.settings)
     message.load(unpack_string(data, messageSize, 14))
     self.message = message
     
     return 14 + messageSize
Exemplo n.º 4
0
 def _load(self, data):
     nameSize, = unpack_from('<I', data)
     self.newName = unpack_string(data, nameSize, 4)
     return 4 + nameSize
Exemplo n.º 5
0
 def _load(self, data):
     channelSize, = unpack_from('<I', data)
     self.channelName = unpack_string(data, channelSize, 4)
     
     return 4 + channelSize
Exemplo n.º 6
0
 def _load(self, data):
     (self.majorVersion,
     self.minorVersion,
     nameSize) = unpack_from('<BBI', data)
     self.playerName = unpack_string(data, nameSize, 6)
     return 6 + nameSize
Exemplo n.º 7
0
 def _load(self, data):
     motdSize, = unpack_from('<I', data)
     self.motd = unpack_string(data, motdSize, 4)
     return 4 + motdSize