minetest icon indicating copy to clipboard operation
minetest copied to clipboard

Adjustable player-timeouts

Open RonnyBarthmann opened this issue 3 years ago • 11 comments

Problem

Players take down whole servers if they leave the server "uncleaned" ... If a player only cut the connection and don´t log off, the server sends incremental amounts of date to the old pipe wich cause lags to all other player

Solutions

make the timeout adjustable so the server-owners can control the timeout-time viathe minetest.conf

Alternatives

make the timeout faster ( e.g. 3s ) ... ping over 3000 is bad anyway (trust me ... i had it myself)

Additional context

we can ad a "rejoin" setting where the server stops sending date after the timeout but if the client respond in the "rejoin"-time the server just starts to communicat with the client again so the client dont need to reconnect

RonnyBarthmann avatar Dec 09 '22 07:12 RonnyBarthmann

https://github.com/minetest/minetest/blob/504e43e0dae50ad98e19db0649c9c825cf2ab7a7/src/network/connection.cpp#L1454-L1459

https://github.com/minetest/minetest/blob/504e43e0dae50ad98e19db0649c9c825cf2ab7a7/src/network/connectionthreads.cpp#L265-L270

This uses the default connection timeout CONNECTION_TIMEOUT = 30 seconds which is summed up here:

https://github.com/minetest/minetest/blob/504e43e0dae50ad98e19db0649c9c825cf2ab7a7/src/network/connection.cpp#L915-L926

And reset for each received package:

https://github.com/minetest/minetest/blob/504e43e0dae50ad98e19db0649c9c825cf2ab7a7/src/network/connectionthreads.cpp#L962

If there is an issue, then it's caused by the client sending ping-like packets. There's no need to log off. They're logged out automatically and their connection is terminated.

~~For further analysis, you could profile the sent packages with m_packetcounter by setting the debug log level at least to info.~~ EDIT: Sorry, that's for client-side only-

SmallJoker avatar Dec 09 '22 17:12 SmallJoker

Hello! I'm afraid we need more technical information, for example "when i use [code] in my mod, this effect happens". Or, in general, if you've observed any effect, please provide more reproducible steps (such as "join y server with a bad connection"). Also, what do you mean exactly with "uncleaned"?

Zughy avatar Dec 13 '22 23:12 Zughy

well, to reproduce this you justneed to host a server (without any mods) and connect to it with a mobile phone

then open a network-monitor on the server-system an watch whats happend when the mobile-client-app is closed with the home button

importan is to close the app the simple way (as everyone does) with minimizing it first with the home button and then close it with the recents app list

RonnyBarthmann avatar Dec 14 '22 12:12 RonnyBarthmann

to verify that you close the app the "unclean" way just log in with a second account simultaneously and watch the chat if the chat says "user1 left (time out)" then everything is fine and you should have seen a high amount of network traffic server-side just before the "user1 left (time out)" message occurred

RonnyBarthmann avatar Dec 14 '22 12:12 RonnyBarthmann

I think this relates to the resending behaviour of the reliability layer of our networking code. I don't remember whether we have linear or exponential backoff, or if there is any maximum on how many packets are actively being resent.

sfan5 avatar Dec 14 '22 14:12 sfan5

well it looks like a linear increase in the monitor; like a perfect ramp nothing like a exponential curve and a maximum would also help i guess

RonnyBarthmann avatar Dec 15 '22 05:12 RonnyBarthmann

why are the "Feature request" removed ... isnt a added setting in minetest.conf a "feature" ???

so everyone can set the behavior fitting to his network

RonnyBarthmann avatar Dec 15 '22 05:12 RonnyBarthmann

just found this issue, I agree and this would also help preventing people from disabling connection, digging bypassing blocks protection and enabling connection again

immagiov4 avatar May 29 '25 20:05 immagiov4

The problem described by this issue is largely fixed by 3987318f0.

preventing people from disabling connection, digging bypassing blocks protection and enabling connection again

A reliable prevention for this is verification of movement, not shorter timeouts.

sfan5 avatar May 29 '25 20:05 sfan5

It could at least easily mitigate the glitch I mentioned until such a system is in place.

Also, it doesn't make sense that it's not configurable: some servers don't require such a long waiting time, it could actually be detrimental for some of them: as an example, if someone takes the ball in our fast-paced touchdown FPS game on the AES server and then looses connection, they will be still and defendless for a lot of time while an enemy could just kill them, take the ball they dropped and score - if they were near our base. So I don't see why such a parameter should be forced by the code when many others are not.

immagiov4 avatar May 29 '25 21:05 immagiov4

just found this issue, I agree and this would also help preventing people from disabling connection, digging bypassing blocks protection and enabling connection again

opened an issue to discuss this further: #16216

appgurueu avatar Jun 01 '25 13:06 appgurueu