机器人移动

This commit is contained in:
flswld
2023-05-14 18:37:47 +08:00
parent 4f6a1a0825
commit c826ea0448

View File

@@ -172,18 +172,31 @@ func clientLogic(account string, session *net.Session) {
ReliableSeq: moveReliableSeq, ReliableSeq: moveReliableSeq,
IsReliable: true, IsReliable: true,
} }
logger.Debug("EntityMoveInfo: %v, account: %v", entityMoveInfo, account)
combatData, err := pb.Marshal(entityMoveInfo) combatData, err := pb.Marshal(entityMoveInfo)
if err != nil { if err != nil {
logger.Error("marshal EntityMoveInfo error: %v, account: %v", err, account) logger.Error("marshal EntityMoveInfo error: %v, account: %v", err, account)
continue continue
} }
session.SendMsg(cmd.CombatInvocationsNotify, &proto.CombatInvocationsNotify{ combatInvocationsNotify := &proto.CombatInvocationsNotify{
InvokeList: []*proto.CombatInvokeEntry{{ InvokeList: []*proto.CombatInvokeEntry{{
CombatData: combatData, CombatData: combatData,
ForwardType: proto.ForwardType_FORWARD_TO_ALL_EXCEPT_CUR, ForwardType: proto.ForwardType_FORWARD_TO_ALL_EXCEPT_CUR,
ArgumentType: proto.CombatTypeArgument_ENTITY_MOVE, ArgumentType: proto.CombatTypeArgument_ENTITY_MOVE,
}}, }},
}) }
body, err := pb.Marshal(combatInvocationsNotify)
if err != nil {
logger.Error("marshal CombatInvocationsNotify error: %v, account: %v", err, account)
continue
}
unionCmdNotify := &proto.UnionCmdNotify{
CmdList: []*proto.UnionCmd{{
Body: body,
MessageId: cmd.CombatInvocationsNotify,
}},
}
session.SendMsg(cmd.UnionCmdNotify, unionCmdNotify)
} }
} }
if tickCounter%5 != 0 { if tickCounter%5 != 0 {