Avoid repeated hours and game down status notifications

may_play_now() tells deities about hours restriction and game down
status.  It runs at login and before and after each command.  Getting
notified that often is annoying.

Avoid repetition by remembering notification in new player flags
PF_HOURS and PF_DOWN.  Add a notification when hours restriction has
been lifted.  Ensure the notification is printed before the prompt,
not before the command, by calling may_play_now() from command() only
for mortals.  Safe, because may_play_now() always returns true for
deities anyway.
This commit is contained in:
Markus Armbruster 2009-02-08 14:54:02 +01:00
parent b404216dbe
commit 9ff2c62309
4 changed files with 22 additions and 15 deletions

View file

@ -89,7 +89,9 @@ struct player {
/* player flags */
enum {
PF_UTF8 = bit(0) /* client wants UTF-8 */
PF_UTF8 = bit(0), /* client wants UTF-8 */
PF_DOWN = bit(1), /* told player game is down */
PF_HOURS = bit(2) /* told player hours restriction is on */
};
#endif