public static string GodMode() { if (!LobbyMsgHandler.isHostGMAcnt) { return("没有gm权限"); } Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (((hostPlayer != null) && (hostPlayer.Captain != 0)) && (hostPlayer.Captain.handle.ActorControl is HeroWrapper)) { HeroWrapper actorControl = hostPlayer.Captain.handle.ActorControl as HeroWrapper; FrameCommand <SwitchActorSwitchGodMode> command = FrameCommandFactory.CreateFrameCommand <SwitchActorSwitchGodMode>(); command.cmdData.IsGodMode = !actorControl.bGodMode ? ((sbyte)1) : ((sbyte)0); command.Send(); return(CheatCommandBase.Done); } return("无法获取到正确的角色信息"); }
public void pickHeroHead(PlayerHead ph) { if ((((ph.MyHero.handle != null) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer() != null)) && (Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle != null)) && (ph.MyHero != Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain)) { for (int i = 0; i < this.heroHeads.Length; i++) { PlayerHead head = this.heroHeads[i]; if ((null == head) || (head.MyHero == 0)) { break; } head.SetPicked(ph == head); } FrameCommand <SwitchCaptainCommand> command = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>(); command.cmdData.ObjectID = ph.MyHero.handle.ObjID; command.Send(); } }
public static string GodMode() { if (!LobbyMsgHandler.isHostGMAcnt) { return("没有gm权限"); } Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer(); if (hostPlayer != null && hostPlayer.Captain && hostPlayer.Captain.handle.ActorControl is HeroWrapper) { HeroWrapper heroWrapper = hostPlayer.Captain.handle.ActorControl as HeroWrapper; FrameCommand <SwitchActorSwitchGodMode> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchActorSwitchGodMode>(); frameCommand.cmdData.IsGodMode = (heroWrapper.bGodMode ? 0 : 1); frameCommand.Send(); return(CheatCommandBase.Done); } return("无法获取到正确的角色信息"); }
private void SendMoveDirection(int moveDegree) { this.PreMoveDirection = moveDegree; this.ConfirmDirSndFrame = 0; this.FixtimeDirSndFrame = 0; FrameCommand <MoveDirectionCommand> frameCommand = FrameCommandFactory.CreateCSSyncFrameCommand <MoveDirectionCommand>(); frameCommand.cmdData.Degree = (short)moveDegree; if (this.nDirMoveSeq <= 255 && this.nDirMoveSeq >= 0) { Singleton <FrameSynchr> .GetInstance().m_MoveCMDSendTime[(int)this.nDirMoveSeq] = (uint)(Time.realtimeSinceStartup * 1000f); } byte nSeq; this.nDirMoveSeq = (nSeq = this.nDirMoveSeq) + 1; frameCommand.cmdData.nSeq = nSeq; frameCommand.Send(); }
public void SendStopMove(Player player = null, bool force = false) { if ((this.PreMoveDirection != 0x7fffffff) || force) { if (player == null) { player = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); } if (player != null) { this.PreMoveDirection = 0x7fffffff; this.ConfirmDirSndFrame = 0; this.FixtimeDirSndFrame = 0; FrameCommand <StopMoveCommand> command = FrameCommandFactory.CreateFrameCommand <StopMoveCommand>(); command.playerID = player.PlayerId; command.Send(); } } }
private bool SendRequestUseSkillTarget(Skill readySkillObj) { uint num = 0u; BaseAttackMode currentAttackMode = this.Actor.handle.ActorControl.GetCurrentAttackMode(); FrameCommand <UseObjectiveSkillCommand> frameCommand = FrameCommandFactory.CreateCSSyncFrameCommand <UseObjectiveSkillCommand>(); if (currentAttackMode != null) { num = currentAttackMode.SelectSkillTarget(this); } if (num == 0u) { return(false); } frameCommand.cmdData.ObjectID = num; frameCommand.cmdData.SlotType = this.SlotType; frameCommand.Send(); return(true); }
private bool SendRequestUseSkillPos(Skill readySkillObj) { bool flag = false; VInt3 zero = VInt3.zero; BaseAttackMode currentAttackMode = this.Actor.handle.ActorControl.GetCurrentAttackMode(); FrameCommand <UsePositionSkillCommand> frameCommand = FrameCommandFactory.CreateCSSyncFrameCommand <UsePositionSkillCommand>(); if (currentAttackMode != null) { flag = currentAttackMode.SelectSkillPos(this, out zero); } if (flag) { frameCommand.cmdData.Position = new VInt2(zero.x, zero.z); frameCommand.cmdData.SlotType = this.SlotType; frameCommand.Send(); return(true); } return(false); }
private void RequestUseSkillEnemyHeroSelectMode(uint objID) { if (objID == 0u) { return; } PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(objID); if (!actor || actor.handle.ActorControl.IsDeadState) { return; } if (this.CanUseSkillWithEnemyHeroSelectMode()) { Skill arg_5C_0 = (this.NextSkillObj != null) ? this.NextSkillObj : this.SkillObj; FrameCommand <UseObjectiveSkillCommand> frameCommand = FrameCommandFactory.CreateCSSyncFrameCommand <UseObjectiveSkillCommand>(); frameCommand.cmdData.ObjectID = objID; frameCommand.cmdData.SlotType = this.SlotType; frameCommand.Send(); } }
public void SendFrameCommand(int signalID, int worldPositionX, int worldPositionY, int worldPositionZ, byte bAlliance = 0, byte type = 0, uint targetObj_id = 0, uint targetHeroID = 0) { this.CancelSelectedSignalButton(); Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); if (((hostPlayer != null) && (hostPlayer.Captain != 0)) && (hostPlayer.Captain.handle != null)) { FrameCommand <SignalCommand> command = FrameCommandFactory.CreateFrameCommand <SignalCommand>(); command.playerID = hostPlayer.PlayerId; command.cmdData.m_heroID = (uint)hostPlayer.Captain.handle.TheActorMeta.ConfigId; command.cmdData.m_signalID = (byte)signalID; command.cmdData.m_worldPositionX = worldPositionX; command.cmdData.m_worldPositionY = worldPositionY; command.cmdData.m_worldPositionZ = worldPositionZ; command.cmdData.m_bAlies = bAlliance; command.cmdData.m_elementType = type; command.cmdData.m_targetObjId = targetObj_id; command.cmdData.m_targetHeroID = targetHeroID; command.Send(); } }
private void SendMoveDirection(int moveDegree, uint playerId = 0) { byte num; if (playerId == 0) { Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); if (hostPlayer == null) { return; } playerId = hostPlayer.PlayerId; } this.PreMoveDirection = moveDegree; this.ConfirmDirSndFrame = 0; this.FixtimeDirSndFrame = 0; FrameCommand <MoveDirectionCommand> command = FrameCommandFactory.CreateFrameCommand <MoveDirectionCommand>(); command.cmdData.Degree = (short)moveDegree; this.nDirMoveSeq = (byte)((num = this.nDirMoveSeq) + 1); command.cmdData.nSeq = num; command.Send(); }
public void pickHeroHead(PlayerHead ph) { if (ph.MyHero.handle == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer() == null || Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain.handle == null) { return; } if (ph.MyHero == Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain) { return; } for (int i = 0; i < this.heroHeads.Length; i++) { PlayerHead playerHead = this.heroHeads[i]; if (null == playerHead || !playerHead.MyHero) { break; } playerHead.SetPicked(ph == playerHead); } FrameCommand <SwitchCaptainCommand> frameCommand = FrameCommandFactory.CreateFrameCommand <SwitchCaptainCommand>(); frameCommand.cmdData.ObjectID = ph.MyHero.handle.ObjID; frameCommand.Send(); }