8 print('wrong number of arguments, expected one (game file)')
10 game_file_name = sys.argv[1]
11 game = server_.game.Game(game_file_name)
12 if os.path.exists(game_file_name):
13 if not os.path.isfile(game_file_name):
14 print('game file name does not refer to a valid game file')
16 with open(game_file_name, 'r') as f:
18 for i in range(len(lines)):
20 print("FILE INPUT LINE %s: %s" % (i, line), end='')
21 game.io.handle_input(line, store=False)
23 game.io.handle_input('MAP_SIZE Y:5,X:5')
24 game.io.handle_input('TERRAIN_LINE 0 "xxxxx"')
25 game.io.handle_input('TERRAIN_LINE 1 "x...x"')
26 game.io.handle_input('TERRAIN_LINE 2 "x.X.x"')
27 game.io.handle_input('TERRAIN_LINE 3 "x...x"')
28 game.io.handle_input('TERRAIN_LINE 4 "xxxxx"')
29 game.io.handle_input('THING_TYPE 0 human')
30 game.io.handle_input('THING_POS 0 Y:3,X:3')
31 game.io.handle_input('THING_TYPE 1 monster')
32 game.io.handle_input('THING_POS 1 Y:1,X:1')
33 game.io.run_loop_with_server()