-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix array decoding #510
fix array decoding #510
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #510 +/- ##
==========================================
+ Coverage 80.49% 80.70% +0.21%
==========================================
Files 47 47
Lines 6367 6401 +34
==========================================
+ Hits 5125 5166 +41
+ Misses 1029 1021 -8
- Partials 213 214 +1 ☔ View full report in Codecov by Sentry. |
3cb8a8a
to
d7f89fd
Compare
It still fails for me, but now at least I can create a replicable example (here's the match): package main
import (
dem "github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs"
"github.com/markus-wa/demoinfocs-golang/v4/pkg/demoinfocs/events"
"log"
"os"
)
func main() {
f, err := os.Open("1-f06e69ac-25e4-4a11-a7ec-092bdf1c4f69-1-1.dem")
if err != nil {
log.Panic("failed to open demo file: ", err)
}
defer f.Close()
p := dem.NewParser(f)
defer p.Close()
p.RegisterEventHandler(func(e events.FrameDone) {
for _, pl := range p.GameState().Participants().All() {
pl.MVPs()
}
})
err = p.ParseToEnd()
if err != nil {
panic(err)
}
}
|
can you send the full stacktrace please @BestAwperEver 🙏 |
Sure! Is it still non-replicable though?
|
@BestAwperEver that's a CS:GO demo, right? Or is it actually CS2? sorry I'm on my phone - I didn't expect propdecoder.go in a cs2 stack trace |
The filestamp is "PBDEMS2" and the match was played on February 12, so I'm pretty sure it's CS2. Don't mind the link -- it contains "csgo" instead of "cs2" (and works as well if you replace "csgo" by "cs2") just because I've created it manually from the old link on a CS:GO match by replacing the ID which I got from the demo file name 😃 |
f39979e
to
5d503e7
Compare
@BestAwperEver can you try again with |
02da378
to
7b8da17
Compare
I assume you've already tested it, but I ran the demo on the current master and encountered no issues with the code above. Thanks! |
see #509
I'm not really sure why the old version was crashing on all versions of Go except 1.21 - but this should fix array decoding to be much more consistent.
Previously PropertyUpdate events contained either a
fieldState
or an int, now it's always an array.