Hi!
Ahh yeah - formulated like that, you are asking SFS questions
First question you need to ask yourself is, if you want authoritative server or not (meaning - server side logic that controls everything including cheat checks etc.etc.).
In the latter case you are going to code a java extension on the server, and then communicate with it using the SendXtMessage methods.
The island demo as it is currently uses SendObject, which is a basic "spam all clients in the same room with me with this object, using server only for message relay".
The above isnt really very efficient once you scale up, but it can work great for some things that neither require server side logic, that every player has to get and/or dont happen that often.
Otherwise its time to break open your Java skills and write extensions.
Onto your questions in more specifics:
As usual there is no "only one way" solution, so what is specific for you might not apply for others.
But in general you need rework how the island demo sends its transforms if you want to scale up. The transform should be packed on the client side, send to a server extension, where its then even further aggregated with everyone elses transform and send out as a single "position update" to all clients. They then need to unpack and apply the transform updates to the avatars. This will save _a lot_ of bandwidth and be an efficiency improvement.
You can then further create zones. If your server knows about your level design, you can create zones and restrict sending update messages to contain only enemy transforms that are actually visible and/or within range. Or you could do it distance based and throttle sending updates.
For changing clothes or avatar model, it somewhat depends on how often this could happen.
You can either use user variables in the existing methods (and would then get an user variable updated callback) - or if someone changes his clothes you can send it out from an extension similar to the above mentioned transform method.
For damage models and health - you are starting to really move into a situation where you need an authoritative server. This is an area of itself to write a book about.
The short version: for anything that your game client wants to do, it sends a request to the server saying "I would like to shoot my gun at player 4. Is that ok?"
The server has your entire game logic and data running as a simulation. It is the ONLY place where the data model lives (hence authoritative). The server could in your example now run the following:
* check if you actually carry the gun you claim
* check if its out of ammo
* check if player 4 is actually in range of you
* run a line of sight check and see if you can see the player
* grab the stats for your weapon out of the data model
* run the "determine if you hit" code
* apply the resulting damage to the data model on the server side
* send back the resulting damage info to all game clients (especially the 2 battling it out)
THEN the clients do what they do with the data they get back.
The above would vary depending on the exact game you make, but this is how e.g. WAR and WoW do it. The game client runs some kind of animation while the server does its things. E..g if you cast a spell, it does some kind of "wave arms around for 2 secs" animation. In this time, the server runs the code and sends back to the clients ASAP. Then the resulting fireball is spawned after time is over, damage info floats over the heads and a monster die animation might be shown. But thats simply rendering the result of that one response/request exchange between client and server.
So that model you apply all over!!
Hope that answers your questions
/Thomas