home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / QUICKBBS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-04-10  |  27.3 KB  |  707 lines

  1. {╔═════════════════════════════════════════════════════════════════════════╗
  2.  ║                                                                         ║
  3.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  4.  ║                                                                         ║
  5.  ║ Author    : Gerhard Hoogterp                                            ║
  6.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  7.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  8.  ║                                                                         ║
  9.  ║ SnailMail : Kremersmaten 108                                            ║
  10.  ║             7511 LC Enschede                                            ║
  11.  ║             The Netherlands                                             ║
  12.  ║                                                                         ║
  13.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  14.  ║                                                                         ║
  15.  ╚═════════════════════════════════════════════════════════════════════════╝}
  16. {--------------------------------------------------------------------------|
  17.  Description:
  18.  
  19.   This unit contains all the QBBS specific stuff. It's main purpose is to
  20.   fill the GlobalInfo record. Doing things this way it's easier to make a
  21.   door less system dependable. As long as you only use the information
  22.   in GlobalInfo in your doors, it's easy to make versions for other BBSses
  23.   or to add support for more than one BBS. (Detect in your mainprogram and
  24.   call the right initprocedure!)
  25.  
  26.   If an other BBS doesn't support some information which is contained in the
  27.   GlobalInfo record, it's up to YOU to provide usable values!
  28.  
  29. |--------------------------------------------------------------------------}
  30. {$Define UseMultiLanguage}  {Turn multilang. support for logging on/off}
  31.  
  32. Unit QuickBBS;
  33. Interface
  34. Uses Dos,
  35.      CRT,
  36. {$IfDef UseMultiLanguage}
  37.      Language, { Language support, needed for Logging         }
  38. {$EndIf}
  39.      FileObj,  { Typed file handling object                   }
  40.      Fossil,   { Fossil object, needed for online msgs.       }
  41.      GlobInfo; { The globale info. Thisone needs to be filled }
  42.  
  43. Const  QBBS = 3;  { This is a unike BBS tag to indentify the current  }
  44.                   { BBS in the global info. Make tags for other BBSes }
  45.                   { Also unike, at least for your own programs!       }
  46.  
  47. Var QPath : PathStr;
  48.  
  49.  
  50. (*****************************************************************)
  51. (*         Structures document for QuickBBS version 2.75         *)
  52. (*         Copyright 1991, Pegasus Software                      *)
  53. (*                     All Rights Reserved.                      *)
  54. (*****************************************************************)
  55. { Downsized a bit by me, Gerhard Hoogterp                         }
  56.  
  57. Const
  58.   MaxMsgAreas  = 200;
  59.   MaxFileAreas = 200;                                                  
  60.   MaxEvents    = 30;                                                   
  61.                                                                        
  62. type                                                                   
  63.                                                                        
  64.   QFlagType = array[1..4] of Byte;
  65.                                                                        
  66.   QUserRecord = record
  67.                  Name        : String[35];                             
  68.                  City        : String[25];                             
  69.                  Pwd         : String[15];                             
  70.                  DataPhone,
  71.                  HomePhone   : String[12];                             
  72.                  LastTime    : String[5];
  73.                  LastDate    : String[8];
  74.                  Attrib      : Byte;                                   
  75.                  Flags       : QFlagType;
  76.                  Credit,
  77.                  Pending,
  78.                  TimesPosted,
  79.                  HighMsgRead,
  80.                  SecLvl,
  81.                  Times,
  82.                  Ups,
  83.                  Downs,
  84.                  UpK,
  85.                  DownK,
  86.                  TodayK      : Word;
  87.                  Elapsed,
  88.                  Len         : Integer;
  89.                  CombinedPtr : Word; (* Record number in
  90.                                COMBINED.BBS *)
  91.                  AliasPtr     : Word; (* Record number in ALIAS.BBS    
  92.                                *)
  93.                  Birthday    : Longint;                                
  94.                end;                                                    
  95. (*  Attrib:
  96.                                                                        
  97.       Bit 0: Deleted
  98.       Bit 1: Screen Clear Codes                                        
  99.       Bit 2: More Prompt                                               
  100.       Bit 3: ANSI                                                      
  101.       Bit 4: No-Kill                                                   
  102.       Bit 5: Ignore Download Hours
  103.       Bit 6: ANSI Full Screen Editor                                   
  104.       Bit 7: Sex (0=male, 1=female)                                    
  105.                                                                        
  106. *)                                                                     
  107.                                                                        
  108.   QAliasRecord = String[35]; (* for ALIAS.BBS *)
  109.  
  110.   { Other Stuff ************************************************* }    
  111.  
  112.  
  113.   QSysInfoRecord = record
  114.                     CallCount  : LongInt;                              
  115.                     LastCaller : String[35];                           
  116.                     ExtraSpace : array[1..128] of Byte;                
  117.                   end;
  118.  
  119.   QTimeLogRecord = record
  120.                     StartDate   : String[8];                           
  121.                     BusyPerHour : array[0..23] of Integer;             
  122.                     BusyPerDay  : array[0..6] of Integer;              
  123.                   end;                                                 
  124.                                                                        
  125.   { Configuration Information *********************************** }
  126.                                                                        
  127.   QTypeMsgs  = (Standard,Netmail,EMail,EchoMail);
  128.   QKindMsgs  = (Both,Private,Public,ROnly);
  129.   QEventStat = (Deleted, Enabled, Disabled);
  130.   QAskType   = (No, Maybe, Yes);
  131.                                                                        
  132.   QSecurityRecord = Record
  133.                       Security : Word;
  134.                       Flags    : QFlagType;
  135.                     End;
  136.                                                                        
  137.   QEventRecord = record (* EVENTCFG.DAT *)
  138.                   Status      : QEventStat;
  139.                   RunTime     : LongInt;
  140.                   ErrorLevel  : Byte;                                  
  141.                   Days        : Byte;                                  
  142.                   Forced      : Boolean;                               
  143.                   LastTimeRun : LongInt;
  144.                   Spare       : Array[1..7] of Byte;                   
  145.                 end;                                                   
  146.                                                                        
  147.   QConfigRecord = record  (* QUICKCFG.DAT *)
  148.                                                                        
  149.                    VersionID : Word;                                   
  150.                                                                        
  151.                    Node      : Byte;                                   
  152.                                                                        
  153.                    (*  Modem Parameters  *)
  154.                    CommPort      : Integer;                            
  155.                    InitBaud      : Word;                               
  156.                    ModemDelay    : Word;                               
  157.                    InitTimes,                                          
  158.                    AnswerWait    : Integer;                            
  159.                    ModemInitStr,                                       
  160.                    ModemBusyStr  : String[70];
  161.                    ModemInitResp,                                      
  162.                    ModemBusyResp,
  163.                    Resp300,                                            
  164.                    Resp1200,                                           
  165.                    Resp2400,                                           
  166.                    Resp9600,                                           
  167.                    Resp19200,                                          
  168.                    Resp38400     : String[40];                         
  169.                                                                        
  170.                    (*  System Paths  *)                                
  171.                    EditorCmdStr    : String[70];                       
  172.                    MenuPath,                                           
  173.                    TextPath,                                           
  174.                    NetPath,
  175.                    NodelistPath,                                       
  176.                    MsgPath,                                            
  177.                    SwapPath,
  178.                    OverlayPath     : String[66];                       
  179.                                                                        
  180.                    (* System misc strings *)                           
  181.                    LoadingMessage  : String[70];
  182.                    SelectionPrompt : String[70];                       
  183.                    NoMailString    : String[70];                       
  184.                    OriginLine      : String[58];                       
  185.                    QuoteStr        : String[3];                        
  186.                                                                        
  187.                    (*  User Restrictions *)                            
  188.                    LowBaudStart,                                       
  189.                    LowBaudEnd,                                         
  190.                    DownloadStart,                                      
  191.                    DownloadEnd     : LongInt;                          
  192.                    MaxPageTimes,                                       
  193.                    PageBellLen     : Integer;                          
  194.                    PagingStart,
  195.                    PagingEnd       : LongInt;
  196.                    MinBaud,                                            
  197.                    GraphicsBaud,                                       
  198.                    XferBaud        : Integer;                          
  199.                                                                        
  200.                    (*  Matrix Information  *)                          
  201.                    MatrixZone,                                         
  202.                    MatrixNet,
  203.                    MatrixNode,                                         
  204.                    MatrixPoint     : array[0..10] of Integer;          
  205.                    NetMailBoard    : Integer;                          
  206.                                                                        
  207.                    (*  Default Information for New Users  *)           
  208.                    DefaultSec      : QSecurityRecord;
  209.                    MinimumSec      : QSecurityRecord;
  210.                    DefaultCredit   : Integer;                          
  211.                                                                        
  212.                    (*  Sysop Security Etc. *)                          
  213.                    SysopSecurity   : QSecurityRecord;
  214.                    SysopName       : String[35];                       
  215.                    SystemName      : String[40];                       
  216.                    RegKey          : LongInt;
  217.                                                                        
  218.                    (*  Misc System Parameters  *)                      
  219.                                                                        
  220.                    TextFileShells,                                     
  221.                    AltJswap,                                           
  222.                    Editorswap,                                         
  223.                    AutoLogonChar,
  224.                    FastLogon,                                          
  225.                    UseLastRead,                                        
  226.                    MonoMode,                                           
  227.                    DirectWrite,                                        
  228.                    SnowCheck,                                          
  229.                    NetEchoExit,                                        
  230.                    OneWordNames,                                       
  231.                    CheckMail,                                          
  232.                    AskHomePhone,                                       
  233.                    AskDataPhone,                                       
  234.                    AskBirthday,                                        
  235.                    AskSex,                                             
  236.                    Use_Xmodem,                                         
  237.                    Use_Xmodem1k,
  238.                    Use_Ymodem,                                         
  239.                    Use_YmodemG,                                        
  240.                    Use_Sealink,                                        
  241.                    Use_Zmodem,                                         
  242.                    Inp_Fields,                                         
  243.                    GraphicsAvail,                                      
  244.                    ForceUS_Phone   : Boolean;
  245.                    InactiveTimeOut : Integer;
  246.                    LogonTime       : Integer;                          
  247.                    DefFgColor      : Integer;                          
  248.                    DefBgColor      : Integer;                          
  249.                    PasswordTries   : Integer;                          
  250.                    EntFldColor     : Byte; (*  Color for entry         
  251.                                      fields *)                         
  252.                    BorderColor      : Byte; (* Color for menu          
  253.                                      borders *)                        
  254.                    WindowColor     : Byte;                             
  255.                    StatusBarColor  : Byte;                             
  256.                    UploadCredit    : Integer;                          
  257.                    ScreenBlank     : Byte;                             
  258.  
  259.                    (* Callback verifier *)                             
  260.                    VerifierInit    : string[35];                       
  261.                    DialString      : string[15];                       
  262.                    DialSuffix      : string[15];                       
  263.                    DupeCheck       : Boolean;                          
  264.                    NewUserSec,                                         
  265.                    MemberSec       : Word;
  266.                    MemberFlags     : Array[1..4,1..8] of Char;         
  267.                    LDcost          : Word;
  268.                    LDenable,                                           
  269.                    ResumeLocal,                                        
  270.                    ResumeLD        : Boolean;                          
  271.                    LDstart,
  272.                    LDend           : Longint;                          
  273.                                                                        
  274.                    ExtraSpace      : Array[1..400] of Byte;            
  275.                                                                        
  276.                  end;                                                  
  277.  
  278.  QGosubDataType = array[1..20] of String[8];
  279.  
  280.  QExitRecord = record
  281.                  BaudRate        : Integer;
  282.                  SysInfo         : QSysInfoRecord;
  283.                  TimeLogInfo     : QTimeLogRecord;
  284.                  UserInfo        : QUserRecord;
  285.                  EventInfo       : QEventRecord;
  286.                  NetMailEntered  : Boolean;
  287.                  EchoMailEntered : Boolean;
  288.                  LoginTime       : String[5];
  289.                  LoginDate       : String[8];
  290.                  TmLimit         : Integer;
  291.                  LoginSec        : LongInt;
  292.                  Credit          : LongInt;
  293.                  UserRecNum      : Integer;
  294.                  ReadThru        : Integer;
  295.                  PageTimes       : Integer;
  296.                  DownLimit       : Integer;
  297.                  WantChat        : Boolean;
  298.                  GosubLevel      : Byte;
  299.                  GosubData       : QGosubDataType;
  300.                  Menu            : String[8];
  301.                end;
  302.  
  303. {--------------------------------------------------------------------------|
  304.   Variables which contain the CONFIG.RA and the EXITINFO.BBS info. Note
  305.   that I included Q(bbs) in the variable name to avoid conflicts with the
  306.   names of other BBSses their configuration files.
  307. |--------------------------------------------------------------------------}
  308.  
  309. Var QExitInfo  : QExitRecord;
  310.     QConfig    : QConfigRecord;
  311.  
  312. {--------------------------------------------------------------------------|
  313.   And the procedures to read and write the configuration info.
  314.  
  315.   InitQBBS
  316.          Should be called once at the start of your program to initialize
  317.          your door for QBBS
  318.  
  319.   UpdateExitInfo
  320.          Rewrites the EXITINFO.BBS Record. To avoid problems with newer
  321.          version of QBBS, which probably add fields to this file, only
  322.          as much bytes are read and written as the size of the record
  323.          defined in this unit. As long as the file is upward compatible
  324.          this should avoid conflicts.
  325.          The function returns false if it wasn't able to write the info.
  326.  
  327.          The users TimeLimit and Security are always updated while writing,
  328.          Other field you have to change for yourself.
  329.  
  330. |--------------------------------------------------------------------------}
  331.  
  332.  
  333. Procedure InitQBBS;
  334. Function QBBSUpdateExitInfo:Boolean;
  335.  
  336.  
  337. Implementation
  338. Uses LowLevel; { To avoid a circular reference error }
  339.  
  340. Const UseLog : Boolean = False; { Is set to TRUE as soon as a LogProcedure }
  341.                                 { is installed                             }
  342.  
  343. Const Months : Array[1..12] Of String[3] =
  344.        ('Jan','Feb','Mar','Apr','May','Jun',
  345.         'Jul','Aug','Sep','Oct','Nov','Dec');
  346.  
  347. {$F+}
  348. Procedure QBBSLogIt(LogLine  : MaxlogStr);
  349. {$F-}
  350.  
  351. Var Log    : Text;
  352.     temp   : Integer;
  353.     Hour   : Word;
  354.     Minute : Word;
  355.     Dum    : Word;
  356.     Day    : Word;
  357.     Month  : Word;
  358.     Year   : Word;
  359.  
  360. Begin
  361. If Not UseLog
  362.    Then Exit;
  363.  
  364. {$IfDef UseMultiLanguage}
  365.   LogLine:=ExpandString(LogLine);
  366. {$EndIf}
  367.  
  368. GetTime(Hour,Minute,Dum,Dum);
  369. GetDate(Year,Month,Day,Dum);
  370. LogLine:= S(Day,2)+'-'+
  371.           Months[Month]+'-'+
  372.           S(Year-1900,2)+' '+
  373.           S(Hour,2)+':'+
  374.           S(Minute,2)+'  '+
  375.           LogLine;
  376.  
  377. If LogLine[1]=' '
  378.    Then LogLine[1]:='0';
  379. For Dum:=11 To 15 Do
  380.  If LogLine[Dum]=' '
  381.     Then LogLine[Dum]:='0';
  382.  
  383. FileMode:=ReadWrite+ShareDenyNone;
  384. Assign(Log,GlobalInfo.LogFileName);
  385. Append(Log);
  386. If IoResult<>0
  387.    Then Rewrite(Log);
  388. WriteLn(Log,LogLine);
  389. Close(Log);
  390. If IoResult<>0
  391.    Then Begin
  392.         WriteLn(#254' Can''t LOG anymore !!!');
  393.         UseLog:=False;
  394.         End;
  395. End;
  396.  
  397. Procedure QBBSBirthDay(    Magic          : LongInt;
  398.                        Var Day,Month,Year : Word;
  399.                        Var Age            : Byte);
  400.  
  401. Const DaysAMonth : Array[1..12] Of Byte =
  402.                    (31,28,31,30,31,30,31,
  403.                     31,30,31,30,31);
  404.  
  405. Var Now : DateTime;
  406.     Dum : Word;
  407.  
  408. Function IsLeapYear(Year : Word):Boolean;
  409. Begin
  410. IsLeapYear:= ((Year Mod 4)   =  0)  And
  411.              {((Year Mod 400) =  0) And}
  412.              ((Year Mod 100) <> 0);
  413. End;
  414.  
  415. Begin
  416. Year:=1600;
  417. While (Magic>365) Do
  418.  Begin
  419.  If (IsLeapYear(Year))
  420.     Then Dec(Magic);
  421.  Inc(Year);
  422.  Dec(Magic,365);
  423.  End;
  424.  
  425. Month:=1;
  426. Repeat
  427.  If Magic>DaysAMonth[Month]
  428.     Then Begin
  429.          Dec(Magic,DaysAMonth[Month]);
  430.          If (Month=2) And
  431.             IsLeapYear(Year)
  432.             Then Dec(Magic);
  433.          Inc(Month);
  434.          End;
  435. Until Magic<=DaysAMonth[Month];
  436. Day:=Magic;
  437. With Now Do
  438.  GetDate(Year,Month,Day,Dum);
  439.  
  440. Age:=Now.Year-Year-1;
  441. If (Now.Month>Month) or
  442.    ((Now.Month=Month) And (Now.Day>=Day))
  443.    Then Inc(Age);
  444.  
  445. End;
  446.  
  447.  
  448. Function ReadQBBSConfig:Boolean;
  449. Var Conf : FileObject;
  450.     Size : Word;
  451. Begin
  452. ReadQBBSConfig:=False;
  453. FillChar(QConfig,SizeOf(QConfig),#00);
  454.  
  455. Conf.Open('QUICKCFG.DAT',1,ReadOnly+ShareDenyNone);
  456. If Conf.Error<>0
  457.    Then Begin
  458.         Conf.Open(QPath+'QUICKCFG.DAT',1,ReadOnly+ShareDenyNone);
  459.         If Conf.Error<>0
  460.            Then Exit;
  461.         End;
  462. Size:=SizeOf(QConfig);
  463. Conf.ReadBuffer(QConfig,Size);
  464. Conf.Close;
  465.  
  466.  
  467. With GlobalInfo Do
  468.  Begin
  469.  BBStag  := QBBS;
  470.  BBSName := 'QBBS v.'+S(Lo(QConfig.VersionID),0)+'.'+SF(Hi(QConfig.VersionID),2);
  471.  
  472.  OnlineStatus:=Normal;
  473.  SystemStatus:=S_OK;
  474.  
  475.  LogfileName   := 'SYSTEM.LOG';
  476.  
  477.  LogIt := QBBSLogIt;
  478.  
  479.  UseLog        := True;
  480.  TimeOutTime   := QConfig.InactiveTimeout;
  481.  Warnings      := 2; { My constate! }
  482.  
  483.  
  484.  UserFilePath  := QConfig.MsgPath;
  485.  CompletePath(UserFilePath);
  486.  
  487.  
  488.  LeftBracket   := '[';
  489.  RightBracket  := ']';
  490.  
  491.  SysopName     := QConfig.SysOpName;
  492.  SystemName    := QConfig.SystemName;
  493.  SystemLocation:= 'UnKnown';
  494.  
  495.  LocalMono     := QConfig.MonoMode;
  496.  
  497.  If ExistParameter('P:')
  498.     Then ComPort:=Str2Nr(GrabParameter('P:'))
  499.     Else ComPort := QConfig.CommPort;
  500.  
  501.  MultiLine     := QConfig.Node>1;
  502.  End; {With}
  503.  
  504. {---- To make sure the major paths are all nice and complete... ---------}
  505.  
  506. CompletePath(QConfig.MenuPath);
  507. CompletePath(QConfig.TextPath);
  508. CompletePath(QConfig.NetPath);
  509. CompletePath(QConfig.NodelistPath);
  510. CompletePath(QConfig.MsgPath);
  511. GlobalInfo.CommonDir:=GlobalInfo.SystemPath;
  512.  
  513. ReadQBBSConfig  := True;
  514. End;
  515.  
  516.  
  517.  
  518. {---- ExitInfo.bbs procedures -----------------------------------------}
  519.  
  520. Function QBBSUpdateExitInfo:Boolean;
  521. Var Info : FileObject;
  522.     Size : Word;
  523. Begin
  524. QBBSUpdateExitInfo:=False;
  525.  
  526. If GlobalInfo.MultiLine
  527.    Then Info.Open('EXITINFO.BBS',1,ReadWrite+ShareDenyNone)
  528.    Else Info.Open(GlobalInfo.SystemPath+'EXITINFO.BBS',1,ReadWrite+ShareDenyNone);
  529.  
  530. If Info.Error <> 0
  531.    Then Exit;
  532.  
  533. Size:=SizeOf(QExitInfo);
  534.  
  535. QExitInfo.UserInfo.SecLvl:=GlobalInfo.UserSecurity;
  536.  
  537. QExitInfo.TmLimit:=GlobalInfo.MinRemaining;
  538.  
  539. Info.GotoRecord(0);
  540. Info.WriteBuffer(QExitInfo,Size);
  541. Info.Close;
  542.  
  543. QBBSUpdateExitInfo:=Info.Error=0;
  544. End;
  545.  
  546.  
  547. Function ReadExitInfo:Boolean;
  548. Var Info : FileObject;
  549.     Size : Word;
  550.     TDate: DateTime;
  551. Begin
  552. ReadExitInfo:=False;
  553. FillChar(QExitInfo,SizeOf(QExitInfo),#00);
  554.  
  555. If GlobalInfo.MultiLine
  556.    Then Info.Open('EXITINFO.BBS',1,ReadOnly+ShareDenyNone)
  557.    Else Info.Open(GlobalInfo.SystemPath+'EXITINFO.BBS',1,ReadOnly+ShareDenyNone);
  558.  
  559. If Info.Error <> 0
  560.    Then Exit;
  561.  
  562. Size:=SizeOf(QExitInfo);
  563. Info.ReadBuffer(QExitInfo,Size);
  564. Info.Close;
  565.  
  566. With GlobalInfo Do
  567.  Begin
  568.  
  569.  ScreenWidth  := 80;
  570.  
  571.  UserName     := QExitInfo.UserInfo.Name;
  572.  UserHandle   := '';
  573.  UserGroup    := 1;
  574.  
  575.  If QExitInfo.UserInfo.AliasPtr>0
  576.     Then Begin
  577.          Info.Open(GlobalInfo.UserFilePath+'ALIAS.BBS',SizeOf(UserHandle),ReadOnly+ShareDenyNone);
  578.          If Info.Error=0
  579.             Then Begin
  580.                  Info.GotoRecord(QExitInfo.UserInfo.AliasPtr);
  581.                  Info.Read(UserHandle);
  582.                  Info.Close;
  583.                  End;
  584.          End;
  585.  
  586.  UserLocation := QExitInfo.UserInfo.City;
  587.  UserSecurity := QExitInfo.UserInfo.SecLvl;
  588.  
  589.  If QExitInfo.UserInfo.BirthDay>0
  590.     Then Begin
  591.          With TDate Do
  592.           Begin
  593.           QBBSBirthDay(QExitInfo.USerInfo.BirthDay,Day,Month,Year,UserAge);
  594.           UserBirthDay :=SF(Day,2)+'-'+SF(Month,2)+'-'+SF(Year-1900,2);
  595.           End;
  596.          End
  597.     Else Begin
  598.          UserBirthDay := 'Unknown ';
  599.          UserAge      := 0;
  600.          End;
  601.  
  602.  
  603.  UserSex      := (QExitInfo.UserInfo.Attrib  And $40 ) = $40;
  604.  ScreenLength := QExitInfo.UserInfo.Len;
  605.  UseGraphics  := (QExitInfo.UserInfo.Attrib  And $08 ) = $08;
  606.  UseAVATAR    := False;
  607.  UseMoreYN    := (QExitInfo.UserInfo.Attrib  And $04 ) = $04;
  608.  UseClrScr    := (QExitInfo.UserInfo.Attrib  And $02 ) = $02;
  609.  UseQuietMode := False;
  610.  
  611.  BaudRate     := QExitInfo.BaudRate;
  612.  MinRemaining := QExitInfo.TmLimit;
  613.  TimeLimit    := QExitInfo.TmLimit;
  614.  End; {With}
  615.  
  616. GlobalInfo.IEMSI.Session := False;
  617.  
  618. ReadExitInfo:= True;
  619. End;
  620.  
  621.  
  622.  
  623. {--------------------------------------------------------------------------|
  624.   INITQBBS:
  625.  
  626.   Read the QBBS configuration files (CONFIG.BBS and EXITINFO.BBS) and fill
  627.   and check for the standard commandline parameters.
  628.  
  629.   -T:<Time>     Maximal time in this door, overrules the EXITINFO.BBS setting
  630.                 The time has to be given in minutes. Mostly here for
  631.                 compatability with RAdoor 2.3
  632.   -N:<Node>     Node number, there's no other way under RA. Defaults to node 1
  633.   -P:<CommPort> Overrules the CONFIG.RA Comport setting. Usefull for multiline
  634.                 Systems.
  635.   -NOS          Turns off local noise for default.
  636.  
  637.   Further the GlobalInfo variables SystemPath and HomeDir are filled:
  638.  
  639.   SystemPath    Path to the RA system directory. The environment variable
  640.                 RA= has to be there.
  641.  
  642.   HomeDir       The directory from where the door was fired up. I usual
  643.                 use this directory to look for auxilary files. The homedir
  644.                 is found by stripping the filename of ParamStr(0). The user
  645.                 can ALWAYS overrule this value by setting an environment
  646.                 variable <PROGNAME> with an other path. PROGNAME is the REAL
  647.                 name of the program (the EXE file) minus the path and the
  648.                 extention!
  649.  
  650. |--------------------------------------------------------------------------}
  651.  
  652.  
  653.  
  654. Procedure InitQBBS;
  655.  
  656. Var ProgName : String[8];
  657.     Dum      : String[4];
  658.     TTime    : Word;
  659. Begin
  660. QPath:=GetEnv('QUICK');
  661. CompletePath(QPath);
  662. GlobalInfo.SystemPath:=QPath;
  663.  
  664.  
  665. FSplit(ParamStr(0),GlobalInfo.HomeDir,ProgName,Dum);
  666. If GetEnv(ProgName)<>''
  667.    Then GlobalInfo.HomeDir:=GetEnv(ProgName);
  668. If GlobalInfo.HomeDir<>''
  669.    Then CompletePath(GlobalInfo.HomeDir);
  670.  
  671.  
  672. GlobalInfo.Node:=Str2Nr(GrabParameter('N:'));
  673. If GlobalInfo.Node=0
  674.    Then GlobalInfo.Node:=1;
  675.  
  676. If Not ReadQBBSConfig
  677.    Then Begin
  678.         WriteLn(#254' Couldn''t read CONFIG info!');
  679.         Halt;
  680.         End;
  681.  
  682. If Not ReadExitInfo
  683.    Then Begin
  684.         WriteLn(#254' Couldn''t read EXITINFO.BBS!');
  685.         Halt;
  686.         End;
  687.  
  688. If ExistParameter('T:')
  689.    Then Begin
  690.         TTime:=Str2Nr(GrabParameter('T:'));
  691.         If TTime<=GlobalInfo.MinRemaining
  692.            Then GlobalInfo.MinRemaining:=TTime;
  693.         End;
  694.  
  695. If ExistParameter('L:')
  696.    Then GlobalInfo.Language:=GrabParameter('L:')
  697.    Else GlobalInfo.Language:='ENGLISH';
  698.  
  699. If ExistParameter('NOS')
  700.    Then GlobalInfo.LocalNoise:=False;
  701.  
  702. End;
  703. End.
  704.  
  705.  
  706.  
  707.