-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server NetworkManager does not accept new connections from new clients if ONLY/FIRST client in game closes browser (webgl) #3117
Comments
@kevinstriker The one thing that may or may not be causing issues is that it seems the player's are never removed from the lobby upon disconnecting (not sure if this is intentional or not). The next test is to enable Websockets and see if I get similar results where the server continues to accept connections and if not then determine if this is a Websocket + Multiplayer services issue (or the like). From an NGO perspective, it looks like the server isn't running into any issues. The "Failed to connect to server." message on the client side is basically saying that either:
If using Websockets works running a dedicated server locally on my system, then I will run through the dedicated side of things to try and replicate the issue...and if so I will need to get the services folks involved to help troubleshoot/narrow down what the cause could be. |
@kevinstriker The MainMenu (Client) scene contains a The Server scene contains a Then it appears the PrototypeMap (loaded by both of the above scenes) contains a You should only have 1 Can you replicate this issue if you remove the NetworkManager from the PrototypeMap? |
First of all BIG thanks for getting back to me. Yes apologies, I do turn off the NetworkManager gameobject in the PrototypeMap. Yes you're correct, I don't remove the lobby / players from lobby properly (yet). Sorry about that, will deff add it later, since i'm just basically playtesting the game with a couple of friends it's not that big of an issue yet. After digging for days and getting quite hopeless about what this issue might be caused by. I am really happy to get your response hahaha, that sounds a bit desperate but just know it's big time appreciated. Tonight i digged some more and started logging in some NGO / Transport classes in the PackageCache. In case you have any questions really feel free to ask! Kind regards, PS: sorry i hit the wrong button when commenting, i accidentlly closed instead of just commented, now re-open :) |
No worries... just wanted to make sure there wasn't something broken within the NGO SDK itself which seems to be the case so far. I will proceed to the dedicated server hosting side of things then. One thing that I am going to check on... is how the session is being created... It seems the 1st player is what gets the server instance to spin up...and so there could be something on the service side that considers the session ended if the owner who started the game completely disconnects (i.e. browser closed). From an NGO side, there is nothing that I am seeing that would be causing this... so I will most likely need to get someone from the cloud services side to take a look and determine if this is just a settings thing or the like. |
Thanks @NoelStephensUnity ! Yeah completely understandable! The game is a casual first person shooter for web. Games last 10 minutes and once spun up, the server should stay active for 10 minutes (the match time). Game flow:
While this flow might not be the final flow. It is however very common (and preferred) for web shooter games that the Server can exists for 10 minutes without it becoming "unjoinable”. People will indeed leave during these sessions quite often, hopping between games etc. Making this small bug have quite some impact. PS: i did think about closing the game when 0 players are in the game. However this only solves the problem partly. Since the bug happens right away after player leaving the browser, before the time out disconnect happens; meaning even with the check, there is a window of unjoinable games. |
@NoelStephensUnity i'm the whole week working regular office hours and also available in the evenings for any questions. So FYI if i wrote something that is unclear (english is not my native language), really feel free to ask questions when you take a look somewhere this week! Hopefully we can track this bug down :) |
Ahhh... so when the last client disconnects by just closing the browser (i.e. non-graceful disconnect) it causes the issue to happen. |
@NoelStephensUnity yes indeed!!! Yesss, non-graceful way was indeed the name i was looking for!!! This way of closing the game happens quite often for web games. I was thinking, I could just de-allocate the server when player count is 0 as a workaround. |
@kevinstriker However, it seems odd that a new player cannot join even if the server still thinks the last player is connected... Just to check, does this happen if say you join with 1 client and then close the browser or does it require more clients to join? Also, have you set the NetworkManager Log Level to Developer and if so do you have the dedicated server log file where this scenario happened? The only other thing I could think of would be to try reconnecting (after having ungracefully disconnected) in private browser mode to see if there are any cached values getting in the way of things... Have raised this issue with the services group and once they have a chance to look over the issue and respond will let you know. |
Yes i did put Developer log level! It does not log the new connection. It does happen in private browser mode. And also when i use another browser (also in private mode). It does not need multiple players. If the first and only player leaves, non-graceful, the server no longer accepts new connections. Changing the heartbeat value does not fix the corrupt state, it allows me to join, but many weird things happen after. Server crashes and if i leave before the crash it seems to think I was the host, instead of a client..., and many things go sideways. So the connection/session manager is still bugged. However i do get 1 step further that way. Hopefully the service team is able to look soon! Unfortunately this issue is quite big for web based games using multiplay. |
Hi @michalChrobot, i just see the new labels on this issue 😃 , thanks a lot for looking into this!!! Please feel free to ask any questions if something is unclear! |
Hi, yup, we imported the issue to track it internally, I will try to keep you updated when we will have a progress on it |
@michalChrobot okay thanks to let me know! So the game is planned to release in January. On a game portal website. However, since it's the game portal's tester that found this issue, and they mentioned it multiple times. Would it be possible to receive an estimate of when this will be looked into? A time frame would allow to plan / communicate properly :) Kind regards, |
@NoelStephensUnity hi, is an indication possible when this issue will be looked into? Unfortunately the game portal confirmed this bug has to be fixed before hosting it. I would be very happy to use a workaround, but none of the workarounds i tried works / or does result in bigger bugs. While mid January (expected release) is still 6 weeks away, with holidays coming up, would it still be safe to say that this issue will be looked into before? |
Hi @kevinstriker, Thanks for reaching out and for your patience. We've moved your issue to the top of the multiplayer services team's backlog. I'll keep you apprised with updates. Cheers, |
Hi @kevinstriker, Could you please try the following changes? In the
This should help resolve the re-connection issue. video.mp4Cheers, |
Description
if the last/only player in a Multiplay Server setup closes their browser to quit the game.
The server does not accept new clients joining the game anymore...
Reproduce Steps
In Unity create a dedicated server build (keep aware of the name, you need it in Build Configuration later). Create a Build in Unity Services -> Multiplayer Hosting -> Buiids. By uploading the files you build from unity. After create build configuration, use the name of the build and search for xxx.x86_64 as the Game server executeable.
-nographics -port $$port$$ -queryport $$query_port$$ -logFile $$log_dir$$/Engine.log
create a fleet with build config and build and a region.
This will cause an exception on the StartClient()
Actual Outcome
StartClient() does not succeeds and time’s out.
Expected Outcome
New players should still be able to join the server by .StartClient().
Environment
Screenshot
Here you can see that there is no new Connection event happening after the last player closes the game by closing the browser. (10-30 seconds later the server kicks him out of the game, connectedClients = 0 after). And after that joining the game from Editor, webgl or any other instance does not work anymore
Additional Context
See ZIP project.
NGO.zip
The text was updated successfully, but these errors were encountered: