Page 1 of 1

Question about onRoomVariablesUpdate

Posted: 27 Sep 2007, 03:32
by mistermind
Hey guys, long time no see :)
Question about onRoomVariablesUpdate on SFS Basic v1.5.5
When I try deleting a room variable by using

Code: Select all

slotList = new Array();
slotList.push({name:_root.gameSlotNumber,val:null});
smartfox.setRoomVariables(slotList,roomID);


Apparently I don't get the event trigger by onRoomVariablesUpdate. Is that normal or am I doing something wrong?

Posted: 27 Sep 2007, 08:13
by Lapo
Usually you don't need to pass the roomId, unless you're connected in multiple rooms.
Is this the case? are you sure that the passed roomId is correct?

Posted: 27 Sep 2007, 14:14
by mistermind
Hey there Lapo :)
Yea I use constants just to make sure Im always using the same id, and in this case I actually use this method only after the trigger onJoinRoom, so in fact there is no need for the room ID. But thats ok its probably something Im doing wrong. Just wanted to make sure that when a variable gets deleted it calls the onRoomVariableUpdate event.

Posted: 27 Sep 2007, 14:53
by mistermind
Humm I did a couple tests here and I think that on SFS Basic 1.5.5 the onRoomVariablesUpdate event do not trigger when you set a variable to null. There is no receiving when you set it to null. just a sending on the XML output, and I also ran some trace tests to make sure, and it didn't trigger at all when you remove it.
When the user leaves the game and he is the var owner it get destroyed and updated, but when you set to null nothing happens.
Im still gonna run a couple more tests here but thats what I've noticed so far.