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