ReactiveDrop / reactivedrop_public_src

Alien Swarm: Reactive Drop game source code and issue tracker.
https://reactivedrop.com
124 stars 36 forks source link

Autokick after idle time #173

Closed mithrand0 closed 2 years ago

mithrand0 commented 2 years ago

Some players join games, and go away for hours, blocking slots for other players.

Yesterday, I encountered a lobby with 3 players playing, and 5 players away for longer time. Voting doesn't work any more in this scenario. Also, these players block the auto-restart feature of the server, since the server is never idle.

I think it would be good to have a configurable idle timer, that removes people from the lobby who have no activity (mouse, keyboard input) for longer time. Going absent for a moment is fine, blocking slots for hours is doubtful. A configuration variable here might be nice.

BenLubar commented 2 years ago

I don't think mouse movement is a good indicator because the game still receives mouse movement if it's not in the foreground.

mithrand0 commented 2 years ago

Setting idle time to 1800 seconds seems to make servers shutting down after exactly 30 min.

The suspicion here is that entity with index 0 might be the server itself, that kicks itself after the idle timer expiries, making all please disconnect with:

Disconnected (server is shutting down)

BenLubar commented 2 years ago

Hmm, it shouldn't be kicking worldspawn unless GetUserID is returning the wrong value...

https://github.com/ReactiveDrop/reactivedrop_public_src/commit/b4c4324a9f3ff81c6531f18a761a998c213016b5#diff-ac4eba9f0c3fc309ee396bc786798d90dcbfc81a29b0f22126fc4c1565cf4357R469

BenLubar commented 2 years ago

Just tested kickid with worldspawn and SourceTV; neither shut down the server (although SourceTV didn't show up in the player list, which was weird)

BenLubar commented 2 years ago

Ok, tried again and kicking sourcetv does something

mithrand0 commented 2 years ago

I have setup Germany #4 [beta, testing] with idle kick set to 300s for testing. It is on beta branch.

BenLubar commented 2 years ago

@mithrand0 looks like the SteamCMD bug is active here too: image

If you install the server via appid 563560 rather than 582400 it appears to work. Install appid 1007 in the same folder to get the steamworks dedicated server DLLs.

mithrand0 commented 2 years ago

@BenLubar doing 563560 + 1007 now

wawawawawawawa commented 2 years ago

Some auto-kick could be a good answer yeah. Another option is to make vote system based on the number of active players, right now if too many afk, you can't even change map :/ The problem with such thing would be grief if you insta kick when someone don't even have the time to pick a char, but if there is some minimal timer before being able to votekick, it shouldn't matter.

mithrand0 commented 2 years ago

Implemented.