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 rrf is None: return -1 else: return rrf[0] def getMapXML(self, code): try: dbcur.execute('select mapxml from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] except: dbcur2.execute('select mapxml from mapeditor where code = ?', [code]) rrf = dbcur2.fetchone() if rrf is None: return -1 else: return rrf[0] def getMapYesVotes(self, code): dbcur.execute('select yesvotes from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getMapNoVotes(self, code): dbcur.execute('select novotes from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getMapPerma(self, code): dbcur.execute('select perma from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getMapDel(self, code): dbcur.execute('select deleted from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getProfileTitle(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.titleNumber return found def getProfileTribe(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.tribe return found def getProfileSaves(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.micesaves return found def getProfileShamanCheese(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.shamancheese return found def getProfileFirstCount(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.firstcount return found def getProfileCheeseCount(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: found = player.cheesecount return found def getProfileTitleList(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: titlelist = player.titleList titlelist = json.dumps(titlelist) titlelist = titlelist.replace("[","") titlelist = titlelist.replace("]","")