Skip to content

Commit

Permalink
proto updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoene committed Apr 18, 2024
1 parent e477b9b commit 6af6fe4
Show file tree
Hide file tree
Showing 113 changed files with 62,634 additions and 40,974 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ update: update-protobufs generate

update-protobufs:
rm -rf dota
svn export https://github.com/SteamDatabase/GameTracking-Dota2.git/trunk/Protobufs dota
mkdir -p ./dota/tmp && \
curl -L -o - https://github.com/SteamDatabase/GameTracking-Dota2/archive/master.tar.gz | tar -xz --strip-components=1 -C ./dota/tmp && \
cp -a ./dota/tmp/Protobufs/*.proto ./dota/ && \
rm -rf ./dota/tmp
rm -rf dota/gametoolevents.proto dota/dota_messages_mlbot.proto dota/dota_gcmessages_common_bot_script.proto dota/steammessages_base.proto dota/steammessages_clientserver_login.proto dota/tensorflow
$(SED) -i 's/^\(\s*\)\(optional\|repeated\|required\|extend\)\s*\./\1\2 /' dota/*.proto
$(SED) -i 's!^\s*rpc\s*\(\S*\)\s*(\.\([^)]*\))\s*returns\s*(\.\([^)]*\))\s*{!rpc \1 (\2) returns (\3) {!' dota/*.proto
$(SED) -i '1isyntax = "proto2";\n\npackage dota;\noption go_package = "github.com/dotabuff/manta/dota;dota";\n' dota/*.proto
$(SED) -i '/^import "google\/protobuf\/valve_extensions\.proto"/d' dota/*.proto
$(SED) -i '/^option (/d' dota/*.proto
$(SED) -i 's/\s\[.*\]//g' dota/*.proto
$(SED) -i 's/\.CMsgSteamLearn/CMsgSteamLearn/g' dota/*.proto
$(SED) -i 's/\.CMsgShowcaseItem/CMsgShowcaseItem/g' dota/*.proto
$(SED) -i 's/\.CMsgShowcaseBackground/CMsgShowcaseBackground/g' dota/*.proto
protoc -I dota --go_out=paths=source_relative:dota dota/*.proto

generate:
Expand Down
175 changes: 175 additions & 0 deletions callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Callbacks struct {
onCDemoFullPacket []func(*dota.CDemoFullPacket) error
onCDemoSaveGame []func(*dota.CDemoSaveGame) error
onCDemoSpawnGroups []func(*dota.CDemoSpawnGroups) error
onCDemoAnimationData []func(*dota.CDemoAnimationData) error
onCNETMsg_NOP []func(*dota.CNETMsg_NOP) error
onCNETMsg_Disconnect []func(*dota.CNETMsg_Disconnect) error
onCNETMsg_SplitScreenUser []func(*dota.CNETMsg_SplitScreenUser) error
Expand Down Expand Up @@ -84,6 +85,7 @@ type Callbacks struct {
onCUserMessageSayTextChannel []func(*dota.CUserMessageSayTextChannel) error
onCUserMessageShake []func(*dota.CUserMessageShake) error
onCUserMessageShakeDir []func(*dota.CUserMessageShakeDir) error
onCUserMessageWaterShake []func(*dota.CUserMessageWaterShake) error
onCUserMessageTextMsg []func(*dota.CUserMessageTextMsg) error
onCUserMessageScreenTilt []func(*dota.CUserMessageScreenTilt) error
onCUserMessageVoiceMask []func(*dota.CUserMessageVoiceMask) error
Expand All @@ -110,6 +112,7 @@ type Callbacks struct {
onCUserMessageRequestDllStatus []func(*dota.CUserMessageRequestDllStatus) error
onCUserMessageRequestUtilAction []func(*dota.CUserMessageRequestUtilAction) error
onCUserMessageRequestInventory []func(*dota.CUserMessageRequestInventory) error
onCUserMessageRequestDiagnostic []func(*dota.CUserMessageRequestDiagnostic) error
onCMsgVDebugGameSessionIDEvent []func(*dota.CMsgVDebugGameSessionIDEvent) error
onCMsgPlaceDecalEvent []func(*dota.CMsgPlaceDecalEvent) error
onCMsgClearWorldDecalsEvent []func(*dota.CMsgClearWorldDecalsEvent) error
Expand Down Expand Up @@ -269,6 +272,10 @@ type Callbacks struct {
onCDOTAUserMsg_DuelAccepted []func(*dota.CDOTAUserMsg_DuelAccepted) error
onCDOTAUserMsg_DuelRequested []func(*dota.CDOTAUserMsg_DuelRequested) error
onCDOTAUserMsg_MuertaReleaseEvent_AssignedTargetKilled []func(*dota.CDOTAUserMsg_MuertaReleaseEvent_AssignedTargetKilled) error
onCDOTAUserMsg_PlayerDraftSuggestPick []func(*dota.CDOTAUserMsg_PlayerDraftSuggestPick) error
onCDOTAUserMsg_PlayerDraftPick []func(*dota.CDOTAUserMsg_PlayerDraftPick) error
onCDOTAUserMsg_UpdateLinearProjectileCPData []func(*dota.CDOTAUserMsg_UpdateLinearProjectileCPData) error
onCDOTAUserMsg_GiftPlayer []func(*dota.CDOTAUserMsg_GiftPlayer) error

pb *proto.Buffer
}
Expand Down Expand Up @@ -359,6 +366,11 @@ func (c *Callbacks) OnCDemoSpawnGroups(fn func(*dota.CDemoSpawnGroups) error) {
c.onCDemoSpawnGroups = append(c.onCDemoSpawnGroups, fn)
}

// OnCDemoAnimationData registers a callback EDemoCommands_DEM_AnimationData
func (c *Callbacks) OnCDemoAnimationData(fn func(*dota.CDemoAnimationData) error) {
c.onCDemoAnimationData = append(c.onCDemoAnimationData, fn)
}

// OnCNETMsg_NOP registers a callback for NET_Messages_net_NOP
func (c *Callbacks) OnCNETMsg_NOP(fn func(*dota.CNETMsg_NOP) error) {
c.onCNETMsg_NOP = append(c.onCNETMsg_NOP, fn)
Expand Down Expand Up @@ -664,6 +676,11 @@ func (c *Callbacks) OnCUserMessageShakeDir(fn func(*dota.CUserMessageShakeDir) e
c.onCUserMessageShakeDir = append(c.onCUserMessageShakeDir, fn)
}

// OnCUserMessageWaterShake registers a callback for EBaseUserMessages_UM_WaterShake
func (c *Callbacks) OnCUserMessageWaterShake(fn func(*dota.CUserMessageWaterShake) error) {
c.onCUserMessageWaterShake = append(c.onCUserMessageWaterShake, fn)
}

// OnCUserMessageTextMsg registers a callback for EBaseUserMessages_UM_TextMsg
func (c *Callbacks) OnCUserMessageTextMsg(fn func(*dota.CUserMessageTextMsg) error) {
c.onCUserMessageTextMsg = append(c.onCUserMessageTextMsg, fn)
Expand Down Expand Up @@ -794,6 +811,11 @@ func (c *Callbacks) OnCUserMessageRequestInventory(fn func(*dota.CUserMessageReq
c.onCUserMessageRequestInventory = append(c.onCUserMessageRequestInventory, fn)
}

// OnCUserMessageRequestDiagnostic registers a callback for EBaseUserMessages_UM_RequestDiagnostic
func (c *Callbacks) OnCUserMessageRequestDiagnostic(fn func(*dota.CUserMessageRequestDiagnostic) error) {
c.onCUserMessageRequestDiagnostic = append(c.onCUserMessageRequestDiagnostic, fn)
}

// OnCMsgVDebugGameSessionIDEvent registers a callback for EBaseGameEvents_GE_VDebugGameSessionIDEvent
func (c *Callbacks) OnCMsgVDebugGameSessionIDEvent(fn func(*dota.CMsgVDebugGameSessionIDEvent) error) {
c.onCMsgVDebugGameSessionIDEvent = append(c.onCMsgVDebugGameSessionIDEvent, fn)
Expand Down Expand Up @@ -1589,6 +1611,26 @@ func (c *Callbacks) OnCDOTAUserMsg_MuertaReleaseEvent_AssignedTargetKilled(fn fu
c.onCDOTAUserMsg_MuertaReleaseEvent_AssignedTargetKilled = append(c.onCDOTAUserMsg_MuertaReleaseEvent_AssignedTargetKilled, fn)
}

// OnCDOTAUserMsg_PlayerDraftSuggestPick registers a callback for EDotaUserMessages_DOTA_UM_PlayerDraftSuggestPick
func (c *Callbacks) OnCDOTAUserMsg_PlayerDraftSuggestPick(fn func(*dota.CDOTAUserMsg_PlayerDraftSuggestPick) error) {
c.onCDOTAUserMsg_PlayerDraftSuggestPick = append(c.onCDOTAUserMsg_PlayerDraftSuggestPick, fn)
}

// OnCDOTAUserMsg_PlayerDraftPick registers a callback for EDotaUserMessages_DOTA_UM_PlayerDraftPick
func (c *Callbacks) OnCDOTAUserMsg_PlayerDraftPick(fn func(*dota.CDOTAUserMsg_PlayerDraftPick) error) {
c.onCDOTAUserMsg_PlayerDraftPick = append(c.onCDOTAUserMsg_PlayerDraftPick, fn)
}

// OnCDOTAUserMsg_UpdateLinearProjectileCPData registers a callback for EDotaUserMessages_DOTA_UM_UpdateLinearProjectileCPData
func (c *Callbacks) OnCDOTAUserMsg_UpdateLinearProjectileCPData(fn func(*dota.CDOTAUserMsg_UpdateLinearProjectileCPData) error) {
c.onCDOTAUserMsg_UpdateLinearProjectileCPData = append(c.onCDOTAUserMsg_UpdateLinearProjectileCPData, fn)
}

// OnCDOTAUserMsg_GiftPlayer registers a callback for EDotaUserMessages_DOTA_UM_GiftPlayer
func (c *Callbacks) OnCDOTAUserMsg_GiftPlayer(fn func(*dota.CDOTAUserMsg_GiftPlayer) error) {
c.onCDOTAUserMsg_GiftPlayer = append(c.onCDOTAUserMsg_GiftPlayer, fn)
}

func (c *Callbacks) callByDemoType(t int32, buf []byte) error {
switch t {
case 0: // dota.EDemoCommands_DEM_Stop
Expand Down Expand Up @@ -1895,6 +1937,25 @@ func (c *Callbacks) callByDemoType(t int32, buf []byte) error {

return nil

case 16: // dota.EDemoCommands_DEM_AnimationData
if c.onCDemoAnimationData == nil {
return nil
}

msg := &dota.CDemoAnimationData{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCDemoAnimationData {
if err := fn(msg); err != nil {
return err
}
}

return nil

}

if v(1) {
Expand Down Expand Up @@ -3065,6 +3126,25 @@ func (c *Callbacks) callByPacketType(t int32, buf []byte) error {

return nil

case 122: // dota.EBaseUserMessages_UM_WaterShake
if c.onCUserMessageWaterShake == nil {
return nil
}

msg := &dota.CUserMessageWaterShake{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCUserMessageWaterShake {
if err := fn(msg); err != nil {
return err
}
}

return nil

case 124: // dota.EBaseUserMessages_UM_TextMsg
if c.onCUserMessageTextMsg == nil {
return nil
Expand Down Expand Up @@ -3559,6 +3639,25 @@ func (c *Callbacks) callByPacketType(t int32, buf []byte) error {

return nil

case 162: // dota.EBaseUserMessages_UM_RequestDiagnostic
if c.onCUserMessageRequestDiagnostic == nil {
return nil
}

msg := &dota.CUserMessageRequestDiagnostic{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCUserMessageRequestDiagnostic {
if err := fn(msg); err != nil {
return err
}
}

return nil

case 200: // dota.EBaseGameEvents_GE_VDebugGameSessionIDEvent
if c.onCMsgVDebugGameSessionIDEvent == nil {
return nil
Expand Down Expand Up @@ -6580,6 +6679,82 @@ func (c *Callbacks) callByPacketType(t int32, buf []byte) error {

return nil

case 620: // dota.EDotaUserMessages_DOTA_UM_PlayerDraftSuggestPick
if c.onCDOTAUserMsg_PlayerDraftSuggestPick == nil {
return nil
}

msg := &dota.CDOTAUserMsg_PlayerDraftSuggestPick{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCDOTAUserMsg_PlayerDraftSuggestPick {
if err := fn(msg); err != nil {
return err
}
}

return nil

case 621: // dota.EDotaUserMessages_DOTA_UM_PlayerDraftPick
if c.onCDOTAUserMsg_PlayerDraftPick == nil {
return nil
}

msg := &dota.CDOTAUserMsg_PlayerDraftPick{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCDOTAUserMsg_PlayerDraftPick {
if err := fn(msg); err != nil {
return err
}
}

return nil

case 622: // dota.EDotaUserMessages_DOTA_UM_UpdateLinearProjectileCPData
if c.onCDOTAUserMsg_UpdateLinearProjectileCPData == nil {
return nil
}

msg := &dota.CDOTAUserMsg_UpdateLinearProjectileCPData{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCDOTAUserMsg_UpdateLinearProjectileCPData {
if err := fn(msg); err != nil {
return err
}
}

return nil

case 623: // dota.EDotaUserMessages_DOTA_UM_GiftPlayer
if c.onCDOTAUserMsg_GiftPlayer == nil {
return nil
}

msg := &dota.CDOTAUserMsg_GiftPlayer{}
c.pb.SetBuf(buf)
if err := c.pb.Unmarshal(msg); err != nil {
return err
}

for _, fn := range c.onCDOTAUserMsg_GiftPlayer {
if err := fn(msg); err != nil {
return err
}
}

return nil

}

return nil
Expand Down
Loading

0 comments on commit 6af6fe4

Please sign in to comment.