hi all,
i created a room var this way:
var varList = []
varList.push( {name:myName, val:myVal} )
_server.setRoomVariables(room, null, varList)
and when i try to delete it passing a null value:
var varList = []
varList.push( {name:myName, val:null} )
_server.setRoomVariables(room, null, varList)
the variable is still there and still has the old value
is there a way to delete the variable so it returns null when i check it's existence later on?
delete a server owned variable?
Ok,
the bug was found... actually the bug is a really weird one.
The problem is with Rhino, the AS/JS engine.
It seems that null object return "object" when you check their type with typeof() instead of "null"
I'd expect to trace "null" but it actually trace "object".
That said you can see why the deletion doesn't work. The null value that you pass in the Room Variable you want to delete is not recognized as type == "null".
Solution:
Before we release a patched version, you can quickly stop the problem from happening by following these steps:
- download this file and unzip it
- copy it to your Server/lib/ folder
- reload your extension(s)
Finally, in oder to delete a room variable, pass an undefined value instead of null
Hope it helps
the bug was found... actually the bug is a really weird one.
The problem is with Rhino, the AS/JS engine.
It seems that null object return "object" when you check their type with typeof() instead of "null"
Code: Select all
var p = null
trace("Type: " + typeof(p))
I'd expect to trace "null" but it actually trace "object".
That said you can see why the deletion doesn't work. The null value that you pass in the Room Variable you want to delete is not recognized as type == "null".
Solution:
Before we release a patched version, you can quickly stop the problem from happening by following these steps:
- download this file and unzip it
- copy it to your Server/lib/ folder
- reload your extension(s)
Finally, in oder to delete a room variable, pass an undefined value instead of null
Hope it helps
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 48 guests