mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:32:26 +08:00
无果的远征,多人世界放技能该卡还是得卡
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package net
|
||||
|
||||
import "hk4e/pkg/logger"
|
||||
import (
|
||||
"hk4e/pkg/logger"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
const (
|
||||
KcpXorKeyChange = iota
|
||||
@@ -28,7 +31,7 @@ func (k *KcpConnectManager) eventHandle() {
|
||||
// 事件处理
|
||||
for {
|
||||
event := <-k.kcpEventInput
|
||||
logger.LOG.Info("kcp manager recv event, ConvId: %v, EventId: %v, EventMessage: %v", event.ConvId, event.EventId, event.EventMessage)
|
||||
logger.LOG.Info("kcp manager recv event, ConvId: %v, EventId: %v, EventMessage Type: %v", event.ConvId, event.EventId, reflect.TypeOf(event.EventMessage))
|
||||
switch event.EventId {
|
||||
case KcpXorKeyChange:
|
||||
// XOR密钥切换
|
||||
|
||||
@@ -63,15 +63,22 @@ func (p *ProtoEnDecode) protoDecode(kcpMsg *KcpMsg) (protoMsgList []*ProtoMsg) {
|
||||
msg.PayloadMessage = protoMessage.message
|
||||
protoMsgList = append(protoMsgList, msg)
|
||||
}
|
||||
for _, msg := range protoMsgList {
|
||||
cmdName := "???"
|
||||
if msg.PayloadMessage != nil {
|
||||
cmdName = string(msg.PayloadMessage.ProtoReflect().Descriptor().FullName())
|
||||
}
|
||||
logger.LOG.Debug("[RECV UNION CMD], cmdId: %v, cmdName: %v, convId: %v, headMsg: %v", msg.CmdId, cmdName, msg.ConvId, msg.HeadMessage)
|
||||
}
|
||||
} else {
|
||||
protoMsg.PayloadMessage = protoMessageList[0].message
|
||||
protoMsgList = append(protoMsgList, protoMsg)
|
||||
cmdName := ""
|
||||
if protoMsg.PayloadMessage != nil {
|
||||
cmdName = string(protoMsg.PayloadMessage.ProtoReflect().Descriptor().FullName())
|
||||
}
|
||||
logger.LOG.Debug("[RECV], cmdId: %v, cmdName: %v, convId: %v, headMsg: %v", protoMsg.CmdId, cmdName, protoMsg.ConvId, protoMsg.HeadMessage)
|
||||
}
|
||||
cmdName := ""
|
||||
if protoMsg.PayloadMessage != nil {
|
||||
cmdName = string(protoMsg.PayloadMessage.ProtoReflect().Descriptor().FullName())
|
||||
}
|
||||
logger.LOG.Debug("[recv], cmdId: %v, cmdName: %v, convId: %v, headMsg: %v", protoMsg.CmdId, cmdName, protoMsg.ConvId, protoMsg.HeadMessage)
|
||||
return protoMsgList
|
||||
}
|
||||
|
||||
@@ -103,7 +110,7 @@ func (p *ProtoEnDecode) protoEncode(protoMsg *ProtoMsg) (kcpMsg *KcpMsg) {
|
||||
if protoMsg.PayloadMessage != nil {
|
||||
cmdName = string(protoMsg.PayloadMessage.ProtoReflect().Descriptor().FullName())
|
||||
}
|
||||
logger.LOG.Debug("[send], cmdId: %v, cmdName: %v, convId: %v, headMsg: %v", protoMsg.CmdId, cmdName, protoMsg.ConvId, protoMsg.HeadMessage)
|
||||
logger.LOG.Debug("[SEND], cmdId: %v, cmdName: %v, convId: %v, headMsg: %v", protoMsg.CmdId, cmdName, protoMsg.ConvId, protoMsg.HeadMessage)
|
||||
kcpMsg = new(KcpMsg)
|
||||
kcpMsg.ConvId = protoMsg.ConvId
|
||||
kcpMsg.CmdId = protoMsg.CmdId
|
||||
|
||||
Reference in New Issue
Block a user