From a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5 Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 9 May 2008 19:21:08 +0000 Subject: - (internal) change 86400/... (seconds of day/month/...) to named constants. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4284 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/stuff.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mbbsd/stuff.c') diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index f67779a5..73515eca 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -165,6 +165,24 @@ void syncnow(void) #endif } +void +wait_penalty(int sec) +{ + static time4_t lastWait = 0; + + syncnow(); + if (now - lastWait < sec) + { + sec = now - lastWait; + if (sec < 0 || sec >= 5) + sec = 5; + sleep(sec); + peek_input(0.1, Ctrl('C')); + drop_input(); + } + lastWait = now; +} + // TODO // move this function to visio.c /** -- cgit v1.2.3