-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_warserver.py
executable file
·35 lines (31 loc) · 1.14 KB
/
start_warserver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import argparse
from core import game_state, engine_turns, engine_artemis, engine_rpc, artemis_connector
try:
from core import pyro_connector
PYRO = True
except ImportError:
PYRO = False
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Starts the Artemis WarServer.')
parser.add_argument('--load', '-l', type=open, metavar='FILE', help='Load saved game or scenario from file')
#parser.add_argument('--headless', action='store_true', help='run without a gui')
parser.add_argument('--pyro_nameserver', type=str, help='connect to an existing pyto nameserver')
args = parser.parse_args()
print("starting warserver")
game = game_state.create_game(args.load)
print("starting warserver in headless mode")
if game.turn.remaining:
engine_turns.start(game.turn.remaining)
else:
engine_turns.start_default_game()
#print(game)
artemis_connector.start_server()
if PYRO:
if args.pyro_nameserver:
pyro_connector.start_server(args.pyro_nameserver)
else:
pyro_connector.start_server()
else:
print("module Pyro4 not found. Running without Pyro server")
print("everything is up and running")