Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
dda41fb
Fix up event names and hierarchy.
GraylinKim Sep 22, 2013
24c0acf
Flesh out the ping class.
GraylinKim Sep 22, 2013
bb8f9d2
Misc. documentation improvements.
GraylinKim Sep 22, 2013
1d03283
First pass at replay resume support. refs #91
GraylinKim Sep 22, 2013
e672168
Remove unused player_names. closes #158.
GraylinKim Nov 17, 2013
a3153db
Remove map specific attributes from the listing.
GraylinKim Dec 2, 2013
6fb12e8
Raise an informative error on corrupt tracker file
GraylinKim Dec 2, 2013
caeb6ca
Fix python3 bug in plugin error handling routine.
GraylinKim Dec 2, 2013
2b35c07
Fixes #160 with non back compatible changes.
GraylinKim Dec 2, 2013
72da6ae
Remove some old % style string formatting.
GraylinKim Dec 2, 2013
6d13524
And this is why you run tests before pushing.
GraylinKim Dec 2, 2013
665cc12
Make note of the additional changes in the log.
GraylinKim Dec 2, 2013
1d9c141
adding a missing change from the list
StoicLoofah Dec 6, 2013
52e5be9
Merge pull request #163 from StoicLoofah/update-0.7-changelog
GraylinKim Dec 7, 2013
fe86668
Remove a couple more defunct replay attributes.
GraylinKim Dec 11, 2013
9283c33
Use generic UnitType and Ability classes for data.
GraylinKim Dec 11, 2013
4d068bf
datapacks is a better word than builds here.
GraylinKim Dec 11, 2013
0e6286f
Replace all references to gateway with region.
GraylinKim Dec 11, 2013
d9df519
Fix typo.
GraylinKim Dec 11, 2013
bd2a8cf
Use a regular dict for raw data results.
GraylinKim Dec 11, 2013
f58daf7
Remove stray reference.
GraylinKim Dec 11, 2013
b968b57
Misc import and documentation improvements.
GraylinKim Dec 11, 2013
81809e5
Don't forget the tests.
GraylinKim Dec 11, 2013
03bbdae
Our readers and lambdas can't be pickled.
GraylinKim Dec 11, 2013
b421a7c
Initial pass at PTR 2.1 support.
GraylinKim Dec 11, 2013
38dfa77
Fix small bugs in PTR support.
GraylinKim Dec 12, 2013
ba404a5
Clarify the highest leauge user attribute.
GraylinKim Dec 12, 2013
94263a5
The clan logo is a DepotFile location, not a string.
GraylinKim Dec 13, 2013
f012566
Fixes #165, properly parse mouse click events.
GraylinKim Dec 13, 2013
4b45b62
Fix initdata parsing for base_build 23260 replays.
GraylinKim Dec 13, 2013
53e5678
Add killer logic to ContextLoader, refine the API.
GraylinKim Dec 19, 2013
e5001a3
added a replay thats failing for GGTracker, but surprisingly it turns…
dsjoerg Jan 5, 2014
00411e3
Bump mpyq version.
GraylinKim Jan 8, 2014
18ca54c
fix name of 'ControlGroupEvent' in comments
eqy Jan 30, 2014
a303fd7
Merge pull request #167 from eqy/patch-1
GraylinKim Jan 30, 2014
9277ec4
No more lints.
Apr 13, 2014
d275182
Merge pull request #168 from MakozFriends/master
GraylinKim Apr 15, 2014
214cd7c
Fixes SelectionTracker plugin with new handler names.
Apr 23, 2014
1a6220b
Merge pull request #169 from MakozFriends/hotfix/selectiontracker
GraylinKim May 5, 2014
b35d88c
new failing test for replays that started by loading a saved game
dsjoerg Jun 30, 2014
c860d8e
fix for replays that started with a load from a saved game
dsjoerg Jun 30, 2014
89f4eee
amended author info
dsjoerg Sep 26, 2014
6f30900
fix for 2.1.4
dsjoerg Sep 26, 2014
6580ebb
Fix various issues related to issue #180.
GraylinKim Dec 29, 2014
0dbe561
Fix gameheart plugin handling of teams and observers. Closes #174.
GraylinKim Dec 29, 2014
83d3809
Add option to print observers to sc2printer.
GraylinKim Dec 29, 2014
26c569e
Harden up the code for processing s2ma files.
GraylinKim Dec 29, 2014
6c48e8a
This is a polish translation.
GraylinKim Dec 29, 2014
a194b67
Remove PersonDict and AttributeDict implementations.
GraylinKim Dec 31, 2014
3e1cea3
Remove dead code.
GraylinKim Jan 5, 2015
722ae4f
Bump version to a pre-release (for clarity).
GraylinKim Jan 5, 2015
c5d22d6
decoding this so that it reads as a string not bytes in python 3
StoicLoofah Feb 11, 2015
4b3bd9b
Merge pull request #183 from StoicLoofah/decode_upgrade_type_name
GraylinKim Mar 3, 2015
20156ec
Fix ancient typo in struct decoder. refs #184
GraylinKim Mar 15, 2015
2139abc
remove debugging print statement
dsjoerg Oct 7, 2015
d69feb4
add failing test for 3.0
dsjoerg Oct 7, 2015
333d027
add failing creepspread test
dsjoerg Feb 23, 2016
4eb4593
new failing test for 3.2
dsjoerg Apr 6, 2016
4d42147
fix for 3.2 (while breaking for older versions)
dsjoerg Apr 6, 2016
5e6e235
Use Pillow since pil is not available on Ubuntu 14.04.
nickelsen Apr 13, 2016
4be87ef
Fix LotV time by fps modifier (for length) and new game_speed_factors…
nickelsen Apr 14, 2016
504fff2
Merge pull request #9 from nickelsen/vagrant
dsjoerg Apr 15, 2016
b36791c
Merge pull request #10 from nickelsen/lotv-length-fix
dsjoerg Apr 17, 2016
73d11a9
Fix MapInfo parsing for version 0x26
gravelweb Apr 18, 2016
80ea580
Merge pull request #11 from gravelweb/mini-map
dsjoerg Apr 19, 2016
3bc825c
handle 3.3.0
dsjoerg May 18, 2016
189dcea
Fix some non-python 3 things
DasFranck May 21, 2016
5dbe62b
Adding StringIO import for Python3
DasFranck May 21, 2016
641e494
Run tests on circleci.
nickelsen Jun 9, 2016
32721d3
Merge pull request #15 from nickelsen/circleci
dsjoerg Jun 9, 2016
d5f5203
mark as expected a failure related to the APM from a HotS replay. it…
dsjoerg Jun 9, 2016
4b73007
tell CircleCI to ignore the branches that we know are old and busted
dsjoerg Jun 9, 2016
504fd5c
Merge branch 'upstream' into upstream
DasFranck Jun 9, 2016
bdf3bc2
Merge pull request #13 from DasFranck/upstream
dsjoerg Jun 10, 2016
90bc219
Add handler for command_update_target_unit_event
gravelweb Jun 9, 2016
9520a57
UpdateTargetAbilityEvent: Safer implementation, per player ability tr…
gravelweb Jun 11, 2016
9fd95ac
UpdateTargetAbilityEvent: Unit tests
gravelweb Jun 11, 2016
6fdaf29
Merge pull request #14 from gravelweb/update-target
dsjoerg Jun 11, 2016
32dec12
@mischanix wrote this back in Sept 2015 but I neglected to commit unt…
dsjoerg Jul 13, 2016
7df5941
fix usage message to have the right script name
dsjoerg Jul 13, 2016
cf67e1d
add new abilities and units for 3.4.0 (44401)
dsjoerg Jul 13, 2016
82fff8c
add test for 3.4.0. it passed before we did anything for it, and it s…
dsjoerg Jul 13, 2016
82887d9
register datapack so that the new ability info is actually used
dsjoerg Jul 13, 2016
2d36f82
44401 units, take 2
dsjoerg Jul 13, 2016
2f7bfcf
more units for unit lookup yay
dsjoerg Jul 13, 2016
a131d50
howto on how to do the abilities and units nonsense
dsjoerg Jul 13, 2016
ae41bda
handle 3.7
dsjoerg Oct 18, 2016
131ac4e
add another replay to the 3.7 test, works fine
dsjoerg Oct 18, 2016
dbffc7f
add new abilities and units for 47185
dsjoerg Oct 26, 2016
d5eb61a
Merge remote-tracking branch 'upstream/master' into ggtracker/upstream
StoicLoofah Nov 18, 2016
e6ca55b
fixing tests from graylinkim/ggtracker merge
StoicLoofah Nov 18, 2016
c86eb5a
fixing more references from the CHANGELOG
StoicLoofah Nov 28, 2016
f5fa1c5
Merge pull request #16 from StoicLoofah/reconcile_graylinkim_ggtracker
dsjoerg Dec 4, 2016
af4d492
bump to 0.8.0, update some URLs and contributor info
dsjoerg Dec 6, 2016
8cdc7d2
added support for protocol 48258
frugs Dec 11, 2016
afe0232
Merge pull request #17 from frugs/master
dsjoerg Dec 11, 2016
3730034
Remove unnecessary print statement
nibalizer Jan 19, 2017
93b1cf3
Merge pull request #20 from nibalizer/remove_print
dsjoerg Jan 19, 2017
688b65c
Update unit_info.json
nibalizer Feb 18, 2017
0a5c9bf
Merge pull request #21 from nibalizer/unit_info
dsjoerg Feb 18, 2017
a46e0b6
add failing test for 3.12 replay
dsjoerg Mar 30, 2017
d46a21e
process reward_overrides properly for the first time ever, hopefully …
dsjoerg Mar 31, 2017
ef9496b
Added script to generate [build]_abilities.csv file from balance data…
frugs Jun 8, 2017
b9e4628
Replaced ability generation script with full build data generation sc…
frugs Jun 9, 2017
e89e0fc
Merge pull request #22 from frugs/master
dsjoerg Jun 9, 2017
8ea0c3f
Extended build data generation script to also generate ability_lookup…
frugs Jun 9, 2017
7291d99
Merge pull request #23 from frugs/master
dsjoerg Jun 9, 2017
a778a22
Build data generation script now merges new build data with existing …
frugs Jun 9, 2017
494831a
Fixed oversight with build data generation script which could
frugs Jun 9, 2017
c3e095c
Merge pull request #24 from frugs/master
dsjoerg Jun 9, 2017
44526f6
Updated HOWTO on how to support new sc2 build versions
frugs Jun 9, 2017
52ea388
Merge pull request #25 from frugs/master
dsjoerg Jun 9, 2017
65acc3b
Add support for build version 53644 replays
frugs Jun 9, 2017
d31c51f
Merge branch 'master' into build_53644
frugs Jun 10, 2017
73cb79c
Updated two files so that update target point event is actually read …
Jun 13, 2017
4bd6341
Merge pull request #28 from ccopland94/updatetargetpointcommandevent_…
dsjoerg Jun 14, 2017
1db695b
Preserve old command names in ability lookup
frugs Jun 15, 2017
f05142a
Merge remote-tracking branch 'upstream/upstream' into build_53644
frugs Jun 15, 2017
944c9a0
Merge pull request #26 from frugs/build_53644
dsjoerg Jun 15, 2017
bfc62a9
Update build data generation script so that it preserves existing com…
frugs Jun 15, 2017
905a9b7
Merge pull request #29 from frugs/master
dsjoerg Jun 15, 2017
39e81bc
broken test showing that 54518 replays cant be processed
dsjoerg Jun 21, 2017
abe4797
correctly process 54518 replays
dsjoerg Jun 21, 2017
169751d
better test-running instructions
dsjoerg Jun 21, 2017
e063542
merge
dsjoerg Jun 21, 2017
41790bc
support build 54724 units and abilities
frugs Jun 23, 2017
f8e026a
Merge pull request #30 from frugs/master
dsjoerg Jun 23, 2017
b0327d7
Add flake8 to testing
Aug 22, 2017
16a3dbf
Merge pull request #31 from cclauss/patch-3
dsjoerg Aug 22, 2017
2ecd0b3
print() function for Python 3
Aug 22, 2017
0648ba1
Define print() function and raw_input for Python 3
Aug 22, 2017
8da9225
Define print() function for Python 3
Aug 22, 2017
5f91a2a
Define raw_input for Python 3
Aug 22, 2017
ad76266
fix typo
Aug 22, 2017
99e633f
Define cmp() for Python 3
Aug 22, 2017
7be34b7
Add hacking to get flake8 plus plugins
Aug 22, 2017
e51c262
Add flake8 to the testing
Aug 22, 2017
f582386
Add Python 2.7 and 3.6 to the testing and flake8 as well
Aug 22, 2017
c0beb4e
Merge pull request #34 from cclauss/patch-3
dsjoerg Aug 22, 2017
9a68777
Merge pull request #33 from cclauss/patch-2
dsjoerg Aug 22, 2017
211e23c
Merge pull request #32 from cclauss/patch-1
dsjoerg Aug 22, 2017
89750b6
print() function for Python 3
Aug 22, 2017
6b2ce4b
Be explicit about the error for flake8
Aug 22, 2017
26435ef
Python 2.7.12 instead of 2.7.13
Aug 22, 2017
1baa866
pip install hacking ; pip3 install hacking
Aug 23, 2017
bc0bd39
Merge pull request #35 from cclauss/patch-1
dsjoerg Aug 23, 2017
5953aa4
Merge branch 'upstream' into patch-3
dsjoerg Aug 23, 2017
e81e799
Merge branch 'upstream' into patch-2
dsjoerg Aug 23, 2017
c66fb3e
Merge pull request #37 from cclauss/patch-3
dsjoerg Aug 23, 2017
db59814
Merge pull request #36 from cclauss/patch-2
dsjoerg Aug 23, 2017
a15a5f5
test demonstrating that we can parse the replay mentioned in #190
dsjoerg Sep 18, 2017
ddcd2a2
Corrected mispelling of 'collection'
davidkuhta Nov 12, 2017
39b8681
Merge pull request #40 from davidkuhta/upstream
dsjoerg Nov 13, 2017
ddf2a3e
build 64469 support
Apr 27, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
- 3.6
- pypy
install:
- python setup.py develop
- pip install coveralls
- pip install coveralls hacking
- mkdir local_cache
before_script:
# stop the build if there are Python syntax errors or undefined names
- time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- time flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- SC2READER_CACHE_DIR=local_cache coverage run --source=sc2reader test_replays/test_all.py
- SC2READER_CACHE_DIR=local_cache coverage run --source=sc2reader --append test_s2gs/test_all.py
Expand Down
28 changes: 26 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
CHANGELOG
============

