Page 1 of 1

Login as moderator in AS3

Posted: 17 Feb 2010, 16:33
by nespe11
Hi,

I´m using SmartFoxServer 1.6.6 Trial (I´ll buy a license if it suits what I need :D )

In my smartfoxserver connect 16 clients that send data from a socket every 10 seconds and I have the problem that the smartfoxserver disconnects these clients (kick them).

I turned off the AntiFlood and the BadWordsFilter and I set the DroppedPackets in this way:

Code: Select all

<ClientMessagQueue>
<QueueSize>60</QueueSize>
<MaxAllowedDroppedPackets>1000</MaxAllowedDroppedPackets></ClientMessagQueue>
I´m trying to log the clients as Moderators to avoid that the smartfoxserver kick them. I´m using this code:

Code: Select all

function onJoinRoom(evt:SFSEvent):void
		{
			var room:Room = sfs.getActiveRoom();
			txtU.text = "Equipos conectados: " + room.getUserCount();
			
			var aux:Array = room.getUserList();
			var miUser:User;
			for (var i in aux)
			{
				var user:User = aux[i];
				user.setModerator(true);
				var variablesUsu:Array = user.getVariables();
				if (user.getName() == sfs.myUserName) {
					miUser = user;
					miUser.setModerator(true);
				}
			}
		}
but when I log to the AdminTool.swf and I check the Zone Browser, in the user properties always show moderator: false.

How can I log users as moderators in AS3 that work?

Thanks in advance and sorry about my English.

Posted: 18 Feb 2010, 15:17
by Lapo
In my smartfoxserver connect 16 clients that send data from a socket every 10 seconds and I have the problem that the smartfoxserver disconnects these clients (kick them).
Are these clients built with SFS API?
16 clients sending data every 10 seconds won't do any harm, unless they are sending MB/s of data in each request :)
Can you better explain how this test work?
Can you also provide details on these disconnections? Do they happen at the same time? After how long does it happen? Is it constant?

Moderators have to be recognized by the server side. You can define moderator login and password in the config.xml.
Just calling setModerator() on the client won't do it.
You can learn more about it in this tutorial -> http://www.smartfoxserver.com/docs/docP ... /index.htm

Scroll down at approx. 50% of the article where it talks about "Moderators"

Posted: 18 Feb 2010, 15:54
by nespe11
Hi Lapo,

Many thanks for your help.

The operation of the test is as follows:

We have 16 server rooms in a building. Every room has a socket that sends temperature and humidity data in a XML to a central server.
In this central server, we have 16 .exe generated with Flash buitl with SFS API that connect to this sockets and through SmartFoxServer sends all this data to an Flash AS3 + Papervision aplication that shows the planes of these rooms and the temperature and humidity data.

The XML that the clients sends is a short XML in each request (8 nodes maximum).

The disconnections are random, sometimes they are turned off after ten minutes, sometimes days.

I have read the link you sent me and I modified the clients to reconnect when the smartfoxserver kicks them.
I modified too the config.xml to define the 16 users moderators.
I modified the MaxAllowedDroppedPackets in the config.xml too and now its seems that the clientes are stable.
If in a couple of days will continue to maintain stable, we will give the solution for good xD

My opinion is that the problem was MaxAllowedDroppedPackets now that I modified to 1000 no longer seem to disconnections

Regards and thanks for your help.