diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-10 03:21:08 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-05-10 03:21:08 +0800 |
commit | a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5 (patch) | |
tree | d2abd2d1aa673ad667e60b8029f0796d2e20a78f /mbbsd/stuff.c | |
parent | 961bf03bac8ac5264a028d3f580904bbd5b4e37f (diff) | |
download | pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.gz pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.bz2 pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.lz pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.xz pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.tar.zst pttbbs-a4ba6b74f6dc61cec1a6b258e1609d9f7f7ef8a5.zip |
- (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
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r-- | mbbsd/stuff.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 /** |