-
Notifications
You must be signed in to change notification settings - Fork 4
/
player_component_handler_gen.go
28 lines (24 loc) · 1.21 KB
/
player_component_handler_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Code generated by proto_code_gen. DO NOT EDIT.
// https://github.com/fish-tennis/proto_code_gen
package game
import (
. "github.com/fish-tennis/gnet"
"github.com/fish-tennis/gentity"
"github.com/fish-tennis/gserver/pb"
"google.golang.org/protobuf/proto"
)
// 自动注册玩家组件相关消息回调
func player_component_handler_gen(packetHandlerRegister PacketHandlerRegister) {
// 请求加coin的测试消息
// @Client表示是客户端发的消息,工具也可以考虑为客户端生成相应的辅助代码(c#或lua)
// @Client
gentity.RegisterProtoCodeGen(packetHandlerRegister, "Money", PacketCommand(pb.CmdMoney_Cmd_CoinReq), new(pb.CoinReq), func(c gentity.Component, m proto.Message) {
c.(*Money).OnCoinReq(PacketCommand(pb.CmdMoney_Cmd_CoinReq), m.(*pb.CoinReq))
})
// 完成任务
// @Client表示是客户端发的消息,工具也可以考虑为客户端生成相应的辅助代码(c#或lua)
// @Client
gentity.RegisterProtoCodeGen(packetHandlerRegister, "Quest", PacketCommand(pb.CmdQuest_Cmd_FinishQuestReq), new(pb.FinishQuestReq), func(c gentity.Component, m proto.Message) {
c.(*Quest).OnFinishQuestReq(PacketCommand(pb.CmdQuest_Cmd_FinishQuestReq), m.(*pb.FinishQuestReq))
})
}