diff --git a/dissect/defuse.go b/dissect/defuse.go index 500e2f9..344dd7e 100644 --- a/dissect/defuse.go +++ b/dissect/defuse.go @@ -1,8 +1,9 @@ package dissect import ( - "github.com/rs/zerolog/log" "strings" + + "github.com/rs/zerolog/log" ) func readDefuserTimer(r *Reader) error { diff --git a/dissect/feedback.go b/dissect/feedback.go index 61a0841..4881c98 100644 --- a/dissect/feedback.go +++ b/dissect/feedback.go @@ -56,14 +56,24 @@ var activity2 = []byte{0x00, 0x00, 0x00, 0x22, 0xe3, 0x09, 0x00, 0x79} var killIndicator = []byte{0x22, 0xd9, 0x13, 0x3c, 0xba} func readMatchFeedback(r *Reader) error { - bombIndicator, err := r.Bytes(1) - if err != nil { - return err - } - _ = bytes.Equal(bombIndicator, []byte{0x01}) // TODO, figure out meaning - err = r.Seek(activity2) - if err != nil { - return err + if r.Header.CodeVersion < Y9S1 { + if err := r.Skip(1); err != nil { + return err + } + if err := r.Seek(activity2); err != nil { + return err + } + } else { + if err := r.Skip(9); err != nil { + return err + } + valid, err := r.Int() + if err != nil || valid != 4 { + return err + } + if err := r.Skip(24); err != nil { + return err + } } size, err := r.Int() if err != nil { @@ -137,6 +147,10 @@ func readMatchFeedback(r *Reader) error { log.Debug().Interface("match_update", u).Send() return nil } + // TODO: Y9S1 may have removed or modified other match feedback options + if r.Header.CodeVersion >= Y9S1 { + return nil + } b, err := r.Bytes(size) if err != nil { return err diff --git a/dissect/site.go b/dissect/site.go index 329dd11..0bd4dce 100644 --- a/dissect/site.go +++ b/dissect/site.go @@ -1,12 +1,12 @@ package dissect import ( - "github.com/rs/zerolog/log" "strings" + + "github.com/rs/zerolog/log" ) func readSpawn(r *Reader) error { - log.Debug().Msg("site found") location, err := r.String() if err != nil { return err