.rm 78 .lm 2 DoorMan - 2.00 (C)Copyright 1987, 1988: by Chris B. Smith All rights, not expressly granted herein, are reserved. September 12, 1988 DoorMan is a supplemental program for GT Power version 13.00+. DoorMan, with ChekTime, allows the sysop of a GT host system to insure that callers do not overstay there welcome while inside a GT DOOR. DoorMan is a two program system. DoorMan.EXE is a TSR (Terminate and Stay Resident) program. It should be included in your GTHOST or AUTOEXEC file. It does absolutley nothing until you have run ChekTime to turn it on. ChekTime reads GTUSER.BBS to get the information necessary to calculate the time the user should be off the system. It then signals to DoorMan that he should begin checking the time (18.2 times per second) and reboot the system if the user refuses to log off in time. ChekTime should also be run as the user leaves the door. It will, at this time, signal to DoorMan to quit checking the time. DoorMan may also be configured to monitor carrier detect. If this function is utilized, DoorMan will also reboot when he senses a drop in carrier detect. This function can only be initiated by a user supplied program. GT Power 13.00+ will automatically sense DoorMan's existence and utilize this function. If you wish to use DoorMan with other BBS programs you will have to supply the necessary code to do so. An explanation of how to implement this is included at the end of this document. 1) You may copy and distibute these programs freely as long as you insure that both DoorMan, ChekTime and this document are included in the distribution package. 2) No one may modify DoorMan, ChekTime or this document in any manner without the prior written consent of Chris B. Smith. 3) Chris B. Smith is not responsible for any losses which may occur from its use either directly or indirectly. Installation: Installation is very simple. Place the following command in your GTHOST.BAT: DOORMAN When DoorMan executes you will see nothing. He simply loads into memory and terminates, staying resident. The default state, OFF, remains in effect until you execute ChekTime. Place the following commands in all your GTDOORx.BAT files or any batch file which takes a user outside of GT: CHEKTIME ON VIEWARC (* this is an example door program *) CHEKTIME OFF When ChekTime executes, it will display a message to the user that he/she will be ejected at a specific time. This is all calculated from information placed in GTUSER.BBS by GT host mode. If the user exits the door before the specified time, ChekTime turns DoorMan OFF and allows GT to resume the responsibility of insuring the time limits are not compromised. ChekTime will also display a report on the screen of the various flags in the DoorMan configuration record, at this time. To obtain just the report type: CHEKTIME REPORT at the DOS prompt. It is also possible to turn off the watchdog function. This is favorable when you are running a door that monitors carrier detect itself. A PCBoard door is a good example of this type of door. An example of how to turn off the watchdog function follows. CHEKTIME WATCHDOG OFF TW (* this is an example door program *) Programming: For those who would like to adapt DoorMan to other BBS systems, below you will find a brief description of its specifications. The following is the layout of the DoorMan configuration record: #define OFF 0 /* value for active flag ... clock is off */ #define ON 1 /* value for active flag ... clock is on */ struct StructClockConfig { long far * sign_str; /* pointer to long containing "door" */ int active_fl; /* is watchtime active - default OFF */ long boot_start; /* if BIOS clock is between start & end */ long boot_end; /* system will reboot if active_fl is 1 */ int watchdog; /* is watchdog active - default OFF */ int MSR; /* the port number of the modem status reg */ }; /* is stored here */ /* This is the default structure of the current clock configuration */ struct StructClockConfig ClockConfig = { (long far *) "door", OFF, 0L, 0L, OFF, 0 }; The following is a Turbo C code segement to check to see if DoorMan is present in memory: int DoormanExists() { Regs.h.ah = 0x10; Regs.x.dx = 0xffff; int86x(0x14, &Regs, &Regs, &SegRegs); if (Regs.x.dx != 0xffff) { /* set ConfigPtr to point at the config. rec. - returned in DS:DX */ ConfigPtr = (struct StructClockConfig far *) (((unsigned long) SegRegs.ds << 16) + (unsigned long) Regs.x.dx); /* check to see if the signature is there */ if (*ConfigPtr->sign_str != *ClockConfig.sign_str) { cputs("\r\nDOORMAN has not been installed!\r\n"); return(0); /* return 0 if DoorMan not found */ } return(1) /* return 1 if DoorMan is found */ } return(0); /* return 0 if DoorMan not found */ } To turn ON the watchdog function: if (DoormanExists()) { ConfigPtr->MSR = MSReg; /* modem status port address in record */ ConfigPtr->watchdog = ON; /* WatchDog ON */ } To turn ON the watchtime function: if (DoormanExists()) { ConfigPtr->boot_start = StartTime; /* start and end times are long */ ConfigPtr->boot_end = EndTime; /* integers in BIOS time format */ ConfigPtr->active_fl = ON; /* WatchTime ON */ } To turn off the functions: if (DoormanExists()) { ConfigPtr->active_fl = OFF; ConfigPtr->watchdog = OFF; } Calculation of the start and end times is left as an excercise. Be sure they are long numbers in BIOS time format (I.E. number of ticks since midnight). Forward inquiries to: Chris B. Smith The Private Sector CompuServe # P. O. Box 696 (713) 664-7679 76120,41 Bellaire, TX 77401 300/1200/2400 baud N-8-1 GT Net/Node 001/002 Credits: Special thanks goes to Paul Meiners for making DoorMan easily interfacable with GT. GT is a product of P & M Software Company - Houston, TX.