haxball / haxball-issues

115 stars 43 forks source link

Players remain in the room even after leaving it #521

Open Lyfhael opened 6 years ago

Lyfhael commented 6 years ago

Hey! It never done that before. I got a new VPS from OVH(Debian 9 (Stretch)), I'm using haxball.com/headless to launch the script.

If a player leave the game(by closing the page for example), he still remain in the room for 1-2 minutes. I've tried it myself.

If I enter the room, leave it, come back leave it again, and come back, There are 3 of me in the room.

If you got a solution I'd gladly take it, it causes some trouble in the room, players picking people that actually left the game, so they're afk and we need to pause the game, a lot of time, and it's annoying. Or it just uses slots for nothing.

If I kick the player tho he's instantly out of the room. But not when he leaves by himself.

Thank you !

Raamyy commented 6 years ago

I think that this is related to the speed of your network, It might be too slow.

Lyfhael commented 6 years ago

It's not slow at all, there're absolutely 0 laggs in-game for no one. Fastest ping is 6ms, average 13. I can even create 2 rooms it wouldn't have any lagg.

I had the same model of VPS from OVH a week ago but I had to change. The only thing that changed is that now I use Debian 9 instead of Ubuntu.

The speed of the network is not slow ^^

basro commented 6 years ago

@teisseire117, does this happen if you leave the room using the leave button to go back to the room list?

Some browsers don't properly close the connection when closing the tab, so the players will leave after a timeout if that happens. The timeout should not be two minutes though, it should be 30 seconds. If you really are seeing two minute timeouts then that's a bug.

Lyfhael commented 6 years ago

@basro Yes, even if I use the leave button.

I also asked friends to test it, they experience the same thing. They disconnect, but they're still in the room for 30 seconds(not 2 minutes I was exaggerating). We all tried with 'Leave' button.

I tested with Chrome, and friends with Opera and Firefox. We have differents IP/Computers of course.

And only on my server. (It's open 24/7 you can try it whenever you want https://www.haxball.com/play?c=j9KVcRcEPwI )

basro commented 6 years ago

What browser are you using to host the headless room?

Does it still happen if you run a room without any custom scripts? just calling HBInit({})

Lyfhael commented 6 years ago

@basro I host the server on Google Chrome Version 69.0.3497.81 (Official Build) (64-bit)

Yes it does happen even if I only put HBinit({}) in the script .(test room with only HBinit: https://www.haxball.com/play?c=gjl9ZAssEe8 )

basro commented 6 years ago

I was able to reproduce this after updating chrome to version 69, I'll investigate. Could be a bug in chrome, or a change in the WebRTC API.

Lyfhael commented 6 years ago

@basro Yeah now you say it I updated Chrome on my personal computer(It was version 68 before) and tested to create a room and I get the same problem too.

Alright I'll wait til it's fix :)

basro commented 6 years ago

I've confirmed this to be a bug in chrome, they will be fixing it eventually.

Meanwhile I'll be reducing the disconnection timeout time significantly (to about 15 seconds from 30), that will hopefully improve the situation.

I'll keep this issue as open until chrome has fixed it on the stable version.

Mirac35 commented 6 years ago

Making disconnect timeout to 5 secs from 15 can solve this problem immidatiely imo. Cuz waiting for 15 secs for afk player is gives same results with 30. I kick them no matter what in 10 secs :)

VukBakic commented 6 years ago

@basro I still have this problem on Chrome Version 70.0.3538.35 (Official Build) beta (64-bit) Are there any news?

helppe commented 5 years ago

no it is not only chrome, i use firefox... and have the problem too. see https://github.com/haxball/haxball-issues/issues/691

basro commented 5 years ago

If using firefox you connect to a chrome hosted room then you'll see this bug happen. If using chrome you connect to a firefox room you'll also see this happen. But using firefox in both the host and the client should not reproduce this and doesn't for me. @helppe: could you please verify if this bug happens for you when both host and clients are using firefox?

helppe commented 5 years ago

impossible to say, anyone accept to test with me. but i really find that there was a "before" and "after" date where this beahaviour appears, without changing anything from my side.

helppe commented 5 years ago

impossible to say, anyone accept to test with me. but i really find that there was a "before" and "after" date where this beahaviour appears, without changing anything from my side.