Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc2reader breaks on sc2AI bot replays #149

Open
dericktseng opened this issue Aug 11, 2021 · 1 comment
Open

sc2reader breaks on sc2AI bot replays #149

dericktseng opened this issue Aug 11, 2021 · 1 comment

Comments

@dericktseng
Copy link

https://cdn.discordapp.com/attachments/319346988904873984/875093028598083624/701042_VeTerran_Ketroc_BlackburnAIE.SC2Replay

The sc2AI bot replays seems to not have indications of region data, which breaks the parser.

Traceback (most recent call last):
  File "...\tester\test.py", line 4, in <module>
    replay = sc2.load_replay('701042_VeTerran_Ketroc_BlackburnAIE.SC2Replay', load_map=False)
  File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 88, in load_replay
    return self.load(Replay, source, options, **new_options)
  File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 166, in load
    return self._load(cls, resource, filename=filename, options=options)
  File "...\Python\Python39\lib\site-packages\sc2reader\factories\sc2factory.py", line 175, in _load
    obj = cls(resource, filename=filename, factory=self, **options)
  File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 302, in __init__
    self.load_all_details()
  File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 444, in load_all_details
    self.load_details()
  File "...\Python\Python39\lib\site-packages\sc2reader\resources.py", line 389, in load_details
    self.region = details["cache_handles"][0].server.lower()
IndexError: list index out of range
@StoicLoofah
Copy link
Collaborator

Right, I believe there may be several places where sc2reader fails due to stripped data from that set of replays.

We woudl welcome a PR that tries to address those! I think it would be fair to just leave blanks in the cases where the data is unavailable

cclauss added a commit to cclauss/sc2reader that referenced this issue Aug 12, 2021
Fixes ggtracker#149…. Please review for the side effects of setting:
`self.region = self.map_hash = self.map_file = ""`
craigdods added a commit to craigdods/sc2reader that referenced this issue Jul 15, 2023
One of two fixes

This one corrects for the error we see here:

sc2reader/engine/plugins/context.py", line 66, in handleTargetUnitCommandEvent
    self.last_target_ability_event[event.player.pid] = event
AttributeError: 'NoneType' object has no attribute 'pid'
craigdods added a commit to craigdods/sc2reader that referenced this issue Jul 15, 2023
Fixes the issue when defaulting to LoTV for GAME_SPEED_FACTOR for bot replays
cclauss added a commit to cclauss/sc2reader that referenced this issue Jul 16, 2023
* 2 of 2 changes to support bot replays in ggtracker#149

Fixes the issue when defaulting to LoTV for GAME_SPEED_FACTOR for bot replays

* Update sc2reader/resources.py

Co-authored-by: Christian Clauss <[email protected]>

* Update sc2reader/resources.py

Co-authored-by: Christian Clauss <[email protected]>

* Update sc2reader/resources.py

Co-authored-by: Christian Clauss <[email protected]>

* Update sc2reader/resources.py

Co-authored-by: Christian Clauss <[email protected]>

---------

Co-authored-by: Christian Clauss <[email protected]>
cclauss added a commit to cclauss/sc2reader that referenced this issue Jul 16, 2023
* 1 of 2 changes to support bot replays in ggtracker#149

One of two fixes

This one corrects for the error we see here:

sc2reader/engine/plugins/context.py", line 66, in handleTargetUnitCommandEvent
    self.last_target_ability_event[event.player.pid] = event
AttributeError: 'NoneType' object has no attribute 'pid'

* Update sc2reader/engine/plugins/context.py

Co-authored-by: Christian Clauss <[email protected]>

---------

Co-authored-by: Christian Clauss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants