mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
Ai世界玩家人数超过4人测试
This commit is contained in:
1 parent
3ecdb6ff70
commit
1793054ef4
22 files changed
+596
-251
No files matched your search
@@ -228,14 +228,22 @@ func (f *FightRoutine) attackHandle(gameMsg *mq.GameMsg) {
|
||||
continue
|
||||
}
|
||||
hitInfo := new(proto.EvtBeingHitInfo)
|
||||
clientProtoObj := GetClientProtoObjByName("EvtBeingHitInfo")
|
||||
if clientProtoObj == nil {
|
||||
logger.Error("get client proto obj is nil")
|
||||
return
|
||||
}
|
||||
ok := utils.UnmarshalProtoObj(hitInfo, clientProtoObj, entry.CombatData)
|
||||
if !ok {
|
||||
continue
|
||||
if config.CONF.Hk4e.ClientProtoProxyEnable {
|
||||
clientProtoObj := GetClientProtoObjByName("EvtBeingHitInfo")
|
||||
if clientProtoObj == nil {
|
||||
logger.Error("get client proto obj is nil")
|
||||
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
|
||||
if attackResult == nil {
|
||||
@@ -303,10 +311,6 @@ func initClientCmdProtoMap() {
|
||||
}
|
||||
|
||||
func GetClientProtoObjByName(protoObjName string) pb.Message {
|
||||
if !config.CONF.Hk4e.ClientProtoProxyEnable {
|
||||
logger.Error("client proto proxy func not enable")
|
||||
return nil
|
||||
}
|
||||
fn := ClientCmdProtoMapRefValue.MethodByName("GetClientProtoObjByName")
|
||||
ret := fn.Call([]reflect.Value{reflect.ValueOf(protoObjName)})
|
||||
obj := ret[0].Interface()
|
||||
|
||||
Reference in new issue
Block a user