def target(): if 'username' in session: print "AFTER LOAD GAME" uid = base.getID(session['username']) mylat = request.args.get('mylat') mylong = request.args.get('mylng') ##replace and run base.updateLat(uid, mylat) #will upload into mongo base.updateLong(uid, mylong) base.printData() return "hi"
def target(): if 'username' in session: print "AFTER LOAD GAME" uid = base.getID(session['username']) mylat = request.args.get('mylat') mylong = request.args.get('mylng') ##replace and run base.updateLat (uid, mylat) #will upload into mongo base.updateLong (uid, mylong) base.printData() return "hi"
def index(): print "Game oN?" print base.gameONcheck() print "Users" base.printUsers() print "Data" base.printData() print base.gameONcheck() if 'username' in session: return render_template("index.html", corner=session['username']) return render_template("index.html")
def index(): print"Game oN?" print base.gameONcheck() print "Users" base.printUsers() print "Data" base.printData() print base.gameONcheck() if 'username' in session: return render_template ("index.html", corner = session['username']) return render_template ("index.html")
def game(): if 'username' in session: if base.gameONcheck(): print "BEFORE UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) if (base.checkStatus(uid)): return render_template("game.html", corner=session['username'], username=session['username'], target=base.getName(tid)) else: flash("You have been killed", "error") return redirect(url_for("index")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def game(): if 'username' in session: if base.gameONcheck(): print "BEFORE UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) if (base.checkStatus(uid)): return render_template ("game.html", corner = session['username'], username = session['username'], target = base.getName(tid)) else: flash ("You have been killed", "error") return redirect (url_for ("index")) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def status(): if 'username' in session: if base.gameONcheck(): print "AFTER UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) print tid u = base.checkStatus(uid) t = base.checkStatus(tid) us = "" ts = "" if (u): us = "Alive" else: flash("You have been killed", "error") return redirect(url_for("index")) #us = "Dead" if (t): ts = "Alive" else: #flash ("Sorry, you have been killed") #return redirect (url_for("index")) ts = "Dead" #print u #print t return render_template("status.html", corner=session['username'], user_status=us, target_status=ts) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))
def status (): if 'username' in session: if base.gameONcheck(): print "AFTER UPDATE" base.printData() uid = base.getID(session['username']) tid = base.getTargetID(uid) print tid u = base.checkStatus(uid) t = base.checkStatus(tid) us = "" ts = "" if (u): us = "Alive" else: flash ("You have been killed", "error") return redirect (url_for("index")) #us = "Dead" if (t): ts = "Alive" else: #flash ("Sorry, you have been killed") #return redirect (url_for("index")) ts = "Dead" #print u #print t return render_template ("status.html", corner = session['username'], user_status = us, target_status = ts) else: flash("Anathema has yet to begin", "error") return redirect(url_for("index")) else: flash("You are not logged in", "error") return redirect(url_for("index"))