It is not directly implemented but they had it in mind and I dont think it would be all that hard to implement.
In rough detail you would need to modify the instance entry to check the number in the instance and then spawn a new instance. and when some one leaves check to see how many people are in the instance and if there are none delete the instance.
Here are some code segments to help.... let me know if you get something working.
- Code:
-
public static void CloseInstance(Long instanceOid){
InstanceClient.deleteInstance(instanceOid);
}
public static Long CreateInstance(String instanceName){
//create new instance for players
Template override = new Template();
/Overrides the template instance's name so they are not identical
override.put(Namespace.INSTANCE, InstanceClient.TEMPL_INSTANCE_NAME, instanceName + Engine.getOIDManager().getNextOid());
Long instanceOid = InstanceClient.createInstance(instanceName, override);
if (instanceOid == null || instanceOid.compareTo(0L) == 0){
Log.error("Instance was not created");
return null;
}
Log.debug("Instance was created");
return instanceOid;
}
You would need to add a way to look up all of the instance with that template I was using this code to create a private instance for a group of players so it just sent the ones entering the appropriate instanceOid.