22 package com.realtime.crossfire.jxclient.commands;
27 import java.util.Collection;
28 import org.jetbrains.annotations.NotNull;
48 super(
"scriptkill", crossfireServerConnection);
64 public void execute(@NotNull
final String args) {
65 final Collection<ScriptProcess> scriptProcesses = scriptManager.
getScripts(args);
66 if (scriptProcesses.isEmpty()) {
70 if (scriptProcesses.size() > 1) {
71 drawInfoError(
"More than one script matches: "+scriptProcesses+
".");
74 final ScriptProcess scriptProcess = scriptProcesses.iterator().next();
Abstract base class for Command implementations.
void drawInfoError(@NotNull final String message)
Displays an error message.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
boolean hasScripts()
Returns whether at least one script is running.
Maintains currently running script processes.
Set< ScriptProcess > getScripts(@NotNull final String partialScriptName)
Returns all running scripts matching a given (partial) name or a script ID.
void killScript()
Kills the script process.
Implements the "scriptkill" command.
An external command executed as a client-sided script.
ScriptkillCommand(@NotNull final ScriptManager scriptManager, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
final ScriptManager scriptManager
The ScriptManager to use.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments