Skip to content

Commit fb3c622

Browse files
authored
Merge pull request #331 from markus-wa/v3
v3.0.0
2 parents 6269293 + 82e8cba commit fb3c622

File tree

106 files changed

+29156
-99678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+29156
-99678
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
ci:
77
strategy:
88
matrix:
9-
go-version: [1.11.x, 1.18.x]
9+
go-version: [1.18.x]
1010

1111
runs-on: ubuntu-latest
1212

@@ -36,9 +36,8 @@ jobs:
3636
# install 7zip for decompressing test demos
3737
sudo apt-get install -y p7zip-full
3838
39-
# Install interface generator - go 1.11 doesn't allow specifying a version with go get or go install, so we need to manually git clone
40-
git clone https://github.com/vburenin/ifacemaker /tmp/ifacemaker
41-
pushd /tmp/ifacemaker && git checkout v1.1.0 && go install . && popd
39+
# Install interface generator
40+
go install github.com/vburenin/[email protected]
4241
4342
# Fetch refs for linter
4443
git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*

.github/workflows/protobuf.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
if: env.PROTOBUFS_CHANGED == 'true'
2727
uses: actions/setup-go@v2
2828
with:
29-
go-version: 1.14.x
29+
go-version: 1.18.x
3030

3131
- name: Install Protobuf tools
3232
if: env.PROTOBUFS_CHANGED == 'true'
@@ -43,14 +43,14 @@ jobs:
4343
if: env.PROTOBUFS_CHANGED == 'true'
4444
run: |
4545
cd pkg/demoinfocs/msg
46-
sed -i '1s/^/option go_package = "msg";\n\n/' proto/cstrike15_usermessages.proto
47-
sed -i '1s/^/option go_package = "msg";\n\n/' proto/cstrike15_gcmessages.proto
48-
sed -i '1s/^/option go_package = "msg";\n\n/' proto/engine_gcmessages.proto
49-
sed -i '1s/^/option go_package = "msg";\n\n/' proto/netmessages.proto
50-
sed -i '1s/^/option go_package = "msg";\n\n/' proto/steammessages.proto
46+
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/cstrike15_usermessages.proto
47+
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/cstrike15_gcmessages.proto
48+
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/engine_gcmessages.proto
49+
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/netmessages.proto
50+
sed -i '1s/^/option go_package = "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/msg";\n\n/' proto/steammessages.proto
5151
5252
export PATH=/tmp/protoc/bin:$PATH
53-
protoc -I=proto --gogofaster_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. proto/*.proto
53+
./generate.sh
5454
5555
- name: Commit changes
5656
if: env.PROTOBUFS_CHANGED == 'true'

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ linters-settings:
6464
disabled-checks:
6565
- ifElseChain
6666
gci:
67-
local-prefixes: github.com/markus-wa/demoinfocs-golang/v2
67+
local-prefixes: github.com/markus-wa/demoinfocs-golang/v3

README.md

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A blazing fast, feature complete and production ready Go library for parsing and
44

55
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://vshymanskyy.github.io/StandWithUkraine)
66

7-
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs?tab=doc)
7+
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs?tab=doc)
88
[![Build Status](https://img.shields.io/github/workflow/status/markus-wa/demoinfocs-golang/CI/master?style=flat-square)](https://github.com/markus-wa/demoinfocs-golang/actions)
99
[![codecov](https://img.shields.io/codecov/c/github/markus-wa/demoinfocs-golang?style=flat-square)](https://codecov.io/gh/markus-wa/demoinfocs-golang)
1010
[![Go Report](https://goreportcard.com/badge/github.com/markus-wa/demoinfocs-golang?style=flat-square)](https://goreportcard.com/report/github.com/markus-wa/demoinfocs-golang)
@@ -25,7 +25,7 @@ If you have been enjoying this library and are considering donating, please chec
2525

2626
## Go Get
2727

28-
go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs
28+
go get -u github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs
2929

3030
## Table of Contents
3131

@@ -49,7 +49,7 @@ If you have been enjoying this library and are considering donating, please chec
4949

5050
## Requirements
5151

52-
This library requires at least `go 1.11` to run.
52+
This library requires at least `go 1.18` to run.
5353
You can download the latest version of Go [here](https://golang.org/).
5454

5555
## Quickstart Guide
@@ -66,7 +66,7 @@ go mod init github.com/<YOUR_GITHUB_USER>/my-project
6666
# the module name (github.com/<YOUR_GITHUB_USER>/my-project) can always be changed later
6767
# you can also put example.com/my-project or anything else if you don't plan to publish your project
6868
69-
go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs
69+
go get -u github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs
7070
```
7171

7272
3. Create a `main.go` file with the example below
@@ -88,8 +88,8 @@ import (
8888
"log"
8989
"os"
9090

91-
dem "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
92-
events "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events"
91+
dem "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs"
92+
events "github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events"
9393
)
9494

9595
func main() {
@@ -146,24 +146,24 @@ Check out the [examples](examples) folder for more examples, like [how to genera
146146

147147
### Documentation
148148

149-
The full API documentation is available here on [pkg.go.dev](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs).
149+
The full API documentation is available here on [pkg.go.dev](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs).
150150

151151
## Features
152152

153-
* Game events (kills, shots, round starts/ends, footsteps etc.) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events?tab=doc) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
154-
* Tracking of game-state (players, teams, grenades, ConVars etc.) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs?tab=doc#GameState)
155-
* Grenade projectiles / trajectories - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs?tab=doc#GameState.GrenadeProjectiles) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/nade-trajectories)
156-
* Access to entities, server-classes & data-tables - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/sendtables?tab=doc#ServerClasses) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/entities)
157-
* Access to all net-messages - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs?tab=doc#NetMessageCreator) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/net-messages)
158-
* Chat & console messages <sup id="achat1">1</sup> - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events?tab=doc#ChatMessage) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
159-
* Matchmaking ranks (official MM demos only) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events?tab=doc#RankUpdate)
153+
* Game events (kills, shots, round starts/ends, footsteps etc.) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events?tab=doc) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
154+
* Tracking of game-state (players, teams, grenades, ConVars etc.) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs?tab=doc#GameState)
155+
* Grenade projectiles / trajectories - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs?tab=doc#GameState.GrenadeProjectiles) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/nade-trajectories)
156+
* Access to entities, server-classes & data-tables - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/sendtables?tab=doc#ServerClasses) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/entities)
157+
* Access to all net-messages - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs?tab=doc#NetMessageCreator) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/net-messages)
158+
* Chat & console messages <sup id="achat1">1</sup> - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events?tab=doc#ChatMessage) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
159+
* Matchmaking ranks (official MM demos only) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs/events?tab=doc#RankUpdate)
160160
* Full POV demo support <sup id="achat1">2</sup>
161-
* Support for encrypted net-messages (if the [decryption key](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2@master/pkg/demoinfocs#ParserConfig) is provided)
161+
* Support for encrypted net-messages (if the [decryption key](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3@master/pkg/demoinfocs#ParserConfig) is provided)
162162
* JavaScript (browser / Node.js) support via WebAssembly - [example](https://github.com/markus-wa/demoinfocs-wasm)
163163
* [Easy debugging via build-flags](#debugging)
164164
* Built with performance & concurrency in mind
165165

166-
1. <small id="f1">In MM demos the chat is encrypted, so [`ParserConfig.NetMessageDecryptionKey`](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2@master/pkg/demoinfocs#ParserConfig) needs to be set - see also [`MatchInfoDecryptionKey()`](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2@master/pkg/demoinfocs#MatchInfoDecryptionKey).</small>
166+
1. <small id="f1">In MM demos the chat is encrypted, so [`ParserConfig.NetMessageDecryptionKey`](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3@master/pkg/demoinfocs#ParserConfig) needs to be set - see also [`MatchInfoDecryptionKey()`](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v3@master/pkg/demoinfocs#MatchInfoDecryptionKey).</small>
167167
2. <small id="f2">Better than some other parsers at the time of writing.</small>
168168

169169
## Performance / Benchmarks
@@ -229,7 +229,7 @@ If your project is using this library feel free to submit a PR or send a message
229229
You can use the build tag `debugdemoinfocs` (i.e. `go test -tags debugdemoinfocs -v`) to print out debugging information - such as game events or unhandled demo-messages - during the parsing process.<br>
230230
Side-note: The tag isn't called `debug` to avoid naming conflicts with other libs (and underscores in tags don't work, apparently).
231231

232-
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags="-X 'github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs.debugServerClasses=YES'"`
232+
To change the default debugging behavior, Go's `ldflags` parameter can be used. Example for additionally printing out all server-classes with their properties: `-ldflags="-X 'github.com/markus-wa/demoinfocs-golang/v3/pkg/demoinfocs.debugServerClasses=YES'"`
233233

234234
Check out `debug_on.go` for any other settings that can be changed.
235235

@@ -281,14 +281,9 @@ After adding it to your `PATH` you can use `scripts/generate-interfaces.sh` to u
281281

282282
Should you need to re-generate the protobuf generated code in the `msg` package, you will need the following tools:
283283

284-
- The latest protobuf generator (`protoc`) from your package manager or https://github.com/google/protobuf/releases
285-
286-
- And `protoc-gen-gogofaster` from [gogoprotobuf](https://github.com/gogo/protobuf) to generate code for go.
287-
288-
go get -u github.com/gogo/protobuf/protoc-gen-gogofaster
289-
290-
[//]: # "The go get above needs two tabs so it's displayed a) as part of the last list entry and b) as a code-block"
291-
[//]: # "Oh and don't try to move these comments above it either"
284+
```
285+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
286+
```
292287

293288
Make sure both are inside your `PATH` variable.
294289

assets/maps/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

assets/maps/de_ancient.jpg

-133 KB
Binary file not shown.

assets/maps/de_cache.jpg

-83.6 KB
Binary file not shown.

assets/maps/de_canals.jpg

-79.6 KB
Binary file not shown.

assets/maps/de_cbble.jpg

-62.3 KB
Binary file not shown.

assets/maps/de_dust.jpg

-61.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)