Пример #1
0
def endgame():
	if request.args.get("gameover", False) == True:
		db.closegame()
Пример #2
0
@app.route("/placeMacguffin", methods=["GET","POST"])
def placeMacguffin():
	db.addmacguffin(float(request.args.get("x", -1)), float(request.args.get("y", -1)))#gets macg's coordinates

@app.route("/removeMacguffin", methods=["GET","POST"])
def removeMacguffin():
	db.remmacguffin(float(request.args.get("x", -1)), float(request.args.get("y", -1)))#gets macg's coordinates

@app.route("/updateMacguffins", methods=["GET","POST"])
def updateMacguffins():
	return json.dumps(db.retmacguffin())#gets macgs' coordinates

@app.route("/endgame", methods=["GET","POST"])
def endgame():
	if request.args.get("gameover", False) == True:
		db.closegame()

@app.route("/getSelf", methods=["GET","POST"])
def getSelf():
	return str(session["player"])

@app.route("/logout", methods=["GET","POST"])
def logout():
	return str(logout(str(session["player"])))

if __name__=="__main__":
    db.startup()
    db.closegame()
    app.run(host="0.0.0.0", port=6399)#port#?