Пример #1
0
def showPlayers():
    coll = list(rwfb.openDB()["players"].find())
    for m in rwfb.openDB()["mobs"].find():
        coll.append(m)
    return Response(response=json_util.dumps(list(coll)),
        status=200,
        mimetype="application/json")
Пример #2
0
def main():
    db = rwfb.openDB()
    #print(rwfb.getAll(db))
    num = "845"#18007778888"
    print(rwfb.getTopTen(db))
    rwfb.createPlayer(db, num, "LeslieLanderTheReprimander")
    rwfb.createPlayer(db, "111", "HartogTheWarthog")
    rwfb.createPlayer(db, "12", "LeiYuAndTheGreatKazoo")
Пример #3
0
def textHandling():
    """Handling a text message."""
    db = rwfb.openDB()
    if request.method == "GET":
        return "HI"
    elif request.method == "POST":
        num = request.values.get("From", None)
        msg = request.values.get("Body", None).lower()
        if rwfb.query(db, num):
            return handleAction(db, num, msg)
        else:
            rwfb.createPlayer(db, num, "worm")
            resp = twilio.twiml.Response()
            resp.message("You've created an account with {} "
                         "under the name {}. Type '?' for a list of"
                         "commands".format(num, "worm"))
            return str(resp)
Пример #4
0
def main():
    db = rwfb.openDB()
    rwfb.createMonsters(db, NUM_MON)
Пример #5
0
def viewPlayer(number):
    db = rwfb.openDB()
    num = number  # "18007778888"
    return rwfb.getStats(db, num)
Пример #6
0
def showLeaders():
    players=rwfb.getTopTen(rwfb.openDB())
    return render_template('leaderboard.html', players=players)
Пример #7
0
def createPlayer(number):
    db = rwfb.openDB()
    num = number  # "18007778888"
    rwfb.createPlayer(db, num, "worm")
    return "Player Created"
Пример #8
0
def showPlayers2():
    players=rwfb.getAll(rwfb.openDB())
    return render_template('show_map.html', players=players)
Пример #9
0
def showPlayers(players = rwfb.getAll(rwfb.openDB())):
    #db = rwfb.openDB()
    #players = rwfb.getAll(db)
    return render_template('show_map.html', players=players)