Example #1
0
    def __init__(self, **kwargs):
        kwargs.update(
            caption=G.APP_NAME,
        )

#        G.delayed_inits()

        super(Window, self).__init__(
            G.WINDOW_WIDTH, G.WINDOW_HEIGHT, **kwargs)

        G.delayed_inits()

        self.exclusive = False
        self.reticle = None
        self.controller = None
        controller = MainMenuController(self)
        self.switch_controller(controller)

        if G.FULLSCREEN:
            self.set_fullscreen()
        self.total_fps = 0.0
        self.iterations = 0
        pyglet.clock.schedule_interval(self.update, 1.0 / G.MAX_FPS)

        if G.FOG_ENABLED:
            self.enableFog()
Example #2
0
    # start server timer
    G.main_timer = timer.Timer(G.TIMER_INTERVAL, name="G.main_timer")
    G.main_timer.start()

    return server, server_thread


if __name__ == '__main__':
    #TODO: Enable server launch options
    #In the mean time, manually set
    setattr(G.LAUNCH_OPTIONS, "seed", None)
    G.SAVE_FILENAME = "world"

    load_modules(server=True)

    G.delayed_inits()

    server, server_thread = start_server()
    print('Server loop running in thread: ' + server_thread.name)

    ip, port = server.server_address
    print "Listening on",ip,port

    helptext = "Available commands: " + ", ".join(["say", "stop", "save"])
    while 1:
        args = raw_input().replace(chr(13), "").split(" ")  # On some systems CR is appended, gotta remove that
        cmd = args.pop(0)
        if cmd == "say":
            msg = "Server: %s" % " ".join(args)
            print msg
            for player in server.players.itervalues():
Example #3
0
    # start server timer
    G.main_timer = timer.Timer(G.TIMER_INTERVAL, name="G.main_timer")
    G.main_timer.start()

    return server, server_thread


if __name__ == '__main__':
    #TODO: Enable server launch options
    #In the mean time, manually set
    setattr(G.LAUNCH_OPTIONS, "seed", None)
    G.SAVE_FILENAME = "world"

    load_modules(server=True)

    G.delayed_inits()

    server, server_thread = start_server()
    print('Server loop running in thread: ' + server_thread.name)

    ip, port = server.server_address
    print "Listening on", ip, port

    helptext = "Available commands: " + ", ".join(["say", "stop", "save"])
    while 1:
        args = raw_input().replace(chr(13), "").split(
            " ")  # On some systems CR is appended, gotta remove that
        cmd = args.pop(0)
        if cmd == "say":
            msg = "Server: %s" % " ".join(args)
            print msg