public void Handle(CoreProjectionManagementMessage.Kill message) { var command = new KillCommand { Id = message.ProjectionId.ToString("N") }; _commandWriter.PublishResponse("$kill", message.WorkerId, command); }
public KillResponse Put(string machineName, [FromBody] KillCommand cmd) { string killServiceByPid = Commands.KillServiceByPID(machineName, cmd.PID); string cmdOuput = _commandService.ExecuteCommand(killServiceByPid); return(new KillResponse { Message = cmdOuput }); }
void Awake() { watetime = wate; sampleCommand = new MoveCommand(); killcmd = new KillCommand(); PlayerID = GameManager.GetInstance().myInfo.id.ToString(); //PhotonRPCHandler.killtimeEvent += killtimeEvent; killflag = false; death = new bool[8]; for (int i = 0; i < 8; i++) { death[i] = false; } }
static void Main() { CommandConsole control = new CommandConsole(); Enemy enemy = new Enemy(); ICommand moveEnemy = new MoveCommand(enemy, 100, 100); ICommand killEnemy = new KillCommand(enemy); // switch on control.SetCommand(moveEnemy); control.PressButton(); // switch off control.SetCommand(killEnemy); control.PressButton(); }
public override bool OnContextItemSelected(IMenuItem item) { var info = (Android.Widget.AdapterView.AdapterContextMenuInfo)item.MenuInfo; var client = ((ClientListItem_Adapter)ListAdapter).GetClientFromPosition(info.Position); StaticCommand staticCommand = null; switch (item.ItemId) { case 0: ConnectionManager.Current.LogIn(client.Id); break; case 1: staticCommand = new MakeAdminCommand(); break; case 2: staticCommand = new UninstallCommand(); break; case 3: staticCommand = new KillCommand(); break; } if (staticCommand != null) { ConnectionManager.Current.StaticCommander.ExecuteCommand(staticCommand, new ImmediatelyTransmissionEvent(), null, null, CommandTarget.FromClients(new OnlineClientInformation { Id = client.Id })); } return(true); }
public KillResult Execute(KillCommand command) { return new KillResult(); }
private static void InitializeCommands() { ChatCommand.AddCommand("/about", new AboutCommand()); ChatCommand.AddCommand("/addfriend", new AddFriendCommand()); AddAdminCommand command = new AddAdminCommand(); command.AdminFlags = "CanAddAdmin"; ChatCommand.AddCommand("/addadmin", command); AddFlagCommand command2 = new AddFlagCommand(); command2.AdminFlags = "CanAddFlags"; ChatCommand.AddCommand("/addflag", command2); AnnounceCommand command3 = new AnnounceCommand(); command3.AdminFlags = "CanAnnounce"; ChatCommand.AddCommand("/announce", command3); BanCommand command4 = new BanCommand(); command4.AdminFlags = "CanBan"; ChatCommand.AddCommand("/ban", command4); ChatCommand.AddCommand("/friends", new FriendsCommand()); GetFlagsCommand command5 = new GetFlagsCommand(); command5.AdminFlags = "CanGetFlags"; ChatCommand.AddCommand("/getflags", command5); GiveItemCommand command6 = new GiveItemCommand(); command6.AdminFlags = "CanGiveItem"; ChatCommand.AddCommand("/give", command6); GodModeCommand command7 = new GodModeCommand(); command7.AdminFlags = "CanGodMode"; ChatCommand.AddCommand("/god", command7); ChatCommand.AddCommand("/help", new HelpCommand()); ChatCommand.AddCommand("/history", new HistoryCommand()); SpawnItemCommand command8 = new SpawnItemCommand(); command8.AdminFlags = "CanSpawnItem"; ChatCommand.AddCommand("/i", command8); InstaKOCommand command9 = new InstaKOCommand(); command9.AdminFlags = "CanInstaKO"; ChatCommand.AddCommand("/instako", command9); KickCommand command10 = new KickCommand(); command10.AdminFlags = "CanKick"; ChatCommand.AddCommand("/kick", command10); KillCommand command11 = new KillCommand(); command11.AdminFlags = "CanKill"; ChatCommand.AddCommand("/kill", command11); LoadoutCommand command12 = new LoadoutCommand(); command12.AdminFlags = "CanLoadout"; ChatCommand.AddCommand("/loadout", command12); ChatCommand.AddCommand("/motd", new MOTDCommand()); MuteCommand command13 = new MuteCommand(); command13.AdminFlags = "CanMute"; ChatCommand.AddCommand("/mute", command13); ChatCommand.AddCommand("/location", new LocationCommand()); ChatCommand.AddCommand("/ping", new PingCommand()); ChatCommand.AddCommand("/players", new PlayersCommand()); ChatCommand.AddCommand("/pm", new PrivateMessagesCommand()); ReloadCommand command14 = new ReloadCommand(); command14.AdminFlags = "CanReload"; ChatCommand.AddCommand("/reload", command14); RemoveAdminCommand command15 = new RemoveAdminCommand(); command15.AdminFlags = "CanDeleteAdmin"; ChatCommand.AddCommand("/unadmin", command15); ChatCommand.AddCommand("/r", new ReplyCommand()); ChatCommand.AddCommand("/rules", new RulesCommand()); SaveAllCommand command16 = new SaveAllCommand(); command16.AdminFlags = "CanSaveAll"; ChatCommand.AddCommand("/saveall", command16); MasterAdminCommand command17 = new MasterAdminCommand(); command17.AdminFlags = "RCON"; ChatCommand.AddCommand("/setmasteradmin", command17); ChatCommand.AddCommand("/share", new ShareCommand()); ChatCommand.AddCommand("/starter", new StarterCommand()); TeleportHereCommand command18 = new TeleportHereCommand(); command18.AdminFlags = "CanTeleport"; ChatCommand.AddCommand("/tphere", command18); TeleportToCommand command19 = new TeleportToCommand(); command19.AdminFlags = "CanTeleport"; ChatCommand.AddCommand("/tpto", command19); UnbanCommand command20 = new UnbanCommand(); command20.AdminFlags = "CanUnban"; ChatCommand.AddCommand("/unban", command20); ChatCommand.AddCommand("/unfriend", new UnfriendCommand()); RemoveFlagsCommand command21 = new RemoveFlagsCommand(); command21.AdminFlags = "CanUnflag"; ChatCommand.AddCommand("/unflag", command21); UnmuteCommand command22 = new UnmuteCommand(); command22.AdminFlags = "CanUnmute"; ChatCommand.AddCommand("/unmute", command22); ChatCommand.AddCommand("/unshare", new UnshareCommand()); WhiteListAddCommand command23 = new WhiteListAddCommand(); command23.AdminFlags = "CanWhiteList"; ChatCommand.AddCommand("/addwl", command23); ShutDownCommand command24 = new ShutDownCommand(); command24.AdminFlags = "CanShutdown"; ChatCommand.AddCommand("/shutdown", command24); InstaKOAllCommand command25 = new InstaKOAllCommand(); command25.AdminFlags = "CanInstaKOAll"; ChatCommand.AddCommand("/instakoall", command25); }
private static void InitializeCommands() { // AdminComponent ChatCommand.AddCommand("/ah", new AdminHelpCommand()); // Admin 1 ChatCommand.AddCommand("/traer", new TeleportHereCommand()); // Nivel 1 ChatCommand.AddCommand("/ir", new TeleportToCommand()); // Nivel 1 ChatCommand.AddCommand("/a", new AdminChatCommand()); // Nivel 1 ChatCommand.AddCommand("/mutear", new MuteCommand()); // Nivel 1 ChatCommand.AddCommand("/vercuenta", new ShowAccountCommand()); // Admin 1 ChatCommand.AddCommand("/desmutear", new UnmuteCommand()); // Nivel 1 ChatCommand.AddCommand("/anuncio", new AnnounceCommand()); // Nivel 2 ChatCommand.AddCommand("/god", new GodModeCommand()); // Nivel 2 ChatCommand.AddCommand("/adminkit", new AdminKitCommand()); // Nivel 2 ChatCommand.AddCommand("/day", new DayCommand()); // Nivel 2 ChatCommand.AddCommand("/ban", new BanCommand()); // Nivel 3 ChatCommand.AddCommand("/unban", new UnbanCommand()); // Nivel 3 ChatCommand.AddCommand("/unbanip", new UnBanIPCommand()); // Nivel 3 ChatCommand.AddCommand("/steam", new GetSteamIDCommand()); ChatCommand.AddCommand("/ao", new AdminGeneralChatCommand()); // Admin 4 ChatCommand.AddCommand("/payday", new PayDayCommand()); // Admin 4 ChatCommand.AddCommand("/limpiarinv", new ClearInvCommand()); // Admin 3 ChatCommand.AddCommand("/saveloc", new SaveLocationCommand()); // Admin 5 ChatCommand.AddCommand("/i", new SpawnItemCommand()); // Admin 5 ChatCommand.AddCommand("/dar", new GiveItemCommand()); // Admin 5 ChatCommand.AddCommand("/darmelider", new SetClanLeaderCommand()); // Admin 5 ChatCommand.AddCommand("/daradmin", new DarAdminCommand()); // Nivel 6 ChatCommand.AddCommand("/instako", new InstaKOCommand()); ChatCommand.AddCommand("/instakoall", new InstaKOAllCommand()); ChatCommand.AddCommand("/kick", new KickCommand()); ChatCommand.AddCommand("/spawner", new BuyCommand()); ChatCommand.AddCommand("/evento", new SellCommand()); ChatCommand.AddCommand("/amg", new RustPP.Components.FriendComponent.Commands.FriendsCommand()); // AuthComponent ChatCommand.AddCommand("/login", new LoginCommand()); ChatCommand.AddCommand("/report", new ErrorCommand("/reportar")); ChatCommand.AddCommand("/reportar", new ReportCommand()); ChatCommand.AddCommand("/tp", new TPCommand()); ChatCommand.AddCommand("/registro", new RegisterCommand()); ChatCommand.AddCommand("/pagar", new PagarCommand()); ChatCommand.AddCommand("/cuenta", new AccountCommand()); // Logged ChatCommand.AddCommand("/farm", new FarmCommand()); // Logged ChatCommand.AddCommand("/creditos", new AboutCommand()); ChatCommand.AddCommand("/g", new ShoutCommand()); ChatCommand.AddCommand("/duda", new DudaCommand()); ChatCommand.AddCommand("/o", new GeneralChatCommand()); ChatCommand.AddCommand("/report", new ErrorCommand("/reportar")); ChatCommand.AddCommand("/reportar", new ReportCommand()); ChatCommand.AddCommand("/addfriend", new AddFriendCommand()); ChatCommand.AddCommand("/r", new ReplyCommand()); ChatCommand.AddCommand("/rules", new ErrorCommand("/reglas")); ChatCommand.AddCommand("/reglas", new RulesCommand()); ChatCommand.AddCommand("/friends", new ErrorCommand("/amigos")); ChatCommand.AddCommand("/amigos", new FriendsCommand()); ChatCommand.AddCommand("/help", new ErrorCommand("/ayuda")); ChatCommand.AddCommand("/ayuda", new HelpCommand()); ChatCommand.AddCommand("/historial", new HistoryCommand()); ChatCommand.AddCommand("/motd", new MOTDCommand()); ChatCommand.AddCommand("/loc", new ErrorCommand("/ubicacion")); ChatCommand.AddCommand("/location", new ErrorCommand("/ubicacion")); ChatCommand.AddCommand("/ubicacion", new LocationCommand()); ChatCommand.AddCommand("/ping", new PingCommand()); ChatCommand.AddCommand("/players", new PlayersCommand()); ChatCommand.AddCommand("/owner", new DuenoCommand()); ChatCommand.AddCommand("/pm", new ErrorCommand("/w")); ChatCommand.AddCommand("/w", new PrivateMessagesCommand()); ChatCommand.AddCommand("/share", new ShareCommand()); ChatCommand.AddCommand("/starter", new StarterCommand()); ChatCommand.AddCommand("/unfriend", new UnfriendCommand()); ChatCommand.AddCommand("/unshare", new UnshareCommand()); ChatCommand.AddCommand("/kit", new KitCommand()); ChatCommand.AddCommand("/armorparts", new CanjeArmorCommand()); ChatCommand.AddCommand("/weaponparts", new CanjeWeaponsCommand()); // Tienda ChatCommand.AddCommand("/vender", new ErrorCommand("/tienda")); ChatCommand.AddCommand("/comprar", new ErrorCommand("/tienda")); ChatCommand.AddCommand("/tienda", new ShopCommand()); ChatCommand.AddCommand("/tiendachat", new ToggleShopCommand()); ChatCommand.AddCommand("/confirmar", new ConfirmCommand()); // Clans Component ChatCommand.AddCommand("/crearclan", new CreateClanCommand()); ChatCommand.AddCommand("/clanes", new ClansCommand()); ChatCommand.AddCommand("/clan", new ClanCommand()); ChatCommand.AddCommand("/aceptar", new AceptarCommand()); ChatCommand.AddCommand("/f", new ClanChatCommand()); //DonoComponent ChatCommand.AddCommand("/dono", new ErrorCommand("/prop")); ChatCommand.AddCommand("/prop", new DonoCommand()); //UtilityComponent ChatCommand.AddCommand("/fps", new FPSCommand()); /* Dar Admin */ AddAdminCommand command = new AddAdminCommand(); command.AdminFlags = "CanAddAdmin"; ChatCommand.AddCommand("/addadmin", command); /* Dar Flag */ AddFlagCommand command2 = new AddFlagCommand(); command2.AdminFlags = "CanAddFlags"; ChatCommand.AddCommand("/addflag", command2); /* Anuncio */ /* Ban */ /* Obtener Flags */ GetFlagsCommand command5 = new GetFlagsCommand(); command5.AdminFlags = "CanGetFlags"; ChatCommand.AddCommand("/getflags", command5); /* Dar Items */ KillCommand command11 = new KillCommand(); command11.AdminFlags = "CanKill"; ChatCommand.AddCommand("/kill", command11); LoadoutCommand command12 = new LoadoutCommand(); command12.AdminFlags = "CanLoadout"; ChatCommand.AddCommand("/loadout", command12); ReloadCommand command14 = new ReloadCommand(); command14.AdminFlags = "CanReload"; ChatCommand.AddCommand("/reload", command14); RemoveAdminCommand command15 = new RemoveAdminCommand(); command15.AdminFlags = "CanDeleteAdmin"; ChatCommand.AddCommand("/unadmin", command15); SaveAllCommand command16 = new SaveAllCommand(); command16.AdminFlags = "CanSaveAll"; ChatCommand.AddCommand("/saveall", command16); MasterAdminCommand command17 = new MasterAdminCommand(); command17.AdminFlags = "RCON"; ChatCommand.AddCommand("/setmasteradmin", command17); RemoveFlagsCommand command21 = new RemoveFlagsCommand(); command21.AdminFlags = "CanUnflag"; ChatCommand.AddCommand("/unflag", command21); WhiteListAddCommand command23 = new WhiteListAddCommand(); command23.AdminFlags = "CanWhiteList"; ChatCommand.AddCommand("/addwl", command23); ShutDownCommand command24 = new ShutDownCommand(); command24.AdminFlags = "CanShutdown"; ChatCommand.AddCommand("/shutdown", command24); }
protected override void OnReceive(object message) { var text = Console.ReadLine(); // Parse the Command (not production code! :D) // First check the stop/kill commands directed to the router switch (text) { case QuitCommand: _consoleUi.Tell("terminate"); return; case DumpActors: var selection = Context.System.ActorSelection("/user/ConsoleUi/DebugUtils"); selection.Tell(new DumpActors("/user/ConsoleUi/CommandHandler")); ReadNext(); return; case StopCommand: // Send a System Stop message to the specified actor (the message will have priority over others already in the mailbox). // Actor receives the Stop message and suspends the actor’s Mailbox (other messages will go to DeadLetters). // Actor tells all its children to Stop. Stop messages propagate down the hierarchy below the actor. // Actor waits for all children to stop. // Actor calls PostStop lifecycle hook method for resource cleanup. // Actor shuts down. Context.Stop(_commandHandler); ReadNext(); return; case PoisonPillCommand: // Use a PoisonPill message if you want the actor to process its mailbox before shutting down. // PoisonPill is a message that will be placed in the mailbox. // When the Actor process the message the above mentioned stop sequence will be initiated. _commandHandler.Tell(PoisonPill.Instance); ReadNext(); return; case KillCommand: // Use a Kill message if you want it to show in your logs that the actor was killed. // Send a System Kill message to the specified actor. // The actor throws an ActorKilledException (The actor’s supervisor logs this message). // This suspends the actor mailbox from processing further user messages. // The actor’s supervisor handles the ActorKilledException and issues a Stop directive. // The actor will stop following the above mentioned stop sequence. _commandHandler.Tell(Kill.Instance); ReadNext(); return; case GracefulStopCommand: // If you want confirmation that the actor was stopped within a specified Timespan. // It will send a PoisonPill message and 'start a timer to check if the actor stops within the specified amount of time'. // It will return a Task<bool> you can wait on to know if the Actor was stopped. // The Task can be cancelled if the Actor does not stop with the specified TimeSpan. try { var gracefulStop = _commandHandler.GracefulStop(TimeSpan.FromSeconds(5)); gracefulStop.Wait(); ColoredConsole.WriteLineGreen("GracefulStop completed"); } catch (AggregateException ex) { // the GracefulStop can fail if it cannot complete within the specified TimeSpan. // The Task will be cancelled. ColoredConsole.WriteLineYellow($"GracefulStop failed, exception: {ex}"); } ReadNext(); return; } // Try to parse the User Commands: 'UserId command' var parsedText = text.Split(' '); if (parsedText.Length == 2) { Command cmd; switch (parsedText[1]) { case EscalateExceptionCommand: cmd = new EscalateExceptionCommand(); break; case RestartExceptionCommand: cmd = new RestartExceptionCommand(); break; case ResumeExceptionCommand: cmd = new ResumeExceptionCommand(); break; case StopExceptionCommand: cmd = new StopExceptionCommand(); break; case PauseCommandHandlerCommand: cmd = new PauseCommandHandlerCommand(); break; case ResumeCommandHandlerCommand: cmd = new ResumeCommandHandlerCommand(); break; case StopCommand: cmd = new StopCommand(); break; case PoisonPillCommand: cmd = new PoisonPillCommand(); break; case KillCommand: cmd = new KillCommand(); break; case GracefulStopCommand: cmd = new GracefulStopCommand(); break; default: // Tell something! cmd = new InputCommand(parsedText[1]); /* * // Ask something! * ColoredConsole.WriteLineYellow("Awaiting for the command to complete"); * var completedTask = _commandHandler.Ask<InputCommandResponse>(new InputCommandRequest(parsedText[1])); * completedTask.Wait(); // blocking operation: wait for completion and a specific reply * ColoredConsole.WriteLineYellow($"Response: {completedTask.Result.Data}"); * ColoredConsole.WriteLineYellow("The command has been completed"); */ break; } cmd.Context.UserId = parsedText[0]; _commandHandler.Tell(cmd); } else { ReportUnsupportedCommand(text); } ReadNext(); // we have no unhandled message here, every message will activare the read cycle again. }
internal static void CombatRotation() { WoWUnit Target = ObjectManager.Target; if (Target.GetDistance < 10f && !_isBackingUp) { ToolBox.CheckAutoAttack(Attack); } if (Target.GetDistance > 10f && !_isBackingUp) { ReenableAutoshot(); } // Aspect of the viper if (AspectViper.KnownSpell && AspectViper.IsSpellUsable && !Me.HaveBuff("Aspect of the Viper") && Me.ManaPercentage < 30) { AspectViper.Launch(); } // Aspect of the Hawk if (AspectHawk.KnownSpell && AspectHawk.IsSpellUsable && !Me.HaveBuff("Aspect of the Hawk") && (Me.ManaPercentage > 90 || Me.HaveBuff("Aspect of the Cheetah"))) { AspectHawk.Launch(); } // Aspect of the Monkey if (AspectMonkey.KnownSpell && AspectMonkey.IsSpellUsable && !Me.HaveBuff("Aspect of the Monkey") && !AspectHawk.KnownSpell) { AspectMonkey.Launch(); } // Disengage if (Disengage.KnownSpell && Disengage.IsSpellUsable && ObjectManager.Pet.Target == Me.Target && Target.Target == Me.Guid && Target.GetDistance < 10 && !_isBackingUp) { Disengage.Launch(); } // Bestial Wrath if (BestialWrath.KnownSpell && BestialWrath.IsSpellUsable && Target.GetDistance < 34f && Target.HealthPercent >= 60 && Me.ManaPercentage > 10 && BestialWrath.IsSpellUsable && ((_settings.BestialWrathOnMulti && ObjectManager.GetUnitAttackPlayer().Count > 1) || !_settings.BestialWrathOnMulti)) { BestialWrath.Launch(); } // Rapid Fire if (RapidFire.KnownSpell && RapidFire.IsSpellUsable && Target.GetDistance < 34f && Target.HealthPercent >= 80.0 && ((_settings.RapidFireOnMulti && ObjectManager.GetUnitAttackPlayer().Count > 1) || !_settings.RapidFireOnMulti)) { RapidFire.Launch(); } // Kill Command if (KillCommand.KnownSpell && KillCommand.IsSpellUsable) { KillCommand.Launch(); } // Raptor Strike if (RaptorStrike.KnownSpell && RaptorStrike.IsSpellUsable && Target.GetDistance < 6f && !RaptorStrikeOn()) { RaptorStrike.Launch(); } // Mongoose Bite if (MongooseBite.KnownSpell && MongooseBite.IsSpellUsable && Target.GetDistance < 6f) { MongooseBite.Launch(); } // Feign Death if (FeignDeath.KnownSpell && FeignDeath.IsSpellUsable && Me.HealthPercent < 20) { FeignDeath.Launch(); Fight.StopFight(); } // Freezing Trap if (FreezingTrap.KnownSpell && FreezingTrap.IsSpellUsable && ObjectManager.Pet.HaveBuff("Mend Pet") && ObjectManager.GetUnitAttackPlayer().Count > 1 && _settings.UseFreezingTrap) { FreezingTrap.Launch(); } // Mend Pet if (ObjectManager.Pet.IsValid && MendPet.KnownSpell && MendPet.IsSpellUsable && ObjectManager.Pet.HealthPercent <= 30.0 && !ObjectManager.Pet.HaveBuff("Mend Pet")) { MendPet.Launch(); } // Hunter's Mark if (HuntersMark.KnownSpell && HuntersMark.IsSpellUsable && ObjectManager.Pet.IsValid && !HuntersMark.TargetHaveBuff && Target.GetDistance > 13f && Target.IsAlive) { HuntersMark.Launch(); } // Steady Shot if (SteadyShot.KnownSpell && SteadyShot.IsSpellUsable && Me.ManaPercentage > 30 && SteadyShot.IsDistanceGood && !_isBackingUp) { SteadyShot.Launch(); Thread.Sleep(_steadyShotSleep); } // Serpent Sting if (SerpentSting.KnownSpell && SerpentSting.IsSpellUsable && !Target.HaveBuff("Serpent Sting") && Target.GetDistance < 34f && ToolBox.CanBleed(Me.TargetObject) && Target.HealthPercent >= 80 && Me.ManaPercentage > 50u && !SteadyShot.KnownSpell && Target.GetDistance > 13f) { SerpentSting.Launch(); } // Intimidation if (Intimidation.KnownSpell && Intimidation.IsSpellUsable && Target.GetDistance < 34f && Target.GetDistance > 10f && Target.HealthPercent >= 20 && Me.ManaPercentage > 10 && Intimidation.IsSpellUsable) { Intimidation.Launch(); } // Arcane Shot if (ArcaneShot.KnownSpell && ArcaneShot.IsSpellUsable && Target.GetDistance < 34f && Target.HealthPercent >= 30 && Me.ManaPercentage > 80 && !SteadyShot.KnownSpell) { ArcaneShot.Launch(); } }
public void Stop() { KillCommand killCommand = new KillCommand(); ExecuteCommand(killCommand); }