Hi, sorry if this is a little dumb of a question.
Basically each client which connects should register a dynamicphysicsnode and a node.
individually, (by commenting out the others code) they each work. but together, i get some kind of failed thread error on the server.
here is how I am doing it on both the client and server
// Instantiate an instance of a JMEGraphicalController
JMEPhysicsGraphicalController physicscontroller = new JMEPhysicsGraphicalController();
JMEGraphicalController graphicscontroller = new JMEGraphicalController();
PhysicsSync physicssyncer = new PhysicsSync();
Syncer2 graphicalsyncer = new Syncer2();
// Create SynchronizationManager instance for this server
SynchronizationManager physicsserverSyncManager = new SynchronizationManager(client, physicscontroller);
SynchronizationManager graphicalserverSyncManager = new SynchronizationManager(client, graphicscontroller);
physicsserverSyncManager.addSyncObjectManager(physicssyncer);
graphicalserverSyncManager.addSyncObjectManager(graphicalsyncer);
JGN.createThread(physicsserverSyncManager).start();
JGN.createThread(graphicalserverSyncManager).start();
while (app.ingamestate == null) {
try {
System.out.println("null line 59");
Thread.sleep(100);
} catch(Exception exc) {
exc.printStackTrace();
}
}
Node player2 = app.ingamestate.getPlayer2();
DynamicPhysicsNode player = app.ingamestate.getPlayer1();
Node rootNode = app.ingamestate.getrootNode();
physicssyncer.setScene(rootNode);
graphicalsyncer.setScene(rootNode);
// Connect to the server before we register anything
System.out.println("Connecting!");
client.connectAndWait(serverReliable, serverFast, 1000);
System.out.println("Connected!");
// Register server vehicle
System.out.println("register player");
// Register server vehicle
physicsserverSyncManager.register(player, new SynchronizeCreateMessage(), 50);
graphicalserverSyncManager.register(player2, new SynchronizeCreateMessage(), 50);
I build them each individually and start each their own thread. am I doing this inappropriately? because i cant seem to get it to work.
Thanks for the help.