SFSEventType.USER_VARIABLES_UPDATE not firing

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

SFSEventType.USER_VARIABLES_UPDATE not firing

Post 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;
	@Override
	public void handleServerEvent(ISFSEvent event) throws SFSException {
		trace("USER VARIABLE UPDATE");
		main = (GameMaster) getParentExtension();
		main.CheckUserStatuses();
	}

}
The room also has the permission set to send these updates.
Here is a screenshot:
http://screencast.com/t/ze8eU1j3d
http://screencast.com/t/m0QpYciUFO


Is there anything I am missing?
louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

Post by louissi »

Please can anyone help me? I am on a tight delay and I can't wrap my head around this one.
Robbilie
Posts: 190
Joined: 04 Sep 2010, 19:48
Location: Ratingen, Germany

Post 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...
louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

Post 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.
louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

Post 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 :(
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post by appels »

louissi
Posts: 48
Joined: 03 Mar 2006, 20:55

Post 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.
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Post by appels »

yep, a very good suggestion. I don't think it's mentioned in the docs.
At least i didn't find it.
Post Reply