File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,21 @@ Example: `ConVar` messages
3535
3636``` go
3737import (
38+ proto " github.com/gogo/protobuf/proto"
39+
3840 dem " github.com/markus-wa/demoinfocs-golang"
41+ ex " github.com/markus-wa/demoinfocs-golang/examples"
3942 msg " github.com/markus-wa/demoinfocs-golang/msg"
4043)
4144
4245cfg := dem.DefaultParserConfig
4346cfg.AdditionalNetMessageCreators = map [int ]dem.NetMessageCreator {
44- 6 : func () proto.Message {
47+ int (msg. NET_Messages_net_SetConVar ) : func () proto.Message {
4548 return new (msg.CNETMsg_SetConVar )
4649 },
4750}
51+
52+ p := dem.NewParserWithConfig (f, cfg)
4853```
4954
5055## Registering net-message handlers
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ func main() {
2020 // Configure parsing of ConVar net-message (id=6)
2121 cfg := dem .DefaultParserConfig
2222 cfg .AdditionalNetMessageCreators = map [int ]dem.NetMessageCreator {
23- 6 : func () proto.Message {
23+ int ( msg . NET_Messages_net_SetConVar ) : func () proto.Message {
2424 return new (msg.CNETMsg_SetConVar )
2525 },
2626 }
You can’t perform that action at this time.
0 commit comments