ggtracker / ggtracker/sc2reader

Event.player is None

Open
#91 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
169
Forks
152
PR merge metrics
No merged PRs in 30d

Description

When using the APMTracker plugin, it became clear to me that the events that the plugin parses the attribute player is None.

Code to reproduce:

class TestPlugin(object):

    name = 'TestPlugin'
            
    def handleCommandEvent(self, event, replay):
        print(event.player)
                
replay_file = '/home/rcortini/soft/sc2reader/test_replays/4.7.0.70154/1.SC2Replay'
replay = sc2reader.load_replay(
    replay_file,
    engine=sc2reader.engine.GameEngine(plugins=[TestPlugin()]))

which outputs a bunch of Nones.

By the way, this also means that the APMTracker plugin does not work, and that it is very difficult to write functional plugins.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GameEngine plugin path used by load_replay and follow handleCommandEvent for command events in the provided reproduction. Check how event.player is assigned while parsing the referenced replay and how APMTracker consumes it. Done means parsed command events expose the correct player and APMTracker and custom plugins no longer receive None.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.