def on_player_leave(addr):
    print jgsapi.pretty_ip(addr), "left app"
    player = Turret.instances.get(addr, None)
    Turret.instances.pop(addr, None)
    if player != None:
        player.delete()
    queue.append({"type": "repositionTurrets", "addr": addr})
Beispiel #2
0
def on_player_join(addr):
    print jgsapi.pretty_ip(addr), "joined app"
    accel_counter[addr] = 0
    jiro.switchController("color", addr)
    queue.append({"type": "createPlayer", "addr": addr})

    change_back = False
    for addr in Player.instances.keys():
        if jiro.getPlayerControllerName(addr) in ["waitstart", "startgame"]:
            change_back = True
            break

    if change_back:
        for addr in Player.instances.keys():
            if jiro.getPlayerControllerName(addr) in [
                    "waitstart", "startgame"
            ]:
                jiro.switchController("wait", addr)
Beispiel #3
0
def cleanup():
    window.close()
    pyglet.app.exit()
    with open("accel_count.txt", "a") as f:
        for person in accel_counter:
            f.write(
                jgsapi.pretty_ip(person) + " " + jiro.getPlayerName(person) +
                " " + str(accel_counter[person]) + "\n")
    print "Podium Bounce server stopped!"
Beispiel #4
0
def on_player_leave(addr):
    print jgsapi.pretty_ip(addr), "left app"
    player = Player.instances.get(addr, None)
    if player != None:
        player.delete()
    Player.instances.pop(addr, None)
    scoreboard.removePlayer(addr)

    change = True
    for target in Player.instances:
        if jiro.getPlayerControllerName(target) == "color":
            change = False
            break

    if change:
        i = 0
        for target in Player.instances:
            if i == 0:
                jiro.switchController("startgame", target)
            else:
                jiro.switchController("waitstart", target)
            i += 1
Beispiel #5
0
def on_player_leave(addr):
    print jgsapi.pretty_ip(addr), "left app"
    queue.append({"type": "destroyPlayer", "addr": addr})
Beispiel #6
0
def on_player_join(addr):
    print jgsapi.pretty_ip(addr), "joined app"
    jiro.switchController("ball", addr)
    queue.append({"type": "createPlayer", "addr": addr})
def on_player_leave(addr):
    print jgsapi.pretty_ip(addr), "left app"
    player = Ball.instances.get(addr, None)
    if player != None:
        player.delete()
    Ball.instances.pop(addr, None)