Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by aLucidWorld · May 28, 2010 at 01:22 AM · gameserverexitsmartfox

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Molix · May 28, 2010 at 02:26 AM

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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image aLucidWorld · May 28, 2010 at 04:06 AM 0
Share

Worked great! Thanks for taking the time to answer.

avatar image Saulo Camarotti · May 06, 2011 at 02:14 PM 0
Share

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

avatar image Molix · May 06, 2011 at 08:20 PM 0
Share

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

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Best way to handle Sockets? 0 Answers

Menu button in game isn't working 0 Answers

MMO Server backend: Smartfox or Photon 2 Answers

How to make an online server. 0 Answers

Do I need Smartfox server for a client and server in different "rooms" or scenes or scenearios? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges