mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-09-12 21:25:23 -05:00
Merge pull request #63 from SMTDDR/master
Support PAL/NTSC or international or something...
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user