public void RequestBuyEquip() { if (((uint)m_frame + m_wrapper.actor.ObjID) % 30 == 0) { //CBattleEquipSystem battleEquipSystem = (CBattleEquipSystem)CBattleSystem.instance.m_battleEquipSystem; //if (battleEquipSystem == null) //{ // return; //} m_wrapper.actor.pEquipCtrl.GetQuicklyBuyEquipList(); { for (int i = 0; i < m_wrapper.actor.pEquipCtrl.retlist.Length; i++) { if (m_wrapper.actor.pEquipCtrl.retlist[i] > 0) { FrameCommand <PlayerBuyEquipCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <PlayerBuyEquipCommand>(); MGFrameCommand <PlayerBuyEquipCommand> cmd = SmartReferencePool.instance.Fetch <MGFrameCommand <PlayerBuyEquipCommand> >(); frameCommand.cmdData.m_equipID = m_wrapper.actor.pEquipCtrl.retlist[i]; cmd.SetFrameCommand(ref frameCommand); cmd.playerID = CPlayerManager.instance.HostPlayerId; GameDefine.BattleNetHandler.WriteMsg(cmd); break; } } } } }
public virtual void RequestMoveToActor(uint objID) { // RealMoveToActor(objID); // return; CharHandle_t actor = GameCharMgr.instance.GetActor(objID); if (!actor) { return; } VecInt3 dest2 = actor.handle.location; if (m_lastDest != dest2) { m_lastDest = dest2; //VecInt3 vInt = dest2 - m_wrapper.actor.location; //if (vInt != VecInt3.zero) //{ // int num = (int)((double)(IntMath.atan2(-vInt.z, vInt.x).single * 180f) / 3.1416); // DebugHelper.Assert(num < 32767 && num > -32768, "WARN: num < 32767 && num > -32768"); // int num2 = num - InputModel.instance.PreMoveDirection; // if (num2 > 1 || num2 < -1 || InputModel.instance.FixtimeDirSndFrame > 30) // { // InputModel.instance.SendMoveDirection(num); // } //} FrameCommand <MoveToPosCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>(); MGFrameCommand <MoveToPosCommand> final = SmartReferencePool.instance.Fetch <MGFrameCommand <MoveToPosCommand> >(); Player ownerPlayer = CharHelper.GetOwnerPlayer(ref m_wrapper.actorPtr); frameCommand.playerID = ownerPlayer.PlayerId; frameCommand.cmdData.destPosition = dest2; final.SetFrameCommand(ref frameCommand); final.playerID = ownerPlayer.PlayerId; GameDefine.BattleNetHandler.WriteMsg(final); } }
public void RequestMovePosition(Vector3 dest) { // RealMovePosition(dest); // return; // // UnityEngine.Debug.Log(".................." + dest VecInt3 dest2 = new VecInt3(dest); if (m_lastDest != dest2 || m_wrapper.myBehavior != eObjBehavMode.Destination_Move) { m_lastDest = dest2; //VecInt3 vInt = dest2 - m_wrapper.actor.location; //if (vInt != VecInt3.zero) //{ // int num = (int)((double)(IntMath.atan2(-vInt.z, vInt.x).single * 180f) / 3.1416); // DebugHelper.Assert(num < 32767 && num > -32768, "WARN: num < 32767 && num > -32768"); // int num2 = num - InputModel.instance.PreMoveDirection; // if (num2 > 1 || num2 < -1 || InputModel.instance.FixtimeDirSndFrame > 30) // { // InputModel.instance.SendMoveDirection(num); // } //} FrameCommand <MoveToPosCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <MoveToPosCommand>(); MGFrameCommand <MoveToPosCommand> final = SmartReferencePool.instance.Fetch <MGFrameCommand <MoveToPosCommand> >(); Player ownerPlayer = CharHelper.GetOwnerPlayer(ref m_wrapper.actorPtr); frameCommand.playerID = ownerPlayer.PlayerId; frameCommand.cmdData.destPosition = dest2; final.SetFrameCommand(ref frameCommand); final.playerID = ownerPlayer.PlayerId; GameDefine.BattleNetHandler.WriteMsg(final); } }