0.8.0 -
---------------------------
* Merged into ggtracker/sc2reader, which mostly means that we have a bunch of parsing fixes. Thanks @StoicLoofah!

0.6.5 - December ?? 2013
0.7.0 -
---------------------------

* Deprecated unit.killed_by in favor of unit.killing_player
Expand All @@ -17,6 +20,27 @@ CHANGELOG
* Removed the defunct replay.player_names attribute.
* Removed the defunct replay.events_by_type attribute.
* Removed the defunct replay.other_people attribute.
* Replays can now be pickled and stored for later consumption.
* All references to the gateway attribute have been replaced in favor of region; e.g. replay.region
* Use generic UnitType and Ability classes for data. This means no more unit._type_class.__class__.__name__. But hopefully people were not doing that anyway.
* Now a CorruptTrackerFileError is raised when the tracker file is corrupted (generally only older resume_from_replay replays)
* Added replay.resume_from_replay flag. See replay.resume_user_info for additional info.
* PacketEvent is now ProgressEvent.
* SetToHotkeyEvent is now SetControlGroupEvent.
* AddToHotkeyEvent is now AddToControlGroupEvent.
* GetFromHotkeyEvent is now GetControlGroupEvent.
* PlayerAbilityEvent is no longer part of the event hierarchy.
* AbilityEvent doubled as both an abstract and concrete class (very bad, see #160). Now split into:
* AbilityEvent is now CommandEvent
* AbilityEvent is now BasicCommandEvent
* TargetAbilityEvent is now TargetUnitCommandEvent
* LocationAbilityEvent is now TargetPointCommandEvent
* SelfAbilityEvent is now DataCommandEvent
* Removed the defunct replay.player_names attribute.
* Removed the defunct replay.events_by_type attribute.
* Removed the defunct replay.other_people attribute.

* event.name is no longer a class property; it can only be accessed from an event instance.
* PingEvents now have new attributes:
* event.to_all - true if ping seen by all
* event.to_allies - true if ping seen by allies
Expand All @@ -28,7 +52,7 @@ CHANGELOG
---------------------------

* Fix bug in code for logging errors.
* Fix siege tank supply count
* Fix siege tank supply count.
* Small improvements to message.events parsing.

0.6.3 - September 15th 2013
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Author and Maintainer:
Maintainer:
David Joerg - @dsjoerg on github

Author:
Graylin Kim - graylinkim @ github

Contributors:
David Joerg - @dsjoerg on github
Alexander Hanhikoski - @alexhanh on github
Bas Peschier (fizzgig) - @bpeschier on github
Jason Dana - @sheutka on github
Expand Down
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ To run the tests just use::

When repeatedly running tests it can be very helpful to make sure you've set a local cache directory to prevent long fetch times from battle.net::

export SC2READER_CACHE_DIR=local_cache
# or
SC2READER_CACHE_DIR=local_cache python test_replays/test_all.py
SC2READER_CACHE_DIR=local_cache PYTHONPATH=. python -m unittest test_replays.test_all

To run just one test:

Expand Down
27 changes: 27 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
machine:
post:
- pyenv global 2.7.12 3.6.2
dependencies:
pre:
- pip install --upgrade pip
- pip3 install --upgrade pip
- pip install hacking
- pip3 install hacking
general:
branches:
ignore:
- ggmaster
- hots
- jonomon
- master
- old_master
test:
override:
- python2.7 -m flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
- python2.7 -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- python2.7 -m python -m unittest discover test_replays
- python2.7 -m python -m unittest discover test_s2gs
- python3.6 -m flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
- python3.6 -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- python3.6 -m python -m unittest discover test_replays
- python3.6 -m python -m unittest discover test_s2gs
2 changes: 1 addition & 1 deletion docs/source/articles/whatsinareplay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file was introduced in 2.0.4 and is unncessary for the Starcraft II to repr
What isn't in a replay?
--------------------------

Replays are specifically designed to only include data essential to recreate the game. Game state is not recorded because the game engine can recreate it based off the other information. That means no player resource counts, colleciton rates, supply values, vision, unit positions, unit deaths, etc. Information that you are super interested in probably is not directly recorded. Fortunately since 2.0.4 tracker events now record some of this information; prior to that patch we had to run our own simulations to guess at most of the data.
Replays are specifically designed to only include data essential to recreate the game. Game state is not recorded because the game engine can recreate it based off the other information. That means no player resource counts, collection rates, supply values, vision, unit positions, unit deaths, etc. Information that you are super interested in probably is not directly recorded. Fortunately since 2.0.4 tracker events now record some of this information; prior to that patch we had to run our own simulations to guess at most of the data.


The other important aspect of this is that instead of completely describing all of the game data (unit data, ability data, map info, etc), replays maintain a list of dependencies. These dependencies might look like this:
Expand Down
11 changes: 8 additions & 3 deletions examples/sc2autosave.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@

import sc2reader

try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3


def run(args):
#Reset wipes the destination clean so we can start over.
Expand Down Expand Up @@ -367,12 +372,12 @@ def reset(args):
elif not os.path.isdir(args.dest):
exit("Cannot reset, destination must be directory: {0}", args.dest)

print 'About to reset directory: {0}\nAll files and subdirectories will be removed.'.format(args.dest)
print('About to reset directory: {0}\nAll files and subdirectories will be removed.'.format(args.dest))
choice = raw_input('Proceed anyway? (y/n) ')
if choice.lower() == 'y':
args.log.write('Removing old directory: {0}\n'.format(args.dest))
if not args.dryrun:
print args.dest
print(args.dest)
shutil.rmtree(args.dest)
else:
sys.exit("Script Aborted")
Expand Down Expand Up @@ -511,7 +516,7 @@ def main():
try:
run(parser.parse_args())
except KeyboardInterrupt:
print "\n\nScript Interupted. Process Aborting"
print("\n\nScript Interupted. Process Aborting")

if __name__ == '__main__':
main()
6 changes: 3 additions & 3 deletions examples/sc2store.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ def main():

for path in args.paths:
for file_name in sc2reader.utils.get_files(path, depth=0):
print "CREATING: {0}".format(file_name)
print("CREATING: {0}".format(file_name))
db.add(Game(sc2reader.read_file(file_name), db))

db.commit()

print list(db.query(distinct(Person.name)).all())
print(list(db.query(distinct(Person.name)).all()))

#for row in db.query(distinct(Person.name)).all():
# print row
# print(row)


def load_session(args):
Expand Down
Loading