home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / DOOR / CHKTIME.ZIP / CHKTIME.DOC next >
Text File  |  1993-12-07  |  6KB  |  130 lines

  1. CheckTime - BBS Door Time Lapse Watch!
  2. <Public Domain> by Jeff Phillips
  3.  
  4. FidoNet:    1:133/131, The Delicate Sound of Thunder
  5. InterNet:   rmc@crl.com or jeff.phillips@f131.n133.z1.fidonet.org
  6. Compu$pend: 72223,1200 (I use this the least)
  7.  
  8. Started in 1989 (and recently converted to C and features added), CheckTime
  9. is a program that will allow you to ensure proper spacing between executions
  10. of any program, although the intent was for doors.
  11.  
  12. There are programs out there that will allow you to limit the amount of time
  13. spent IN the door, such as DTL (Door Time Limiter) by LlanoWare.  This is
  14. good for controlling those renegades who want to sit in a door just because
  15. they have more time than the other guy, and thus have the advantage.
  16.  
  17. Allow me to explain the occurrence that infuriated me enough to update this
  18. program.  I walked into my computer room earlier tonight (last night!?), and
  19. saw one of my staff members, who have oodles of time, sitting in TradeWars
  20. with about an hour and a half.  I walked back in the room about a half hour
  21. later, and saw he hadn't done anything more than hit enter a few times!
  22.  
  23. In this instance, DTL was ONE answer... now he can't have that much time to
  24. waste just sitting there.  But my problem was that if TW kicked him out, he
  25. could re-enter TW and sit there again!
  26.  
  27. So, I found my old stash of 720k disks, and pulled out CheckTime v0.00 Alpha,
  28. converted it to C from Pascal (forgot how to program Pascal), and cranked in
  29. a feature or two.  CheckTime is NOT meant to be used in lieu of DTL or a like
  30. product; at least, not at this time.
  31.  
  32. The command syntax is:
  33.    CHKTIME <min> <IN | OUT> [<seclvl>]
  34.  
  35. where: <min> is the number of minutes (between 1 and 1439) that must
  36.              elapse between CALLS to the door program
  37.        <IN | OUT> is the mode the user is performing; IN means the user is
  38.              going INTO the program, OUT means they are coming out.
  39.        <seclvl> is the SysOp security level, which will force CheckTime
  40.              to bypass checking the time on any user whose security
  41.              level is at or above this level.
  42.  
  43. The old CheckTime did not account for time in the door, so a time of 30 would
  44. include the time spent in the door the first time around.  I have changed it
  45. so that EACH call to CheckTime will update the database, and the time that
  46. the user is refused access commences from when they last EXITED the program.
  47. Note that if an IN is called, and they are not yet permitted, the time is NOT
  48. updated; in any other case (IN called, user gets in, or OUT called), the
  49. "Last Run" time IS updated.
  50.  
  51. Note that each door is independant, and a database should be kept in each
  52. door's directory.  At this time, CheckTime expects the DORINFO1.DEF file to
  53. be present in the directory from which it was invoked.  I suggest putting
  54. CHKTIME in the path, and running it once you have switched to the door
  55. directory.  Since CheckTime is node independant, a user cannot log on another
  56. node and circumvent the protection.
  57.  
  58. Batch File Processing
  59.  
  60.       Batch files MUST be used in order for CheckTime to function
  61.       properly.  CheckTime will return the result of the test in the
  62.       form of an ErrorLevel (check DOS manual for additional
  63.       information).  The values returned are:
  64.          1: The user MAY NOT use the door yet;
  65.          0: The user may use the door, for one of these reasons:
  66.             -- Time elapsed is equal to or larger than specified wait
  67.             -- The program could not find DORINFO1.DEF in the execution
  68.                directory
  69.             -- The user has a SysOp level access (or greater)
  70.             -- One or both of the parameters contained non-numeric
  71.                characters, resulting in a processing failure
  72.  
  73. So, for example, my TradeWars batch file reads:
  74.  
  75.   --------------------------------------------------------------------------
  76. @ECHO OFF
  77. ECHO Loading Tradewars 2002 ...
  78. REM --- Cut users time to 45 minutes regardless with LlanoWare's DTL
  79. DTL
  80.  
  81. REM --- The line below equivocates to X: and CD \DOORS\TW2
  82. X:\DOORS\TW2\
  83.  
  84. REM --- Check for multinode usage with Al Lawrence's/Sunrise Doors INUSE.
  85. REM --- If "INUSE." exists here, then the door is being used by someone else.
  86. IF EXIST INUSE X:\DOORS\INUSE\INUSE X:\DOORS\INUSE\INUSE%TASK%.CFG
  87. IF EXIST INUSE GOTO Out
  88.  
  89. REM --- Not in use... let's go...
  90. COPY X:\RA\NODE%TASK\DORINFO1.DEF
  91.  
  92. REM --- Don't allow users to enter until 60 minutes has passed from the last
  93. REM --- time they entered the game. Errorlevel of 1 means they can't play.
  94. CHKTIME 60 IN
  95. IF ERRORLEVEL 1 GOTO NOGO
  96.  
  97. REM --- Mark it INUSE for us so others are locked out.
  98. REN NOTINUSE INUSE
  99. TW2002 -QBBS
  100.  
  101. REM --- The game is no longer in use; open it to other nodes.
  102. REN INUSE NOTINUSE
  103.  
  104. REM --- Don't run the OUT program unless they got in in the first place;
  105. REM --- otherwise, they will keep updating their last IN without actually
  106. REM --- entering the program!
  107. CHKTIME 60 OUT
  108. GOTO Out
  109.  
  110. :NoGo
  111. REM --- We got kicked out... throw a message to the user to indicate why.
  112. REM --- Hopefully they will check their scrollback buffer to see what it said.
  113. ECHO You must wait 60 minutes between plays of this game. > COM2:
  114.  
  115. REM --- The game is no longer in use; open it to other nodes.
  116. REN INUSE NOTINUSE
  117.  
  118. :Out
  119. X:\RA\NODE%TASK\
  120.   --------------------------------------------------------------------------
  121. Since the program only requires the DORINFO1.DEF file, any BBS software which
  122. creates this file can use this utility!
  123.  
  124. If you have any questions, comments, or suggestions, send to the above node
  125. addresses, or to:
  126.      Jeff Phillips
  127.      3715 Northcrest Road, Suite 23
  128.      Atlanta, GA  30340
  129.  
  130.