mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
132 stars 14 forks source link

MBBSEmu - Nightly Cleanup Routine #11

Closed enusbaum closed 4 years ago

enusbaum commented 4 years ago

Modules register a "Midnight Cleanup Routine" when calling REGISTER_MODULE() during init. On a traditional MajorBBS/Worldgroup install, this routine is invoked once per day (3:00A by default). Most modules use this routine to handle cleanup, user maintenance, and daily resets for mobs, etc.

MBBSEmu should:

  1. Have a configuration option in the appsettings.json of a time (UTC? Local?) for the time of day this routine is to run
  2. The Worker Thread/Event Loop in MbbsHost.cs should be enhanced to execute these routines in each registered module once per day at the given time

https://github.com/enusbaum/MBBSEmu/blob/master/MBBSEmu/HostProcess/MbbsHost.cs

Note: As per the MajorBBS Development Guide, the Channel Number while Auto-Cleanup operations are being invoked should be set to -2 (0xFFFE)

paladine commented 4 years ago

Would also be nice to be able to programmatically invoke the cleanup handler, whether it be via a signal handler (SIGUSR1 for example) or some other mechanism.

enusbaum commented 4 years ago

Fixed in https://github.com/enusbaum/MBBSEmu/pull/23