Skip to content

Commit 4bd8eec

Browse files
committed
Patch attribute mapping for AI players.
More work needs to be done here, but this will do for now.
1 parent f5eadd0 commit 4bd8eec

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

sc2reader/constants.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
'yes':'yes'
308308
}),
309309

310-
0x01F4: ("Player Type", {
310+
0x01F4: ("Controller", {
311311
'Humn': 'Human',
312312
'Comp': 'Computer',
313313
'Open': 'Open',
@@ -341,6 +341,12 @@
341341
0x07E1: ("FFA Teams", lambda value: int(value[1:])),
342342
0x07E2: ("Custom Teams", lambda value: int(value[1:])),
343343

344+
0x0FA0: ("Game Privacy", {
345+
'Norm': 'Normal',
346+
'NoBO': 'No Build Order',
347+
'NoMH': 'No Match History',
348+
}),
349+
344350
0x0BB8: ("Game Speed", {
345351
'Slor': 'Slower',
346352
'Slow': 'Slow',
@@ -384,16 +390,21 @@
384390
'VyEy': 'Very easy',
385391
'Easy': 'Easy',
386392
'Medi': 'Medium',
387-
'Hard': 'Hard',
388-
'VyHd': 'Very hard',
389-
'Insa': 'Insane',
393+
'MdHd': 'Hard',
394+
'Hard': 'Harder',
395+
'HdVH': 'Very Hard',
396+
'VyHd': 'Elite',
397+
'ChVi': 'Cheater 1 (Vision)',
398+
'ChRe': 'Cheater 2 (Resources)',
399+
'Insa': 'Cheater 3 (Insane)',
390400
}),
391401

392402

393-
0x0BBF: ("Player Type", {
403+
0x0BBF: ("Participant Role", {
394404
'Part':'Participant',
395-
'Watc':'Watcher'
405+
'Watc':'Observer'
396406
}),
407+
397408
0x0BC0: ("Watcher Type", {
398409
'Obs': 'Observer',
399410
'Ref':'Referee'
@@ -404,7 +415,7 @@
404415
'Amm': 'Ladder',
405416
'': 'Single',
406417
}),
407-
0x0BC2: ("Alliances", {
418+
0x0BC2: ("Locked Alliances", {
408419
'no':'unlocked',
409420
'yes':'locked',
410421
})

sc2reader/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def createPlayer(pid, pdata, attributes):
369369
player.pick_race = attributes.get('Race','Unknown')
370370
player.play_race = LOCALIZED_RACES.get(pdata.race, pdata.race)
371371
player.difficulty = attributes.get('Difficulty','Unknown')
372-
player.is_human = (attributes.get('Player Type','Computer') == 'Human')
372+
player.is_human = (attributes.get('Controller','Computer') == 'Human')
373373
player.uid = pdata.bnet.uid
374374
player.subregion = pdata.bnet.subregion
375375
player.gateway = {0:'', 1:'us',2:'eu',3:'kr',6:'sea', 98:'xx'}[pdata.bnet.unknown1] # actually is gateway!!!

0 commit comments

Comments
 (0)