22 package com.realtime.crossfire.jxclient.commands;
27 import java.util.Collection;
28 import org.jetbrains.annotations.NotNull;
49 super(
"scripttell", crossfireServerConnection);
65 public void execute(@NotNull
final String args) {
71 final String[] tmp = args.split(
" +", 2);
72 final Collection<ScriptProcess> scriptProcesses = scriptManager.
getScripts(tmp[0]);
73 if (scriptProcesses.isEmpty()) {
83 final String cmd =
"scripttell "+tmp[1];
85 scriptProcess.commandSent(cmd);
Abstract base class for Command implementations.
ScripttellCommand(@NotNull final ScriptManager scriptManager, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
void drawInfoError(@NotNull final String message)
Displays an error message.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
final ScriptManager scriptManager
The ScriptManager to use.
boolean hasScripts()
Returns whether at least one script is running.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments
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.
Implements the "scripttell" command.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
An external command executed as a client-sided script.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.