22 package com.realtime.crossfire.jxclient.commands;
27 import java.util.Collection;
28 import java.util.TreeSet;
29 import org.jetbrains.annotations.NotNull;
49 super(
"scripts", crossfireServerConnection);
65 public void execute(@NotNull
final String args) {
66 final Collection<ScriptProcess> scriptProcesses =
new TreeSet<>(scriptManager.
getScripts(args));
67 if (scriptProcesses.isEmpty()) {
73 for (
final Object scriptProcess : scriptProcesses) {
Abstract base class for Command implementations.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
final ScriptManager scriptManager
The ScriptManager to use.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
Implements the "scripts" command.
boolean hasScripts()
Returns whether at least one script is running.
Maintains currently running script processes.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments
Set< ScriptProcess > getScripts(@NotNull final String partialScriptName)
Returns all running scripts matching a given (partial) name or a script ID.
ScriptsCommand(@NotNull final ScriptManager scriptManager, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
An external command executed as a client-sided script.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void drawInfo(@NotNull final String message)
Displays a regular output message.