Hey,
I'm a noob (newb, n00b, nubs) too -- but I think what he's saying is, have the server push an SFSObject or something to the client, and in that object set a parameter (you could call it _mobType). Then, on your client's network controller, when it received an object check if there is an _mobType set, and if there is then instantiate a preFab for that type on a particular spawn point. You could even pass WHICH spawn point as a different parameter.
If you look at the NetworkController script in the island demo, you will see this function:
// Here we process incoming SFS objects
private void OnObjectReceived(SFSObject data, User fromUser) {
//First determine the type of this object - what it contains ?
String _cmd = data.GetString("_cmd");
switch (_cmd) {
case "t": // "t" - means transform sync data
SendTransformToRemotePlayerObject(data, fromUser);
break;
case "f": // "f" - means force our local player to send his transform
ForceSendTransform(data);
break;
case "a": // "a" - for animation message received
SendAnimationMessageToRemotePlayerObject(data, fromUser);
break;
}
}
Notice that the only thing they are doing is receiving the SFSObject (which is called data) and then checking if it has an _cmd parameter. If it does, it looks at that command. If its a "t", it sends a transform. If its an "f", it forces a transform, if it's an "a", it sends an animation.
You can look at the AnimationSynchronizer script, and you will see how they instantiate the SFSObject and put the data inside of it:
void SendAnimationMessage(int animType)
{
SmartFoxClient client = NetworkController.GetClient();
SFSObject data = new SFSObject();
data.Put("_cmd", "a"); //We put _cmd = "a" here to know that this object contains animation message
data.Put("typ", animType);
client.SendObject(data);
}
In the above example, you will see where I added another parameter called "type", and put an integer into it.
Now, I haven't instantiated an SFSObject in java on my server side extensions yet, but basically it's probably very similar. I'm sure you can find examples of how to create an SFSObject and send it in the smartfoxserver examples.
So, in summary:
1) On the server, instantiate an SFSObject, stuff a few parameters into it, like _mobType and _spawnLocation
2) On the client, read those parameters and do stuff with them, ie:
String newMobType = data.GetString("_mobType");
String spawnLocation = data.GetString("_spawnLocation");
... but I'm just a noob, so don't take my word for it. All of this is assuming you can instantiate an SFSObject in a java extension
If you can't, well.. Then Boo.