mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 12:52:31 +08:00
网关性能优化
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
[hk4e]
|
|
||||||
client_proto_proxy_enable = false
|
|
||||||
|
|
||||||
[logger]
|
[logger]
|
||||||
level = "DEBUG"
|
level = "DEBUG"
|
||||||
mode = "CONSOLE"
|
mode = "CONSOLE"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
[hk4e]
|
[hk4e]
|
||||||
client_proto_proxy_enable = false
|
|
||||||
game_data_config_path = "./game_data_config"
|
game_data_config_path = "./game_data_config"
|
||||||
gacha_history_server = "https://hk4e.flswld.com/api/v1"
|
gacha_history_server = "https://hk4e.flswld.com/api/v1"
|
||||||
load_scene_lua_config = true # 是否加载场景详情LUA配置数据
|
load_scene_lua_config = true # 是否加载场景详情LUA配置数据
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ func (m *MessageQueue) recvHandler() {
|
|||||||
}
|
}
|
||||||
if netMsg.EventId == NormalMsg {
|
if netMsg.EventId == NormalMsg {
|
||||||
// protobuf PayloadMessage
|
// protobuf PayloadMessage
|
||||||
payloadMessage := m.cmdProtoMap.GetProtoObjByCmdId(gameMsg.CmdId)
|
payloadMessage := m.cmdProtoMap.GetProtoObjCacheByCmdId(gameMsg.CmdId)
|
||||||
if payloadMessage == nil {
|
if payloadMessage == nil {
|
||||||
logger.Error("get protobuf obj by cmd id error: %v", err)
|
logger.Error("get protobuf obj by cmd id error: %v", err)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package utils
|
|
||||||
|
|
||||||
import (
|
|
||||||
"hk4e/common/config"
|
|
||||||
"hk4e/pkg/logger"
|
|
||||||
"hk4e/pkg/object"
|
|
||||||
|
|
||||||
pb "google.golang.org/protobuf/proto"
|
|
||||||
)
|
|
||||||
|
|
||||||
func UnmarshalProtoObj(serverProtoObj pb.Message, clientProtoObj pb.Message, data []byte) bool {
|
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
|
||||||
err := pb.Unmarshal(data, clientProtoObj)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse client proto obj error: %v", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
delList, err := object.CopyProtoBufSameField(serverProtoObj, clientProtoObj)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("copy proto obj error: %v", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if len(delList) != 0 {
|
|
||||||
logger.Error("delete field name list: %v", delList)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(data, serverProtoObj)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse server proto obj error: %v", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
BIN
docs/luac.exe.win
Normal file
BIN
docs/luac.exe.win
Normal file
Binary file not shown.
@@ -1,14 +1,10 @@
|
|||||||
package engine
|
package engine
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"hk4e/common/config"
|
|
||||||
"hk4e/common/constant"
|
"hk4e/common/constant"
|
||||||
"hk4e/common/mq"
|
"hk4e/common/mq"
|
||||||
"hk4e/common/utils"
|
|
||||||
"hk4e/gate/client_proto"
|
|
||||||
"hk4e/pkg/logger"
|
"hk4e/pkg/logger"
|
||||||
"hk4e/protocol/cmd"
|
"hk4e/protocol/cmd"
|
||||||
"hk4e/protocol/proto"
|
"hk4e/protocol/proto"
|
||||||
@@ -23,7 +19,6 @@ type FightEngine struct {
|
|||||||
func NewFightEngine(messageQueue *mq.MessageQueue) (r *FightEngine) {
|
func NewFightEngine(messageQueue *mq.MessageQueue) (r *FightEngine) {
|
||||||
r = new(FightEngine)
|
r = new(FightEngine)
|
||||||
r.messageQueue = messageQueue
|
r.messageQueue = messageQueue
|
||||||
initClientCmdProtoMap()
|
|
||||||
go r.fightHandle()
|
go r.fightHandle()
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
@@ -228,22 +223,10 @@ func (f *FightRoutine) attackHandle(gameMsg *mq.GameMsg) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
hitInfo := new(proto.EvtBeingHitInfo)
|
hitInfo := new(proto.EvtBeingHitInfo)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(entry.CombatData, hitInfo)
|
||||||
clientProtoObj := GetClientProtoObjByName("EvtBeingHitInfo")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse EvtBeingHitInfo error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(hitInfo, clientProtoObj, entry.CombatData)
|
|
||||||
if !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(entry.CombatData, hitInfo)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse EvtBeingHitInfo error: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
attackResult := hitInfo.AttackResult
|
attackResult := hitInfo.AttackResult
|
||||||
if attackResult == nil {
|
if attackResult == nil {
|
||||||
@@ -299,23 +282,3 @@ func (f *FightRoutine) getAllPlayer(entityMap map[uint32]*Entity) []uint32 {
|
|||||||
}
|
}
|
||||||
return uidList
|
return uidList
|
||||||
}
|
}
|
||||||
|
|
||||||
var ClientCmdProtoMap *client_proto.ClientCmdProtoMap
|
|
||||||
|
|
||||||
func initClientCmdProtoMap() {
|
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
|
||||||
ClientCmdProtoMap = client_proto.NewClientCmdProtoMap()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetClientProtoObjByName(protoObjName string) pb.Message {
|
|
||||||
fn := ClientCmdProtoMap.RefValue.MethodByName("GetClientProtoObjByName")
|
|
||||||
ret := fn.Call([]reflect.Value{reflect.ValueOf(protoObjName)})
|
|
||||||
obj := ret[0].Interface()
|
|
||||||
if obj == nil {
|
|
||||||
logger.Error("try to get a not exist proto obj, protoObjName: %v", protoObjName)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
clientProtoObj := obj.(pb.Message)
|
|
||||||
return clientProtoObj
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,4 +10,4 @@
|
|||||||
> 2. 将对应版本的proto协议文件和client_cmd.csv协议号文件复制到proto目录下
|
> 2. 将对应版本的proto协议文件和client_cmd.csv协议号文件复制到proto目录下
|
||||||
> 3. 到项目根目录下执行`make gen_client_proto`(本操作可能会修改proto文件,请注意备份)
|
> 3. 到项目根目录下执行`make gen_client_proto`(本操作可能会修改proto文件,请注意备份)
|
||||||
> 4. 执行`protoc --go_out=. *.proto`,将proto目录下的proto协议文件编译成pb.go
|
> 4. 执行`protoc --go_out=. *.proto`,将proto目录下的proto协议文件编译成pb.go
|
||||||
> 5. 将gate和gs和fight服务器的配置文件中开启client_proto_proxy_enable客户端协议代理功能
|
> 5. 将gate服务器的配置文件中开启client_proto_proxy_enable客户端协议代理功能
|
||||||
|
|||||||
@@ -217,16 +217,11 @@ func ProtoEncode(protoMsg *ProtoMsg,
|
|||||||
}
|
}
|
||||||
// payload msg
|
// payload msg
|
||||||
if protoMsg.PayloadMessage != nil {
|
if protoMsg.PayloadMessage != nil {
|
||||||
cmdId, protoData := EncodeProtoToPayload(protoMsg.PayloadMessage, serverCmdProtoMap)
|
protoData := EncodeProtoToPayload(protoMsg.PayloadMessage, serverCmdProtoMap)
|
||||||
if cmdId == 0 || protoData == nil {
|
if protoData == nil {
|
||||||
logger.Error("encode proto data is nil")
|
logger.Error("encode proto data is nil")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if cmdId != 65535 && cmdId != protoMsg.CmdId {
|
|
||||||
logger.Error("cmd id is not match with proto obj, src cmd id: %v, found cmd id: %v",
|
|
||||||
protoMsg.CmdId, cmdId)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
kcpMsg.ProtoData = protoData
|
kcpMsg.ProtoData = protoData
|
||||||
} else {
|
} else {
|
||||||
kcpMsg.ProtoData = nil
|
kcpMsg.ProtoData = nil
|
||||||
@@ -279,7 +274,7 @@ func ProtoEncode(protoMsg *ProtoMsg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func DecodePayloadToProto(cmdId uint16, protoData []byte, serverCmdProtoMap *cmd.CmdProtoMap) (protoObj pb.Message) {
|
func DecodePayloadToProto(cmdId uint16, protoData []byte, serverCmdProtoMap *cmd.CmdProtoMap) (protoObj pb.Message) {
|
||||||
protoObj = serverCmdProtoMap.GetProtoObjByCmdId(cmdId)
|
protoObj = serverCmdProtoMap.GetProtoObjCacheByCmdId(cmdId)
|
||||||
if protoObj == nil {
|
if protoObj == nil {
|
||||||
logger.Error("get new proto object is nil")
|
logger.Error("get new proto object is nil")
|
||||||
return nil
|
return nil
|
||||||
@@ -292,15 +287,14 @@ func DecodePayloadToProto(cmdId uint16, protoData []byte, serverCmdProtoMap *cmd
|
|||||||
return protoObj
|
return protoObj
|
||||||
}
|
}
|
||||||
|
|
||||||
func EncodeProtoToPayload(protoObj pb.Message, serverCmdProtoMap *cmd.CmdProtoMap) (cmdId uint16, protoData []byte) {
|
func EncodeProtoToPayload(protoObj pb.Message, serverCmdProtoMap *cmd.CmdProtoMap) (protoData []byte) {
|
||||||
cmdId = serverCmdProtoMap.GetCmdIdByProtoObj(protoObj)
|
|
||||||
var err error = nil
|
var err error = nil
|
||||||
protoData, err = pb.Marshal(protoObj)
|
protoData, err = pb.Marshal(protoObj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("marshal proto object err: %v", err)
|
logger.Error("marshal proto object err: %v", err)
|
||||||
return 0, nil
|
return nil
|
||||||
}
|
}
|
||||||
return cmdId, protoData
|
return protoData
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetClientProtoObjByName(protoObjName string, clientCmdProtoMap *client_proto.ClientCmdProtoMap) pb.Message {
|
func GetClientProtoObjByName(protoObjName string, clientCmdProtoMap *client_proto.ClientCmdProtoMap) pb.Message {
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ import (
|
|||||||
"hk4e/pkg/random"
|
"hk4e/pkg/random"
|
||||||
"hk4e/protocol/cmd"
|
"hk4e/protocol/cmd"
|
||||||
"hk4e/protocol/proto"
|
"hk4e/protocol/proto"
|
||||||
|
|
||||||
|
pb "google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -80,7 +82,8 @@ func (k *KcpConnectManager) recvMsgHandle(protoMsg *ProtoMsg, session *Session)
|
|||||||
rsp.HeadMessage = k.getHeadMsg(protoMsg.HeadMessage.ClientSequenceId)
|
rsp.HeadMessage = k.getHeadMsg(protoMsg.HeadMessage.ClientSequenceId)
|
||||||
rsp.PayloadMessage = pingRsp
|
rsp.PayloadMessage = pingRsp
|
||||||
k.localMsgOutput <- rsp
|
k.localMsgOutput <- rsp
|
||||||
logger.Debug("convId: %v, RTO: %v, SRTT: %v, RTTVar: %v", protoMsg.ConvId, session.conn.GetRTO(), session.conn.GetSRTT(), session.conn.GetSRTTVar())
|
logger.Debug("convId: %v, RTO: %v, SRTT: %v, RTTVar: %v",
|
||||||
|
protoMsg.ConvId, session.conn.GetRTO(), session.conn.GetSRTT(), session.conn.GetSRTTVar())
|
||||||
if connState != ConnActive {
|
if connState != ConnActive {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -108,13 +111,20 @@ func (k *KcpConnectManager) recvMsgHandle(protoMsg *ProtoMsg, session *Session)
|
|||||||
logger.Error("conn not active so drop packet, cmdId: %v, userId: %v, convId: %v", protoMsg.CmdId, userId, protoMsg.ConvId)
|
logger.Error("conn not active so drop packet, cmdId: %v, userId: %v, convId: %v", protoMsg.CmdId, userId, protoMsg.ConvId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
gameMsg := new(mq.GameMsg)
|
||||||
|
gameMsg.UserId = userId
|
||||||
|
gameMsg.CmdId = protoMsg.CmdId
|
||||||
|
gameMsg.ClientSeq = protoMsg.HeadMessage.ClientSequenceId
|
||||||
|
// 在这里直接序列化成二进制数据 终结PayloadMessage的生命周期并回收进缓存池
|
||||||
|
payloadMessageData, err := pb.Marshal(protoMsg.PayloadMessage)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("parse payload msg to bin error: %v, stack: %v", err, logger.Stack())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
k.serverCmdProtoMap.PutProtoObjCache(protoMsg.CmdId, protoMsg.PayloadMessage)
|
||||||
|
gameMsg.PayloadMessageData = payloadMessageData
|
||||||
// 转发到寻路服务器
|
// 转发到寻路服务器
|
||||||
if session.pathfindingServerAppId != "" && (protoMsg.CmdId == cmd.QueryPathReq || protoMsg.CmdId == cmd.ObstacleModifyNotify) {
|
if session.pathfindingServerAppId != "" && (protoMsg.CmdId == cmd.QueryPathReq || protoMsg.CmdId == cmd.ObstacleModifyNotify) {
|
||||||
gameMsg := new(mq.GameMsg)
|
|
||||||
gameMsg.UserId = userId
|
|
||||||
gameMsg.CmdId = protoMsg.CmdId
|
|
||||||
gameMsg.ClientSeq = protoMsg.HeadMessage.ClientSequenceId
|
|
||||||
gameMsg.PayloadMessage = protoMsg.PayloadMessage
|
|
||||||
k.messageQueue.SendToPathfinding(session.pathfindingServerAppId, &mq.NetMsg{
|
k.messageQueue.SendToPathfinding(session.pathfindingServerAppId, &mq.NetMsg{
|
||||||
MsgType: mq.MsgTypeGame,
|
MsgType: mq.MsgTypeGame,
|
||||||
EventId: mq.NormalMsg,
|
EventId: mq.NormalMsg,
|
||||||
@@ -124,11 +134,6 @@ func (k *KcpConnectManager) recvMsgHandle(protoMsg *ProtoMsg, session *Session)
|
|||||||
}
|
}
|
||||||
// 转发到战斗服务器
|
// 转发到战斗服务器
|
||||||
if session.fightServerAppId != "" && protoMsg.CmdId == cmd.CombatInvocationsNotify {
|
if session.fightServerAppId != "" && protoMsg.CmdId == cmd.CombatInvocationsNotify {
|
||||||
gameMsg := new(mq.GameMsg)
|
|
||||||
gameMsg.UserId = userId
|
|
||||||
gameMsg.CmdId = protoMsg.CmdId
|
|
||||||
gameMsg.ClientSeq = protoMsg.HeadMessage.ClientSequenceId
|
|
||||||
gameMsg.PayloadMessage = protoMsg.PayloadMessage
|
|
||||||
k.messageQueue.SendToFight(session.fightServerAppId, &mq.NetMsg{
|
k.messageQueue.SendToFight(session.fightServerAppId, &mq.NetMsg{
|
||||||
MsgType: mq.MsgTypeGame,
|
MsgType: mq.MsgTypeGame,
|
||||||
EventId: mq.NormalMsg,
|
EventId: mq.NormalMsg,
|
||||||
@@ -136,11 +141,6 @@ func (k *KcpConnectManager) recvMsgHandle(protoMsg *ProtoMsg, session *Session)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 转发到GS
|
// 转发到GS
|
||||||
gameMsg := new(mq.GameMsg)
|
|
||||||
gameMsg.UserId = userId
|
|
||||||
gameMsg.CmdId = protoMsg.CmdId
|
|
||||||
gameMsg.ClientSeq = protoMsg.HeadMessage.ClientSequenceId
|
|
||||||
gameMsg.PayloadMessage = protoMsg.PayloadMessage
|
|
||||||
k.messageQueue.SendToGs(session.gsServerAppId, &mq.NetMsg{
|
k.messageQueue.SendToGs(session.gsServerAppId, &mq.NetMsg{
|
||||||
MsgType: mq.MsgTypeGame,
|
MsgType: mq.MsgTypeGame,
|
||||||
EventId: mq.NormalMsg,
|
EventId: mq.NormalMsg,
|
||||||
|
|||||||
@@ -2,13 +2,10 @@ package game
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"reflect"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"hk4e/common/config"
|
|
||||||
"hk4e/common/mq"
|
"hk4e/common/mq"
|
||||||
"hk4e/gate/client_proto"
|
|
||||||
"hk4e/gate/kcp"
|
"hk4e/gate/kcp"
|
||||||
"hk4e/gdconf"
|
"hk4e/gdconf"
|
||||||
"hk4e/gs/dao"
|
"hk4e/gs/dao"
|
||||||
@@ -49,13 +46,12 @@ var ONLINE_PLAYER_NUM int32 = 0 // 当前在线玩家数
|
|||||||
var SELF *model.Player
|
var SELF *model.Player
|
||||||
|
|
||||||
type GameManager struct {
|
type GameManager struct {
|
||||||
dao *dao.Dao
|
dao *dao.Dao
|
||||||
snowflake *alg.SnowflakeWorker
|
snowflake *alg.SnowflakeWorker
|
||||||
clientCmdProtoMap *client_proto.ClientCmdProtoMap
|
gsId uint32
|
||||||
gsId uint32
|
gsAppid string
|
||||||
gsAppid string
|
mainGsAppid string
|
||||||
mainGsAppid string
|
ai *model.Player // 本服的Ai玩家对象
|
||||||
ai *model.Player // 本服的Ai玩家对象
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGameManager(dao *dao.Dao, messageQueue *mq.MessageQueue, gsId uint32, gsAppid string, mainGsAppid string) (r *GameManager) {
|
func NewGameManager(dao *dao.Dao, messageQueue *mq.MessageQueue, gsId uint32, gsAppid string, mainGsAppid string) (r *GameManager) {
|
||||||
@@ -63,11 +59,6 @@ func NewGameManager(dao *dao.Dao, messageQueue *mq.MessageQueue, gsId uint32, gs
|
|||||||
r.dao = dao
|
r.dao = dao
|
||||||
MESSAGE_QUEUE = messageQueue
|
MESSAGE_QUEUE = messageQueue
|
||||||
r.snowflake = alg.NewSnowflakeWorker(int64(gsId))
|
r.snowflake = alg.NewSnowflakeWorker(int64(gsId))
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
|
||||||
r.clientCmdProtoMap = client_proto.NewClientCmdProtoMap()
|
|
||||||
// 反射调用的方法在启动时测试是否正常防止中途panic
|
|
||||||
r.GetClientProtoObjByName("PingReq")
|
|
||||||
}
|
|
||||||
r.gsId = gsId
|
r.gsId = gsId
|
||||||
r.gsAppid = gsAppid
|
r.gsAppid = gsAppid
|
||||||
r.mainGsAppid = mainGsAppid
|
r.mainGsAppid = mainGsAppid
|
||||||
@@ -289,11 +280,17 @@ func (g *GameManager) SendMsgToGate(cmdId uint16, userId uint32, clientSeq uint3
|
|||||||
logger.Error("payload msg is nil, stack: %v", logger.Stack())
|
logger.Error("payload msg is nil, stack: %v", logger.Stack())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 在这里直接序列化成二进制数据 防止发送的消息内包含各种游戏数据指针 而造成并发读写的问题
|
||||||
|
payloadMessageData, err := pb.Marshal(payloadMsg)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("parse payload msg to bin error: %v, stack: %v", err, logger.Stack())
|
||||||
|
return
|
||||||
|
}
|
||||||
gameMsg := &mq.GameMsg{
|
gameMsg := &mq.GameMsg{
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
CmdId: cmdId,
|
CmdId: cmdId,
|
||||||
ClientSeq: clientSeq,
|
ClientSeq: clientSeq,
|
||||||
PayloadMessage: payloadMsg,
|
PayloadMessageData: payloadMessageData,
|
||||||
}
|
}
|
||||||
MESSAGE_QUEUE.SendToGate(gateAppId, &mq.NetMsg{
|
MESSAGE_QUEUE.SendToGate(gateAppId, &mq.NetMsg{
|
||||||
MsgType: mq.MsgTypeGame,
|
MsgType: mq.MsgTypeGame,
|
||||||
@@ -407,15 +404,3 @@ func (g *GameManager) KickPlayer(userId uint32, reason uint32) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GameManager) GetClientProtoObjByName(protoObjName string) pb.Message {
|
|
||||||
fn := g.clientCmdProtoMap.RefValue.MethodByName("GetClientProtoObjByName")
|
|
||||||
ret := fn.Call([]reflect.Value{reflect.ValueOf(protoObjName)})
|
|
||||||
obj := ret[0].Interface()
|
|
||||||
if obj == nil {
|
|
||||||
logger.Error("try to get a not exist proto obj, protoObjName: %v", protoObjName)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
clientProtoObj := obj.(pb.Message)
|
|
||||||
return clientProtoObj
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ package game
|
|||||||
import (
|
import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"hk4e/common/config"
|
|
||||||
"hk4e/common/constant"
|
"hk4e/common/constant"
|
||||||
"hk4e/common/utils"
|
|
||||||
"hk4e/gdconf"
|
"hk4e/gdconf"
|
||||||
"hk4e/gs/model"
|
"hk4e/gs/model"
|
||||||
"hk4e/pkg/alg"
|
"hk4e/pkg/alg"
|
||||||
@@ -19,47 +17,37 @@ import (
|
|||||||
|
|
||||||
var cmdProtoMap *cmd.CmdProtoMap = nil
|
var cmdProtoMap *cmd.CmdProtoMap = nil
|
||||||
|
|
||||||
func DoForward[IET model.InvokeEntryType](player *model.Player, req pb.Message, copyFieldList []string, forwardField string, invokeHandler *model.InvokeHandler[IET]) {
|
func DoForward[IET model.InvokeEntryType](player *model.Player, invokeHandler *model.InvokeHandler[IET],
|
||||||
|
cmdId uint16, newNtf pb.Message, forwardField string,
|
||||||
|
srcNtf pb.Message, copyFieldList []string) {
|
||||||
if cmdProtoMap == nil {
|
if cmdProtoMap == nil {
|
||||||
cmdProtoMap = cmd.NewCmdProtoMap()
|
cmdProtoMap = cmd.NewCmdProtoMap()
|
||||||
}
|
}
|
||||||
cmdId := cmdProtoMap.GetCmdIdByProtoObj(req)
|
|
||||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||||
if world == nil {
|
if world == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if invokeHandler.AllLen() == 0 && invokeHandler.AllExceptCurLen() == 0 && invokeHandler.HostLen() == 0 {
|
if srcNtf != nil && copyFieldList != nil {
|
||||||
ntf := cmdProtoMap.GetProtoObjByCmdId(cmdId)
|
|
||||||
for _, fieldName := range copyFieldList {
|
for _, fieldName := range copyFieldList {
|
||||||
reflection.CopyStructField(ntf, req, fieldName)
|
reflection.CopyStructField(newNtf, srcNtf, fieldName)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if invokeHandler.AllLen() == 0 && invokeHandler.AllExceptCurLen() == 0 && invokeHandler.HostLen() == 0 {
|
||||||
for _, v := range world.GetAllPlayer() {
|
for _, v := range world.GetAllPlayer() {
|
||||||
GAME_MANAGER.SendMsg(cmdId, v.PlayerID, player.ClientSeq, ntf)
|
GAME_MANAGER.SendMsg(cmdId, v.PlayerID, player.ClientSeq, newNtf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if invokeHandler.AllLen() > 0 {
|
if invokeHandler.AllLen() > 0 {
|
||||||
ntf := cmdProtoMap.GetProtoObjByCmdId(cmdId)
|
reflection.SetStructFieldValue(newNtf, forwardField, invokeHandler.EntryListForwardAll)
|
||||||
for _, fieldName := range copyFieldList {
|
GAME_MANAGER.SendToWorldA(world, cmdId, player.ClientSeq, newNtf)
|
||||||
reflection.CopyStructField(ntf, req, fieldName)
|
|
||||||
}
|
|
||||||
reflection.SetStructFieldValue(ntf, forwardField, invokeHandler.EntryListForwardAll)
|
|
||||||
GAME_MANAGER.SendToWorldA(world, cmdId, player.ClientSeq, ntf)
|
|
||||||
}
|
}
|
||||||
if invokeHandler.AllExceptCurLen() > 0 {
|
if invokeHandler.AllExceptCurLen() > 0 {
|
||||||
ntf := cmdProtoMap.GetProtoObjByCmdId(cmdId)
|
reflection.SetStructFieldValue(newNtf, forwardField, invokeHandler.EntryListForwardAllExceptCur)
|
||||||
for _, fieldName := range copyFieldList {
|
GAME_MANAGER.SendToWorldAEC(world, cmdId, player.ClientSeq, newNtf, player.PlayerID)
|
||||||
reflection.CopyStructField(ntf, req, fieldName)
|
|
||||||
}
|
|
||||||
reflection.SetStructFieldValue(ntf, forwardField, invokeHandler.EntryListForwardAllExceptCur)
|
|
||||||
GAME_MANAGER.SendToWorldAEC(world, cmdId, player.ClientSeq, ntf, player.PlayerID)
|
|
||||||
}
|
}
|
||||||
if invokeHandler.HostLen() > 0 {
|
if invokeHandler.HostLen() > 0 {
|
||||||
ntf := cmdProtoMap.GetProtoObjByCmdId(cmdId)
|
reflection.SetStructFieldValue(newNtf, forwardField, invokeHandler.EntryListForwardHost)
|
||||||
for _, fieldName := range copyFieldList {
|
GAME_MANAGER.SendToWorldH(world, cmdId, player.ClientSeq, newNtf)
|
||||||
reflection.CopyStructField(ntf, req, fieldName)
|
|
||||||
}
|
|
||||||
reflection.SetStructFieldValue(ntf, forwardField, invokeHandler.EntryListForwardHost)
|
|
||||||
GAME_MANAGER.SendToWorldH(world, cmdId, player.ClientSeq, ntf)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +57,12 @@ func (g *GameManager) UnionCmdNotify(player *model.Player, payloadMsg pb.Message
|
|||||||
if player.SceneLoadState != model.SceneEnterDone {
|
if player.SceneLoadState != model.SceneEnterDone {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
DoForward[proto.CombatInvokeEntry](player, &proto.CombatInvocationsNotify{}, []string{}, "InvokeList", player.CombatInvokeHandler)
|
DoForward[proto.CombatInvokeEntry](player, player.CombatInvokeHandler,
|
||||||
DoForward[proto.AbilityInvokeEntry](player, &proto.AbilityInvocationsNotify{}, []string{}, "Invokes", player.AbilityInvokeHandler)
|
cmd.CombatInvocationsNotify, new(proto.CombatInvocationsNotify), "InvokeList",
|
||||||
|
nil, nil)
|
||||||
|
DoForward[proto.AbilityInvokeEntry](player, player.AbilityInvokeHandler,
|
||||||
|
cmd.AbilityInvocationsNotify, new(proto.AbilityInvocationsNotify), "Invokes",
|
||||||
|
nil, nil)
|
||||||
player.CombatInvokeHandler.Clear()
|
player.CombatInvokeHandler.Clear()
|
||||||
player.AbilityInvokeHandler.Clear()
|
player.AbilityInvokeHandler.Clear()
|
||||||
}
|
}
|
||||||
@@ -80,7 +72,6 @@ func (g *GameManager) MassiveEntityElementOpBatchNotify(player *model.Player, pa
|
|||||||
if player.SceneLoadState != model.SceneEnterDone {
|
if player.SceneLoadState != model.SceneEnterDone {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ntf := req
|
|
||||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||||
if world == nil {
|
if world == nil {
|
||||||
return
|
return
|
||||||
@@ -90,9 +81,9 @@ func (g *GameManager) MassiveEntityElementOpBatchNotify(player *model.Player, pa
|
|||||||
logger.Error("scene is nil, sceneId: %v", player.SceneId)
|
logger.Error("scene is nil, sceneId: %v", player.SceneId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ntf.OpIdx = scene.GetMeeoIndex()
|
req.OpIdx = scene.GetMeeoIndex()
|
||||||
scene.SetMeeoIndex(scene.GetMeeoIndex() + 1)
|
scene.SetMeeoIndex(scene.GetMeeoIndex() + 1)
|
||||||
g.SendToWorldA(world, cmd.MassiveEntityElementOpBatchNotify, player.ClientSeq, ntf)
|
g.SendToWorldA(world, cmd.MassiveEntityElementOpBatchNotify, player.ClientSeq, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg pb.Message) {
|
func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg pb.Message) {
|
||||||
@@ -113,22 +104,10 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
|||||||
switch entry.ArgumentType {
|
switch entry.ArgumentType {
|
||||||
case proto.CombatTypeArgument_COMBAT_EVT_BEING_HIT:
|
case proto.CombatTypeArgument_COMBAT_EVT_BEING_HIT:
|
||||||
hitInfo := new(proto.EvtBeingHitInfo)
|
hitInfo := new(proto.EvtBeingHitInfo)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(entry.CombatData, hitInfo)
|
||||||
clientProtoObj := g.GetClientProtoObjByName("EvtBeingHitInfo")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse EvtBeingHitInfo error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(hitInfo, clientProtoObj, entry.CombatData)
|
|
||||||
if !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(entry.CombatData, hitInfo)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse EvtBeingHitInfo error: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
attackResult := hitInfo.AttackResult
|
attackResult := hitInfo.AttackResult
|
||||||
if attackResult == nil {
|
if attackResult == nil {
|
||||||
@@ -171,22 +150,10 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
|
|||||||
player.CombatInvokeHandler.AddEntry(entry.ForwardType, entry)
|
player.CombatInvokeHandler.AddEntry(entry.ForwardType, entry)
|
||||||
case proto.CombatTypeArgument_ENTITY_MOVE:
|
case proto.CombatTypeArgument_ENTITY_MOVE:
|
||||||
entityMoveInfo := new(proto.EntityMoveInfo)
|
entityMoveInfo := new(proto.EntityMoveInfo)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(entry.CombatData, entityMoveInfo)
|
||||||
clientProtoObj := g.GetClientProtoObjByName("EntityMoveInfo")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse EntityMoveInfo error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(entityMoveInfo, clientProtoObj, entry.CombatData)
|
|
||||||
if !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(entry.CombatData, entityMoveInfo)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse EntityMoveInfo error: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
motionInfo := entityMoveInfo.MotionInfo
|
motionInfo := entityMoveInfo.MotionInfo
|
||||||
if motionInfo.Pos == nil || motionInfo.Rot == nil {
|
if motionInfo.Pos == nil || motionInfo.Rot == nil {
|
||||||
@@ -530,7 +497,9 @@ func (g *GameManager) ClientAbilityInitFinishNotify(player *model.Player, payloa
|
|||||||
// logger.Debug("ClientAbilityInitFinishNotify: %v", entry)
|
// logger.Debug("ClientAbilityInitFinishNotify: %v", entry)
|
||||||
invokeHandler.AddEntry(entry.ForwardType, entry)
|
invokeHandler.AddEntry(entry.ForwardType, entry)
|
||||||
}
|
}
|
||||||
DoForward[proto.AbilityInvokeEntry](player, &proto.ClientAbilityInitFinishNotify{}, []string{"EntityId"}, "Invokes", invokeHandler)
|
DoForward[proto.AbilityInvokeEntry](player, invokeHandler,
|
||||||
|
cmd.ClientAbilityInitFinishNotify, new(proto.ClientAbilityInitFinishNotify), "Invokes",
|
||||||
|
req, []string{"EntityId"})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg pb.Message) {
|
func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg pb.Message) {
|
||||||
@@ -544,7 +513,9 @@ func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg
|
|||||||
|
|
||||||
invokeHandler.AddEntry(entry.ForwardType, entry)
|
invokeHandler.AddEntry(entry.ForwardType, entry)
|
||||||
}
|
}
|
||||||
DoForward[proto.AbilityInvokeEntry](player, req, []string{"EntityId", "IsInitHash"}, "Invokes", invokeHandler)
|
DoForward[proto.AbilityInvokeEntry](player, invokeHandler,
|
||||||
|
cmd.ClientAbilityChangeNotify, new(proto.ClientAbilityChangeNotify), "Invokes",
|
||||||
|
req, []string{"IsInitHash", "EntityId"})
|
||||||
|
|
||||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||||
if world == nil {
|
if world == nil {
|
||||||
@@ -554,23 +525,10 @@ func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg
|
|||||||
switch abilityInvokeEntry.ArgumentType {
|
switch abilityInvokeEntry.ArgumentType {
|
||||||
case proto.AbilityInvokeArgument_ABILITY_META_ADD_NEW_ABILITY:
|
case proto.AbilityInvokeArgument_ABILITY_META_ADD_NEW_ABILITY:
|
||||||
abilityMetaAddAbility := new(proto.AbilityMetaAddAbility)
|
abilityMetaAddAbility := new(proto.AbilityMetaAddAbility)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(abilityInvokeEntry.AbilityData, abilityMetaAddAbility)
|
||||||
clientProtoObj := g.GetClientProtoObjByName("AbilityMetaAddAbility")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse AbilityMetaAddAbility error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(abilityMetaAddAbility, clientProtoObj, abilityInvokeEntry.AbilityData)
|
|
||||||
if !ok {
|
|
||||||
logger.Error("AbilityMetaAddAbility proto error")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(abilityInvokeEntry.AbilityData, abilityMetaAddAbility)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse AbilityMetaAddAbility error: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
worldAvatar := world.GetWorldAvatarByEntityId(abilityInvokeEntry.EntityId)
|
worldAvatar := world.GetWorldAvatarByEntityId(abilityInvokeEntry.EntityId)
|
||||||
if worldAvatar == nil {
|
if worldAvatar == nil {
|
||||||
@@ -584,23 +542,10 @@ func (g *GameManager) ClientAbilityChangeNotify(player *model.Player, payloadMsg
|
|||||||
worldAvatar.SetAbilityList(abilityList)
|
worldAvatar.SetAbilityList(abilityList)
|
||||||
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
|
case proto.AbilityInvokeArgument_ABILITY_META_MODIFIER_CHANGE:
|
||||||
abilityMetaModifierChange := new(proto.AbilityMetaModifierChange)
|
abilityMetaModifierChange := new(proto.AbilityMetaModifierChange)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(abilityInvokeEntry.AbilityData, abilityMetaModifierChange)
|
||||||
clientProtoObj := g.GetClientProtoObjByName("AbilityMetaModifierChange")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse AbilityMetaModifierChange error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(abilityMetaModifierChange, clientProtoObj, abilityInvokeEntry.AbilityData)
|
|
||||||
if !ok {
|
|
||||||
logger.Error("AbilityMetaModifierChange proto error")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(abilityInvokeEntry.AbilityData, abilityMetaModifierChange)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse AbilityMetaModifierChange error: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
abilityAppliedModifier := &proto.AbilityAppliedModifier{
|
abilityAppliedModifier := &proto.AbilityAppliedModifier{
|
||||||
ModifierLocalId: abilityMetaModifierChange.ModifierLocalId,
|
ModifierLocalId: abilityMetaModifierChange.ModifierLocalId,
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"hk4e/common/config"
|
|
||||||
"hk4e/common/constant"
|
"hk4e/common/constant"
|
||||||
"hk4e/common/utils"
|
|
||||||
"hk4e/gdconf"
|
"hk4e/gdconf"
|
||||||
"hk4e/gs/model"
|
"hk4e/gs/model"
|
||||||
"hk4e/pkg/endec"
|
"hk4e/pkg/endec"
|
||||||
@@ -23,22 +21,10 @@ func (g *GameManager) HandleAbilityStamina(player *model.Player, entry *proto.Ab
|
|||||||
case proto.AbilityInvokeArgument_ABILITY_MIXIN_COST_STAMINA:
|
case proto.AbilityInvokeArgument_ABILITY_MIXIN_COST_STAMINA:
|
||||||
// 大剑重击 或 持续技能 耐力消耗
|
// 大剑重击 或 持续技能 耐力消耗
|
||||||
costStamina := new(proto.AbilityMixinCostStamina)
|
costStamina := new(proto.AbilityMixinCostStamina)
|
||||||
if config.GetConfig().Hk4e.ClientProtoProxyEnable {
|
err := pb.Unmarshal(entry.AbilityData, costStamina)
|
||||||
clientProtoObj := g.GetClientProtoObjByName("AbilityMixinCostStamina")
|
if err != nil {
|
||||||
if clientProtoObj == nil {
|
logger.Error("parse AbilityMixinCostStamina error: %v", err)
|
||||||
logger.Error("get client proto obj is nil")
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
ok := utils.UnmarshalProtoObj(costStamina, clientProtoObj, entry.AbilityData)
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err := pb.Unmarshal(entry.AbilityData, costStamina)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("parse AbilityMixinCostStamina error: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 处理持续耐力消耗
|
// 处理持续耐力消耗
|
||||||
g.SkillSustainStamina(player, costStamina.IsSwim)
|
g.SkillSustainStamina(player, costStamina.IsSwim)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"hk4e/pkg/logger"
|
"hk4e/pkg/logger"
|
||||||
"hk4e/protocol/proto"
|
"hk4e/protocol/proto"
|
||||||
@@ -10,11 +11,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CmdProtoMap struct {
|
type CmdProtoMap struct {
|
||||||
cmdIdProtoObjMap map[uint16]reflect.Type
|
cmdIdProtoObjMap map[uint16]reflect.Type
|
||||||
protoObjCmdIdMap map[reflect.Type]uint16
|
protoObjCmdIdMap map[reflect.Type]uint16
|
||||||
cmdDeDupMap map[uint16]bool
|
cmdDeDupMap map[uint16]bool
|
||||||
cmdIdCmdNameMap map[uint16]string
|
cmdIdCmdNameMap map[uint16]string
|
||||||
cmdNameCmdIdMap map[string]uint16
|
cmdNameCmdIdMap map[string]uint16
|
||||||
|
cmdIdProtoObjCacheMap map[uint16]*sync.Pool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCmdProtoMap() (r *CmdProtoMap) {
|
func NewCmdProtoMap() (r *CmdProtoMap) {
|
||||||
@@ -24,318 +26,312 @@ func NewCmdProtoMap() (r *CmdProtoMap) {
|
|||||||
r.cmdDeDupMap = make(map[uint16]bool)
|
r.cmdDeDupMap = make(map[uint16]bool)
|
||||||
r.cmdIdCmdNameMap = make(map[uint16]string)
|
r.cmdIdCmdNameMap = make(map[uint16]string)
|
||||||
r.cmdNameCmdIdMap = make(map[string]uint16)
|
r.cmdNameCmdIdMap = make(map[string]uint16)
|
||||||
|
r.cmdIdProtoObjCacheMap = make(map[uint16]*sync.Pool)
|
||||||
r.registerAllMessage()
|
r.registerAllMessage()
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CmdProtoMap) registerAllMessage() {
|
func (c *CmdProtoMap) registerAllMessage() {
|
||||||
// 登录
|
// 登录
|
||||||
c.registerMessage(DoSetPlayerBornDataNotify, &proto.DoSetPlayerBornDataNotify{}) // 注册账号通知 新号播放开场动画
|
c.regMsg(DoSetPlayerBornDataNotify, func() any { return new(proto.DoSetPlayerBornDataNotify) }) // 注册账号通知 新号播放开场动画
|
||||||
c.registerMessage(SetPlayerBornDataReq, &proto.SetPlayerBornDataReq{}) // 注册账号请求
|
c.regMsg(SetPlayerBornDataReq, func() any { return new(proto.SetPlayerBornDataReq) }) // 注册账号请求
|
||||||
c.registerMessage(SetPlayerBornDataRsp, &proto.SetPlayerBornDataRsp{}) // 注册账号响应
|
c.regMsg(SetPlayerBornDataRsp, func() any { return new(proto.SetPlayerBornDataRsp) }) // 注册账号响应
|
||||||
c.registerMessage(GetPlayerTokenReq, &proto.GetPlayerTokenReq{}) // 获取玩家token请求 第一个登录包
|
c.regMsg(GetPlayerTokenReq, func() any { return new(proto.GetPlayerTokenReq) }) // 获取玩家token请求 第一个登录包
|
||||||
c.registerMessage(GetPlayerTokenRsp, &proto.GetPlayerTokenRsp{}) // 获取玩家token响应
|
c.regMsg(GetPlayerTokenRsp, func() any { return new(proto.GetPlayerTokenRsp) }) // 获取玩家token响应
|
||||||
c.registerMessage(PlayerLoginReq, &proto.PlayerLoginReq{}) // 玩家登录请求 第二个登录包
|
c.regMsg(PlayerLoginReq, func() any { return new(proto.PlayerLoginReq) }) // 玩家登录请求 第二个登录包
|
||||||
c.registerMessage(PlayerLoginRsp, &proto.PlayerLoginRsp{}) // 玩家登录响应
|
c.regMsg(PlayerLoginRsp, func() any { return new(proto.PlayerLoginRsp) }) // 玩家登录响应
|
||||||
c.registerMessage(PlayerForceExitReq, &proto.PlayerForceExitReq{}) // 退出游戏请求
|
c.regMsg(PlayerForceExitReq, func() any { return new(proto.PlayerForceExitReq) }) // 退出游戏请求
|
||||||
c.registerMessage(PlayerForceExitRsp, &proto.PlayerForceExitRsp{}) // 退出游戏响应
|
c.regMsg(PlayerForceExitRsp, func() any { return new(proto.PlayerForceExitRsp) }) // 退出游戏响应
|
||||||
c.registerMessage(ServerDisconnectClientNotify, &proto.ServerDisconnectClientNotify{}) // 服务器断开连接通知
|
c.regMsg(ServerDisconnectClientNotify, func() any { return new(proto.ServerDisconnectClientNotify) }) // 服务器断开连接通知
|
||||||
c.registerMessage(ClientReconnectNotify, &proto.ClientReconnectNotify{}) // 在线重连通知
|
c.regMsg(ClientReconnectNotify, func() any { return new(proto.ClientReconnectNotify) }) // 在线重连通知
|
||||||
|
|
||||||
// 基础相关
|
// 基础相关
|
||||||
c.registerMessage(UnionCmdNotify, &proto.UnionCmdNotify{}) // 聚合消息
|
c.regMsg(UnionCmdNotify, func() any { return new(proto.UnionCmdNotify) }) // 聚合消息
|
||||||
c.registerMessage(PingReq, &proto.PingReq{}) // ping请求
|
c.regMsg(PingReq, func() any { return new(proto.PingReq) }) // ping请求
|
||||||
c.registerMessage(PingRsp, &proto.PingRsp{}) // ping响应
|
c.regMsg(PingRsp, func() any { return new(proto.PingRsp) }) // ping响应
|
||||||
c.registerMessage(WorldPlayerRTTNotify, &proto.WorldPlayerRTTNotify{}) // 世界玩家RTT时延
|
c.regMsg(WorldPlayerRTTNotify, func() any { return new(proto.WorldPlayerRTTNotify) }) // 世界玩家RTT时延
|
||||||
c.registerMessage(PlayerDataNotify, &proto.PlayerDataNotify{}) // 玩家信息通知 昵称、属性表等
|
c.regMsg(PlayerDataNotify, func() any { return new(proto.PlayerDataNotify) }) // 玩家信息通知 昵称、属性表等
|
||||||
c.registerMessage(PlayerPropNotify, &proto.PlayerPropNotify{}) // 玩家属性表通知
|
c.regMsg(PlayerPropNotify, func() any { return new(proto.PlayerPropNotify) }) // 玩家属性表通知
|
||||||
c.registerMessage(OpenStateUpdateNotify, &proto.OpenStateUpdateNotify{}) // 游戏功能模块开放状态更新通知
|
c.regMsg(OpenStateUpdateNotify, func() any { return new(proto.OpenStateUpdateNotify) }) // 游戏功能模块开放状态更新通知
|
||||||
c.registerMessage(PlayerTimeNotify, &proto.PlayerTimeNotify{}) // 玩家累计在线时长通知
|
c.regMsg(PlayerTimeNotify, func() any { return new(proto.PlayerTimeNotify) }) // 玩家累计在线时长通知
|
||||||
c.registerMessage(ServerTimeNotify, &proto.ServerTimeNotify{}) // 服务器时间通知
|
c.regMsg(ServerTimeNotify, func() any { return new(proto.ServerTimeNotify) }) // 服务器时间通知
|
||||||
c.registerMessage(WindSeedClientNotify, &proto.WindSeedClientNotify{}) // 客户端XLUA调试通知
|
c.regMsg(WindSeedClientNotify, func() any { return new(proto.WindSeedClientNotify) }) // 客户端XLUA调试通知
|
||||||
|
|
||||||
// 场景
|
// 场景
|
||||||
c.registerMessage(PlayerSetPauseReq, &proto.PlayerSetPauseReq{}) // 玩家暂停请求
|
c.regMsg(PlayerSetPauseReq, func() any { return new(proto.PlayerSetPauseReq) }) // 玩家暂停请求
|
||||||
c.registerMessage(PlayerSetPauseRsp, &proto.PlayerSetPauseRsp{}) // 玩家暂停响应
|
c.regMsg(PlayerSetPauseRsp, func() any { return new(proto.PlayerSetPauseRsp) }) // 玩家暂停响应
|
||||||
c.registerMessage(EnterSceneReadyReq, &proto.EnterSceneReadyReq{}) // 进入场景准备就绪请求
|
c.regMsg(EnterSceneReadyReq, func() any { return new(proto.EnterSceneReadyReq) }) // 进入场景准备就绪请求
|
||||||
c.registerMessage(EnterSceneReadyRsp, &proto.EnterSceneReadyRsp{}) // 进入场景准备就绪响应
|
c.regMsg(EnterSceneReadyRsp, func() any { return new(proto.EnterSceneReadyRsp) }) // 进入场景准备就绪响应
|
||||||
c.registerMessage(SceneInitFinishReq, &proto.SceneInitFinishReq{}) // 场景初始化完成请求
|
c.regMsg(SceneInitFinishReq, func() any { return new(proto.SceneInitFinishReq) }) // 场景初始化完成请求
|
||||||
c.registerMessage(SceneInitFinishRsp, &proto.SceneInitFinishRsp{}) // 场景初始化完成响应
|
c.regMsg(SceneInitFinishRsp, func() any { return new(proto.SceneInitFinishRsp) }) // 场景初始化完成响应
|
||||||
c.registerMessage(EnterSceneDoneReq, &proto.EnterSceneDoneReq{}) // 进入场景完成请求
|
c.regMsg(EnterSceneDoneReq, func() any { return new(proto.EnterSceneDoneReq) }) // 进入场景完成请求
|
||||||
c.registerMessage(EnterSceneDoneRsp, &proto.EnterSceneDoneRsp{}) // 进入场景完成响应
|
c.regMsg(EnterSceneDoneRsp, func() any { return new(proto.EnterSceneDoneRsp) }) // 进入场景完成响应
|
||||||
c.registerMessage(PostEnterSceneReq, &proto.PostEnterSceneReq{}) // 进入场景完成后请求
|
c.regMsg(PostEnterSceneReq, func() any { return new(proto.PostEnterSceneReq) }) // 进入场景完成后请求
|
||||||
c.registerMessage(PostEnterSceneRsp, &proto.PostEnterSceneRsp{}) // 进入场景完成后响应
|
c.regMsg(PostEnterSceneRsp, func() any { return new(proto.PostEnterSceneRsp) }) // 进入场景完成后响应
|
||||||
c.registerMessage(EnterWorldAreaReq, &proto.EnterWorldAreaReq{}) // 进入世界区域请求
|
c.regMsg(EnterWorldAreaReq, func() any { return new(proto.EnterWorldAreaReq) }) // 进入世界区域请求
|
||||||
c.registerMessage(EnterWorldAreaRsp, &proto.EnterWorldAreaRsp{}) // 进入世界区域响应
|
c.regMsg(EnterWorldAreaRsp, func() any { return new(proto.EnterWorldAreaRsp) }) // 进入世界区域响应
|
||||||
c.registerMessage(SceneTransToPointReq, &proto.SceneTransToPointReq{}) // 场景传送点传送请求
|
c.regMsg(SceneTransToPointReq, func() any { return new(proto.SceneTransToPointReq) }) // 场景传送点传送请求
|
||||||
c.registerMessage(SceneTransToPointRsp, &proto.SceneTransToPointRsp{}) // 场景传送点传送响应
|
c.regMsg(SceneTransToPointRsp, func() any { return new(proto.SceneTransToPointRsp) }) // 场景传送点传送响应
|
||||||
c.registerMessage(UnlockTransPointReq, &proto.UnlockTransPointReq{}) // 解锁场景传送点请求
|
c.regMsg(UnlockTransPointReq, func() any { return new(proto.UnlockTransPointReq) }) // 解锁场景传送点请求
|
||||||
c.registerMessage(UnlockTransPointRsp, &proto.UnlockTransPointRsp{}) // 解锁场景传送点响应
|
c.regMsg(UnlockTransPointRsp, func() any { return new(proto.UnlockTransPointRsp) }) // 解锁场景传送点响应
|
||||||
c.registerMessage(ScenePointUnlockNotify, &proto.ScenePointUnlockNotify{}) // 场景传送点解锁通知
|
c.regMsg(ScenePointUnlockNotify, func() any { return new(proto.ScenePointUnlockNotify) }) // 场景传送点解锁通知
|
||||||
c.registerMessage(QueryPathReq, &proto.QueryPathReq{}) // 寻路请求
|
c.regMsg(QueryPathReq, func() any { return new(proto.QueryPathReq) }) // 寻路请求
|
||||||
c.registerMessage(QueryPathRsp, &proto.QueryPathRsp{}) // 寻路响应
|
c.regMsg(QueryPathRsp, func() any { return new(proto.QueryPathRsp) }) // 寻路响应
|
||||||
c.registerMessage(GetScenePointReq, &proto.GetScenePointReq{}) // 获取场景传送点请求
|
c.regMsg(GetScenePointReq, func() any { return new(proto.GetScenePointReq) }) // 获取场景传送点请求
|
||||||
c.registerMessage(GetScenePointRsp, &proto.GetScenePointRsp{}) // 获取场景传送点响应
|
c.regMsg(GetScenePointRsp, func() any { return new(proto.GetScenePointRsp) }) // 获取场景传送点响应
|
||||||
c.registerMessage(GetSceneAreaReq, &proto.GetSceneAreaReq{}) // 获取场景区域请求
|
c.regMsg(GetSceneAreaReq, func() any { return new(proto.GetSceneAreaReq) }) // 获取场景区域请求
|
||||||
c.registerMessage(GetSceneAreaRsp, &proto.GetSceneAreaRsp{}) // 获取场景区域响应
|
c.regMsg(GetSceneAreaRsp, func() any { return new(proto.GetSceneAreaRsp) }) // 获取场景区域响应
|
||||||
c.registerMessage(ChangeGameTimeReq, &proto.ChangeGameTimeReq{}) // 改变游戏内时间请求
|
c.regMsg(ChangeGameTimeReq, func() any { return new(proto.ChangeGameTimeReq) }) // 改变游戏内时间请求
|
||||||
c.registerMessage(ChangeGameTimeRsp, &proto.ChangeGameTimeRsp{}) // 改变游戏内时间响应
|
c.regMsg(ChangeGameTimeRsp, func() any { return new(proto.ChangeGameTimeRsp) }) // 改变游戏内时间响应
|
||||||
c.registerMessage(SceneTimeNotify, &proto.SceneTimeNotify{}) // 场景时间通知
|
c.regMsg(SceneTimeNotify, func() any { return new(proto.SceneTimeNotify) }) // 场景时间通知
|
||||||
c.registerMessage(PlayerGameTimeNotify, &proto.PlayerGameTimeNotify{}) // 玩家游戏内时间通知
|
c.regMsg(PlayerGameTimeNotify, func() any { return new(proto.PlayerGameTimeNotify) }) // 玩家游戏内时间通知
|
||||||
c.registerMessage(SceneEntityAppearNotify, &proto.SceneEntityAppearNotify{}) // 场景实体出现通知
|
c.regMsg(SceneEntityAppearNotify, func() any { return new(proto.SceneEntityAppearNotify) }) // 场景实体出现通知
|
||||||
c.registerMessage(SceneEntityDisappearNotify, &proto.SceneEntityDisappearNotify{}) // 场景实体消失通知
|
c.regMsg(SceneEntityDisappearNotify, func() any { return new(proto.SceneEntityDisappearNotify) }) // 场景实体消失通知
|
||||||
c.registerMessage(SceneAreaWeatherNotify, &proto.SceneAreaWeatherNotify{}) // 场景区域天气通知
|
c.regMsg(SceneAreaWeatherNotify, func() any { return new(proto.SceneAreaWeatherNotify) }) // 场景区域天气通知
|
||||||
c.registerMessage(WorldPlayerLocationNotify, &proto.WorldPlayerLocationNotify{}) // 世界玩家位置通知
|
c.regMsg(WorldPlayerLocationNotify, func() any { return new(proto.WorldPlayerLocationNotify) }) // 世界玩家位置通知
|
||||||
c.registerMessage(ScenePlayerLocationNotify, &proto.ScenePlayerLocationNotify{}) // 场景玩家位置通知
|
c.regMsg(ScenePlayerLocationNotify, func() any { return new(proto.ScenePlayerLocationNotify) }) // 场景玩家位置通知
|
||||||
c.registerMessage(SceneForceUnlockNotify, &proto.SceneForceUnlockNotify{}) // 场景强制解锁通知
|
c.regMsg(SceneForceUnlockNotify, func() any { return new(proto.SceneForceUnlockNotify) }) // 场景强制解锁通知
|
||||||
c.registerMessage(PlayerWorldSceneInfoListNotify, &proto.PlayerWorldSceneInfoListNotify{}) // 玩家世界场景信息列表通知 地图上已解锁点亮的区域
|
c.regMsg(PlayerWorldSceneInfoListNotify, func() any { return new(proto.PlayerWorldSceneInfoListNotify) }) // 玩家世界场景信息列表通知 地图上已解锁点亮的区域
|
||||||
c.registerMessage(PlayerEnterSceneNotify, &proto.PlayerEnterSceneNotify{}) // 玩家进入场景通知 通知客户端进入某个场景
|
c.regMsg(PlayerEnterSceneNotify, func() any { return new(proto.PlayerEnterSceneNotify) }) // 玩家进入场景通知 通知客户端进入某个场景
|
||||||
c.registerMessage(PlayerEnterSceneInfoNotify, &proto.PlayerEnterSceneInfoNotify{}) // 玩家进入场景信息通知 角色、队伍、武器等实体相关信息
|
c.regMsg(PlayerEnterSceneInfoNotify, func() any { return new(proto.PlayerEnterSceneInfoNotify) }) // 玩家进入场景信息通知 角色、队伍、武器等实体相关信息
|
||||||
c.registerMessage(ScenePlayerInfoNotify, &proto.ScenePlayerInfoNotify{}) // 场景玩家信息通知 玩家uid、昵称、多人世界玩家编号等
|
c.regMsg(ScenePlayerInfoNotify, func() any { return new(proto.ScenePlayerInfoNotify) }) // 场景玩家信息通知 玩家uid、昵称、多人世界玩家编号等
|
||||||
c.registerMessage(EnterScenePeerNotify, &proto.EnterScenePeerNotify{}) // 进入场景多人世界玩家编号通知
|
c.regMsg(EnterScenePeerNotify, func() any { return new(proto.EnterScenePeerNotify) }) // 进入场景多人世界玩家编号通知
|
||||||
c.registerMessage(EntityAiSyncNotify, &proto.EntityAiSyncNotify{}) // 实体AI怪物同步通知
|
c.regMsg(EntityAiSyncNotify, func() any { return new(proto.EntityAiSyncNotify) }) // 实体AI怪物同步通知
|
||||||
c.registerMessage(WorldDataNotify, &proto.WorldDataNotify{}) // 世界数据通知 世界等级、是否多人世界等
|
c.regMsg(WorldDataNotify, func() any { return new(proto.WorldDataNotify) }) // 世界数据通知 世界等级、是否多人世界等
|
||||||
c.registerMessage(WorldPlayerInfoNotify, &proto.WorldPlayerInfoNotify{}) // 世界玩家信息通知
|
c.regMsg(WorldPlayerInfoNotify, func() any { return new(proto.WorldPlayerInfoNotify) }) // 世界玩家信息通知
|
||||||
c.registerMessage(HostPlayerNotify, &proto.HostPlayerNotify{}) // 世界房主玩家信息通知
|
c.regMsg(HostPlayerNotify, func() any { return new(proto.HostPlayerNotify) }) // 世界房主玩家信息通知
|
||||||
c.registerMessage(PathfindingEnterSceneReq, &proto.PathfindingEnterSceneReq{}) // 寻路服务器进入场景请求
|
c.regMsg(PathfindingEnterSceneReq, func() any { return new(proto.PathfindingEnterSceneReq) }) // 寻路服务器进入场景请求
|
||||||
c.registerMessage(PathfindingEnterSceneRsp, &proto.PathfindingEnterSceneRsp{}) // 寻路服务器进入场景响应
|
c.regMsg(PathfindingEnterSceneRsp, func() any { return new(proto.PathfindingEnterSceneRsp) }) // 寻路服务器进入场景响应
|
||||||
c.registerMessage(ToTheMoonEnterSceneReq, &proto.ToTheMoonEnterSceneReq{}) // 寻路服务器进入场景请求
|
c.regMsg(ToTheMoonEnterSceneReq, func() any { return new(proto.ToTheMoonEnterSceneReq) }) // 寻路服务器进入场景请求
|
||||||
c.registerMessage(ToTheMoonEnterSceneRsp, &proto.ToTheMoonEnterSceneRsp{}) // 寻路服务器进入场景响应
|
c.regMsg(ToTheMoonEnterSceneRsp, func() any { return new(proto.ToTheMoonEnterSceneRsp) }) // 寻路服务器进入场景响应
|
||||||
c.registerMessage(SetEntityClientDataNotify, &proto.SetEntityClientDataNotify{}) // 通知
|
c.regMsg(SetEntityClientDataNotify, func() any { return new(proto.SetEntityClientDataNotify) }) // 通知
|
||||||
c.registerMessage(LeaveWorldNotify, &proto.LeaveWorldNotify{}) // 删除客户端世界通知
|
c.regMsg(LeaveWorldNotify, func() any { return new(proto.LeaveWorldNotify) }) // 删除客户端世界通知
|
||||||
c.registerMessage(SceneAvatarStaminaStepReq, &proto.SceneAvatarStaminaStepReq{}) // 缓慢游泳或缓慢攀爬时消耗耐力请求
|
c.regMsg(SceneAvatarStaminaStepReq, func() any { return new(proto.SceneAvatarStaminaStepReq) }) // 缓慢游泳或缓慢攀爬时消耗耐力请求
|
||||||
c.registerMessage(SceneAvatarStaminaStepRsp, &proto.SceneAvatarStaminaStepRsp{}) // 缓慢游泳或缓慢攀爬时消耗耐力响应
|
c.regMsg(SceneAvatarStaminaStepRsp, func() any { return new(proto.SceneAvatarStaminaStepRsp) }) // 缓慢游泳或缓慢攀爬时消耗耐力响应
|
||||||
c.registerMessage(LifeStateChangeNotify, &proto.LifeStateChangeNotify{}) // 实体存活状态改变通知
|
c.regMsg(LifeStateChangeNotify, func() any { return new(proto.LifeStateChangeNotify) }) // 实体存活状态改变通知
|
||||||
c.registerMessage(SceneEntityDrownReq, &proto.SceneEntityDrownReq{}) // 场景实体溺水请求
|
c.regMsg(SceneEntityDrownReq, func() any { return new(proto.SceneEntityDrownReq) }) // 场景实体溺水请求
|
||||||
c.registerMessage(SceneEntityDrownRsp, &proto.SceneEntityDrownRsp{}) // 场景实体溺水响应
|
c.regMsg(SceneEntityDrownRsp, func() any { return new(proto.SceneEntityDrownRsp) }) // 场景实体溺水响应
|
||||||
c.registerMessage(ObstacleModifyNotify, &proto.ObstacleModifyNotify{}) // 寻路阻挡变动通知
|
c.regMsg(ObstacleModifyNotify, func() any { return new(proto.ObstacleModifyNotify) }) // 寻路阻挡变动通知
|
||||||
c.registerMessage(DungeonWayPointNotify, &proto.DungeonWayPointNotify{}) // 地牢副本相关
|
c.regMsg(DungeonWayPointNotify, func() any { return new(proto.DungeonWayPointNotify) }) // 地牢副本相关
|
||||||
c.registerMessage(DungeonDataNotify, &proto.DungeonDataNotify{}) // 地牢副本相关
|
c.regMsg(DungeonDataNotify, func() any { return new(proto.DungeonDataNotify) }) // 地牢副本相关
|
||||||
c.registerMessage(SceneAudioNotify, &proto.SceneAudioNotify{}) // 场景风物之琴音乐同步通知
|
c.regMsg(SceneAudioNotify, func() any { return new(proto.SceneAudioNotify) }) // 场景风物之琴音乐同步通知
|
||||||
c.registerMessage(BeginCameraSceneLookNotify, &proto.BeginCameraSceneLookNotify{}) // 场景镜头注目通知
|
c.regMsg(BeginCameraSceneLookNotify, func() any { return new(proto.BeginCameraSceneLookNotify) }) // 场景镜头注目通知
|
||||||
|
|
||||||
// 战斗与同步
|
// 战斗与同步
|
||||||
c.registerMessage(AvatarFightPropNotify, &proto.AvatarFightPropNotify{}) // 角色战斗属性通知
|
c.regMsg(AvatarFightPropNotify, func() any { return new(proto.AvatarFightPropNotify) }) // 角色战斗属性通知
|
||||||
c.registerMessage(EntityFightPropUpdateNotify, &proto.EntityFightPropUpdateNotify{}) // 实体战斗属性更新通知
|
c.regMsg(EntityFightPropUpdateNotify, func() any { return new(proto.EntityFightPropUpdateNotify) }) // 实体战斗属性更新通知
|
||||||
c.registerMessage(CombatInvocationsNotify, &proto.CombatInvocationsNotify{}) // 战斗通知 包含场景中实体的移动数据和伤害数据,多人游戏服务器转发
|
c.regMsg(CombatInvocationsNotify, func() any { return new(proto.CombatInvocationsNotify) }) // 战斗通知 包含场景中实体的移动数据和伤害数据,多人游戏服务器转发
|
||||||
c.registerMessage(AbilityInvocationsNotify, &proto.AbilityInvocationsNotify{}) // 技能通知 多人游戏服务器转发
|
c.regMsg(AbilityInvocationsNotify, func() any { return new(proto.AbilityInvocationsNotify) }) // 技能通知 多人游戏服务器转发
|
||||||
c.registerMessage(ClientAbilityInitFinishNotify, &proto.ClientAbilityInitFinishNotify{}) // 客户端技能初始化完成通知 多人游戏服务器转发
|
c.regMsg(ClientAbilityInitFinishNotify, func() any { return new(proto.ClientAbilityInitFinishNotify) }) // 客户端技能初始化完成通知 多人游戏服务器转发
|
||||||
c.registerMessage(EvtDoSkillSuccNotify, &proto.EvtDoSkillSuccNotify{}) // 释放技能成功事件通知
|
c.regMsg(EvtDoSkillSuccNotify, func() any { return new(proto.EvtDoSkillSuccNotify) }) // 释放技能成功事件通知
|
||||||
c.registerMessage(ClientAbilityChangeNotify, &proto.ClientAbilityChangeNotify{}) // 客户端技能改变通知
|
c.regMsg(ClientAbilityChangeNotify, func() any { return new(proto.ClientAbilityChangeNotify) }) // 客户端技能改变通知
|
||||||
c.registerMessage(MassiveEntityElementOpBatchNotify, &proto.MassiveEntityElementOpBatchNotify{}) // 风元素染色相关通知
|
c.regMsg(MassiveEntityElementOpBatchNotify, func() any { return new(proto.MassiveEntityElementOpBatchNotify) }) // 风元素染色相关通知
|
||||||
c.registerMessage(EvtAvatarEnterFocusNotify, &proto.EvtAvatarEnterFocusNotify{}) // 进入弓箭蓄力瞄准状态通知
|
c.regMsg(EvtAvatarEnterFocusNotify, func() any { return new(proto.EvtAvatarEnterFocusNotify) }) // 进入弓箭蓄力瞄准状态通知
|
||||||
c.registerMessage(EvtAvatarUpdateFocusNotify, &proto.EvtAvatarUpdateFocusNotify{}) // 弓箭蓄力瞄准状态移动通知
|
c.regMsg(EvtAvatarUpdateFocusNotify, func() any { return new(proto.EvtAvatarUpdateFocusNotify) }) // 弓箭蓄力瞄准状态移动通知
|
||||||
c.registerMessage(EvtAvatarExitFocusNotify, &proto.EvtAvatarExitFocusNotify{}) // 退出弓箭蓄力瞄准状态通知
|
c.regMsg(EvtAvatarExitFocusNotify, func() any { return new(proto.EvtAvatarExitFocusNotify) }) // 退出弓箭蓄力瞄准状态通知
|
||||||
c.registerMessage(EvtEntityRenderersChangedNotify, &proto.EvtEntityRenderersChangedNotify{}) // 实体可视状态改变通知
|
c.regMsg(EvtEntityRenderersChangedNotify, func() any { return new(proto.EvtEntityRenderersChangedNotify) }) // 实体可视状态改变通知
|
||||||
c.registerMessage(EvtCreateGadgetNotify, &proto.EvtCreateGadgetNotify{}) // 创建实体通知
|
c.regMsg(EvtCreateGadgetNotify, func() any { return new(proto.EvtCreateGadgetNotify) }) // 创建实体通知
|
||||||
c.registerMessage(EvtDestroyGadgetNotify, &proto.EvtDestroyGadgetNotify{}) // 销毁实体通知
|
c.regMsg(EvtDestroyGadgetNotify, func() any { return new(proto.EvtDestroyGadgetNotify) }) // 销毁实体通知
|
||||||
|
|
||||||
// 队伍
|
// 队伍
|
||||||
c.registerMessage(ChangeAvatarReq, &proto.ChangeAvatarReq{}) // 更换角色请求 切人
|
c.regMsg(ChangeAvatarReq, func() any { return new(proto.ChangeAvatarReq) }) // 更换角色请求 切人
|
||||||
c.registerMessage(ChangeAvatarRsp, &proto.ChangeAvatarRsp{}) // 更换角色响应
|
c.regMsg(ChangeAvatarRsp, func() any { return new(proto.ChangeAvatarRsp) }) // 更换角色响应
|
||||||
c.registerMessage(SetUpAvatarTeamReq, &proto.SetUpAvatarTeamReq{}) // 配置队伍请求 队伍换人
|
c.regMsg(SetUpAvatarTeamReq, func() any { return new(proto.SetUpAvatarTeamReq) }) // 配置队伍请求 队伍换人
|
||||||
c.registerMessage(SetUpAvatarTeamRsp, &proto.SetUpAvatarTeamRsp{}) // 配置队伍响应
|
c.regMsg(SetUpAvatarTeamRsp, func() any { return new(proto.SetUpAvatarTeamRsp) }) // 配置队伍响应
|
||||||
c.registerMessage(ChooseCurAvatarTeamReq, &proto.ChooseCurAvatarTeamReq{}) // 切换队伍请求 切队伍
|
c.regMsg(ChooseCurAvatarTeamReq, func() any { return new(proto.ChooseCurAvatarTeamReq) }) // 切换队伍请求 切队伍
|
||||||
c.registerMessage(ChooseCurAvatarTeamRsp, &proto.ChooseCurAvatarTeamRsp{}) // 切换队伍响应
|
c.regMsg(ChooseCurAvatarTeamRsp, func() any { return new(proto.ChooseCurAvatarTeamRsp) }) // 切换队伍响应
|
||||||
c.registerMessage(ChangeMpTeamAvatarReq, &proto.ChangeMpTeamAvatarReq{}) // 配置多人游戏队伍请求 多人游戏队伍换人
|
c.regMsg(ChangeMpTeamAvatarReq, func() any { return new(proto.ChangeMpTeamAvatarReq) }) // 配置多人游戏队伍请求 多人游戏队伍换人
|
||||||
c.registerMessage(ChangeMpTeamAvatarRsp, &proto.ChangeMpTeamAvatarRsp{}) // 配置多人游戏队伍响应
|
c.regMsg(ChangeMpTeamAvatarRsp, func() any { return new(proto.ChangeMpTeamAvatarRsp) }) // 配置多人游戏队伍响应
|
||||||
c.registerMessage(AvatarTeamUpdateNotify, &proto.AvatarTeamUpdateNotify{}) // 角色队伍更新通知 全部队伍的名字和其中中包含了哪些角色
|
c.regMsg(AvatarTeamUpdateNotify, func() any { return new(proto.AvatarTeamUpdateNotify) }) // 角色队伍更新通知 全部队伍的名字和其中中包含了哪些角色
|
||||||
c.registerMessage(SceneTeamUpdateNotify, &proto.SceneTeamUpdateNotify{}) // 场景队伍更新通知
|
c.regMsg(SceneTeamUpdateNotify, func() any { return new(proto.SceneTeamUpdateNotify) }) // 场景队伍更新通知
|
||||||
c.registerMessage(SyncTeamEntityNotify, &proto.SyncTeamEntityNotify{}) // 同步队伍实体通知
|
c.regMsg(SyncTeamEntityNotify, func() any { return new(proto.SyncTeamEntityNotify) }) // 同步队伍实体通知
|
||||||
c.registerMessage(DelTeamEntityNotify, &proto.DelTeamEntityNotify{}) // 删除队伍实体通知
|
c.regMsg(DelTeamEntityNotify, func() any { return new(proto.DelTeamEntityNotify) }) // 删除队伍实体通知
|
||||||
c.registerMessage(SyncScenePlayTeamEntityNotify, &proto.SyncScenePlayTeamEntityNotify{}) // 同步场景玩家队伍实体通知
|
c.regMsg(SyncScenePlayTeamEntityNotify, func() any { return new(proto.SyncScenePlayTeamEntityNotify) }) // 同步场景玩家队伍实体通知
|
||||||
|
|
||||||
// 多人世界
|
// 多人世界
|
||||||
c.registerMessage(PlayerApplyEnterMpReq, &proto.PlayerApplyEnterMpReq{}) // 世界敲门请求
|
c.regMsg(PlayerApplyEnterMpReq, func() any { return new(proto.PlayerApplyEnterMpReq) }) // 世界敲门请求
|
||||||
c.registerMessage(PlayerApplyEnterMpRsp, &proto.PlayerApplyEnterMpRsp{}) // 世界敲门响应
|
c.regMsg(PlayerApplyEnterMpRsp, func() any { return new(proto.PlayerApplyEnterMpRsp) }) // 世界敲门响应
|
||||||
c.registerMessage(PlayerApplyEnterMpNotify, &proto.PlayerApplyEnterMpNotify{}) // 世界敲门通知
|
c.regMsg(PlayerApplyEnterMpNotify, func() any { return new(proto.PlayerApplyEnterMpNotify) }) // 世界敲门通知
|
||||||
c.registerMessage(PlayerApplyEnterMpResultReq, &proto.PlayerApplyEnterMpResultReq{}) // 世界敲门处理请求
|
c.regMsg(PlayerApplyEnterMpResultReq, func() any { return new(proto.PlayerApplyEnterMpResultReq) }) // 世界敲门处理请求
|
||||||
c.registerMessage(PlayerApplyEnterMpResultRsp, &proto.PlayerApplyEnterMpResultRsp{}) // 世界敲门处理响应
|
c.regMsg(PlayerApplyEnterMpResultRsp, func() any { return new(proto.PlayerApplyEnterMpResultRsp) }) // 世界敲门处理响应
|
||||||
c.registerMessage(PlayerApplyEnterMpResultNotify, &proto.PlayerApplyEnterMpResultNotify{}) // 世界敲门处理通知
|
c.regMsg(PlayerApplyEnterMpResultNotify, func() any { return new(proto.PlayerApplyEnterMpResultNotify) }) // 世界敲门处理通知
|
||||||
c.registerMessage(PlayerGetForceQuitBanInfoReq, &proto.PlayerGetForceQuitBanInfoReq{}) // 获取强退禁令信息请求
|
c.regMsg(PlayerGetForceQuitBanInfoReq, func() any { return new(proto.PlayerGetForceQuitBanInfoReq) }) // 获取强退禁令信息请求
|
||||||
c.registerMessage(PlayerGetForceQuitBanInfoRsp, &proto.PlayerGetForceQuitBanInfoRsp{}) // 获取强退禁令信息响应
|
c.regMsg(PlayerGetForceQuitBanInfoRsp, func() any { return new(proto.PlayerGetForceQuitBanInfoRsp) }) // 获取强退禁令信息响应
|
||||||
c.registerMessage(BackMyWorldReq, &proto.BackMyWorldReq{}) // 返回单人世界请求
|
c.regMsg(BackMyWorldReq, func() any { return new(proto.BackMyWorldReq) }) // 返回单人世界请求
|
||||||
c.registerMessage(BackMyWorldRsp, &proto.BackMyWorldRsp{}) // 返回单人世界响应
|
c.regMsg(BackMyWorldRsp, func() any { return new(proto.BackMyWorldRsp) }) // 返回单人世界响应
|
||||||
c.registerMessage(ChangeWorldToSingleModeReq, &proto.ChangeWorldToSingleModeReq{}) // 转换单人模式请求
|
c.regMsg(ChangeWorldToSingleModeReq, func() any { return new(proto.ChangeWorldToSingleModeReq) }) // 转换单人模式请求
|
||||||
c.registerMessage(ChangeWorldToSingleModeRsp, &proto.ChangeWorldToSingleModeRsp{}) // 转换单人模式响应
|
c.regMsg(ChangeWorldToSingleModeRsp, func() any { return new(proto.ChangeWorldToSingleModeRsp) }) // 转换单人模式响应
|
||||||
c.registerMessage(SceneKickPlayerReq, &proto.SceneKickPlayerReq{}) // 剔除玩家请求
|
c.regMsg(SceneKickPlayerReq, func() any { return new(proto.SceneKickPlayerReq) }) // 剔除玩家请求
|
||||||
c.registerMessage(SceneKickPlayerRsp, &proto.SceneKickPlayerRsp{}) // 剔除玩家响应
|
c.regMsg(SceneKickPlayerRsp, func() any { return new(proto.SceneKickPlayerRsp) }) // 剔除玩家响应
|
||||||
c.registerMessage(SceneKickPlayerNotify, &proto.SceneKickPlayerNotify{}) // 剔除玩家通知
|
c.regMsg(SceneKickPlayerNotify, func() any { return new(proto.SceneKickPlayerNotify) }) // 剔除玩家通知
|
||||||
c.registerMessage(PlayerQuitFromMpNotify, &proto.PlayerQuitFromMpNotify{}) // 退出多人游戏通知
|
c.regMsg(PlayerQuitFromMpNotify, func() any { return new(proto.PlayerQuitFromMpNotify) }) // 退出多人游戏通知
|
||||||
c.registerMessage(JoinPlayerSceneReq, &proto.JoinPlayerSceneReq{}) // 进入他人世界请求
|
c.regMsg(JoinPlayerSceneReq, func() any { return new(proto.JoinPlayerSceneReq) }) // 进入他人世界请求
|
||||||
c.registerMessage(JoinPlayerSceneRsp, &proto.JoinPlayerSceneRsp{}) // 进入他人世界响应
|
c.regMsg(JoinPlayerSceneRsp, func() any { return new(proto.JoinPlayerSceneRsp) }) // 进入他人世界响应
|
||||||
c.registerMessage(GuestBeginEnterSceneNotify, &proto.GuestBeginEnterSceneNotify{}) // 他人开始进入世界通知
|
c.regMsg(GuestBeginEnterSceneNotify, func() any { return new(proto.GuestBeginEnterSceneNotify) }) // 他人开始进入世界通知
|
||||||
c.registerMessage(GuestPostEnterSceneNotify, &proto.GuestPostEnterSceneNotify{}) // 他人进入世界完成通知
|
c.regMsg(GuestPostEnterSceneNotify, func() any { return new(proto.GuestPostEnterSceneNotify) }) // 他人进入世界完成通知
|
||||||
c.registerMessage(PlayerPreEnterMpNotify, &proto.PlayerPreEnterMpNotify{}) // 他人正在进入世界通知
|
c.regMsg(PlayerPreEnterMpNotify, func() any { return new(proto.PlayerPreEnterMpNotify) }) // 他人正在进入世界通知
|
||||||
|
|
||||||
// 社交
|
// 社交
|
||||||
c.registerMessage(SetPlayerBirthdayReq, &proto.SetPlayerBirthdayReq{}) // 设置生日请求
|
c.regMsg(SetPlayerBirthdayReq, func() any { return new(proto.SetPlayerBirthdayReq) }) // 设置生日请求
|
||||||
c.registerMessage(SetPlayerBirthdayRsp, &proto.SetPlayerBirthdayRsp{}) // 设置生日响应
|
c.regMsg(SetPlayerBirthdayRsp, func() any { return new(proto.SetPlayerBirthdayRsp) }) // 设置生日响应
|
||||||
c.registerMessage(SetNameCardReq, &proto.SetNameCardReq{}) // 修改名片请求
|
c.regMsg(SetNameCardReq, func() any { return new(proto.SetNameCardReq) }) // 修改名片请求
|
||||||
c.registerMessage(SetNameCardRsp, &proto.SetNameCardRsp{}) // 修改名片响应
|
c.regMsg(SetNameCardRsp, func() any { return new(proto.SetNameCardRsp) }) // 修改名片响应
|
||||||
c.registerMessage(GetAllUnlockNameCardReq, &proto.GetAllUnlockNameCardReq{}) // 获取全部已解锁名片请求
|
c.regMsg(GetAllUnlockNameCardReq, func() any { return new(proto.GetAllUnlockNameCardReq) }) // 获取全部已解锁名片请求
|
||||||
c.registerMessage(GetAllUnlockNameCardRsp, &proto.GetAllUnlockNameCardRsp{}) // 获取全部已解锁名片响应
|
c.regMsg(GetAllUnlockNameCardRsp, func() any { return new(proto.GetAllUnlockNameCardRsp) }) // 获取全部已解锁名片响应
|
||||||
c.registerMessage(UnlockNameCardNotify, &proto.UnlockNameCardNotify{}) // 名片解锁通知
|
c.regMsg(UnlockNameCardNotify, func() any { return new(proto.UnlockNameCardNotify) }) // 名片解锁通知
|
||||||
c.registerMessage(SetPlayerSignatureReq, &proto.SetPlayerSignatureReq{}) // 修改签名请求
|
c.regMsg(SetPlayerSignatureReq, func() any { return new(proto.SetPlayerSignatureReq) }) // 修改签名请求
|
||||||
c.registerMessage(SetPlayerSignatureRsp, &proto.SetPlayerSignatureRsp{}) // 修改签名响应
|
c.regMsg(SetPlayerSignatureRsp, func() any { return new(proto.SetPlayerSignatureRsp) }) // 修改签名响应
|
||||||
c.registerMessage(SetPlayerNameReq, &proto.SetPlayerNameReq{}) // 修改昵称请求
|
c.regMsg(SetPlayerNameReq, func() any { return new(proto.SetPlayerNameReq) }) // 修改昵称请求
|
||||||
c.registerMessage(SetPlayerNameRsp, &proto.SetPlayerNameRsp{}) // 修改昵称响应
|
c.regMsg(SetPlayerNameRsp, func() any { return new(proto.SetPlayerNameRsp) }) // 修改昵称响应
|
||||||
c.registerMessage(SetPlayerHeadImageReq, &proto.SetPlayerHeadImageReq{}) // 修改头像请求
|
c.regMsg(SetPlayerHeadImageReq, func() any { return new(proto.SetPlayerHeadImageReq) }) // 修改头像请求
|
||||||
c.registerMessage(SetPlayerHeadImageRsp, &proto.SetPlayerHeadImageRsp{}) // 修改头像响应
|
c.regMsg(SetPlayerHeadImageRsp, func() any { return new(proto.SetPlayerHeadImageRsp) }) // 修改头像响应
|
||||||
c.registerMessage(GetPlayerFriendListReq, &proto.GetPlayerFriendListReq{}) // 好友列表请求
|
c.regMsg(GetPlayerFriendListReq, func() any { return new(proto.GetPlayerFriendListReq) }) // 好友列表请求
|
||||||
c.registerMessage(GetPlayerFriendListRsp, &proto.GetPlayerFriendListRsp{}) // 好友列表响应
|
c.regMsg(GetPlayerFriendListRsp, func() any { return new(proto.GetPlayerFriendListRsp) }) // 好友列表响应
|
||||||
c.registerMessage(GetPlayerAskFriendListReq, &proto.GetPlayerAskFriendListReq{}) // 好友申请列表请求
|
c.regMsg(GetPlayerAskFriendListReq, func() any { return new(proto.GetPlayerAskFriendListReq) }) // 好友申请列表请求
|
||||||
c.registerMessage(GetPlayerAskFriendListRsp, &proto.GetPlayerAskFriendListRsp{}) // 好友申请列表响应
|
c.regMsg(GetPlayerAskFriendListRsp, func() any { return new(proto.GetPlayerAskFriendListRsp) }) // 好友申请列表响应
|
||||||
c.registerMessage(AskAddFriendReq, &proto.AskAddFriendReq{}) // 加好友请求
|
c.regMsg(AskAddFriendReq, func() any { return new(proto.AskAddFriendReq) }) // 加好友请求
|
||||||
c.registerMessage(AskAddFriendRsp, &proto.AskAddFriendRsp{}) // 加好友响应
|
c.regMsg(AskAddFriendRsp, func() any { return new(proto.AskAddFriendRsp) }) // 加好友响应
|
||||||
c.registerMessage(AskAddFriendNotify, &proto.AskAddFriendNotify{}) // 加好友通知
|
c.regMsg(AskAddFriendNotify, func() any { return new(proto.AskAddFriendNotify) }) // 加好友通知
|
||||||
c.registerMessage(DealAddFriendReq, &proto.DealAddFriendReq{}) // 处理好友申请请求
|
c.regMsg(DealAddFriendReq, func() any { return new(proto.DealAddFriendReq) }) // 处理好友申请请求
|
||||||
c.registerMessage(DealAddFriendRsp, &proto.DealAddFriendRsp{}) // 处理好友申请响应
|
c.regMsg(DealAddFriendRsp, func() any { return new(proto.DealAddFriendRsp) }) // 处理好友申请响应
|
||||||
c.registerMessage(GetPlayerSocialDetailReq, &proto.GetPlayerSocialDetailReq{}) // 获取玩家社区信息请求
|
c.regMsg(GetPlayerSocialDetailReq, func() any { return new(proto.GetPlayerSocialDetailReq) }) // 获取玩家社区信息请求
|
||||||
c.registerMessage(GetPlayerSocialDetailRsp, &proto.GetPlayerSocialDetailRsp{}) // 获取玩家社区信息响应
|
c.regMsg(GetPlayerSocialDetailRsp, func() any { return new(proto.GetPlayerSocialDetailRsp) }) // 获取玩家社区信息响应
|
||||||
c.registerMessage(GetOnlinePlayerListReq, &proto.GetOnlinePlayerListReq{}) // 在线玩家列表请求
|
c.regMsg(GetOnlinePlayerListReq, func() any { return new(proto.GetOnlinePlayerListReq) }) // 在线玩家列表请求
|
||||||
c.registerMessage(GetOnlinePlayerListRsp, &proto.GetOnlinePlayerListRsp{}) // 在线玩家列表响应
|
c.regMsg(GetOnlinePlayerListRsp, func() any { return new(proto.GetOnlinePlayerListRsp) }) // 在线玩家列表响应
|
||||||
c.registerMessage(PullRecentChatReq, &proto.PullRecentChatReq{}) // 最近聊天拉取请求
|
c.regMsg(PullRecentChatReq, func() any { return new(proto.PullRecentChatReq) }) // 最近聊天拉取请求
|
||||||
c.registerMessage(PullRecentChatRsp, &proto.PullRecentChatRsp{}) // 最近聊天拉取响应
|
c.regMsg(PullRecentChatRsp, func() any { return new(proto.PullRecentChatRsp) }) // 最近聊天拉取响应
|
||||||
c.registerMessage(PullPrivateChatReq, &proto.PullPrivateChatReq{}) // 私聊历史记录请求
|
c.regMsg(PullPrivateChatReq, func() any { return new(proto.PullPrivateChatReq) }) // 私聊历史记录请求
|
||||||
c.registerMessage(PullPrivateChatRsp, &proto.PullPrivateChatRsp{}) // 私聊历史记录响应
|
c.regMsg(PullPrivateChatRsp, func() any { return new(proto.PullPrivateChatRsp) }) // 私聊历史记录响应
|
||||||
c.registerMessage(PrivateChatReq, &proto.PrivateChatReq{}) // 私聊消息发送请求
|
c.regMsg(PrivateChatReq, func() any { return new(proto.PrivateChatReq) }) // 私聊消息发送请求
|
||||||
c.registerMessage(PrivateChatRsp, &proto.PrivateChatRsp{}) // 私聊消息发送响应
|
c.regMsg(PrivateChatRsp, func() any { return new(proto.PrivateChatRsp) }) // 私聊消息发送响应
|
||||||
c.registerMessage(PrivateChatNotify, &proto.PrivateChatNotify{}) // 私聊消息通知
|
c.regMsg(PrivateChatNotify, func() any { return new(proto.PrivateChatNotify) }) // 私聊消息通知
|
||||||
c.registerMessage(ReadPrivateChatReq, &proto.ReadPrivateChatReq{}) // 私聊消息已读请求
|
c.regMsg(ReadPrivateChatReq, func() any { return new(proto.ReadPrivateChatReq) }) // 私聊消息已读请求
|
||||||
c.registerMessage(ReadPrivateChatRsp, &proto.ReadPrivateChatRsp{}) // 私聊消息已读响应
|
c.regMsg(ReadPrivateChatRsp, func() any { return new(proto.ReadPrivateChatRsp) }) // 私聊消息已读响应
|
||||||
c.registerMessage(PlayerChatReq, &proto.PlayerChatReq{}) // 多人聊天消息发送请求
|
c.regMsg(PlayerChatReq, func() any { return new(proto.PlayerChatReq) }) // 多人聊天消息发送请求
|
||||||
c.registerMessage(PlayerChatRsp, &proto.PlayerChatRsp{}) // 多人聊天消息发送响应
|
c.regMsg(PlayerChatRsp, func() any { return new(proto.PlayerChatRsp) }) // 多人聊天消息发送响应
|
||||||
c.registerMessage(PlayerChatNotify, &proto.PlayerChatNotify{}) // 多人聊天消息通知
|
c.regMsg(PlayerChatNotify, func() any { return new(proto.PlayerChatNotify) }) // 多人聊天消息通知
|
||||||
c.registerMessage(GetOnlinePlayerInfoReq, &proto.GetOnlinePlayerInfoReq{}) // 在线玩家信息请求
|
c.regMsg(GetOnlinePlayerInfoReq, func() any { return new(proto.GetOnlinePlayerInfoReq) }) // 在线玩家信息请求
|
||||||
c.registerMessage(GetOnlinePlayerInfoRsp, &proto.GetOnlinePlayerInfoRsp{}) // 在线玩家信息响应
|
c.regMsg(GetOnlinePlayerInfoRsp, func() any { return new(proto.GetOnlinePlayerInfoRsp) }) // 在线玩家信息响应
|
||||||
|
|
||||||
// 卡池
|
// 卡池
|
||||||
c.registerMessage(GetGachaInfoReq, &proto.GetGachaInfoReq{}) // 卡池获取请求
|
c.regMsg(GetGachaInfoReq, func() any { return new(proto.GetGachaInfoReq) }) // 卡池获取请求
|
||||||
c.registerMessage(GetGachaInfoRsp, &proto.GetGachaInfoRsp{}) // 卡池获取响应
|
c.regMsg(GetGachaInfoRsp, func() any { return new(proto.GetGachaInfoRsp) }) // 卡池获取响应
|
||||||
c.registerMessage(DoGachaReq, &proto.DoGachaReq{}) // 抽卡请求
|
c.regMsg(DoGachaReq, func() any { return new(proto.DoGachaReq) }) // 抽卡请求
|
||||||
c.registerMessage(DoGachaRsp, &proto.DoGachaRsp{}) // 抽卡响应
|
c.regMsg(DoGachaRsp, func() any { return new(proto.DoGachaRsp) }) // 抽卡响应
|
||||||
|
|
||||||
// 角色
|
// 角色
|
||||||
c.registerMessage(AvatarDataNotify, &proto.AvatarDataNotify{}) // 角色信息通知
|
c.regMsg(AvatarDataNotify, func() any { return new(proto.AvatarDataNotify) }) // 角色信息通知
|
||||||
c.registerMessage(AvatarAddNotify, &proto.AvatarAddNotify{}) // 角色新增通知
|
c.regMsg(AvatarAddNotify, func() any { return new(proto.AvatarAddNotify) }) // 角色新增通知
|
||||||
c.registerMessage(AvatarLifeStateChangeNotify, &proto.AvatarLifeStateChangeNotify{}) // 角色存活状态改变通知
|
c.regMsg(AvatarLifeStateChangeNotify, func() any { return new(proto.AvatarLifeStateChangeNotify) }) // 角色存活状态改变通知
|
||||||
c.registerMessage(AvatarUpgradeReq, &proto.AvatarUpgradeReq{}) // 角色升级请求
|
c.regMsg(AvatarUpgradeReq, func() any { return new(proto.AvatarUpgradeReq) }) // 角色升级请求
|
||||||
c.registerMessage(AvatarUpgradeRsp, &proto.AvatarUpgradeRsp{}) // 角色升级通知
|
c.regMsg(AvatarUpgradeRsp, func() any { return new(proto.AvatarUpgradeRsp) }) // 角色升级通知
|
||||||
c.registerMessage(AvatarPropNotify, &proto.AvatarPropNotify{}) // 角色属性表更新通知
|
c.regMsg(AvatarPropNotify, func() any { return new(proto.AvatarPropNotify) }) // 角色属性表更新通知
|
||||||
c.registerMessage(AvatarPromoteReq, &proto.AvatarPromoteReq{}) // 角色突破请求
|
c.regMsg(AvatarPromoteReq, func() any { return new(proto.AvatarPromoteReq) }) // 角色突破请求
|
||||||
c.registerMessage(AvatarPromoteRsp, &proto.AvatarPromoteRsp{}) // 角色突破响应
|
c.regMsg(AvatarPromoteRsp, func() any { return new(proto.AvatarPromoteRsp) }) // 角色突破响应
|
||||||
c.registerMessage(AvatarPromoteGetRewardReq, &proto.AvatarPromoteGetRewardReq{}) // 角色突破获取奖励请求
|
c.regMsg(AvatarPromoteGetRewardReq, func() any { return new(proto.AvatarPromoteGetRewardReq) }) // 角色突破获取奖励请求
|
||||||
c.registerMessage(AvatarPromoteGetRewardRsp, &proto.AvatarPromoteGetRewardRsp{}) // 角色突破获取奖励响应
|
c.regMsg(AvatarPromoteGetRewardRsp, func() any { return new(proto.AvatarPromoteGetRewardRsp) }) // 角色突破获取奖励响应
|
||||||
|
c.regMsg(AvatarChangeCostumeReq, func() any { return new(proto.AvatarChangeCostumeReq) }) // 角色换装请求
|
||||||
// 时装
|
c.regMsg(AvatarChangeCostumeRsp, func() any { return new(proto.AvatarChangeCostumeRsp) }) // 角色换装响应
|
||||||
c.registerMessage(AvatarChangeCostumeReq, &proto.AvatarChangeCostumeReq{}) // 角色换装请求
|
c.regMsg(AvatarChangeCostumeNotify, func() any { return new(proto.AvatarChangeCostumeNotify) }) // 角色换装通知
|
||||||
c.registerMessage(AvatarChangeCostumeRsp, &proto.AvatarChangeCostumeRsp{}) // 角色换装响应
|
c.regMsg(AvatarGainCostumeNotify, func() any { return new(proto.AvatarGainCostumeNotify) }) // 角色获得时装通知
|
||||||
c.registerMessage(AvatarChangeCostumeNotify, &proto.AvatarChangeCostumeNotify{}) // 角色换装通知
|
c.regMsg(AvatarWearFlycloakReq, func() any { return new(proto.AvatarWearFlycloakReq) }) // 角色换风之翼请求
|
||||||
c.registerMessage(AvatarGainCostumeNotify, &proto.AvatarGainCostumeNotify{}) // 角色获得时装通知
|
c.regMsg(AvatarWearFlycloakRsp, func() any { return new(proto.AvatarWearFlycloakRsp) }) // 角色换风之翼响应
|
||||||
|
c.regMsg(AvatarFlycloakChangeNotify, func() any { return new(proto.AvatarFlycloakChangeNotify) }) // 角色换风之翼通知
|
||||||
// 风之翼
|
c.regMsg(AvatarGainFlycloakNotify, func() any { return new(proto.AvatarGainFlycloakNotify) }) // 角色获得风之翼通知
|
||||||
c.registerMessage(AvatarWearFlycloakReq, &proto.AvatarWearFlycloakReq{}) // 角色换风之翼请求
|
|
||||||
c.registerMessage(AvatarWearFlycloakRsp, &proto.AvatarWearFlycloakRsp{}) // 角色换风之翼响应
|
|
||||||
c.registerMessage(AvatarFlycloakChangeNotify, &proto.AvatarFlycloakChangeNotify{}) // 角色换风之翼通知
|
|
||||||
c.registerMessage(AvatarGainFlycloakNotify, &proto.AvatarGainFlycloakNotify{}) // 角色获得风之翼通知
|
|
||||||
|
|
||||||
// 背包与道具
|
// 背包与道具
|
||||||
c.registerMessage(PlayerStoreNotify, &proto.PlayerStoreNotify{}) // 玩家背包数据通知
|
c.regMsg(PlayerStoreNotify, func() any { return new(proto.PlayerStoreNotify) }) // 玩家背包数据通知
|
||||||
c.registerMessage(StoreWeightLimitNotify, &proto.StoreWeightLimitNotify{}) // 背包容量上限通知
|
c.regMsg(StoreWeightLimitNotify, func() any { return new(proto.StoreWeightLimitNotify) }) // 背包容量上限通知
|
||||||
c.registerMessage(StoreItemChangeNotify, &proto.StoreItemChangeNotify{}) // 背包道具变动通知
|
c.regMsg(StoreItemChangeNotify, func() any { return new(proto.StoreItemChangeNotify) }) // 背包道具变动通知
|
||||||
c.registerMessage(ItemAddHintNotify, &proto.ItemAddHintNotify{}) // 道具增加提示通知
|
c.regMsg(ItemAddHintNotify, func() any { return new(proto.ItemAddHintNotify) }) // 道具增加提示通知
|
||||||
c.registerMessage(StoreItemDelNotify, &proto.StoreItemDelNotify{}) // 背包道具删除通知
|
c.regMsg(StoreItemDelNotify, func() any { return new(proto.StoreItemDelNotify) }) // 背包道具删除通知
|
||||||
|
|
||||||
// 装备
|
// 装备
|
||||||
c.registerMessage(WearEquipReq, &proto.WearEquipReq{}) // 装备穿戴请求
|
c.regMsg(WearEquipReq, func() any { return new(proto.WearEquipReq) }) // 装备穿戴请求
|
||||||
c.registerMessage(WearEquipRsp, &proto.WearEquipRsp{}) // 装备穿戴响应
|
c.regMsg(WearEquipRsp, func() any { return new(proto.WearEquipRsp) }) // 装备穿戴响应
|
||||||
c.registerMessage(AvatarEquipChangeNotify, &proto.AvatarEquipChangeNotify{}) // 角色装备改变通知
|
c.regMsg(AvatarEquipChangeNotify, func() any { return new(proto.AvatarEquipChangeNotify) }) // 角色装备改变通知
|
||||||
c.registerMessage(CalcWeaponUpgradeReturnItemsReq, &proto.CalcWeaponUpgradeReturnItemsReq{}) // 计算武器升级返回矿石请求
|
c.regMsg(CalcWeaponUpgradeReturnItemsReq, func() any { return new(proto.CalcWeaponUpgradeReturnItemsReq) }) // 计算武器升级返回矿石请求
|
||||||
c.registerMessage(CalcWeaponUpgradeReturnItemsRsp, &proto.CalcWeaponUpgradeReturnItemsRsp{}) // 计算武器升级返回矿石响应
|
c.regMsg(CalcWeaponUpgradeReturnItemsRsp, func() any { return new(proto.CalcWeaponUpgradeReturnItemsRsp) }) // 计算武器升级返回矿石响应
|
||||||
c.registerMessage(WeaponUpgradeReq, &proto.WeaponUpgradeReq{}) // 武器升级请求
|
c.regMsg(WeaponUpgradeReq, func() any { return new(proto.WeaponUpgradeReq) }) // 武器升级请求
|
||||||
c.registerMessage(WeaponUpgradeRsp, &proto.WeaponUpgradeRsp{}) // 武器升级响应
|
c.regMsg(WeaponUpgradeRsp, func() any { return new(proto.WeaponUpgradeRsp) }) // 武器升级响应
|
||||||
c.registerMessage(WeaponPromoteReq, &proto.WeaponPromoteReq{}) // 武器突破请求
|
c.regMsg(WeaponPromoteReq, func() any { return new(proto.WeaponPromoteReq) }) // 武器突破请求
|
||||||
c.registerMessage(WeaponPromoteRsp, &proto.WeaponPromoteRsp{}) // 武器突破响应
|
c.regMsg(WeaponPromoteRsp, func() any { return new(proto.WeaponPromoteRsp) }) // 武器突破响应
|
||||||
c.registerMessage(WeaponAwakenReq, &proto.WeaponAwakenReq{}) // 武器精炼请求
|
c.regMsg(WeaponAwakenReq, func() any { return new(proto.WeaponAwakenReq) }) // 武器精炼请求
|
||||||
c.registerMessage(WeaponAwakenRsp, &proto.WeaponAwakenRsp{}) // 武器精炼响应
|
c.regMsg(WeaponAwakenRsp, func() any { return new(proto.WeaponAwakenRsp) }) // 武器精炼响应
|
||||||
c.registerMessage(SetEquipLockStateReq, &proto.SetEquipLockStateReq{}) // 设置装备上锁状态请求
|
c.regMsg(SetEquipLockStateReq, func() any { return new(proto.SetEquipLockStateReq) }) // 设置装备上锁状态请求
|
||||||
c.registerMessage(SetEquipLockStateRsp, &proto.SetEquipLockStateRsp{}) // 设置装备上锁状态响应
|
c.regMsg(SetEquipLockStateRsp, func() any { return new(proto.SetEquipLockStateRsp) }) // 设置装备上锁状态响应
|
||||||
c.registerMessage(TakeoffEquipReq, &proto.TakeoffEquipReq{}) // 装备卸下请求
|
c.regMsg(TakeoffEquipReq, func() any { return new(proto.TakeoffEquipReq) }) // 装备卸下请求
|
||||||
c.registerMessage(TakeoffEquipRsp, &proto.TakeoffEquipRsp{}) // 装备卸下响应
|
c.regMsg(TakeoffEquipRsp, func() any { return new(proto.TakeoffEquipRsp) }) // 装备卸下响应
|
||||||
|
|
||||||
// 商店
|
// 商店
|
||||||
c.registerMessage(GetShopmallDataReq, &proto.GetShopmallDataReq{}) // 商店信息请求
|
c.regMsg(GetShopmallDataReq, func() any { return new(proto.GetShopmallDataReq) }) // 商店信息请求
|
||||||
c.registerMessage(GetShopmallDataRsp, &proto.GetShopmallDataRsp{}) // 商店信息响应
|
c.regMsg(GetShopmallDataRsp, func() any { return new(proto.GetShopmallDataRsp) }) // 商店信息响应
|
||||||
c.registerMessage(GetShopReq, &proto.GetShopReq{}) // 商店详情请求
|
c.regMsg(GetShopReq, func() any { return new(proto.GetShopReq) }) // 商店详情请求
|
||||||
c.registerMessage(GetShopRsp, &proto.GetShopRsp{}) // 商店详情响应
|
c.regMsg(GetShopRsp, func() any { return new(proto.GetShopRsp) }) // 商店详情响应
|
||||||
c.registerMessage(BuyGoodsReq, &proto.BuyGoodsReq{}) // 商店货物购买请求
|
c.regMsg(BuyGoodsReq, func() any { return new(proto.BuyGoodsReq) }) // 商店货物购买请求
|
||||||
c.registerMessage(BuyGoodsRsp, &proto.BuyGoodsRsp{}) // 商店货物购买响应
|
c.regMsg(BuyGoodsRsp, func() any { return new(proto.BuyGoodsRsp) }) // 商店货物购买响应
|
||||||
c.registerMessage(McoinExchangeHcoinReq, &proto.McoinExchangeHcoinReq{}) // 结晶换原石请求
|
c.regMsg(McoinExchangeHcoinReq, func() any { return new(proto.McoinExchangeHcoinReq) }) // 结晶换原石请求
|
||||||
c.registerMessage(McoinExchangeHcoinRsp, &proto.McoinExchangeHcoinRsp{}) // 结晶换原石响应
|
c.regMsg(McoinExchangeHcoinRsp, func() any { return new(proto.McoinExchangeHcoinRsp) }) // 结晶换原石响应
|
||||||
|
|
||||||
// 载具
|
// 载具
|
||||||
c.registerMessage(CreateVehicleReq, &proto.CreateVehicleReq{}) // 创建载具请求
|
c.regMsg(CreateVehicleReq, func() any { return new(proto.CreateVehicleReq) }) // 创建载具请求
|
||||||
c.registerMessage(CreateVehicleRsp, &proto.CreateVehicleRsp{}) // 创建载具响应
|
c.regMsg(CreateVehicleRsp, func() any { return new(proto.CreateVehicleRsp) }) // 创建载具响应
|
||||||
c.registerMessage(VehicleInteractReq, &proto.VehicleInteractReq{}) // 载具交互请求
|
c.regMsg(VehicleInteractReq, func() any { return new(proto.VehicleInteractReq) }) // 载具交互请求
|
||||||
c.registerMessage(VehicleInteractRsp, &proto.VehicleInteractRsp{}) // 载具交互响应
|
c.regMsg(VehicleInteractRsp, func() any { return new(proto.VehicleInteractRsp) }) // 载具交互响应
|
||||||
c.registerMessage(VehicleStaminaNotify, &proto.VehicleStaminaNotify{}) // 载具耐力消耗通知
|
c.regMsg(VehicleStaminaNotify, func() any { return new(proto.VehicleStaminaNotify) }) // 载具耐力消耗通知
|
||||||
|
|
||||||
// 七圣召唤
|
// 七圣召唤
|
||||||
c.registerMessage(GCGBasicDataNotify, &proto.GCGBasicDataNotify{}) // GCG基本数据通知
|
c.regMsg(GCGBasicDataNotify, func() any { return new(proto.GCGBasicDataNotify) }) // GCG基本数据通知
|
||||||
c.registerMessage(GCGLevelChallengeNotify, &proto.GCGLevelChallengeNotify{}) // GCG等级挑战通知
|
c.regMsg(GCGLevelChallengeNotify, func() any { return new(proto.GCGLevelChallengeNotify) }) // GCG等级挑战通知
|
||||||
// c.registerMessage(GCGDSBanCardNotify, &proto.GCGDSBanCardNotify{}) // GCG禁止的卡牌通知
|
c.regMsg(GCGDSBanCardNotify, func() any { return new(proto.GCGDSBanCardNotify) }) // GCG禁止的卡牌通知
|
||||||
c.registerMessage(GCGDSDataNotify, &proto.GCGDSDataNotify{}) // GCG数据通知 (解锁的内容)
|
c.regMsg(GCGDSDataNotify, func() any { return new(proto.GCGDSDataNotify) }) // GCG数据通知 (解锁的内容)
|
||||||
c.registerMessage(GCGTCTavernChallengeDataNotify, &proto.GCGTCTavernChallengeDataNotify{}) // GCG酒馆挑战数据通知
|
c.regMsg(GCGTCTavernChallengeDataNotify, func() any { return new(proto.GCGTCTavernChallengeDataNotify) }) // GCG酒馆挑战数据通知
|
||||||
c.registerMessage(GCGTCTavernInfoNotify, &proto.GCGTCTavernInfoNotify{}) // GCG酒馆信息通知
|
c.regMsg(GCGTCTavernInfoNotify, func() any { return new(proto.GCGTCTavernInfoNotify) }) // GCG酒馆信息通知
|
||||||
c.registerMessage(GCGTavernNpcInfoNotify, &proto.GCGTavernNpcInfoNotify{}) // GCG酒馆NPC信息通知
|
c.regMsg(GCGTavernNpcInfoNotify, func() any { return new(proto.GCGTavernNpcInfoNotify) }) // GCG酒馆NPC信息通知
|
||||||
c.registerMessage(GCGGameBriefDataNotify, &proto.GCGGameBriefDataNotify{}) // GCG游戏简要数据通知
|
c.regMsg(GCGGameBriefDataNotify, func() any { return new(proto.GCGGameBriefDataNotify) }) // GCG游戏简要数据通知
|
||||||
c.registerMessage(GCGAskDuelReq, &proto.GCGAskDuelReq{}) // GCG游戏对局信息请求
|
c.regMsg(GCGAskDuelReq, func() any { return new(proto.GCGAskDuelReq) }) // GCG游戏对局信息请求
|
||||||
c.registerMessage(GCGAskDuelRsp, &proto.GCGAskDuelRsp{}) // GCG游戏对局信息响应
|
c.regMsg(GCGAskDuelRsp, func() any { return new(proto.GCGAskDuelRsp) }) // GCG游戏对局信息响应
|
||||||
c.registerMessage(GCGInitFinishReq, &proto.GCGInitFinishReq{}) // GCG游戏初始化完成请求
|
c.regMsg(GCGInitFinishReq, func() any { return new(proto.GCGInitFinishReq) }) // GCG游戏初始化完成请求
|
||||||
c.registerMessage(GCGInitFinishRsp, &proto.GCGInitFinishRsp{}) // GCG游戏初始化完成响应
|
c.regMsg(GCGInitFinishRsp, func() any { return new(proto.GCGInitFinishRsp) }) // GCG游戏初始化完成响应
|
||||||
c.registerMessage(GCGMessagePackNotify, &proto.GCGMessagePackNotify{}) // GCG游戏消息包通知
|
c.regMsg(GCGMessagePackNotify, func() any { return new(proto.GCGMessagePackNotify) }) // GCG游戏消息包通知
|
||||||
c.registerMessage(GCGHeartBeatNotify, &proto.GCGHeartBeatNotify{}) // GCG游戏心跳包通知
|
c.regMsg(GCGHeartBeatNotify, func() any { return new(proto.GCGHeartBeatNotify) }) // GCG游戏心跳包通知
|
||||||
c.registerMessage(GCGOperationReq, &proto.GCGOperationReq{}) // GCG游戏客户端操作请求
|
c.regMsg(GCGOperationReq, func() any { return new(proto.GCGOperationReq) }) // GCG游戏客户端操作请求
|
||||||
c.registerMessage(GCGOperationRsp, &proto.GCGOperationRsp{}) // GCG游戏客户端操作响应
|
c.regMsg(GCGOperationRsp, func() any { return new(proto.GCGOperationRsp) }) // GCG游戏客户端操作响应
|
||||||
c.registerMessage(GCGSkillPreviewNotify, &proto.GCGSkillPreviewNotify{}) // GCG游戏技能预览通知
|
c.regMsg(GCGSkillPreviewNotify, func() any { return new(proto.GCGSkillPreviewNotify) }) // GCG游戏技能预览通知
|
||||||
|
|
||||||
// // TODO 客户端开始GCG游戏
|
// // TODO 客户端开始GCG游戏
|
||||||
// c.registerMessage(GCGStartChallengeByCheckRewardReq, &proto.GCGStartChallengeByCheckRewardReq{}) // GCG开始挑战来自检测奖励请求
|
c.regMsg(GCGStartChallengeByCheckRewardReq, func() any { return new(proto.GCGStartChallengeByCheckRewardReq) }) // GCG开始挑战来自检测奖励请求
|
||||||
// c.registerMessage(GCGStartChallengeByCheckRewardRsp, &proto.GCGStartChallengeByCheckRewardRsp{}) // GCG开始挑战来自检测奖励响应
|
c.regMsg(GCGStartChallengeByCheckRewardRsp, func() any { return new(proto.GCGStartChallengeByCheckRewardRsp) }) // GCG开始挑战来自检测奖励响应
|
||||||
// c.registerMessage(GCGStartChallengeReq, &proto.GCGStartChallengeReq{}) // GCG开始挑战请求
|
c.regMsg(GCGStartChallengeReq, func() any { return new(proto.GCGStartChallengeReq) }) // GCG开始挑战请求
|
||||||
// c.registerMessage(GCGStartChallengeRsp, &proto.GCGStartChallengeRsp{}) // GCG开始挑战响应
|
c.regMsg(GCGStartChallengeRsp, func() any { return new(proto.GCGStartChallengeRsp) }) // GCG开始挑战响应
|
||||||
|
|
||||||
// 任务
|
// 任务
|
||||||
c.registerMessage(AddQuestContentProgressReq, &proto.AddQuestContentProgressReq{}) // 添加任务内容进度请求
|
c.regMsg(AddQuestContentProgressReq, func() any { return new(proto.AddQuestContentProgressReq) }) // 添加任务内容进度请求
|
||||||
c.registerMessage(AddQuestContentProgressRsp, &proto.AddQuestContentProgressRsp{}) // 添加任务内容进度响应
|
c.regMsg(AddQuestContentProgressRsp, func() any { return new(proto.AddQuestContentProgressRsp) }) // 添加任务内容进度响应
|
||||||
c.registerMessage(QuestListNotify, &proto.QuestListNotify{}) // 任务列表通知
|
c.regMsg(QuestListNotify, func() any { return new(proto.QuestListNotify) }) // 任务列表通知
|
||||||
c.registerMessage(QuestListUpdateNotify, &proto.QuestListUpdateNotify{}) // 任务列表更新通知
|
c.regMsg(QuestListUpdateNotify, func() any { return new(proto.QuestListUpdateNotify) }) // 任务列表更新通知
|
||||||
c.registerMessage(FinishedParentQuestNotify, &proto.FinishedParentQuestNotify{}) // 已完成父任务列表通知
|
c.regMsg(FinishedParentQuestNotify, func() any { return new(proto.FinishedParentQuestNotify) }) // 已完成父任务列表通知
|
||||||
c.registerMessage(FinishedParentQuestUpdateNotify, &proto.FinishedParentQuestUpdateNotify{}) // 已完成父任务列表更新通知
|
c.regMsg(FinishedParentQuestUpdateNotify, func() any { return new(proto.FinishedParentQuestUpdateNotify) }) // 已完成父任务列表更新通知
|
||||||
c.registerMessage(ServerCondMeetQuestListUpdateNotify, &proto.ServerCondMeetQuestListUpdateNotify{}) // 服务器动态任务列表更新通知
|
c.regMsg(ServerCondMeetQuestListUpdateNotify, func() any { return new(proto.ServerCondMeetQuestListUpdateNotify) }) // 服务器动态任务列表更新通知
|
||||||
c.registerMessage(QuestProgressUpdateNotify, &proto.QuestProgressUpdateNotify{}) // 任务进度更新通知
|
c.regMsg(QuestProgressUpdateNotify, func() any { return new(proto.QuestProgressUpdateNotify) }) // 任务进度更新通知
|
||||||
c.registerMessage(QuestGlobalVarNotify, &proto.QuestGlobalVarNotify{}) // 任务全局变量通知
|
c.regMsg(QuestGlobalVarNotify, func() any { return new(proto.QuestGlobalVarNotify) }) // 任务全局变量通知
|
||||||
|
|
||||||
// 乱七八糟
|
// 乱七八糟
|
||||||
c.registerMessage(MarkMapReq, &proto.MarkMapReq{}) // 标记地图请求
|
c.regMsg(MarkMapReq, func() any { return new(proto.MarkMapReq) }) // 标记地图请求
|
||||||
c.registerMessage(TowerAllDataReq, &proto.TowerAllDataReq{}) // 深渊数据请求
|
c.regMsg(TowerAllDataReq, func() any { return new(proto.TowerAllDataReq) }) // 深渊数据请求
|
||||||
c.registerMessage(TowerAllDataRsp, &proto.TowerAllDataRsp{}) // 深渊数据响应
|
c.regMsg(TowerAllDataRsp, func() any { return new(proto.TowerAllDataRsp) }) // 深渊数据响应
|
||||||
c.registerMessage(ServerAnnounceNotify, &proto.ServerAnnounceNotify{}) // 服务器公告通知
|
c.regMsg(ServerAnnounceNotify, func() any { return new(proto.ServerAnnounceNotify) }) // 服务器公告通知
|
||||||
c.registerMessage(ServerAnnounceRevokeNotify, &proto.ServerAnnounceRevokeNotify{}) // 服务器公告撤销通知
|
c.regMsg(ServerAnnounceRevokeNotify, func() any { return new(proto.ServerAnnounceRevokeNotify) }) // 服务器公告撤销通知
|
||||||
|
|
||||||
// // TODO
|
// TODO
|
||||||
// c.registerMessage(EvtAiSyncSkillCdNotify, &proto.EvtAiSyncSkillCdNotify{})
|
c.regMsg(EvtAiSyncSkillCdNotify, func() any { return new(proto.EvtAiSyncSkillCdNotify) })
|
||||||
// c.registerMessage(EvtAiSyncCombatThreatInfoNotify, &proto.EvtAiSyncCombatThreatInfoNotify{})
|
c.regMsg(EvtAiSyncCombatThreatInfoNotify, func() any { return new(proto.EvtAiSyncCombatThreatInfoNotify) })
|
||||||
// c.registerMessage(EntityConfigHashNotify, &proto.EntityConfigHashNotify{})
|
c.regMsg(EntityConfigHashNotify, func() any { return new(proto.EntityConfigHashNotify) })
|
||||||
// c.registerMessage(MonsterAIConfigHashNotify, &proto.MonsterAIConfigHashNotify{})
|
c.regMsg(MonsterAIConfigHashNotify, func() any { return new(proto.MonsterAIConfigHashNotify) })
|
||||||
// c.registerMessage(GetRegionSearchReq, &proto.GetRegionSearchReq{})
|
c.regMsg(GetRegionSearchReq, func() any { return new(proto.GetRegionSearchReq) })
|
||||||
|
|
||||||
// 空消息
|
|
||||||
c.registerMessage(65535, &proto.NullMsg{})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CmdProtoMap) registerMessage(cmdId uint16, protoObj pb.Message) {
|
func (c *CmdProtoMap) regMsg(cmdId uint16, protoObjNewFunc func() any) {
|
||||||
_, exist := c.cmdDeDupMap[cmdId]
|
_, exist := c.cmdDeDupMap[cmdId]
|
||||||
if exist {
|
if exist {
|
||||||
logger.Error("reg dup msg, cmd id: %v", cmdId)
|
logger.Error("reg dup msg, cmd id: %v", cmdId)
|
||||||
@@ -343,6 +339,7 @@ func (c *CmdProtoMap) registerMessage(cmdId uint16, protoObj pb.Message) {
|
|||||||
} else {
|
} else {
|
||||||
c.cmdDeDupMap[cmdId] = true
|
c.cmdDeDupMap[cmdId] = true
|
||||||
}
|
}
|
||||||
|
protoObj := protoObjNewFunc().(pb.Message)
|
||||||
refType := reflect.TypeOf(protoObj)
|
refType := reflect.TypeOf(protoObj)
|
||||||
// cmdId -> protoObj
|
// cmdId -> protoObj
|
||||||
c.cmdIdProtoObjMap[cmdId] = refType
|
c.cmdIdProtoObjMap[cmdId] = refType
|
||||||
@@ -353,8 +350,37 @@ func (c *CmdProtoMap) registerMessage(cmdId uint16, protoObj pb.Message) {
|
|||||||
c.cmdIdCmdNameMap[cmdId] = cmdName
|
c.cmdIdCmdNameMap[cmdId] = cmdName
|
||||||
// cmdName -> cmdId
|
// cmdName -> cmdId
|
||||||
c.cmdNameCmdIdMap[cmdName] = cmdId
|
c.cmdNameCmdIdMap[cmdName] = cmdId
|
||||||
|
// cmdId -> protoObjCache
|
||||||
|
c.cmdIdProtoObjCacheMap[cmdId] = &sync.Pool{
|
||||||
|
New: protoObjNewFunc,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 性能优化专用方法 若不满足使用条件 请老老实实的用下面的反射方法
|
||||||
|
|
||||||
|
// GetProtoObjCacheByCmdId 从缓存池获取一个对象 请务必确保能容忍获取到的对象含有使用过的脏数据 否则会产生不可预料的后果
|
||||||
|
func (c *CmdProtoMap) GetProtoObjCacheByCmdId(cmdId uint16) pb.Message {
|
||||||
|
cachePool, exist := c.cmdIdProtoObjCacheMap[cmdId]
|
||||||
|
if !exist {
|
||||||
|
logger.Error("unknown cmd id: %v", cmdId)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
protoObj := cachePool.Get().(pb.Message)
|
||||||
|
return protoObj
|
||||||
|
}
|
||||||
|
|
||||||
|
// PutProtoObjCache 将使用结束的对象放回缓存池 请务必确保对象的生命周期真的已经结束了 否则会产生不可预料的后果
|
||||||
|
func (c *CmdProtoMap) PutProtoObjCache(cmdId uint16, protoObj pb.Message) {
|
||||||
|
cachePool, exist := c.cmdIdProtoObjCacheMap[cmdId]
|
||||||
|
if !exist {
|
||||||
|
logger.Error("unknown cmd id: %v", cmdId)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cachePool.Put(protoObj)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 反射方法
|
||||||
|
|
||||||
func (c *CmdProtoMap) GetProtoObjByCmdId(cmdId uint16) pb.Message {
|
func (c *CmdProtoMap) GetProtoObjByCmdId(cmdId uint16) pb.Message {
|
||||||
refType, exist := c.cmdIdProtoObjMap[cmdId]
|
refType, exist := c.cmdIdProtoObjMap[cmdId]
|
||||||
if !exist {
|
if !exist {
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package proto;
|
|
||||||
|
|
||||||
option go_package = "./;proto";
|
|
||||||
|
|
||||||
message NullMsg {
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user