home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
DOOR
/
CHKTIME.ZIP
/
CHKTIME.DOC
next >
Wrap
Text File
|
1993-12-07
|
6KB
|
130 lines
CheckTime - BBS Door Time Lapse Watch!
<Public Domain> by Jeff Phillips
FidoNet: 1:133/131, The Delicate Sound of Thunder
InterNet: rmc@crl.com or jeff.phillips@f131.n133.z1.fidonet.org
Compu$pend: 72223,1200 (I use this the least)
Started in 1989 (and recently converted to C and features added), CheckTime
is a program that will allow you to ensure proper spacing between executions
of any program, although the intent was for doors.
There are programs out there that will allow you to limit the amount of time
spent IN the door, such as DTL (Door Time Limiter) by LlanoWare. This is
good for controlling those renegades who want to sit in a door just because
they have more time than the other guy, and thus have the advantage.
Allow me to explain the occurrence that infuriated me enough to update this
program. I walked into my computer room earlier tonight (last night!?), and
saw one of my staff members, who have oodles of time, sitting in TradeWars
with about an hour and a half. I walked back in the room about a half hour
later, and saw he hadn't done anything more than hit enter a few times!
In this instance, DTL was ONE answer... now he can't have that much time to
waste just sitting there. But my problem was that if TW kicked him out, he
could re-enter TW and sit there again!
So, I found my old stash of 720k disks, and pulled out CheckTime v0.00 Alpha,
converted it to C from Pascal (forgot how to program Pascal), and cranked in
a feature or two. CheckTime is NOT meant to be used in lieu of DTL or a like
product; at least, not at this time.
The command syntax is:
CHKTIME <min> <IN | OUT> [<seclvl>]
where: <min> is the number of minutes (between 1 and 1439) that must
elapse between CALLS to the door program
<IN | OUT> is the mode the user is performing; IN means the user is
going INTO the program, OUT means they are coming out.
<seclvl> is the SysOp security level, which will force CheckTime
to bypass checking the time on any user whose security
level is at or above this level.
The old CheckTime did not account for time in the door, so a time of 30 would
include the time spent in the door the first time around. I have changed it
so that EACH call to CheckTime will update the database, and the time that
the user is refused access commences from when they last EXITED the program.
Note that if an IN is called, and they are not yet permitted, the time is NOT
updated; in any other case (IN called, user gets in, or OUT called), the
"Last Run" time IS updated.
Note that each door is independant, and a database should be kept in each
door's directory. At this time, CheckTime expects the DORINFO1.DEF file to
be present in the directory from which it was invoked. I suggest putting
CHKTIME in the path, and running it once you have switched to the door
directory. Since CheckTime is node independant, a user cannot log on another
node and circumvent the protection.
Batch File Processing
Batch files MUST be used in order for CheckTime to function
properly. CheckTime will return the result of the test in the
form of an ErrorLevel (check DOS manual for additional
information). The values returned are:
1: The user MAY NOT use the door yet;
0: The user may use the door, for one of these reasons:
-- Time elapsed is equal to or larger than specified wait
-- The program could not find DORINFO1.DEF in the execution
directory
-- The user has a SysOp level access (or greater)
-- One or both of the parameters contained non-numeric
characters, resulting in a processing failure
So, for example, my TradeWars batch file reads:
--------------------------------------------------------------------------
@ECHO OFF
ECHO Loading Tradewars 2002 ...
REM --- Cut users time to 45 minutes regardless with LlanoWare's DTL
DTL
REM --- The line below equivocates to X: and CD \DOORS\TW2
X:\DOORS\TW2\
REM --- Check for multinode usage with Al Lawrence's/Sunrise Doors INUSE.
REM --- If "INUSE." exists here, then the door is being used by someone else.
IF EXIST INUSE X:\DOORS\INUSE\INUSE X:\DOORS\INUSE\INUSE%TASK%.CFG
IF EXIST INUSE GOTO Out
REM --- Not in use... let's go...
COPY X:\RA\NODE%TASK\DORINFO1.DEF
REM --- Don't allow users to enter until 60 minutes has passed from the last
REM --- time they entered the game. Errorlevel of 1 means they can't play.
CHKTIME 60 IN
IF ERRORLEVEL 1 GOTO NOGO
REM --- Mark it INUSE for us so others are locked out.
REN NOTINUSE INUSE
TW2002 -QBBS
REM --- The game is no longer in use; open it to other nodes.
REN INUSE NOTINUSE
REM --- Don't run the OUT program unless they got in in the first place;
REM --- otherwise, they will keep updating their last IN without actually
REM --- entering the program!
CHKTIME 60 OUT
GOTO Out
:NoGo
REM --- We got kicked out... throw a message to the user to indicate why.
REM --- Hopefully they will check their scrollback buffer to see what it said.
ECHO You must wait 60 minutes between plays of this game. > COM2:
REM --- The game is no longer in use; open it to other nodes.
REN INUSE NOTINUSE
:Out
X:\RA\NODE%TASK\
--------------------------------------------------------------------------
Since the program only requires the DORINFO1.DEF file, any BBS software which
creates this file can use this utility!
If you have any questions, comments, or suggestions, send to the above node
addresses, or to:
Jeff Phillips
3715 Northcrest Road, Suite 23
Atlanta, GA 30340