Hi Pfeil,
I tried both, and it seems I can't find any difference in either output.
I haven't tried running the server from a Windows machine and it's quite possible that this is the culprit. However, I would still want to solve the issue as it's my main platform for running the server personally.

Signs are pointing against this as my original implementation in Java worked fine with the same server using much the same methods (please excuse the horrors which follow as it was pretty much the first GUI application I ever wrote and it's rather crufty about accessing the UI and the config in the application logic):
Server interaction:
Code:
public class Command {
@Inject
Connection connection;
@Inject
public void sendCommand(String line) {
connection.getOutput().println(line);
connection.getOutput().flush();
if (connection.getOutput().checkError()) {
System.out.println("Not sent.");
}
}
public void loadMission(String mission) {
sendCommand("mission LOAD " + mission);
}
public void endMission() {
sendCommand("mission DESTROY");
}
public void askMission() {
sendCommand("mission");
}
}
Connection:
Code:
public void connect() {
try {
socket = new Socket(Config.getIpAddress(), Integer.decode(Config.getPort()));
output = new PrintWriter(socket.getOutputStream(), true);
input = new BufferedReader(new InputStreamReader(socket.getInputStream(), Charset.forName("UTF-8")));
setConnected(true);
if (socket.isConnected()) {
System.out.println("Connected to server " + Config.getIpAddress() + " on port " + Config.getPort());
}
} catch (IOException e) {
setConnected(false);
System.out.println("Failed to connect to socket.");
e.printStackTrace();
}
}
Choosers:
Code:
public void serverPathButtonAction() {
String serverPath;
File file = serverChooser.showOpenDialog(new Stage());
if (file != null) {
serverPath = file.toString();
Config.setServerPath(serverPath);
serverPathLabel.setText(serverPath);
missionPathButton.setDisable(false);
} else {
serverPathLabel.setText("<no server .exe selected>");
missionPathButton.setDisable(true);
}
}
public void missionPathButtonAction() {
String missionPath;
File file = missionChooser.showOpenDialog(new Stage());
if (file != null) {
missionPath = file.toString();
Config.setMissionPath(missionPath);
missionPathLabel.setText(missionPath);
} else {
missionPathLabel.setText("<no .mis file selected>");
}
}
Path resolution:
Code:
public String resolveMissionPath() {
Path serverPath;
Path missionPath;
Path missionsRoot;
Path missionLoadPath;
String missionLoadString;
serverPath = Paths.get(Config.getServerPath());
missionPath = Paths.get(Config.getMissionPath());
missionsRoot = serverPath.getParent().resolve("Missions");
missionLoadPath = missionsRoot.relativize(missionPath).normalize();
missionLoadString = missionLoadPath.toString().replace("\\", "/");
return missionLoadString;
}
Load/unload command:
Code:
public void startStopButtonAction() {
if (Mission.getMissionRunning()) {
command.endMission();
command.askMission();
} else {
if (Config.getRemoteMode()) {
command.loadMission(Config.getRemotePath());
} else {
command.loadMission(mainConfigPresenter.resolveMissionPath());
}
}
}
Things that are definitely different:
- The PrintWriter only wraps the OutputStream (i.e. it is not buffered as in my current implementation).
- I use the .toString() method on the File rather than .getCanonicalPath.
- I used the CheckError() method previously. Maybe there is actually an error state on the socket?
Just tried using all of these with no luck.