Hi
I got a problem:
1- I want to detect when user kill app(ios, android, window pc...) or lost internet from client, how could I got this event.
2- When 2 users in the same room, when an user disconnect(by case 1), how could I know, it doesn't fire event USER_EXIT.
Please help me
Thank you very much
Unity - How to detect DISCONNECT from client
Re: Unity - How to detect DISCONNECT from client
Hello,
There is an event in Unity that tells you when the app quits:
https://docs.unity3d.com/ScriptReferenc ... nQuit.html
As regards when the app looses connection, there's an SFS2X client event called SFSEvent.CONNECTION_LOST.
If you're not familiar with this I highly recommend to take a look at this very simple Unity example:
http://docs2x.smartfoxserver.com/Exampl ... /connector
There is no USER_EXIT event.
There is an event called SFSEvent.USER_EXIT_ROOM which signals when a user has left the Room (if you and the user were joined in the same Room)
Hope it helps
1- I want to detect when user kill app(ios, android, window pc...) or lost internet from client, how could I got this event.
There is an event in Unity that tells you when the app quits:
https://docs.unity3d.com/ScriptReferenc ... nQuit.html
As regards when the app looses connection, there's an SFS2X client event called SFSEvent.CONNECTION_LOST.
If you're not familiar with this I highly recommend to take a look at this very simple Unity example:
http://docs2x.smartfoxserver.com/Exampl ... /connector
2- When 2 users in the same room, when an user disconnect(by case 1), how could I know, it doesn't fire event USER_EXIT.
There is no USER_EXIT event.
There is an event called SFSEvent.USER_EXIT_ROOM which signals when a user has left the Room (if you and the user were joined in the same Room)
Hope it helps
Who is online
Users browsing this forum: No registered users and 34 guests