Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess:
Collaboration graph

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
 

Detailed Description

A script process that executes an external command.

Author
Andreas Kirschbaum

Definition at line 45 of file DefaultScriptProcess.java.

Constructor & Destructor Documentation

◆ DefaultScriptProcess()

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.

Parameters
scriptIdthe script ID identifying the new script
filenamethe command including arguments to execute
commandQueuethe command queue for sending commands
crossfireServerConnectionthe server connection
statsthe stats instance to watch
floorViewthe floor view to use
itemSetthe item set instance to use
spellsManagerthe spells manager instance to use
mapUpdaterStatethe map updater state instance to use
skillSetthe skill set for looking up skill names
Exceptions
IOExceptionif 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.

Member Function Documentation

◆ killScript()

void com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killScript ( )

◆ readFromScript()

String com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.readFromScript ( ) throws IOException
protected

Reads a line from the script process.

Returns
the line or
null
if the script has exited
Exceptions
IOExceptionif 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.

◆ waitForTermination()

String com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.waitForTermination ( )
protected

Waits until the script has terminated.

Returns
the termination reason or
null
if the script exited normally

Reimplemented from com.realtime.crossfire.jxclient.scripts.AbstractScriptProcess.

Definition at line 99 of file DefaultScriptProcess.java.

References com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.process.

◆ writeToScript()

void com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.writeToScript ( @NotNull final String  data) throws IOException
protected

Sends some data to the script process.

Parameters
datathe data
Exceptions
IOExceptionif 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.

Member Data Documentation

◆ in

final BufferedReader com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.in
private

◆ killed

boolean com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.killed
private

◆ osw

final OutputStreamWriter com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.osw
private

◆ process

final Process com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.process
private

The documentation for this class was generated from the following file: