jME-Networking Example

Okay, all you people that keep showing up at my house asking when I’m going to finally get a test for jME-Networking you can look at, can finally go away…I’ve finally got a very simple test for you:



http://captiveimagination.com/svn/public/jme-networking/trunk/src/com/captiveimagination/jmenet/test/SimpleTest.java

http://captiveimagination.com/svn/public/jme-networking/trunk/src/com/captiveimagination/jmenet/test/SimpleTestClient.java

http://captiveimagination.com/svn/public/jme-networking/trunk/src/com/captiveimagination/jmenet/test/SimpleTestServer.java



Note that this is a very simple test and only shows the most basic example of a client connected to a server and using ‘,’ and ‘.’ you can rotate the box in the client and see it reflected on the server.  Feel free to add to it and send it back to me so I can have some more advanced examples.



Better enjoy because I don’t have time to keep writing examples for you people.  :stuck_out_tongue:



Just to be clear, it’s not that this was in any way difficult (as you can see from the source code), but rather because I’m lazy and/or too busy.  I just don’t want anyone to think JGN must suck if it’s taken me this long to write such a basic test. :wink:

Great, thanx… we have never doubted the value of your contributions  :wink:

im confused… :?



im trying to get started on the networking part of my project, and this basic code just gets me confused.



first, DebugGameState doesnt have a getLightState() method. so i comment out that line and try to run the test,

then it just crashes.



so i run it again in debug mode, and it appears that the game crashes on game.start(). im not really familiar with standard game, been using basegame all the time, so i thought oh

maybe its coz standard game requires me to initi the system. so i changed the method to game.run().



then the game runs, but both the server and the client r just two black screens, nothing else



plz help~ :expressionless:

I've had the same problem. Maybe our CSV needs updating neakor. Will give it a shot when I get home instead.

Oops…I forgot I had added that in my local copy of jME and never checked it in.  Sorry about that, I'll get that checked in tonight.

thx guys~ :smiley:

Okay, those changes are checked in…sorry about that. :o

darkfrog said:

Okay, those changes are checked in....sorry about that. :o


em...i dont know if im doing anything wrong or what.

i replaced my jme with the lasted from head, and it doesnt work, the DebugGameState doesnt have a method called getLightState(). ://

Try updating again because it does. :wink:



https://jme.dev.java.net/source/browse/jme/src/com/jmex/game/state/DebugGameState.java?view=markup

This is really good darkfrog. I love the ease at which you can sync with the graphics. Good job.

I am going to be revising this system a little more in the future to provide functionality to create and delete objects from the scene as requested by the server.  The use would be optional as you may either wish to provide that functionality yourself or not need it at all, but I think it will make client joins much easier to handle if the server sends a "create this object and register it for synchronization" message and it just works. :wink:

How does your game (Galaxies Beyond) handle it when a new client joins currently? Surely you must have something like this already in place?

Yes, it's essentially the same thing, but it's a custom coding in GB rather than supporting the feature directly in JGN.  I'm trying to move everything that might be useful into APIs to help out others rather than making a proprietary game that only benefits me. :wink:

darkfrog said:

Yes, it's essentially the same thing, but it's a custom coding in GB rather than supporting the feature directly in JGN.

The link is broken :frowning:

Phq said:

The link is broken :(

This is now a project on it own: http://code.google.com/p/jgn/