From 634edb441e0b7b231b62b8a33937780ca07cb1b5 Mon Sep 17 00:00:00 2001 From: pnxenopoulos Date: Sun, 3 Sep 2023 21:33:49 -0400 Subject: [PATCH 1/6] added markus v4 for cs2 support --- awpy/parser/go.mod | 8 +++++--- awpy/parser/go.sum | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/awpy/parser/go.mod b/awpy/parser/go.mod index 270b52316..9008d5a59 100644 --- a/awpy/parser/go.mod +++ b/awpy/parser/go.mod @@ -5,13 +5,15 @@ go 1.18 require github.com/markus-wa/demoinfocs-golang/v3 v3.3.0 require ( - github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect + github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0 // indirect github.com/markus-wa/go-unassert v0.1.3 // indirect github.com/markus-wa/gobitread v0.2.3 // indirect github.com/markus-wa/godispatch v1.4.1 // indirect - github.com/markus-wa/ice-cipher-go v0.0.0-20220823210642-1fcccd18c6c1 // indirect + github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7 // indirect github.com/markus-wa/quickhull-go/v2 v2.2.0 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/awpy/parser/go.sum b/awpy/parser/go.sum index 1624196c1..681fa48f3 100644 --- a/awpy/parser/go.sum +++ b/awpy/parser/go.sum @@ -3,11 +3,17 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/golang/geo v0.0.0-20180826223333-635502111454/go.mod h1:vgWZ7cu0fq0KY3PpEHsocXOWJpRtkcbKemU4IUw0M60= github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 h1:gtexQ/VGyN+VVFRXSFiguSNcXmS6rkKT+X7FdIrTtfo= github.com/golang/geo v0.0.0-20210211234256-740aa86cb551/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= +github.com/golang/geo v0.0.0-20230421003525-6adc56603217 h1:HKlyj6in2JV6wVkmQ4XmG/EIm+SCYlPZ+V4GWit7Z+I= +github.com/golang/geo v0.0.0-20230421003525-6adc56603217/go.mod h1:8wI0hitZ3a1IxZfeH3/5I97CI8i5cLGsYe7xNhQGs9U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/markus-wa/demoinfocs-golang/v3 v3.3.0 h1:cXAI081cH5tDmmyPuyUzuIGeP8strtVzdtRB5VlIvL8= github.com/markus-wa/demoinfocs-golang/v3 v3.3.0/go.mod h1:NzAkCtDshPkoSMg3hAyojkmHE4ZgnNWCM1Vv4yCPLsI= +github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0 h1:cP34r7ZHfQvJA0kwO7gA/lWLEAHhIghxTptwnV5KRls= +github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0/go.mod h1:YuAfxa0q7mG+HSUjrSXFmaZ8xVRWK9k/vcG/rLbzrBA= github.com/markus-wa/go-unassert v0.1.3 h1:4N2fPLUS3929Rmkv94jbWskjsLiyNT2yQpCulTFFWfM= github.com/markus-wa/go-unassert v0.1.3/go.mod h1:/pqt7a0LRmdsRNYQ2nU3SGrXfw3bLXrvIkakY/6jpPY= github.com/markus-wa/gobitread v0.2.3 h1:COx7dtYQ7Q+77hgUmD+O4MvOcqG7y17RP3Z7BbjRvPs= @@ -16,6 +22,8 @@ github.com/markus-wa/godispatch v1.4.1 h1:Cdff5x33ShuX3sDmUbYWejk7tOuoHErFYMhUc2 github.com/markus-wa/godispatch v1.4.1/go.mod h1:tk8L0yzLO4oAcFwM2sABMge0HRDJMdE8E7xm4gK/+xM= github.com/markus-wa/ice-cipher-go v0.0.0-20220823210642-1fcccd18c6c1 h1:YH4WI14HARrM3C6mKUMFDBz93O25oWSlLEYGeL27G0w= github.com/markus-wa/ice-cipher-go v0.0.0-20220823210642-1fcccd18c6c1/go.mod h1:JIsht5Oa9P50VnGJTvH2a6nkOqDFJbUeU1YRZYvdplw= +github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7 h1:aR9pvnlnBxifXBmzidpAiq2prLSGlkhE904qnk2sCz4= +github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7/go.mod h1:JIsht5Oa9P50VnGJTvH2a6nkOqDFJbUeU1YRZYvdplw= github.com/markus-wa/quickhull-go/v2 v2.2.0 h1:rB99NLYeUHoZQ/aNRcGOGqjNBGmrOaRxdtqTnsTUPTA= github.com/markus-wa/quickhull-go/v2 v2.2.0/go.mod h1:EuLMucfr4B+62eipXm335hOs23LTnO62W7Psn3qvU2k= github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= @@ -27,13 +35,17 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From d44979b6434fbdfa0381e079c35132b7bda9e40f Mon Sep 17 00:00:00 2001 From: pnxenopoulos Date: Mon, 4 Sep 2023 09:50:06 -0400 Subject: [PATCH 2/6] add go 1.21 req --- .github/workflows/build.yml | 4 ++-- README.md | 2 +- awpy/parser/demoparser.py | 8 ++++---- awpy/parser/go.mod | 2 +- awpy/utils.py | 4 ++-- docs/installation.rst | 2 +- tests/test_utils.py | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26524c7bb..f7f93d396 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.11"] #, "3.12-dev"] - go-version: ["1.18", "1.19", "1.20"] + python-version: ["3.11"] + go-version: ["1.21"] steps: - name: Checkout awpy library uses: actions/checkout@v3 diff --git a/README.md b/README.md index 4ce30f801..da5e824b8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The `awpy` package provides data parsing, analytics and visualization capabiliti ## Setup #### Requirements -`awpy` requires [Python](https://www.python.org/downloads/) >= 3.11 and [Golang](https://golang.org/dl/) >= 1.18. Python acts as a wrapper for the Go code which parses demofiles. +`awpy` requires [Python](https://www.python.org/downloads/) >= 3.11 and [Golang](https://golang.org/dl/) >= 1.21. Python acts as a wrapper for the Go code which parses demofiles. #### Installation To install `awpy`, you can run diff --git a/awpy/parser/demoparser.py b/awpy/parser/demoparser.py index 847782160..d5e0043c5 100644 --- a/awpy/parser/demoparser.py +++ b/awpy/parser/demoparser.py @@ -84,7 +84,7 @@ class DemoParser: json (dict): Dictionary containing the parsed json file Raises: - ValueError: Raises a ValueError if the Golang version is lower than 1.18 + ValueError: Raises a ValueError if the Golang version is lower than 1.21 """ def __init__( @@ -461,7 +461,7 @@ def parse_demo(self) -> None: Outputs a JSON file to current working directory. Raises: - ValueError: Raises a ValueError if the Golang version is lower than 1.18 + ValueError: Raises a ValueError if the Golang version is lower than 1.21 FileNotFoundError: Raises a FileNotFoundError if the demofile path does not exist. """ @@ -471,11 +471,11 @@ def parse_demo(self) -> None: error_message = ( "Error calling Go. " "Check if Go is installed using 'go version'." - " Need at least v1.18.0." + " Need at least v1.21.0." ) self.logger.error(error_message) raise ValueError(error_message) - self.logger.info("Go version>=1.18.0") + self.logger.info("Go version>=1.21.0") # Check if demofile exists if not os.path.exists(os.path.abspath(self.demofile)): diff --git a/awpy/parser/go.mod b/awpy/parser/go.mod index 9008d5a59..8b592cf1e 100644 --- a/awpy/parser/go.mod +++ b/awpy/parser/go.mod @@ -1,6 +1,6 @@ module github.com/pnxenopoulos/csgo -go 1.18 +go 1.21 require github.com/markus-wa/demoinfocs-golang/v3 v3.3.0 diff --git a/awpy/utils.py b/awpy/utils.py index 8bef14154..a9bc2dd37 100644 --- a/awpy/utils.py +++ b/awpy/utils.py @@ -39,7 +39,7 @@ def __getitem__(self, item: Any) -> Any: # noqa: ANN401 def check_go_version() -> bool: """Function to check the Golang version of the current machine. - Returns True if greater than 1.18.0 + Returns True if greater than 1.21.0 Returns: bool whether the found go version is recent enough @@ -64,7 +64,7 @@ def parse_go_version(parsed_resp: list[bytes] | None) -> list[str]: except Exception as e: # noqa: BLE001 print(e) return False - return [int(x) for x in parsed_go_version] >= [1, 18] + return [int(x) for x in parsed_go_version] >= [1, 21] def is_in_range(value: float, minimum: float, maximum: float) -> bool: diff --git a/docs/installation.rst b/docs/installation.rst index b490b0ef8..b8e9f495b 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,6 +3,6 @@ Installation ``pip install awpy`` -To install awpy, you must have Python >= 3.11 and Go (the programming language) installed. You need a Go version greater than 1.18, and you can visit this link to install the latest `Golang version `_. +To install awpy, you must have Python >= 3.11 and Go (the programming language) installed. You need a Go version greater than 1.21, and you can visit this link to install the latest `Golang version `_. Once you have Golang installed, you can check your version in command line by using the command ``go version``. After this, simply run ``pip install awpy``. diff --git a/tests/test_utils.py b/tests/test_utils.py index 6f3943bb2..618e5ee1f 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -10,9 +10,9 @@ class TestUtils: @patch("awpy.utils.subprocess") def test_go_version(self, mock_subproc: MagicMock): - """Tests if the Golang version >= 1.18.0.""" + """Tests if the Golang version >= 1.21.0.""" inputs = [ - b"go version go1.18.4 windows/amd64", + b"go version go1.21.0 windows/amd64", b"go version go1.17.4 windows/amd64", b"go version go1.7.4 windows/amd64", b"", From b753ffe4cc68f43b0e0aae8c2aee11e278f63f4c Mon Sep 17 00:00:00 2001 From: pnxenopoulos Date: Mon, 4 Sep 2023 09:59:47 -0400 Subject: [PATCH 3/6] update readme for cs2 --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index da5e824b8..8ccaa9ec2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # awpy -The `awpy` package provides data parsing, analytics and visualization capabilities for Counter-Strike: Global Offensive (CSGO) data. In this repository, you will find the source code, issue tracker and other useful `awpy` information. Please join [our Discord](https://discord.gg/W34XjsSs2H) for discussion around the library and esports analytics. You may visit the documentation [here](https://awpy.readthedocs.io/en/latest/). +The `awpy` package provides data parsing, analytics and visualization capabilities for Counter-Strike (both CSGO and CS2) data. In this repository, you will find the source code, issue tracker and other useful `awpy` information. Please join [our Discord](https://discord.gg/W34XjsSs2H) for discussion around the library and esports analytics. You may visit the documentation [here](https://awpy.readthedocs.io/en/latest/). ## Table of Contents [Setup and Installation](#setup) @@ -79,14 +79,14 @@ data_df = demo_parser.parse(return_type="df") Please note that the parser parses _everything_ in the demo. This means that you may have rounds from the warmup (denoted with the `isWarmup` flag), rounds that may have ended in a draw, and other odd-looking rounds. Try using the `DemoParser.clean_rounds()` method to clean up. Note that this is not going to be 100 percent perfect. ### Help! The parser doesn't work or lacks a feature -If you need help with the parser, join [our Discord](https://discord.gg/3JrhKYcEKW). CSGO demos are oftentimes imperfect, but if you ask on Discord, we can try to figure out what is the problem. Please remember to post the error and demo if you can! You can also check the [open issues](https://github.com/pnxenopoulos/awpy/issues) or visit visit [our documentation](https://awpy.readthedocs.io/en/latest/). +If you need help with the parser, join [our Discord](https://discord.gg/3JrhKYcEKW). Counter-Strike demos are oftentimes imperfect, but if you ask on Discord, we can try to figure out what is the problem. Please remember to post the error and demo if you can! You can also check the [open issues](https://github.com/pnxenopoulos/awpy/issues) or visit visit [our documentation](https://awpy.readthedocs.io/en/latest/). ## Examples and Projects Take a look at the following Jupyter notebooks provided in our `examples/` directory. These will help you get started parsing and analyzing CSGO data. -- [Parsing a CSGO demofile](https://github.com/pnxenopoulos/awpy/blob/main/examples/00_Parsing_a_CSGO_Demofile.ipynb) -- [Basic CSGO analysis](https://github.com/pnxenopoulos/awpy/blob/main/examples/01_Basic_CSGO_Analysis.ipynb) -- [Basic CSGO visualization](https://github.com/pnxenopoulos/awpy/blob/main/examples/02_Basic_CSGO_Visualization.ipynb) +- [Parsing a demofile](https://github.com/pnxenopoulos/awpy/blob/main/examples/00_Parsing_a_CSGO_Demofile.ipynb) +- [Basic analysis](https://github.com/pnxenopoulos/awpy/blob/main/examples/01_Basic_CSGO_Analysis.ipynb) +- [Basic visualization](https://github.com/pnxenopoulos/awpy/blob/main/examples/02_Basic_CSGO_Visualization.ipynb) - [Working with navigation meshes](https://github.com/pnxenopoulos/awpy/blob/main/examples/03_Working_with_Navigation_Meshes.ipynb) - [Advanced navigation functionality](https://github.com/pnxenopoulos/awpy/blob/main/examples/04_Advanced_Navigation_Functionality.ipynb) - [Map control](https://github.com/pnxenopoulos/awpy/blob/main/examples/05_Map_Control_Calculations_And_Visualizations.ipynb) @@ -102,10 +102,10 @@ We welcome any contributions from the community. You can visit the [issue page]( ``` . ├── awpy -│   ├── analytics # Code for CSGO analytics -│   ├── data # Code for dealing with CSGO map and nav data -│   ├── parser # Code for CSGO demo parser -│   └── visualization # Code for CSGO visualization +│   ├── analytics # Code for analytics +│   ├── data # Code for dealing with map and nav data +│   ├── parser # Code for demo parser +│   └── visualization # Code for visualization ├── doc # Contains documentation files ├── examples # Contains Jupyter Notebooks showing example code └── tests # Contains tests for the awpy package From afdbb7b55daf7f1330617ee7f21c07c0554dd7ca Mon Sep 17 00:00:00 2001 From: pnxenopoulos Date: Mon, 4 Sep 2023 10:24:14 -0400 Subject: [PATCH 4/6] force build --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e18ce4f7..b240d93bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ The coverage run -m pytest --durations=10 command, which runs the Python tests, If you do not have the time or bandwidth, you can omit running the test command locally, since Github actions will run them, as well. -### Testing/Coverage +### Testing & Coverage If you are fixing a bug or adding a new feature make sure to also add [unit tests](https://en.wikipedia.org/wiki/Unit_testing) that cover the original bug or your new functionality. From 64dfec2f88aed3f669ab30942eebd4df05ce6361 Mon Sep 17 00:00:00 2001 From: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:17:52 +0200 Subject: [PATCH 5/6] Changes to actually run cs2 demos --- _typos.toml | 2 ++ awpy/parser/go.mod | 3 +-- awpy/parser/go.sum | 18 ++++++------------ awpy/parser/parse_demo.go | 6 +++--- awpy/parser/parse_demo_test.go | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/_typos.toml b/_typos.toml index 53b0908ef..7e37da79a 100644 --- a/_typos.toml +++ b/_typos.toml @@ -9,6 +9,8 @@ extend-ignore-identifiers-re = [ "MAKAR.*", # Don't correct the id in notebook ".*ba355586.*", + # Dont correct repo version + ".*348096939ba7.*" ] [type.golangcilint] diff --git a/awpy/parser/go.mod b/awpy/parser/go.mod index 8b592cf1e..503c14ce2 100644 --- a/awpy/parser/go.mod +++ b/awpy/parser/go.mod @@ -2,12 +2,11 @@ module github.com/pnxenopoulos/csgo go 1.21 -require github.com/markus-wa/demoinfocs-golang/v3 v3.3.0 +require github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.2 require ( github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0 // indirect github.com/markus-wa/go-unassert v0.1.3 // indirect github.com/markus-wa/gobitread v0.2.3 // indirect github.com/markus-wa/godispatch v1.4.1 // indirect diff --git a/awpy/parser/go.sum b/awpy/parser/go.sum index 681fa48f3..3771121be 100644 --- a/awpy/parser/go.sum +++ b/awpy/parser/go.sum @@ -1,8 +1,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/geo v0.0.0-20180826223333-635502111454/go.mod h1:vgWZ7cu0fq0KY3PpEHsocXOWJpRtkcbKemU4IUw0M60= -github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 h1:gtexQ/VGyN+VVFRXSFiguSNcXmS6rkKT+X7FdIrTtfo= -github.com/golang/geo v0.0.0-20210211234256-740aa86cb551/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/geo v0.0.0-20230421003525-6adc56603217 h1:HKlyj6in2JV6wVkmQ4XmG/EIm+SCYlPZ+V4GWit7Z+I= github.com/golang/geo v0.0.0-20230421003525-6adc56603217/go.mod h1:8wI0hitZ3a1IxZfeH3/5I97CI8i5cLGsYe7xNhQGs9U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -10,18 +9,14 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/markus-wa/demoinfocs-golang/v3 v3.3.0 h1:cXAI081cH5tDmmyPuyUzuIGeP8strtVzdtRB5VlIvL8= -github.com/markus-wa/demoinfocs-golang/v3 v3.3.0/go.mod h1:NzAkCtDshPkoSMg3hAyojkmHE4ZgnNWCM1Vv4yCPLsI= -github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0 h1:cP34r7ZHfQvJA0kwO7gA/lWLEAHhIghxTptwnV5KRls= -github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.0/go.mod h1:YuAfxa0q7mG+HSUjrSXFmaZ8xVRWK9k/vcG/rLbzrBA= +github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.2 h1:vOkS+YKVJYC/KeA+UJSrKojcj23Y8NX4Mt/DKpIVT08= +github.com/markus-wa/demoinfocs-golang/v4 v4.0.0-beta.2/go.mod h1:YuAfxa0q7mG+HSUjrSXFmaZ8xVRWK9k/vcG/rLbzrBA= github.com/markus-wa/go-unassert v0.1.3 h1:4N2fPLUS3929Rmkv94jbWskjsLiyNT2yQpCulTFFWfM= github.com/markus-wa/go-unassert v0.1.3/go.mod h1:/pqt7a0LRmdsRNYQ2nU3SGrXfw3bLXrvIkakY/6jpPY= github.com/markus-wa/gobitread v0.2.3 h1:COx7dtYQ7Q+77hgUmD+O4MvOcqG7y17RP3Z7BbjRvPs= github.com/markus-wa/gobitread v0.2.3/go.mod h1:PcWXMH4gx7o2CKslbkFkLyJB/aHW7JVRG3MRZe3PINg= github.com/markus-wa/godispatch v1.4.1 h1:Cdff5x33ShuX3sDmUbYWejk7tOuoHErFYMhUc2h7sLc= github.com/markus-wa/godispatch v1.4.1/go.mod h1:tk8L0yzLO4oAcFwM2sABMge0HRDJMdE8E7xm4gK/+xM= -github.com/markus-wa/ice-cipher-go v0.0.0-20220823210642-1fcccd18c6c1 h1:YH4WI14HARrM3C6mKUMFDBz93O25oWSlLEYGeL27G0w= -github.com/markus-wa/ice-cipher-go v0.0.0-20220823210642-1fcccd18c6c1/go.mod h1:JIsht5Oa9P50VnGJTvH2a6nkOqDFJbUeU1YRZYvdplw= github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7 h1:aR9pvnlnBxifXBmzidpAiq2prLSGlkhE904qnk2sCz4= github.com/markus-wa/ice-cipher-go v0.0.0-20230901094113-348096939ba7/go.mod h1:JIsht5Oa9P50VnGJTvH2a6nkOqDFJbUeU1YRZYvdplw= github.com/markus-wa/quickhull-go/v2 v2.2.0 h1:rB99NLYeUHoZQ/aNRcGOGqjNBGmrOaRxdtqTnsTUPTA= @@ -34,18 +29,17 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/awpy/parser/parse_demo.go b/awpy/parser/parse_demo.go index 1ef41401d..a074da592 100644 --- a/awpy/parser/parse_demo.go +++ b/awpy/parser/parse_demo.go @@ -11,9 +11,9 @@ import ( "strconv" "strings" - dem "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs" - common "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/common" - events "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events" + dem "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs" + common "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/common" + events "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events" ) const unknown = "Unknown" diff --git a/awpy/parser/parse_demo_test.go b/awpy/parser/parse_demo_test.go index 69c9e0713..a7019c113 100644 --- a/awpy/parser/parse_demo_test.go +++ b/awpy/parser/parse_demo_test.go @@ -3,7 +3,7 @@ package main import ( "testing" - common "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/common" + common "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/common" ) func TestConvertRank(t *testing.T) { From 8ce0b969bb830897a14f3d8a4beec78379d8d2c8 Mon Sep 17 00:00:00 2001 From: Jan-Eric Nitschke <47750513+JanEricNitschke@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:28:08 +0200 Subject: [PATCH 6/6] Fixed non-exhaustive switch --- awpy/parser/parse_demo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awpy/parser/parse_demo.go b/awpy/parser/parse_demo.go index a074da592..9163504a1 100644 --- a/awpy/parser/parse_demo.go +++ b/awpy/parser/parse_demo.go @@ -551,6 +551,12 @@ func convertRoundEndReason(r events.RoundEndReason) string { return "TerroristsSurrender" case events.RoundEndReasonCTSurrender: return "CTSurrender" + case events.RoundEndReasonStillInProgress: + return "StillInProgress" + case events.RoundEndReasonTerroristsPlanted: + return "TerroristsPlanted" + case events.RoundEndReasonCTsReachedHostage: + return "CTsReachedHostage" default: return unknown }