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 = "" look = "0,0,0,0,0" shopcheese = 5000 isdrawer = 0 dbcur.execute("insert into users (name, password, id, privlevel, saves, shamcheese, first, cheese, rounds, titlelist, tribe, currenttitle, shop, friends, look, shopcheese, isdrawer) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (name, password, playerid, privlevel, saves, shamcheese, first, cheese, rounds, titlelist, tribe, currenttitle, shop, friends, look, shopcheese, isdrawer)) def getMapName(self, code): try: dbcur.execute('select name from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] except: dbcur2.execute('select name from mapeditor where code = ?', [code]) rrf = dbcur2.fetchone() if