diff --git a/pymaster.py b/pymaster.py index e97c154..7e2bde3 100755 --- a/pymaster.py +++ b/pymaster.py @@ -126,8 +126,8 @@ class PyMaster: clver = v elif k == 'protocol': protocol = int(v) - elif k == 'key': # defined but not implemented yet - key = v + elif k == 'key': + key = int(v, 16) # somebody is playing :) elif k == 'thisismypcid' or k == 'heydevelopersifyoureadthis': self.fakeInfoForOldVersions(gamedir, addr) @@ -142,6 +142,10 @@ class PyMaster: return packet = MasterProtocol.queryPacketHeader + + if key != None: + packet += b'\x7F' + pack(' i.die: self.serverList.remove(i) @@ -161,9 +165,6 @@ class PyMaster: data = ('\xff\xff\xff\xffc %s:%d' % (addr[0], addr[1])).encode('latin_1') self.sock.sendto(data, i.addr) - if key: - packet += b"\x7f" + key.encode('latin_1') - # Use pregenerated address string packet += i.queryAddr packet += b'\0\0\0\0\0\0' # Fill last IP:Port with \0