x


smartfoxserver keeps me logged in after exiting game

I'm building a game using Unity3D and connecting that to a Smart Fox Server. When I'm testing the game, I click play as usual, login to the Smart Fox Server, test, and then click play again to go back and edit. Problem is, Smart Fox Server is keeping me logged in after I click the play button again to stop the test, so when I go to login again I can't.. I have to wait for it to timeout. Is there a way to have Unity send a call to the smartfox server to log me out when I exit the game?

more ▼

asked May 28 '10 at 01:22 AM

aLucidWorld gravatar image

aLucidWorld
67 14 14 22

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I think you'll want something like:

void OnApplicationQuit() 
{
    UnsubscribeEvents();  // e.g. SFSEvent.onConnectionLost -= OnConnectionLost;
    smartFoxClient.Disconnect();
}

OnApplicationQuit is called when the game exits, and in the editor when you stop playing.

more ▼

answered May 28 '10 at 02:26 AM

Molix gravatar image

Molix
4.8k 16 27 66

Worked great! Thanks for taking the time to answer.

May 28 '10 at 04:06 AM aLucidWorld

I did that, but it's not working for me. Is there any need to do something in the server side?

May 06 '11 at 02:14 PM Saulo Camarotti

You're calling Disconnect(), so that should be enough for the server. Make sure it is actually being called (e.g. add a debug command).

May 06 '11 at 08:20 PM Molix
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x798
x413
x57
x56

asked: May 28 '10 at 01:22 AM

Seen: 1567 times

Last Updated: May 28 '10 at 02:28 AM