Skip to content

Commit 52690e6

Browse files
committed
Added lobby property names to constants.py
1 parent b31b89e commit 52690e6

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

sc2reader/constants.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,38 @@
155155
'E55BB0': 'Pink'
156156
}
157157

158+
## Names of the different properties found in the s2gs files lobby part
159+
LOBBY_PROPERTY_NAMES = {
160+
500 : 'Slot type', #Clsd/Open/Humn/Comp
161+
1000 : 'unknown1', #Dflt
162+
1001 : 'Melee', #no/yes no->2000, yes->2001
163+
2000 : 'Custom mode', #t2/t3/t4/t5/FFA/Cust (tX = X teams)
164+
2001 : 'Melee mode', #1v1/2v2/3v3/4v4/5v5/6v6/FFA
165+
2002 : '1v1 Team', #T1/T2
166+
2003 : '2v2 Team', #T1/T2/T1/T2
167+
2004 : '3v3 Team', #T1/T2/T1/T2/T1/T2
168+
2005 : '4v4 Team', #T1/T2/T1/T2/T1/T2/T1/T2
169+
2006 : 'FFA Team', #T1/T2/T3/T4/T5/T6
170+
2007 : '5v5 Team', #T1/T2/T1/T2/T1/T2/T1/T2/T1/T2
171+
2008 : '6v6 Team', #T1/T2/T1/T2/T1/T2/T1/T2/T1/T2/T1/T2
172+
2011 : "'2 Teams' team", #(T1/T2)*6
173+
2012 : "'3 Teams' team", #(T1/T2/T3)*6
174+
2013 : "'4 Teams' team", #(T1/T2/T3/T4)*6
175+
2014 : "'5 Teams' team", #(T1/T2/T3/T4/T5)*6
176+
2017 : "FFA Team", #T1/T2/T3/T4/T5/T6
177+
2018 : "'Custom' team", #(T1/T2/T3/T4/T5/T6)*5
178+
3000 : 'Game speed', #Slor/Slow/Norm/Fast/Fasr
179+
3001 : 'Race', #Terr/Zerg/Prot/RAND
180+
3002 : 'Color', #tc01/tc02/tc03/tc04/tc05/tc06/tc07/tc08
181+
3003 : 'Handicap', #50/60/70/80/90/100
182+
3004 : 'Difficulty', #VyEy/Easy/Medi/Hard/VyHd/Insa
183+
3006 : 'unknown2', #3/5/7/10/15/20/25/30 (stalemate timer?)
184+
3007 : 'Player mode', #Part/Watch (Participating/Watching) Watch->3008
185+
3008 : 'Spectate mode', #Obs/Ref
186+
3009 : 'Lobby type', #Priv/Pub/Amm
187+
3010 : 'unknown3', #no/yes (Never required)
188+
}
189+
158190
BUILD_ORDER_UPGRADES = {
159191
# Protoss
160192

sc2reader/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,10 @@ def get_lobby_properties(data):
874874
}
875875

876876
lobby_ids = [k for k in defs if defs[k]['lobby_prop']]
877+
lobby_ids.sort()
877878
player_ids = [k for k in defs if not defs[k]['lobby_prop']]
878-
879+
player_ids.sort()
880+
879881
left_lobby = deque([k for k in defs if defs[k]['lobby_prop']])
880882

881883
lobby_props = dict()
@@ -906,8 +908,7 @@ def get_lobby_properties(data):
906908
player_props = [dict() for pid in range(16)]
907909
# Parse each player separately (this is required :( )
908910
for pid in range(16):
909-
# The most required value, 500, is in the back, change this
910-
left_players = deque(reversed([a for a in player_ids]))
911+
left_players = deque([a for a in player_ids])
911912
player = dict()
912913

913914
# Use this to avoid an infinite loop

0 commit comments

Comments
 (0)