Skip to content

Commit 7dbdaaa

Browse files
committed
stop using vtprotobuf (it's not faster than standard pb code)
1 parent dfb9e2f commit 7dbdaaa

21 files changed

+39
-67963
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ Should you need to re-generate the protobuf generated code in the `msg` package,
282282

283283
```
284284
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
285-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
286-
go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
287285
```
288286

289287
Make sure both are inside your `PATH` variable.

examples/net-messages/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242

4343
cfg := dem.DefaultParserConfig
4444
cfg.AdditionalNetMessageCreators = map[int]dem.NetMessageCreator{
45-
int(msg.SVC_Messages_svc_BSPDecal): func() dem.VTProtobufMessage {
45+
int(msg.SVC_Messages_svc_BSPDecal): func() proto.Message {
4646
return new(msg.CSVCMsg_BSPDecal)
4747
},
4848
}

examples/net-messages/netmessages.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"fmt"
55
"os"
66

7+
"google.golang.org/protobuf/proto"
8+
79
ex "github.com/markus-wa/demoinfocs-golang/v2/examples"
810
demoinfocs "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
911
msg "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/msg"
@@ -18,7 +20,7 @@ func main() {
1820
// Configure parsing of BSPDecal net-message
1921
cfg := demoinfocs.DefaultParserConfig
2022
cfg.AdditionalNetMessageCreators = map[int]demoinfocs.NetMessageCreator{
21-
int(msg.SVC_Messages_svc_BSPDecal): func() demoinfocs.VTProtobufMessage {
23+
int(msg.SVC_Messages_svc_BSPDecal): func() proto.Message {
2224
return new(msg.CSVCMsg_BSPDecal)
2325
},
2426
}

pkg/demoinfocs/demoinfocs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919

2020
dispatch "github.com/markus-wa/godispatch"
2121
"github.com/stretchr/testify/assert"
22+
"google.golang.org/protobuf/proto"
2223

2324
demoinfocs "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
2425
common "github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/common"
@@ -56,7 +57,7 @@ func TestDemoInfoCs(t *testing.T) {
5657
p := demoinfocs.NewParserWithConfig(f, demoinfocs.ParserConfig{
5758
MsgQueueBufferSize: 1000,
5859
AdditionalNetMessageCreators: map[int]demoinfocs.NetMessageCreator{
59-
4: func() demoinfocs.VTProtobufMessage { return new(msg.CNETMsg_Tick) },
60+
4: func() proto.Message { return new(msg.CNETMsg_Tick) },
6061
},
6162
})
6263

pkg/demoinfocs/matchinfo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66

77
"github.com/pkg/errors"
8+
"google.golang.org/protobuf/proto"
89

910
"github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/msg"
1011
)
@@ -15,7 +16,7 @@ import (
1516
func MatchInfoDecryptionKey(b []byte) ([]byte, error) {
1617
m := new(msg.CDataGCCStrike15V2_MatchInfo)
1718

18-
err := m.UnmarshalVT(b)
19+
err := proto.Unmarshal(b, m)
1920
if err != nil {
2021
return nil, errors.Wrap(err, "failed to unmarshal MatchInfo message")
2122
}

pkg/demoinfocs/msg/cstrike15_gcmessages.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)