Page 1 of 2

Server Out of Synch

Posted: 19 Aug 2010, 08:01
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 :(

Posted: 19 Aug 2010, 08:17
by rjgtav
maybe an extension with handleInternalEvent userLost?

Posted: 19 Aug 2010, 08:33
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

Posted: 19 Aug 2010, 09:47
by Fun Bobby
try to catch the "userLost" event from a zone-extension in the handleInternalEvent

Posted: 19 Aug 2010, 11:04
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..

Posted: 19 Aug 2010, 12:57
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.

Posted: 19 Aug 2010, 16:32
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

Posted: 19 Aug 2010, 20:38
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.

Posted: 19 Aug 2010, 20:56
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

Posted: 20 Aug 2010, 07:08
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?

Posted: 23 Aug 2010, 05:01
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 :(

Posted: 23 Aug 2010, 06:28
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.

Posted: 23 Aug 2010, 06:47
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??

Posted: 23 Aug 2010, 10:19
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.

Posted: 23 Aug 2010, 10:42
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.