DisabledSysEvents still dispatching onUserVariablesUpdate

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
trueicecold
Posts: 84
Joined: 11 Oct 2009, 11:46
Contact:

DisabledSysEvents still dispatching onUserVariablesUpdate

Post by trueicecold »

Hello all.

in my config.xml I have:

Code: Select all

		<Zone name="peopleRoom" uCountUpdate="false" buddyList="100" maxUsers="20000" customLogin="true">
			<Rooms>
				<Room name="Main" isGame="true" maxUsers="20000" limbo="true" isPrivate="false" isTemp="false" autoJoin="true" uCountUpdate="false" />
			</Rooms>
			<Extensions>
				<extension name="peopleRoom" className="peopleRoom.as" type="script" />
				<extension name="__$RedBox$__" className="com.smartfoxserver.redbox.RedBoxExtension" type="java" />
			</Extensions>
			<DisabledSysEvents>
			  <event>onUserVariablesUpdate</event>
			</DisabledSysEvents>
		</Zone>
but when debuggin my Flex application I still get:

Code: Select all

<msg t='sys'><body action='uVarsUpdate' r='1'><vars><var n='inCall' t='b'><![CDATA[1]]></var><var n='partner' t='n'><![CDATA[1]]></var></vars><user id='2' /></body></msg>
how can it be? :/

Also, will disabling this event save the bandwidth from the server to the client?

Thanks!
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Where do you update a user's variable? A snippet of the methods used would be helpful too.
Smartfox's forum is my daily newspaper.
trueicecold
Posts: 84
Joined: 11 Oct 2009, 11:46
Contact:

Post by trueicecold »

Thanks BigFIsh, I update it both on client side and extension:

in client:

Code: Select all

if (sfsClient.isConnected)
	sfsClient.setUserVariables({fName:fName, lName:lName,  countryCode:countryCode});
in server:

Code: Select all

_server.setUserVariables(partnerUser, {inCall:false});
for each server change, I get "uVarUpdate" event with the new inCall value for all users...

And what about the bandwidth? if I block this event, will it save bandwidth?

thanks a lot![/code]
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

The third parameter of the _server.setUserVariables method determines whether or not to send the update to the client (see http://www.smartfoxserver.com/docs/docP ... ables.html).

Also, I just discovered that onUserVariablesUpdate isn't a valid DisabledSysEvents value (see http://www.smartfoxserver.com/docs/docP ... basics.htm).

If you want to prevent clients from updating variables via client-side, add setUserVariables to your <DisabledSysActions> list.

Yes, disabling it will save bandwidth..
Smartfox's forum is my daily newspaper.
trueicecold
Posts: 84
Joined: 11 Oct 2009, 11:46
Contact:

Post by trueicecold »

BigFIsh - You're my hero :) I can't believe I missed the sendUpdate param in the documentation...

Thanks a lot mate, this would save us gigs and gigs of bandwidth (200 concurrent users at any given time with hectic activity application...) :)
Post Reply