1 | ###
|
---|
2 | # Example gamereport declaration (excludes most non-critical stats).
|
---|
3 | ###
|
---|
4 | gamereport =
|
---|
5 | {
|
---|
6 | 'playerStates':
|
---|
7 | {
|
---|
8 | 'joshua@lobbydev.wildfiregames.com/0ad': 'defeated',
|
---|
9 | 'josh@lobbydev.wildfiregames.com/0ad': 'won'
|
---|
10 | },
|
---|
11 | 'civs':
|
---|
12 | {
|
---|
13 | 'joshua@lobbydev.wildfiregames.com/0ad': 'ptol',
|
---|
14 | 'josh@lobbydev.wildfiregames.com/0ad': 'iber'
|
---|
15 | },
|
---|
16 | 'timeElapsed': '6000',
|
---|
17 | 'teams':
|
---|
18 | {
|
---|
19 | 'joshua@lobbydev.wildfiregames.com/0ad': '-1',
|
---|
20 | 'josh@lobbydev.wildfiregames.com/0ad': '-1'
|
---|
21 | },
|
---|
22 | }
|
---|
23 |
|
---|
24 | ###
|
---|
25 | # Example gamereport access (tested on lobbydev bot).
|
---|
26 | ###
|
---|
27 |
|
---|
28 | # Get a list of player JIDs to use as indicies.
|
---|
29 | players = list(gamereport['teams'].keys())
|
---|
30 |
|
---|
31 | # We don't know their actual player number, but we use some for convinience.
|
---|
32 | player1 = players[0]
|
---|
33 | player2 = players[1]
|
---|
34 |
|
---|
35 | player1Team = gamereport['teams'][player1]
|
---|
36 | player2Team = gamereport['teams'][player2]
|
---|
37 |
|
---|
38 | # Print some data. (Might be helpful to note that teams shown in the 0 A.D. GUI are actually one larger. Eg: Team 1 in the GUI is actually team 0)
|
---|
39 | logging.info("Player JID: " + str(player1) + ", Team: " + str(player1Team) + ", Player JID: " + str(player2) + ", Team: " + str(player2Team))
|
---|