remove open leaderboard functionality

made obsolete by 8ad6ae21e3
This commit is contained in:
Yannik Schmidt
2020-06-17 14:28:09 +02:00
parent 31c5167258
commit 4aae81a950
2 changed files with 0 additions and 58 deletions

View File

@@ -63,37 +63,3 @@ def savePlayerToDatabase(player, incrementWins=0):
def saveMultiplePlayersToDatabase(playerList, incrementWins=0):
for p in playerList:
savePlayerToDatabase(p, incrementWins)
## open leaderboard functions ##
def findPlayerByName(playerName):
conn = sqlite3.connect(DATABASE)
cursor = conn.cursor()
playerNamePrepared = "%{}%".format(playerName.replace("%", "%%"))
cursor.execute("SELECT * FROM players WHERE name == ?", (playerName,))
rows = cursor.fetchall()
playerRow = None
if len(rows) < 1:
cursor.execute("SELECT * FROM players WHERE name LIKE ?", (playerNamePrepared,))
rows = cursor.fetchall()
if len(rows) < 1:
return None
playerRow = rows[0]
else:
playerRow = rows[0]
playerId, playerName, lastGame, wins, mu, sigma, games = playerRow
conn.close()
return Players.PlayerInDatabase(playerId, playerName,
trueskill.newRating(mu=mu, sigma=sigma), wins, games)
def getTotalEntries(playerName):
conn = sqlite3.connect(DATABASE)
cursor = conn.cursor()
playerNamePrepared = "%{}%".format(playerName.replace("%", "%%"))
cursor.execute("select count(*) from players")
count = cursor.fetchone()
conn.close()
return count
def getRankRange(start, end):
pass