Phew, just came back from busy days, anyway, ok, ic that this is like TCP and UDP right?
you use TCP for reliable server and UDP for the other, am i correct?
Yes, that is correct.
then are you saying that, say, RTS Multiplayer use updates on position of each unit rather than sending commands of each player? which one is a better approach?
Commands are typically a bad way to go (although there are some situations where it makes sense) since for whatever reason if one command is missed then your are perpetually out of sync. With positional synchronization by using UDP that is not guaranteed delivery you are able to reduce lag considerably as the biggest aspects of lag are typically seen when you've got a latency spike and then messages get stacked up for delivery and then flood through all at one time. This causes the majority of lag you see in a game. With UDP by sending positional synchronization instead of that flood occurring the messages just simply disapear and once the spike ends the next message is received and is the most up-to-date and jumps to the correct position.
then about registering objects.. what if, im going to create a dedicated server and players more than two? Im just curious what actually happens when we register an object, does that mean if an object has been registered on both side(server and clients) then everytime that object is updated, the server will send a message to all the clients, and hence all the clients update all the properties(which have been changed) of the object with the same id?
then what if Im registering two different objects on each side but with the same id?
Take a look at the example for this. You can register as many objects as you'd like. You simply register it authoritative on the machine that should send information about this object and register the others simply as receivers. There is much more available through the synchronization system that can be handled and I would enourage you to look into this further.
Btw, do you write tutorials for this library?
I haven't had a chance to really do much in the way of tutorials yet, but that is something I intend to do in the long-run. If you are interested in doing so, I have a wiki set up here:
http://www.captiveimagination.com/wiki/index.php/JavaGameNetworking that you can create a tutorial on if you'd like and I'd be happy to proof-read it for you.
and one more question, under what license is this project based on?
The project uses the BSD license.