if rrf is None: return -1 else: return rrf[0] def getCheeseCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select cheese from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getRoundsCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select rounds from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTitleList(self, username): if username.startswith("*"): return "[]" else: dbcur.execute('select titlelist from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTribeRank(self, username): if username.startswith("*"): return "" else: dbcur.execute('select triberank from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getDrawer(self, username): if username.startswith("*"): return "" else: dbcur.execute('select isdrawer from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTribeUsers(self, tribe): username = tribe if username.startswith("*"): return "" else: dbcur.execute('select users from tribes where name = ?', [tribe]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTribeName(self, username): if username.startswith("*"): return "" else: dbcur.execute('select tribe from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] #self.tribe = self.server.getTribeName(username) #self.tribeName = self.server.getTribeName(username) #self.tribeGreeting = self.server.getTribeGreeting(self.tribeName) #self.tribeSettings = self.server.getTribeSettings(self.tribeName) #self.tribeRank = self.server.getTribeRank(username) def getTribeGreeting(self, tribe): username = tribe if username.startswith("*"): return "" else: dbcur.execute('select greeting from tribes where name = ?', [tribe]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTribeSettings(self, tribe): username = tribe if username.startswith("*"): return "" else: dbcur.execute('select options from tribes where name = ?', [tribe]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getCurrentTitle(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select currenttitle from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getUserShop(self, username): if username.startswith("*"): return "" else: dbcur.execute('select shop from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getUserFriends(self, username): if username.startswith("*"): return "" else: dbcur.execute('select friends from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getUserLook(self, username): if username.startswith("*"): return "0,0,0,0,0" else: dbcur.execute('select look from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getShopCheese(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select shopcheese from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def checkExistingUsers(self, username): dbcur.execute('select name from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return 0 else: return 1 def createAccount(self, username, passwordHash): name = username password = passwordHash playerid = "1" privlevel = 1 saves = 0 shamcheese = 0 first = 0 cheese = 0 rounds = 0 titlelist = ["0"] titlelist = json.dumps(titlelist) tribe = "" currenttitle = 0 shop = "" friends = ""