From ec3410c8c2138b4341cf4630aebae7ffd2a2bec0 Mon Sep 17 00:00:00 2001 From: polaris Date: Thu, 17 Apr 2014 16:55:33 -0400 Subject: [PATCH] Small tweaks, nothing major --- gamespy/gs_database.py | 6 +++++- gamespy_gamestats_server.py | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gamespy/gs_database.py b/gamespy/gs_database.py index 743f7b1..c38ed5e 100644 --- a/gamespy/gs_database.py +++ b/gamespy/gs_database.py @@ -28,7 +28,7 @@ class GamespyDatabase(object): # but I'm not good with databases and I'm not 100% positive that, for instance, that all # user id's will be ints, or all passwords will be ints, etc, despite not seeing any # evidence yet to say otherwise as far as Nintendo DS games go. - q = "CREATE TABLE users (profileid INT, userid TEXT, password TEXT, gsbrcd TEXT, email TEXT, uniquenick TEXT, pid TEXT, lon TEXT, lat TEXT, loc TEXT, firstname TEXT, lastname TEXT, stat TEXT, partnerid TEXT, console INT, csnum TEXT, cfc TEXT, bssid TEXT, devname TEXT, birth TEXT, gameid TEXT)" + q = "CREATE TABLE users (profileid INT, userid TEXT, password TEXT, gsbrcd TEXT, email TEXT, uniquenick TEXT, pid TEXT, lon TEXT, lat TEXT, loc TEXT, firstname TEXT, lastname TEXT, stat TEXT, partnerid TEXT, console INT, csnum TEXT, cfc TEXT, bssid TEXT, devname TEXT, birth TEXT, gameid TEXT, enabled INT)" logger.log(-1, q) c.execute(q) @@ -48,6 +48,10 @@ class GamespyDatabase(object): logger.log(-1, q) c.execute(q) + q = "CREATE TABLE gameinfo (profileid INT, dindex TEXT, ptype TEXT, data TEXT)" + logger.log(-1, q) + c.execute(q) + self.conn.commit() def get_dict(self, row): diff --git a/gamespy_gamestats_server.py b/gamespy_gamestats_server.py index 0fa107b..c603153 100644 --- a/gamespy_gamestats_server.py +++ b/gamespy_gamestats_server.py @@ -90,7 +90,6 @@ class Gamestats(LineReceiver): msg = self.crypt(msg) self.transport.write(bytes(msg)) - pass def connectionLost(self, reason): return @@ -205,9 +204,8 @@ class Gamestats(LineReceiver): birth = "" valid_user = self.db.check_user_exists(userid, gsbrcd) - if valid_user == False: - profileid = self.db.create_user(userid, password, email, uniquenick, gsbrcd, console, csnum, cfc, bssid, devname, birth, gameid) - else: + profileid = None + if valid_user: profileid = self.db.perform_login(userid, password, gsbrcd) if profileid == None: @@ -232,6 +230,9 @@ class Gamestats(LineReceiver): msg = self.crypt(msg) self.transport.write(bytes(msg)) + else: + # Return error + pass def perform_ka(self, data_parsed): msg_d = []