0
\$\begingroup\$

I built a multiplayer game with the Unity UNET. For doing this I bought a VPS server. Everything works fine.

But sometimes when players want to quit the game, the servers do not destroy him from the scene!!! & the other players still can see him in the scene till the servers being restarted and ran again!!

For quitting the game I wrote this code :

NetworkManagers.singleton.client.Disconnect();
Destroy(NetworkManagers.singleton.gameObject);

For more explanation, this is my ConnectionConfig for server & client:

MinUpdateTimeout:15
ConnectTimeout:1200
DisconnectTimeout:2000
PingTimeout:500
NetworkDropThreshold:50
OverflowDropThreshold:50
AckDelay:32
AcksType:1
MaxSentMessageQueueSize:150

Why this happening?! Did I miss something?! & how can I avoid that?!

\$\endgroup\$
2
  • \$\begingroup\$ Can it be that if you destroy your Network Manager too fast after the Disconnect(), the message is actually not sent to the server? \$\endgroup\$
    – Zibelas
    Commented Feb 6, 2021 at 8:31
  • \$\begingroup\$ I don't think so!!! I just put an exit button in the online scene to exit & tell the game if the player pushes it, then disconnect it from the server with the two line code. And I don't know, After that there is no connection between the client & the server because the client has disconnected but the server does not destroy it !!! the server is running and it should disconnect the unavailable client but it doesn't sometimes and it's a very very bad bug. In addition, I'm using unity 2018.4.29 @Zibelas \$\endgroup\$
    – iman_sh
    Commented Feb 6, 2021 at 9:37

0

You must log in to answer this question.

Browse other questions tagged .