Merge pull request #63 from SMTDDR/master

Support PAL/NTSC or international or something...
This commit is contained in:
polaris-
2014-09-01 19:19:13 -04:00
2 changed files with 8 additions and 0 deletions

View File

@@ -324,6 +324,11 @@ class GameSpyQRServer(object):
be = self.sessions[session_id].console != 0
k['publicip'] = str(utils.get_ip(bytearray([int(x) for x in address[0].split('.')]), 0, be))
if 'publicport' in k and 'localport' in k and k['publicport'] != k['localport']:
self.log(logging.DEBUG, address, "publicport %s doesn't match localport %s, so changing publicport to %s..." \
% (k['publicport'], k['localport'], str(address[1])))
k['publicport'] = str(address[1])
if "statechanged" in k:
if k['statechanged'] == "2": # Close server
self.server_manager.delete_server(k['gamename'] , session_id)

View File

@@ -75,6 +75,9 @@ def base32_encode(num, reverse=True):
encoded += alpha[num & 0x1f]
num = num >> 5
while len(encoded) < 9:
encoded += "0"
if reverse == True:
encoded = encoded[::-1] # Reverse string