Skip to content

Commit f3047c3

Browse files
committed
Changes all references of realm to gateway.
This is more consistent with Blizzard's own terminology.
1 parent 4781545 commit f3047c3

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

sc2reader/objects.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Location = namedtuple('Location',('x','y'))
1313
Details = namedtuple('Details',['players','map','unknown1','unknown2','unknown3','file_time','unknown4','unknown5','unknown6','unknown7','unknown8','unknown9','unknown10','unknown11'])
1414

15-
MapData = namedtuple('MapData',['unknown','realm','map_hash'])
15+
MapData = namedtuple('MapData',['unknown','gateway','map_hash'])
1616
PlayerData = namedtuple('PlayerData',['name','bnet','race','color','unknown1','unknown2','handicap','unknown3','result'])
1717
ColorData = namedtuple('ColorData',['a','r','g','b'])
1818
BnetData = namedtuple('BnetData',['unknown1','unknown2','subregion','uid'])
@@ -68,7 +68,7 @@ def __init__(self, replay_file, **options):
6868
self.is_ladder = False
6969
self.is_private = False
7070
self.map = ""
71-
self.realm = ""
71+
self.gateway = ""
7272
self.events = list()
7373
self.events_by_type = defaultdict(list)
7474
self.results = dict()
@@ -245,7 +245,7 @@ def __init__(self, pid, name, replay):
245245

246246
@property
247247
def url(self):
248-
return self.URL_TEMPLATE % (self.realm, self.uid, self.subregion, self.name)
248+
return self.URL_TEMPLATE % (self.gateway, self.uid, self.subregion, self.name)
249249

250250
def __str__(self):
251251
return "Player %s - %s (%s)" % (self.pid, self.name, self.play_race)

sc2reader/processors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def Full(replay):
99
# TODO: Change config.py to work with this
1010
# TODO: remove legacy code, restructure config.py: just one processor now
1111
if 'initData' in replay.raw and replay.raw.initData.map_data:
12-
replay.realm = replay.raw.initData.map_data[0].realm
12+
replay.gateway = replay.raw.initData.map_data[0].gateway
1313

1414
if 'details' in replay.raw:
1515
replay.map = replay.raw.details.map
@@ -70,7 +70,7 @@ def Full(replay):
7070
# * replay.details
7171
# * replay.attribute.events
7272
#
73-
# TODO: get a map of realm,subregion# => subregion in here
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)
@@ -95,9 +95,9 @@ def Full(replay):
9595
player.subregion = pdata.bnet.subregion
9696
player.handicap = pdata.handicap
9797

98-
# We need initData for the realm which is required to build the url!
99-
if 'initData' in replay.raw and replay.realm:
100-
player.realm = replay.realm
98+
# We need initData for the gateway which is required to build the url!
99+
if 'initData' in replay.raw and replay.gateway:
100+
player.gateway = replay.gateway
101101

102102
# Conversion instructions to the new color object:
103103
# color_rgba is the color object itself

sc2reader/readers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ def __call__(self,buffer, replay):
3333
# and a map hash which probably ties back to the sc2map files.
3434
#
3535
# Some replays don't seem to have a maps section at all, now we can't
36-
# know what region its from? Very strange...
36+
# know what gateway its from? Very strange...
3737
#
3838
# TODO: Figure out how we could be missing a maps section.
3939
map_data = list()
4040
while buffer.read_chars(4).lower() == 's2ma':
4141
unknown = buffer.read_chars(2)
42-
realm = buffer.read_string(2).lower()
42+
gateway = buffer.read_string(2).lower()
4343
map_hash = buffer.read_chars(32)
44-
map_data.append(MapData(unknown,realm,map_hash))
44+
map_data.append(MapData(unknown,gateway,map_hash))
4545

4646
# Return the extracted information inside an AttributeDict.
4747
return AttributeDict(

0 commit comments

Comments
 (0)