Skip to content
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

Add Automatic Disconnects (link-death and long idle) #153

Open
DavidRieman opened this issue Jan 1, 2022 · 0 comments
Open

Add Automatic Disconnects (link-death and long idle) #153

DavidRieman opened this issue Jan 1, 2022 · 0 comments
Labels
enhancement This task is adding new behavior or performing other refactoring improvements.

Comments

@DavidRieman
Copy link
Owner

DavidRieman commented Jan 1, 2022

Right now, disconnected/idling characters can remain connected and/or with their player Thing inside the world indefinitely. Normally a MUD will kick out such players after a while, so the world isn't filled with false-players.

Here's one way I could see this working in WheelMUD:

We should be able to configure a value in App.config for how long users are allowed to sit idle before being automatically disconnected, and how long their characters can remain in link-death before kicked out. (The default values should not give players a way to cheat out of a losing combat by simply disconnecting.)

Right now we set an AFKReason when disconnect is detected. We could mark the disconnection time there.
Whenever the PlayingState queues an action, we could mark a time for last activity as well.

Periodically (maybe every couple seconds at most - this could be a sleep-heavy thread or other timer tech), we could scan the PlayerManager players list for those who have been disconnected too long, and finish removing them from the world as if they had logged out properly.

The same periodic pulse could check for players who have been idling to within one minute of their auto-disconnect time, and give them a message like "Are you still there? Issue any command to stay connected." Flag that this message has been sent so we don't spam it in that final minute. Clear that flag when any command is received, while updating the last-active time stamp.

Setting the App.config values to 0 could be a way to signal that the admin doesn't want this feature active at all. (Some rare MUDs may wish the player Thing to remain in play indefinitely for specific gameplay reasons.)

@DavidRieman DavidRieman added the enhancement This task is adding new behavior or performing other refactoring improvements. label Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This task is adding new behavior or performing other refactoring improvements.
Projects
None yet
Development

No branches or pull requests

1 participant