Unexplained disconnect

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Unexplained disconnect

Postby hng » 27 Sep 2022, 03:21

Hi, I have an issue "Unexplained" disconnect , after client login & active play in the game, some instance/NPC still got random disconnect - not frequent but it happened occasionally. If I check the log both in client & server the reason is UNKNOW

I'm implementing NPC using this link
https://smartfoxserver.com/blog/ways-of ... -game-p-2/

so the NPC manager (client) are in the same machine+session with the server , so how could it possibility got disconnect ?

the NPC are unique no duplicate id, the NPC that got disconnect are still in active playing/not idle. this is really wired.

any clue ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unexplained disconnect

Postby Lapo » 27 Sep 2022, 07:26

Hello
it sounds like a local connection issue of some sort because SFS2X is not reporting and "idle client" error, or manual disconnection.
Have you checked the client side for errors?

How many NPCs does this local app generate?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Unexplained disconnect

Postby hng » 28 Sep 2022, 02:51

Random disconnect after around 20 NPC become more often after 50 NPC but its not always

In Clients - CONNECTION_LOST event we got UNKNOWN reason

All NPC program in try-catch block so if whatever error did occur we should know

Both the NPC Manager process and the Server process in the same machine+windows session so network failure should not the issue yes , since NPC Manager connect to the server using localhost

Code: Select all

        cfg.setHost("localhost");
        cfg.setPort(9933);
        cfg.setZone("defaultZone");
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unexplained disconnect

Postby Lapo » 28 Sep 2022, 09:16

Yes, I agree in the localhost it is very strange. :?
Also the number of connections (20-50) is very low and should be of no concern.

Unfortunately I can't provide further help without more data. If you are familiar with Wireshark you could capture the traffic between NPCs and the server. It may provide a bit of extra info on the disconnection problem.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Unexplained disconnect

Postby hng » 28 Sep 2022, 10:16

wireshark, ok we'll do that


thanks
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Unexplained disconnect

Postby hng » 10 Oct 2022, 06:10

we found another disconnect issue, in 1 room have 3 bot player and 1 real player.

if the real player leave room or F5 (refresh browser), all others 3 bot player got session remove and disconnect, the reason in bot client is MANUAL

we try if all 4 real player using browser client this issue do not occur and the game it self already in production around half year no such issue, what the problem here, what exactly MANUAL means in client connection_lost reason ?


EDIT:
currently we using the second method for our BOT since at production we will separate the game server and bot in different machine/computer
https://smartfoxserver.com/blog/ways-of ... -game-p-2/

if we change it using the first method does the disconnect issue will go away ?
https://smartfoxserver.com/blog/ways-of ... -game-p-1/
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unexplained disconnect

Postby Lapo » 10 Oct 2022, 07:26

Manual disconnection means that the client called the disconnect() method from their side.
The problem you have described where multiple automated clients receive a manual disconnection seems unlikely. There is only one way to get a disconnection reason==MANUAL, and that is if your client actually initiates the disconnection.

In any case, if the problem is reproducible 100% of the times, please send us a proof of concept so we can reproduce it on our side.
You can use our support@... email box to send the repro-case.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Unexplained disconnect

Postby hng » 10 Oct 2022, 09:59

"There is only one way to get a disconnection reason==MANUAL, and that is if your client actually initiates the disconnection."
thank you Lapo for you clarification narrowing the possible bugs. We will check the code in bot client side.
hng
Posts: 37
Joined: 01 Nov 2021, 18:17

Re: Unexplained disconnect

Postby hng » 11 Oct 2022, 01:48

ok found the culprit, in room_exit events have sfs.disconnect, so if any player exit the room all bot command got disconnect

thanks Lapo
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Unexplained disconnect

Postby Lapo » 11 Oct 2022, 09:41

Great, thanks for the update :)
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 75 guests