STS
Well-known member
Hello, I am developing a upgrade for the Mission Control telemetry systems on my Sim Group. For the moment, we have been using a script in PHP. But now I want to use a desktop application in Java because that allows me (with my knowledge and experimentation) to receive data every 0.5 seconds in slow and fast connections.
Well, the problem is that I was testing today a remote connection via Hamachi to a member´s orbiter who was running DG-IV on Cold & Dark config at runway 33 on KSC, with default scenery. I insert the Hamachi IP adress of the member and hit the Connect button. The program starts receiving data, and I say "Great, It´s working!" but he says "Nope, I got a CTD Here".
I try the same on my local machine and the same nuclear weapon explodes at KSC causing me a CTD, too...
So I start investigating. And discovered that the problem is in this class, in the line that I will signal.
So this is the thread that when launched on KSC rwy 33 on any ship (no failure when on other base or flying) makes orbiter CTD
So I think this is problem of my code, but I test this command on the OrbConnect test client (on Doc folder in Orbiter) SHIP:FOCUS:Status2:1:0:0 and Orbiter also CTD´s so...
Has anybody else got this problem when testing this command with a ship landed in that location? (rwy 33 KSC with default scenery). This can cause several problems to me.
Using Orb:Connect 2.1 .
The algorithm in the PHP Version was different to obtain the fuel level, but was unable to implement it in Java. Will try retrying if nobody has this problem.
Well, the problem is that I was testing today a remote connection via Hamachi to a member´s orbiter who was running DG-IV on Cold & Dark config at runway 33 on KSC, with default scenery. I insert the Hamachi IP adress of the member and hit the Connect button. The program starts receiving data, and I say "Great, It´s working!" but he says "Nope, I got a CTD Here".
I try the same on my local machine and the same nuclear weapon explodes at KSC causing me a CTD, too...
So I start investigating. And discovered that the problem is in this class, in the line that I will signal.
Code:
//Note this code is half in Spanish :P
package ObtencionDatos;
import GUI.Ventanas;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;
import java.net.UnknownHostException;
/**
*
* @author TurryBoeing
*/
public class ObtenerFuel extends Thread {
public static Socket socket1;
// ObtenerFuelMasa masafuel = new ObtenerFuelMasa();
@Override
public void run() {
try {
socket1 = new Socket(Ventanas.ipNave.getText(), 37777);
//Esto lee: El buffered reader obtiene datos del Orbiter. El DataOutputStream manda los comandos al Orbiter
BufferedReader entrada = new BufferedReader(new InputStreamReader(socket1.getInputStream()));
PrintStream salida = new PrintStream(socket1.getOutputStream());
Splitear splitear = new Splitear();
System.out.println(this.getName() + "Conexión. Enviando mensaje.");
while (socket1.isConnected()) {
if (socket1.isClosed()) {
break;
}
salida.println("[B]SHIP:FOCUS:Status2:1:0:0[/B]");
String valorobtenido[];
valorobtenido = splitear.Splitea(entrada.readLine());
Thread.sleep(500);
valorobtenido=splitear.SpliteaPuntoComa(valorobtenido[1]);
String fuels[];
fuels=splitear.SpliteaComas(valorobtenido[1]);
// String fuelmax = valorobtenido[1];
int fuel = (int)(Double.valueOf(fuels[1])*100);
GUI.Ventanas.ProgressFuel.setValue(Integer.valueOf(fuel));
}
//socket1.close();
} catch (UnknownHostException ex) {
System.out.println("Host desconocido: " + ex.getMessage());
} catch (IOException ex) {
System.out.println("Error I/O " + ex.getMessage());
} catch (InterruptedException ex) {
System.out.println("Proceso interrumpido " + ex.getMessage());
}
}
}
So this is the thread that when launched on KSC rwy 33 on any ship (no failure when on other base or flying) makes orbiter CTD
So I think this is problem of my code, but I test this command on the OrbConnect test client (on Doc folder in Orbiter) SHIP:FOCUS:Status2:1:0:0 and Orbiter also CTD´s so...
Has anybody else got this problem when testing this command with a ship landed in that location? (rwy 33 KSC with default scenery). This can cause several problems to me.
Using Orb:Connect 2.1 .
The algorithm in the PHP Version was different to obtain the fuel level, but was unable to implement it in Java. Will try retrying if nobody has this problem.
Last edited: