Exemple #1
0
    #print str(Globals.TIMERS)

    ## Server Loop
    while SERVER_RUN:
        telnet_server.poll()        ## Send, Recv, and look for new connections

        kick_idle()     ## Check for idle clients
     
        currentTime = time.time()
        deltaTime = (currentTime - startupTime) - lastTime
        # print "last " + str(lastTime)
        # print "cur+start " + str((currentTime-startupTime))
        # print "del " + str(deltaTime)
        for timer in Globals.TIMERS:
            timer.tick(deltaTime)
        for timer in Globals.MoveTIMERS:
            timer.tick(deltaTime)
        lastTime = (currentTime - startupTime)

        engineState = Engine.process_clients(SERVER_RUN, OPList, CLIENT_LIST, CLIENT_DATA)           ## Check for client input, saving any state changes generated by the engine to 'engineState'
        if engineState == 'shutdown':
            #print engineState
            SysInit.dataSave(CLIENT_LIST, CLIENT_DATA, TIMERS)
            RoomInit.saveAllRooms()
            MobInit.saveMobs()
            Objects.saveEq()
            SERVER_RUN = False

    print("<< Server shutdown.")