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("]","") titlelist = titlelist.replace("\"","") titlelist = titlelist.replace(" ","") return titlelist return found def sendPrivMsg(self, fromUsername, toUsername, message): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username.lower() == toUsername.lower(): player.sendRecievePrivMsg(fromUsername, message) found = True return found def disconnectPlayer(self, username): found = False for room in self.rooms.itervalues(): for player in room.clients.itervalues(): if player.username == username: room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [player.playerCode]) room.removeClient(player) player.close() found = True print '%s disconnected' % (player.username) break return found def banPlayer(self, username, time, reason, modname): found = False time = int(time) for room in self.rooms.itervalues(): for playerCode, client