Пример #1
0
def game():
	if "player" not in session:#player never logged in
		return redirect(url_for("index"))
	elif db.getplayer(session["player"]) == False:#player never logged back in after the last game ended
		return redirect(url_for("index"))
	elif db.inprogress():
		if int(db.getplayer(session["player"])[2]) < 4:#checks if the player was one of the first 4 to log in
			return render_template("gamepage.html", playing = True, game = (db.getgame())[0], _map = (db.getgame())[1], player=session["player"])
		else:
			return render_template("gamepage.html", playing = False, game = (db.getgame())[0], _map = (db.getgame())[1], player=session["player"])
	else:
		return redirect(url_for("playlist"))#redirects to playlist if the game's not set up yet.
Пример #2
0
def getMap():
	return str((db.getgame())[1]) #sends map number