-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
81 lines (78 loc) · 2.09 KB
/
main.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Please do not modify this file.
# Instead have a look at `README.md` for how to start writing you AI.
import argparse
from joueur.run import run
parser = argparse.ArgumentParser(
description=
'Runs the python client with options. Must provide a game name to play on the server.'
)
parser.add_argument(
'game',
action='store',
help='the name of the game you want to play on the server')
parser.add_argument(
'-s',
'--server',
action='store',
dest='server',
default='localhost',
help='the hostname or the server you want to connect to e.g. locahost:3000')
parser.add_argument(
'-p',
'--port',
action='store',
dest='port',
default=3000,
help=
'the port to connect to on the server. Can be defined on the server arg via server:port'
)
parser.add_argument(
'-n',
'--name',
action='store',
dest='name',
help=
'the name you want to use as your AI\'s player name. This over-rides the name you set in your code'
)
parser.add_argument(
'-i',
'--index',
action='store',
dest='index',
help='the player number you want to be, with 0 being the first player')
parser.add_argument(
'-w',
'--password',
action='store',
dest='password',
default=None,
help='the password required for authentication on official servers')
parser.add_argument(
'-r',
'--session',
action='store',
dest='session',
default='*',
help='the requested game session you want to play on the server')
parser.add_argument(
'--gameSettings',
action='store',
dest='game_settings',
default=None,
help=
'Any settings for the game server to force. Must be query string formatted (key=value&otherKey=otherValue)'
)
parser.add_argument(
'--aiSettings',
action='store',
dest='ai_settings',
default=None,
help=
'Any settings for the AI. Delimit pairs by an ampersand (key=value&otherKey=otherValue)'
)
parser.add_argument(
'--printIO',
action='store_true',
dest='print_io',
help='(debugging) print IO through the TCP socket to the terminal')
run(parser.parse_args())