Crossfire JXClient, Trunk
|
Public Member Functions | |
DefaultScriptProcess (final int scriptId, @NotNull final String filename, @NotNull final CommandQueue commandQueue, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Stats stats, @NotNull final FloorView floorView, @NotNull final ItemSet itemSet, @NotNull final SpellsManager spellsManager, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final SkillSet skillSet) throws IOException | |
void | killScript () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess | |
void | addScriptProcessListener (@NotNull final ScriptProcessListener scriptProcessListener) |
void | commandSent (@NotNull final String cmd) |
int | compareTo (@NotNull final ScriptProcess o) |
boolean | equals (@Nullable final Object obj) |
String | getFilename () |
int | getScriptId () |
int | hashCode () |
void | run () |
String | toString () |
Protected Member Functions | |
String | readFromScript () throws IOException |
String | waitForTermination () |
void | writeToScript (@NotNull final String data) throws IOException |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess | |
AbstractScriptProcess (final int scriptId, @NotNull final String filename, @NotNull final CommandQueue commandQueue, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Stats stats, @NotNull final FloorView floorView, @NotNull final ItemSet itemSet, @NotNull final SpellsManager spellsManager, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final SkillSet skillSet) | |
Private Attributes | |
final BufferedReader | in |
boolean | killed |
final OutputStreamWriter | osw |
final Process | process |
A script process that executes an external command.
Definition at line 45 of file DefaultScriptProcess.java.
com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.DefaultScriptProcess | ( | final int | scriptId, |
@NotNull final String | filename, | ||
@NotNull final CommandQueue | commandQueue, | ||
@NotNull final CrossfireServerConnection | crossfireServerConnection, | ||
@NotNull final Stats | stats, | ||
@NotNull final FloorView | floorView, | ||
@NotNull final ItemSet | itemSet, | ||
@NotNull final SpellsManager | spellsManager, | ||
@NotNull final MapUpdaterState | mapUpdaterState, | ||
@NotNull final SkillSet | skillSet | ||
) | throws IOException |
Creates a new instance.
scriptId | the script ID identifying the new script |
filename | the command including arguments to execute |
commandQueue | the command queue for sending commands |
crossfireServerConnection | the server connection |
stats | the stats instance to watch |
floorView | the floor view to use |
itemSet | the item set instance to use |
spellsManager | the spells manager instance to use |
mapUpdaterState | the map updater state instance to use |
skillSet | the skill set for looking up skill names |
IOException | if the script cannot be created |
Definition at line 84 of file DefaultScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.commandQueue, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.crossfireServerConnection, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.filename, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.floorView, com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.in, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.itemSet, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.mapUpdaterState, com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.osw, com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.process, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.scriptId, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.skillSet, com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.spellsManager, and com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.stats.
void com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killScript | ( | ) |
Kills the script process. Does nothing if the process is not running.
Implements com.realtime.crossfire.jxclient.scripts.ScriptProcess.
Definition at line 119 of file DefaultScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killed, and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.process.
|
protected |
Reads a line from the script process.
IOException | if reading failed |
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 93 of file DefaultScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.in.
|
protected |
Waits until the script has terminated.
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 99 of file DefaultScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.process.
|
protected |
Sends some data to the script process.
data | the data |
IOException | if sending fails |
Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.
Definition at line 109 of file DefaultScriptProcess.java.
References com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killed, and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.osw.
|
private |
The BufferedReader of process.
Definition at line 57 of file DefaultScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.DefaultScriptProcess(), and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.readFromScript().
|
private |
Whether this script has been killed.
Definition at line 68 of file DefaultScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killScript(), and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.writeToScript().
|
private |
The OutputStreamWriter associated with process.
Definition at line 63 of file DefaultScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.DefaultScriptProcess(), and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.writeToScript().
|
private |
The Process instance for the executed child process.
Definition at line 51 of file DefaultScriptProcess.java.
Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.DefaultScriptProcess(), com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killScript(), and com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.waitForTermination().