 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.scripts;
33 import java.io.BufferedReader;
34 import java.io.IOException;
35 import java.io.InputStreamReader;
36 import java.io.OutputStreamWriter;
37 import java.nio.charset.Charset;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
57 private final BufferedReader
in;
63 private final OutputStreamWriter
osw;
87 in =
new BufferedReader(
new InputStreamReader(
process.getInputStream(), Charset.defaultCharset()));
88 osw =
new OutputStreamWriter(
process.getOutputStream(), Charset.defaultCharset());
101 final int exitStatus =
process.waitFor();
102 return exitStatus == 0 ? null :
"exit "+exitStatus;
103 }
catch (
final InterruptedException ex) {
104 return ex.getMessage();
109 protected void writeToScript(@NotNull
final String data)
throws IOException {
final String filename
The script command including arguments.
final CommandQueue commandQueue
The CommandQueue for sending commands.
Model class maintaining the CfItems known to the player.
Implements the map model which is shown in the map and magic map views.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void writeToScript(@NotNull final String data)
Sends some data to the script process.
final Process process
The Process instance for the executed child process.
final MapUpdaterState mapUpdaterState
The MapUpdaterState instance to use.
Manages all known spells.
void killScript()
Kills the script process.
final ItemSet itemSet
The ItemSet instance to use.
final int scriptId
The script ID identifying this script instance.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
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)
Creates a new instance.
String readFromScript()
Reads a line from the script process.
This is the representation of all the statistics of a player, like its speed or its experience.
A script process that executes an external command.
String waitForTermination()
Waits until the script has terminated.
final Stats stats
The Stats instance to watch.
final BufferedReader in
The BufferedReader of process.
boolean killed
Whether this script has been killed.
final FloorView floorView
The FloorView to use.
Default implementation for ScriptProcesses.
final SpellsManager spellsManager
The SpellsManager instance to use.
Provides a view to all items comprising the current floor view.
Maintain the set of skills as sent by the server.
Update a CfMap model from protocol commands.
final SkillSet skillSet
The SkillSet for looking up skill names.
Maintains the pending (ncom) commands sent to the server.
final OutputStreamWriter osw
The OutputStreamWriter associated with process.