Updated Java example.

- Removed setCONN, since very few users should need it in the future.
 - Added test at the beginning of the example to ensure that the client is connected to X-Plane.
This commit is contained in:
Jason Watkins
2015-05-01 14:28:33 -07:00
parent d2282c7695
commit 200eadd1e9

View File

@@ -21,8 +21,8 @@ public class Main
System.out.println("Setting up simulation..."); System.out.println("Setting up simulation...");
try(XPlaneConnect xpc = new XPlaneConnect()) try(XPlaneConnect xpc = new XPlaneConnect())
{ {
System.out.println("Setting inbound port"); // Ensure connection established.
xpc.setCONN(49055); xpc.getDREF("sim/test/test_float");
System.out.println("Setting player aircraft position"); System.out.println("Setting player aircraft position");
float[] posi = new float[] {37.524F, -122.06899F, 2500, 0, 0, 0, 1}; float[] posi = new float[] {37.524F, -122.06899F, 2500, 0, 0, 0, 1};