File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
"github.com/golang/protobuf/proto"
12
12
devents "github.com/paralin/go-dota2/events"
13
13
// gcmm "github.com/paralin/go-dota2/protocol/dota_gcmessages_common_match_management"
14
+ bgcm "github.com/paralin/go-dota2/protocol/base_gcmessages"
14
15
gcm "github.com/paralin/go-dota2/protocol/dota_gcmessages_msgid"
15
16
gcsdkm "github.com/paralin/go-dota2/protocol/gcsdk_gcmessages"
16
17
gcsm "github.com/paralin/go-dota2/protocol/gcsystemmsgs"
@@ -94,9 +95,18 @@ func (d *Dota2) buildHandlerMap() {
94
95
// System events
95
96
uint32 (gcsm .EGCBaseClientMsg_k_EMsgGCPingRequest ): d .handlePingRequest ,
96
97
98
+ // Chat events
97
99
uint32 (gcm .EDOTAGCMsg_k_EMsgGCChatMessage ): d .getEventEmitter (func () devents.Event {
98
100
return & devents.ChatMessage {}
99
101
}),
102
+ uint32 (gcm .EDOTAGCMsg_k_EMsgGCJoinChatChannelResponse ): d .getEventEmitter (func () devents.Event {
103
+ return & devents.JoinedChatChannel {}
104
+ }),
105
+
106
+ // Invites
107
+ uint32 (bgcm .EGCBaseMsg_k_EMsgGCInvitationCreated ): d .getEventEmitter (func () devents.Event {
108
+ return & devents.InvitationCreated {}
109
+ }),
100
110
}
101
111
102
112
d .registerGeneratedHandlers ()
Original file line number Diff line number Diff line change @@ -25,3 +25,23 @@ func (e *ChatMessage) GetEventBody() proto.Message {
25
25
func (e * ChatMessage ) GetEventName () string {
26
26
return "ChatMessage"
27
27
}
28
+
29
+ // JoinedChatChannel is emitted when we join a chat channel.
30
+ type JoinedChatChannel struct {
31
+ gcmcc.CMsgDOTAJoinChatChannelResponse
32
+ }
33
+
34
+ // GetDotaEventMsgID returns the dota message ID of the event.
35
+ func (e * JoinedChatChannel ) GetDotaEventMsgID () dota_gcmessages_msgid.EDOTAGCMsg {
36
+ return dota_gcmessages_msgid .EDOTAGCMsg_k_EMsgGCJoinChatChannelResponse
37
+ }
38
+
39
+ // GetEventBody returns the event body.
40
+ func (e * JoinedChatChannel ) GetEventBody () proto.Message {
41
+ return & e .CMsgDOTAJoinChatChannelResponse
42
+ }
43
+
44
+ // GetEventName returns the chat message event name.
45
+ func (e * JoinedChatChannel ) GetEventName () string {
46
+ return "JoinedChatChannel"
47
+ }
Original file line number Diff line number Diff line change 1
1
package events
2
2
3
3
import (
4
+ "github.com/golang/protobuf/proto"
4
5
bgcm "github.com/paralin/go-dota2/protocol/base_gcmessages"
6
+ "github.com/paralin/go-dota2/protocol/dota_gcmessages_msgid"
5
7
)
6
8
7
- // InvitationCreated is fired when the
9
+ // InvitationCreated confirms that an invitation has been created.
8
10
type InvitationCreated struct {
9
11
bgcm.CMsgInvitationCreated
10
12
}
13
+
14
+ // GetDotaEventMsgID returns the dota message ID of the event.
15
+ func (e * InvitationCreated ) GetDotaEventMsgID () dota_gcmessages_msgid.EDOTAGCMsg {
16
+ return dota_gcmessages_msgid .EDOTAGCMsg (bgcm .EGCBaseMsg_k_EMsgGCInvitationCreated )
17
+ }
18
+
19
+ // GetEventBody returns the event body.
20
+ func (e * InvitationCreated ) GetEventBody () proto.Message {
21
+ return & e .CMsgInvitationCreated
22
+ }
23
+
24
+ // GetEventName returns the event name.
25
+ func (e * InvitationCreated ) GetEventName () string {
26
+ return "InvitationCreated"
27
+ }
You can’t perform that action at this time.
0 commit comments