core.py 428 B

12345678910111213141516171819
  1. import yaml
  2. import _thread
  3. from . import server
  4. import time
  5. def main_loop():
  6. for player in list(server.players.values()):
  7. player.update()
  8. time.sleep(100)
  9. if __name__ == '__main__':
  10. config = yaml.load(open("config/game.yaml"))['game']
  11. def run(*args):
  12. server.run_server(config)
  13. print("Websocket thread terminated.")
  14. _thread.start_new_thread(run, ())
  15. while 1:
  16. main_loop()