File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 145145 '232323' : 'Dark grey' ,
146146 'E55BB0' : 'Pink'
147147}
148+ REGIONS = {
149+ 'us' : {
150+ 1 : 'us' ,
151+ 2 : 'la' ,
152+ },
153+ 'eu' : {
154+ 1 : 'eu' ,
155+ 2 : 'ru' ,
156+ },
157+ 'kr' : {
158+ 1 : 'kr' ,
159+ 2 : 'tw' ,
160+ }
161+ }
Original file line number Diff line number Diff line change 22from .objects import *
33from .utils import key_in_bases , windows_to_unix , Length
44from datetime import datetime
5+ from .constants import REGIONS
56
67def Full (replay ):
78 # Populate replay with details
@@ -70,7 +71,6 @@ def Full(replay):
7071 # * replay.details
7172 # * replay.attribute.events
7273 #
73- # TODO: get a map of gateway, subregion# => subregion in here
7474 # TODO: recognize current locale and use that instead of western
7575 # TODO: fill in the LOCALIZED_RACES table
7676 player = Player (pid ,pdata .name ,replay )
@@ -93,6 +93,7 @@ def Full(replay):
9393 player .type = attributes ['Player Type' ]
9494 player .uid = pdata .bnet .uid
9595 player .subregion = pdata .bnet .subregion
96+ player .region = REGIONS [replay .gateway ][player .subregion ]
9697 player .handicap = pdata .handicap
9798
9899 # We need initData for the gateway which is required to build the url!
You can’t perform that action at this time.
0 commit comments