Page 1 of 1


Posted: 05 Oct 2011, 19:32
by louissi
In my main extension for a room, I add this line of code:

Code: Select all

this.addEventHandler(SFSEventType.USER_VARIABLES_UPDATE, UserVariablesUpdate.class);

Normally, if a user in that room changes one of his variables it should fire this event right? Well its not :(

I am changing a variable the following way:

Code: Select all

var userVars:Array = new Array();
userVars.push(new SFSUserVariable("loaded", true));
sfs.send(new SetUserVariablesRequest(userVars));

The variable is indeed changed when I check in the admin panel.
Here is the class that would receive the Event:

Code: Select all

public class UserVariablesUpdate extends BaseServerEventHandler implements
      IServerEventHandler {
   GameMaster main;
   public void handleServerEvent(ISFSEvent event) throws SFSException {
      trace("USER VARIABLE UPDATE");
      main = (GameMaster) getParentExtension();


The room also has the permission set to send these updates.
Here is a screenshot:

Is there anything I am missing?

Posted: 06 Oct 2011, 15:49
by louissi
Please can anyone help me? I am on a tight delay and I can't wrap my head around this one.

Posted: 06 Oct 2011, 16:15
by Robbilie
the way u do looks a bit strange but it should not be based on this but on the sfsapi (u r doing it client or server side?)
On client i suggest changing directly on user...

Posted: 06 Oct 2011, 17:06
by louissi
The second piece of code is client side.

I am sending the request to the server.

This is the way it should be done. If you change the variable directly on the user, you will cause problems on the server-side and other users won't know you changed your variable.

I still don't know why the event is not firing though.
Any help admins?

EDIT: There are no WARN messages on the console.
The trace I put is not tracing.

Posted: 11 Oct 2011, 23:11
by louissi
Im starting to doubt the answer speed of the support haha. I understand you guys might be busy or cannot find what is wrong, but please give me some sign of life :(

Posted: 12 Oct 2011, 01:16
by appels

Posted: 12 Oct 2011, 12:12
by louissi
Thanks for your help. Might I suggest to make it more obvious in the docs? I never ran into any information about that.

Posted: 12 Oct 2011, 13:00
by appels
yep, a very good suggestion. I don't think it's mentioned in the docs.
At least i didn't find it.