Server Out of Synch

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

Moderators: Lapo, Bax

Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Server Out of Synch

Post by Gaurav »

Hello,

I am having a problem in the SmartFoxServer Pro 1.6.8. The issue is that when server is running and the clients are connected with it. In the meanwhile if any of the clients internet connection get closed or connection breaks for sometime. The server didn't get notified about that and that causes the whole process go out of synch. Hence please anyone suggest me why its going on and what I can do to notify the server about the user connection lost so that it can reflect it to all the other clients connected to the server. Its affecting our project a lot so please help me

Thanks,
Gaurav :(
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

maybe an extension with handleInternalEvent userLost?
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

I have been using at the server handle event for userLost. But the server is not getting notified. Hence my handler is not working
Fun Bobby
Posts: 48
Joined: 26 Sep 2008, 11:23

Post by Fun Bobby »

try to catch the "userLost" event from a zone-extension in the handleInternalEvent
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

Fun Bobby wrote:try to catch the "userLost" event from a zone-extension in the handleInternalEvent
I have an extension written in java and in that extension there is handleInternalEvent which is having a case for userLost. But there is no call to handleInternalEvent. Then how can I handle userLost in between..
Fun Bobby
Posts: 48
Joined: 26 Sep 2008, 11:23

Post by Fun Bobby »

at the top of handleInternalEvent trace all events that are fired. Then see what happens when your client is closed and what event is fired.
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

@Fun Bobby

I have applied the trace at the top but its showing nothing at that time. The way I applied the trace is:

Code: Select all

//ieo is the object of InternalEventObject

SmartFoxServer.log.log(Level.INFO, "Internal Event: "+ ieo.getEventName()
+ " recieved in our UserManagementExtension.");

Its not showing any trace.
Please I need a quick solution so please reply asap
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

try to catch the "userLost" event from a zone-extension in the handleInternalEvent
Did you try that? Because I think userLost internal event is only fired in the zone extension, not via room extensions.
Smartfox's forum is my daily newspaper.
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

Hi BigFish

I am doing the same that is handling that in handle InternalEvent. Please clarify when net connection gets disconnected then y it doesnot make any request to the server
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Yes, everytime a logged-in user gets disconnected (i.e. closing down the browser) 'userLost' internal event should get fired in your zone (root) extension. Note: 'userLost' internal event will not get fired if that user wasn't logged in.

How is your user getting disconnected? And does this happen everytime?
Smartfox's forum is my daily newspaper.
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

Hi BigFish

This is happening with the logged users. While testing what we do is

While the game is in progress the and one of the user goes to network Connection and disable the network connection or he simply unplug the network cable or his internet connection breaks. In this case the server is not getting notified about the userLost as the user is not connected to the server now. Please tell a way to get this notification.

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

Post by BigFIsh »

Are you getting a "logOut" internal event when that occured?

Note: only one of these internal events, "logOut" or "userLost" would get fired. Both internal events won't get triggered at the same time - only one would.
Smartfox's forum is my daily newspaper.
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

NO I am not getting any of the internal event. the server is not getting notified about the userLost. The server says that person is online. And it made the server goes out of synch.
I have made a trace for the InternalEvent. Whenever any internalevent fire it shows that. But in this no internal event??
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

No internal event at all? That's not possible :-)

It is likely to be related to your coding. Perhaps there's a typo somewhere.

This is how the internal event looks like (in java):

Code: Select all

@Override public void handleInternalEvent(InternalEventObject ieo)
{
	trace("Received a server event --> " + ieo.getEventName());
}
(and in actionscript..)

Code: Select all

function handleInternalEvent(evt)
{
	trace("Received a server event --> " + evt.name);
}
Is yours like that?

Lastly, make sure you're using the up-to-date version of that extension, and you're not using the wrong one. A simple test to ensure your extension is the current one you're working on is to trace a unique message in extension's init() function.
Smartfox's forum is my daily newspaper.
Gaurav
Posts: 24
Joined: 19 Apr 2010, 07:09

Post by Gaurav »

Yes thats the same way I am handling the InternalEvent.

Code: Select all

public void handleInternalEvent(InternalEventObject ieo) {
	SmartFoxServer.log.log(Level.INFO, "Internal Event: "
	+ ieo.getEventName()
	+ " recieved in our UserManagementExtension.");
}
The Server I am using is 1.6.8 and I have tried this in 1.6.9 also. The same problem exist there also. The extension is uptodate I have already made it sure.
Post Reply