 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
20 package com.realtime.crossfire.jxclient.commands;
25 import java.util.Collection;
26 import org.jetbrains.annotations.NotNull;
56 public void execute(@NotNull
final String args) {
58 if (scriptProcesses.isEmpty()) {
62 if (scriptProcesses.size() > 1) {
63 drawInfoError(
"More than one script matches: "+scriptProcesses+
".");
66 final ScriptProcess scriptProcess = scriptProcesses.iterator().next();
74 final StringBuilder sb =
new StringBuilder();
75 sb.append(
"Stops a running client-sided script\n");
77 sb.append(
"Usage: scriptkill\n");
78 sb.append(
"Usage: scriptkill <script>\n");
80 sb.append(
"Stops the running client-sided script <script>. ");
81 sb.append(
"<script> is the ID of a running client-sided script or the partial name of a running client-sided script. ");
82 sb.append(
"If only one client-sided script is running, <script> may be omitted.\n");
83 sb.append(
"Note: Kill more than one or even all client-sided scripts: scriptkillall\n");
An external command executed as a client-sided script.
Set< ScriptProcess > getScripts(@NotNull final String partialScriptName)
Returns all running scripts matching a given (partial) name or a script ID.
void execute(@NotNull final String args)
Executes the command with the given arguments.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
boolean hasScripts()
Returns whether at least one script is running.
ScriptkillCommand(@NotNull final ScriptManager scriptManager, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
Abstract base class for Command implementations.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.
String getHelp()
Returns the help text for this command.
void killScript()
Kills the script process.
void drawInfoError(@NotNull final String message)
Displays an error message.
Maintains currently running script processes.
final ScriptManager scriptManager
The ScriptManager to use.
Implements the "scriptkill" command.
final CrossfireServerConnection crossfireServerConnection
The connection instance.