With java can I create a room and give it more than 1 extension? If so how? I'm using helper.createRoom() but i think it only lets me put in 1 extension.
Thanks.
creating rooms with more than 1 extension
I wouldn't recommend to attach multiple extensions to a Room. Especially if of you plan to create many of these rooms.
It's going to be a waste of resources and makes your code trickier. One extension is a full and complete application that you can "attach" to a Zone or Room. Why would you split it in two parts?
It's going to be a waste of resources and makes your code trickier. One extension is a full and complete application that you can "attach" to a Zone or Room. Why would you split it in two parts?
Actually it would be nice.
We have different room extensions for certain games and on top of that we have a general zone extension that keeps track of slots in rooms since room object vars is too annoying to use due to the fact you have to rebuild the entire list instead of just adding a new one
Since the slot/seat code is very simple, it would be easier to have it as a second extension on the room.
I have a problem with the zone extension, but that will be a different post
We have different room extensions for certain games and on top of that we have a general zone extension that keeps track of slots in rooms since room object vars is too annoying to use due to the fact you have to rebuild the entire list instead of just adding a new one
Since the slot/seat code is very simple, it would be easier to have it as a second extension on the room.
I have a problem with the zone extension, but that will be a different post
I am not sure if I understand because I didn't get the "room object vars" passage.
However the common use case for multiple extensions is to reuse code.
What we recommend is to use OOP instead of multiple extensions. The effect is the same and the are multiple benefits.
(e.g. two extension don't share the same data, and they are more expensive to create than one especially at room level)
In Java it is trivial to reuse the code as well as in python. In Actionscript it's probably less done because the nature of the language doesn't promote OOP too much. Anyways you can import other blocks of code using #import and you can create classes as well.
Take a look here:
http://mckoss.com/jscript/object.htm
However the common use case for multiple extensions is to reuse code.
What we recommend is to use OOP instead of multiple extensions. The effect is the same and the are multiple benefits.
(e.g. two extension don't share the same data, and they are more expensive to create than one especially at room level)
In Java it is trivial to reuse the code as well as in python. In Actionscript it's probably less done because the nature of the language doesn't promote OOP too much. Anyways you can import other blocks of code using #import and you can create classes as well.
Take a look here:
http://mckoss.com/jscript/object.htm
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 36 guests