Iam new to SmartFox.
Iam trying to find a way how we can identify disconnection by internet etc. Implemented USER_DISCONNECT at zone level and deployed on the server. After that connected with a sample client and turn off my wifi.
But on server USER_DISCONNECT is not trigged.
I think my approach may be wrong. But my requirement is, when there is a connection issue (internet issue or other connection issue), I need to capture this on smart fox server.
Please suggest a solution approach.
USER_DISCONNECT
-
- Posts: 8
- Joined: 22 Mar 2023, 08:37
Re: USER_DISCONNECT
Hi,
this is a common misconception... turning off the wifi will not shutdown your connection.
Sounds counterintuitive but it's how it works
You can read all the details here:
https://smartfoxserver.com/blog/what-re ... tworkwifi/
If there's anything else let us know.
Cheers
this is a common misconception... turning off the wifi will not shutdown your connection.
Sounds counterintuitive but it's how it works
You can read all the details here:
https://smartfoxserver.com/blog/what-re ... tworkwifi/
If there's anything else let us know.
Cheers
-
- Posts: 8
- Joined: 22 Mar 2023, 08:37
Re: USER_DISCONNECT
Hi Lapo,
Thank you for the response. Now I am clear.
But , how can I noticed disconnection on my server. By using USER_DISCONNET , can I identify that a user is disconnected. Or is there any event can I user on server.
My requirement is, once a player disconnected (internet-failure, or force fully closed application) server need to notify to other users.
As of not iam able to notified if the player closed the application forcefully.
But not able to identify with other criteria i.e network disconnection. Please suggest a solution.
Thank you for the response. Now I am clear.
But , how can I noticed disconnection on my server. By using USER_DISCONNET , can I identify that a user is disconnected. Or is there any event can I user on server.
My requirement is, once a player disconnected (internet-failure, or force fully closed application) server need to notify to other users.
As of not iam able to notified if the player closed the application forcefully.
But not able to identify with other criteria i.e network disconnection. Please suggest a solution.
Re: USER_DISCONNECT
Hi,
yes the DISCONNECTION event will tell you when a User has lost connection.
Also you can enable the HRC system, which is mentioned in the article I've linked, and which can quickly restore the state of a game if one or more players lost connection for a brief moment.
Sure. Just keep in mind that sometimes disconnections can not trigger immediately as they happen, for example in the case of pulling the ethernet cord from a computer or shutting down the WiFi abruptly. In those cases a disconnection will occur at a later time when the operating system of the devices recognize the inactivity of the client.
Cheers
yes the DISCONNECTION event will tell you when a User has lost connection.
Also you can enable the HRC system, which is mentioned in the article I've linked, and which can quickly restore the state of a game if one or more players lost connection for a brief moment.
My requirement is, once a player disconnected (internet-failure, or force fully closed application) server need to notify to other users.
As of not iam able to notified if the player closed the application forcefully.
Sure. Just keep in mind that sometimes disconnections can not trigger immediately as they happen, for example in the case of pulling the ethernet cord from a computer or shutting down the WiFi abruptly. In those cases a disconnection will occur at a later time when the operating system of the devices recognize the inactivity of the client.
Cheers
Who is online
Users browsing this forum: No registered users and 108 guests