diff --git a/gamespy_gamestats_server.py b/gamespy_gamestats_server.py index ed986d3..0e0835d 100644 --- a/gamespy_gamestats_server.py +++ b/gamespy_gamestats_server.py @@ -285,7 +285,7 @@ class Gamestats(LineReceiver): profile_data = None - if 'data' in profile: + if profile != None and 'data' in profile: profile_data = gs_query.parse_gamespy_message("\\prof\\" + profile['data'] + "\\final\\") if profile_data != None: diff --git a/gamespy_natneg_server.py b/gamespy_natneg_server.py index f9664f3..f3f1818 100644 --- a/gamespy_natneg_server.py +++ b/gamespy_natneg_server.py @@ -152,11 +152,11 @@ class GameSpyNatNegServer(object): logger.log(logging.DEBUG, "Received connected command from %s:%s..." % (addr[0], addr[1])) if gameid not in self.session_list: - pass + continue if session_id not in self.session_list[gameid]: - pass + continue if client_id not in self.session_list[gameid][session_id]: - pass + continue self.session_list[gameid][session_id][client_id]['connected'] = True diff --git a/gamespy_qr_server.py b/gamespy_qr_server.py index 163e0f7..e44bd74 100644 --- a/gamespy_qr_server.py +++ b/gamespy_qr_server.py @@ -252,7 +252,7 @@ class GameSpyQRServer(object): self.sessions[session_id].sent_challenge = True - if k['publicip'] == "0": #and k['dwc_hoststate'] == "2": # When dwc_hoststate == 2 then it doesn't send an IP, so calculate it ourselves + if 'publicip' in k and k['publicip'] == "0": #and k['dwc_hoststate'] == "2": # When dwc_hoststate == 2 then it doesn't send an IP, so calculate it ourselves if self.sessions[session_id].console != 0: k['publicip'] = str(ctypes.c_int32(utils.get_int_be(bytearray([int(x) for x in address[0].split('.')]), 0)).value) # Wii else: