Ejemplo n.º 1
0
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"
Ejemplo n.º 2
0
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"
Ejemplo n.º 3
0
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")
Ejemplo n.º 4
0
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")
Ejemplo n.º 5
0
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"))
Ejemplo n.º 6
0
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"))
Ejemplo n.º 7
0
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"))
Ejemplo n.º 8
0
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"))