Page 1 of 1

room.istemp alternative in 2x?

Posted: 06 May 2012, 16:22
by mixart
In SFS1 there was a room method called isTemp() that no longer exists in SFS2x — what is the alternate way to find out if a room is temporary or not?

Re: room.istemp alternative in 2x?

Posted: 06 May 2012, 17:05
by rjgtav
Hi.
In SFS1X a temp room was a room created by a player, not by the server. In SFS2X, on the client-side, there is no way to find whether a room was created by a player or by the server, but on the server-side you can know it by getting that room's owner (which returns null in case it was the server who created it).
That said, if you really need that feature, you could simply create a new global variable called, for example, "temp", which is true when that room was created by an user (you don't need to add that variable to the non-temp rooms). Please note that for creating a global variable, you have to create the room from the server-side.

Re: room.istemp alternative in 2x?

Posted: 06 May 2012, 18:24
by mixart
Thanks (as always) :)
I did end up creating a room variable for this - does the job.

I put it down to just another one of those SFS1 to SFS2 differences.

I am a little disappointed how much more difficult things are in SFS2X. My AS code is about 200 lines larger so far, and my java extension - well that's about 300% the size it was in AS ;)
Hopefully these benefits are all worth it in the end.

Re: room.istemp alternative in 2x?

Posted: 06 May 2012, 18:58
by rjgtav
Yes they will. Remember AS3 and Java are much faster than AS2.0. And the new binary format beats the xml protocol by a huge difference ;)