Skip to content

Commit 1d90d1d

Browse files
authored
Merge pull request #207 from markus-wa/v2
v2.0.0
2 parents e70eafa + ab968b6 commit 1d90d1d

File tree

127 files changed

+11796
-8894
lines changed

Some content is hidden

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

127 files changed

+11796
-8894
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ demoinfocs-golang.test.exe
44
.vscode/
55
.idea/
66
*.log
7+
log.*
78
coverage.*
9+
*.out
10+
demoinfocs.test

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ linters:
1414
- gochecknoglobals
1515
- lll
1616
- typecheck
17+
- gomnd
18+
issues:
19+
exclude-rules:
20+
# Exclude some linters from running on tests files.
21+
- path: _test\.go
22+
linters:
23+
- wsl
24+
- funlen
1725
linters-settings:
1826
gocritic:
1927
disabled-checks:

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ before_script:
3939

4040
script:
4141
# Compile
42-
- bin/build.sh
42+
- scripts/build.sh
4343

4444
# Make sure generated code is up-to-date
45-
- bin/check-interfaces-generated.sh
45+
- scripts/check-interfaces-generated.sh
4646

4747
# Lint changed code
48-
- bin/lint-changes.sh
48+
- scripts/lint-changes.sh
4949

5050
# Run race tests
51-
- bin/race-tests.sh
51+
- scripts/race-tests.sh
5252

5353
# Coverage
5454
# Note: We run ALL tests again to get full coverage
5555
# Race tests are too slow and skip the regression set
56-
- bin/coverage.sh
56+
- scripts/coverage.sh
5757

5858
after_success:
5959
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Is a Go library for super fast parsing and analysing of Counter Strike: Global Offensive (CS:GO) demos (aka replays). It is based on <a href="https://github.com/ValveSoftware/csgo-demoinfo" rel="external">Valve's demoinfogo</a> and <a href="https://github.com/StatsHelix/demoinfo" rel="external">SatsHelix's demoinfo</a>.
44

5-
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang?tab=doc)
5+
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs?tab=doc)
66
[![Build Status](https://travis-ci.org/markus-wa/demoinfocs-golang.svg?branch=master)](https://travis-ci.org/markus-wa/demoinfocs-golang)
77
[![codecov](https://codecov.io/gh/markus-wa/demoinfocs-golang/branch/master/graph/badge.svg)](https://codecov.io/gh/markus-wa/demoinfocs-golang)
88
[![Go Report](https://goreportcard.com/badge/github.com/markus-wa/demoinfocs-golang)](https://goreportcard.com/report/github.com/markus-wa/demoinfocs-golang)
@@ -23,14 +23,20 @@ Go check out [this README on the `v2` branch](https://github.com/markus-wa/demoi
2323

2424
## Requirements
2525

26-
This library is intended to be used with `go 1.11` or higher as it is built using Go modules.
26+
This library should be used with `go 1.11` or higher as it is built using Go modules.
2727

2828
It's recommended to use modules for consumers as well if possible.
2929
If you are unfamiliar with Go modules there's a [list of recommended resources](https://github.com/markus-wa/demoinfocs-golang/wiki/Go-Modules#recommended-links--articles) in the wiki.
3030

3131
## Go Get
3232

33-
go get -u github.com/markus-wa/demoinfocs-golang
33+
go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs
34+
35+
## Upgrading from v1.x to v2
36+
37+
If you are currently using version 1.x of this library, check out [this wiki page](https://github.com/markus-wa/demoinfocs-golang/wiki/Upgrading-from-v1.x-to-v2.0.0) for an upgrade guide.
38+
39+
The old code is also still available in the [`v1` branch](https://github.com/markus-wa/demoinfocs-golang/tree/v1) if you need it.
3440

3541
## Example
3642

@@ -46,8 +52,8 @@ import (
4652
"fmt"
4753
"os"
4854

49-
dem "github.com/markus-wa/demoinfocs-golang"
50-
events "github.com/markus-wa/demoinfocs-golang/events"
55+
dem "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
56+
events "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events"
5157
)
5258

5359
func main() {
@@ -103,12 +109,13 @@ Check out the [examples](examples) folder for more examples, like [how to genera
103109

104110
## Features
105111

106-
* Game events (kills, shots, round starts/ends, footsteps etc.) - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang/events) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
107-
* Tracking of game-state (players, teams, grenades, ConVars etc.) - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang#GameState)
108-
* Grenade projectiles / trajectories - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang#GameState.GrenadeProjectiles) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/nade-trajectories)
109-
* Access to entities, server-classes & data-tables - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang/sendtables#ServerClasses) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/entities)
110-
* Access to all net-messages - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang#NetMessageCreator) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/net-messages)
111-
* Chat & console messages <sup id="achat1">1</sup> - [docs](https://godoc.org/github.com/markus-wa/demoinfocs-golang/events#ChatMessage) / [example](https://github.com/markus-wa/demoinfocs-golang/tree/master/examples/print-events)
112+
* 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)
113+
* 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)
114+
* 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)
115+
* 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)
116+
* 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)
117+
* 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)
118+
* Matchmaking ranks (official MM demos only) - [docs](https://pkg.go.dev/github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/events?tab=doc#RankUpdate)
112119
* POV demo support <sup id="achat1">2</sup>
113120
* JavaScript (browser / Node.js) support via WebAssembly - [example](https://github.com/markus-wa/demoinfocs-wasm)
114121
* [Easy debugging via build-flags](#debugging)
@@ -174,7 +181,7 @@ If your project is using this library feel free to submit a PR or send a message
174181

175182
To install some (optional, but quite handy) `pre-commit` and `pre-push` hooks, you can run the following script.
176183

177-
bin/git-hooks/link-git-hooks.sh
184+
scripts/git-hooks/link-git-hooks.sh
178185

179186
#### `pre-commit`:
180187
- check if [interfaces have been updated](#generating-interfaces)
@@ -193,7 +200,7 @@ However, due to some design flaws in some parts of the code it's currently not a
193200

194201
Running unit tests:
195202

196-
bin/unit-tests.sh
203+
scripts/unit-tests.sh
197204
# or (identical)
198205
go test -short ./...
199206

@@ -207,7 +214,7 @@ Prerequisites:
207214

208215
Downloading demos + running regression tests:
209216

210-
bin/regression-tests.sh
217+
scripts/regression-tests.sh
211218

212219
#### Updating the `default.golden` file
213220

@@ -231,11 +238,11 @@ Check out `debug_on.go` for any other settings that can be changed.
231238

232239
### Generating interfaces
233240

234-
We generate interfaces such as `IGameState` from structs to make it easier to keep docs in synch over structs and interfaces.
241+
We generate interfaces such as `GameState` from structs to make it easier to keep docs in synch over structs and interfaces.
235242
For this we use [@vburenin](https://github.com/vburenin)'s [`ifacemaker`](https://github.com/vburenin/ifacemaker) tool.
236243

237244
You can download the latest version [here](https://github.com/vburenin/ifacemaker/releases).
238-
After adding it to your `PATH` you can use `bin/generate-interfaces.sh` to update interfaces.
245+
After adding it to your `PATH` you can use `scripts/generate-interfaces.sh` to update interfaces.
239246

240247
### Generating protobuf code
241248

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)