{
 $Id$
}

{ra 2.0+}

type
  AskType        = (Yes, No, Ask, Only);
  VideoType      = (Auto, Short, Long);
  FlagType       = array[1..4] of Byte;
  Time           = String[5];

  NetAddress     = record
                     Zone,
                     Net,
                     Node,
                     Point          : Word;
                   end;

  COMBINEDrecord = array[1..200] of Word;

  ARCrecord = record
                Extension : String[3];
                UnpackCmd,
                PackCmd   : String[60];
              end;

  CONFIGrecord = record
    VersionID           : Word;
    xCommPort           : Byte;
    xBaud               : LongInt;
    xInitTries          : Byte;
    xInitStr,
    xBusyStr            : String[70];
    xInitResp,
    xBusyResp,
    xConnect300,
    xConnect1200,
    xConnect2400,
    xConnect4800,
    xConnect9600,
    xConnect19k,
    xConnect38k         : String[40];
    xAnswerPhone        : Boolean;
    xRing,
    xAnswerStr          : String[20];
    xFlushBuffer        : Boolean;
    xModemDelay         : Integer;

    MinimumBaud,
    GraphicsBaud,
    TransferBaud        : word;
    SlowBaudTimeStart,
    SlowBaudTimeEnd,
    DownloadTimeStart,
    DownloadTimeEnd     : Time;

    PageStart           : Array[0..6] of Time;
    PageEnd             : Array[0..6] of Time;

    SeriNum,
    CustNum             : String[22];
{}  FreeSpace1          : Array[1..24] of Byte;
    PwdExpiry           : Word;

    MenuPath,
    TextPath,
    AttachPath,
    NodelistPath,
    MsgBasePath,
    SysPath,
    ExternalEdCmd       : String[60];

    Address             : Array[0..9] of NetAddress;
    SystemName          : String[30];

    NewSecurity         : Word;
    NewCredit           : Word;
    NewFlags            : FlagType;

    OriginLine          : String[60];
    QuoteString         : String[15];
    Sysop               : String[35];
    LogFileName         : String[60];
    FastLogon,
    AllowSysRem,
    MonoMode,
    StrictPwdChecking,
    DirectWrite,
    SnowCheck           : Boolean;
    CreditFactor        : Integer;

    UserTimeOut,
    LogonTime,
    PasswordTries,
    MaxPage,
    PageLength          : Word;
    CheckForMultiLogon,
    ExcludeSysopFromList,
    OneWordNames        : Boolean;
    CheckMail           : AskType;
    AskVoicePhone,
    AskDataPhone,
    DoFullMailCheck,
    AllowFileShells,
    FixUploadDates,
    FreezeChat          : Boolean;
    ANSI,                       { ANSI: Yes, no, or ask new users     }
    ClearScreen,                { Clear:        "                     }
    MorePrompt          : AskType;    { More:         "                     }
    UploadMsgs          : Boolean;
    KillSent            : AskType;    { Kill/Sent     "                     }

    CrashAskSec         : Word;       { Min sec# to ask 'Crash Mail ?'      }
    CrashAskFlags       : FlagType;
    CrashSec            : Word;       { Min sec# to always send crash mail. }
    CrashFlags          : FlagType;
    FAttachSec          : Word;       {        "    ask 'File Attach ?'     }
    FAttachFlags        : FlagType;

    NormFore,
    NormBack,
    StatFore,
    StatBack,
    HiBack,
    HiFore,
    WindFore,
    WindBack,
    ExitLocal,
    Exit300,
    Exit1200,
    Exit2400,
    Exit4800,
    Exit9600,
    Exit19k,
    Exit38k             : Byte;

    MultiLine           : Boolean;
    MinPwdLen           : Byte;
    MinUpSpace          : Word;
    HotKeys             : AskType;
    BorderFore,
    BorderBack,
    BarFore,
    BarBack,
    LogStyle,
    MultiTasker,
    PwdBoard            : Byte;
    xBufferSize         : Word;
    FKeys               : Array[1..10] of String[60];

    WhyPage             : Boolean;
    LeaveMsg            : Byte;
    ShowMissingFiles,
    xLockModem          : Boolean;
{}  FreeSpace2          : Array[1..10] of Byte;
    AllowNetmailReplies : Boolean;
    LogonPrompt         : String[40];
    CheckNewFiles       : AskType;
    ReplyHeader         : String[60];
    BlankSecs           : byte;
    ProtocolAttrib      : Array[1..6] of Byte;
    xErrorFreeString    : String[15];
    xDefaultCombined    : array[1..25] of Byte;
    RenumThreshold      : Word;
    LeftBracket,
    RightBracket        : Char;
    AskForHandle        : Boolean;
    AskForBirthDate     : Boolean;

    GroupMailSec        : Word;

    ConfirmMsgDeletes   : Boolean;

    FreeSpace4          : Array[1..30] of byte;

    TempScanDir         : String[60];
    ScanNow             : AskType;
    xUnknownArcAction,
    xFailedUnpackAction,
    FailedScanAction    : Byte; {Bit 0:Mark deleted, 1:Mark unlisted, 2:Mark notavail}
    xUnknownArcArea,
    xFailedUnpackArea,
    FailedScanArea      : Word;
    ScanCmd             : String[60];
    xDeductIfUnknown    : Boolean;

    NewUserGroup        : Byte;
    AVATAR              : AskType;
    BadPwdArea          : Byte;
    Location            : String[40];
    DoAfterAction       : Byte; {0 = wait for CR, > 0 = wait for x seconds}
{}  OldFileLine         : String[40];
    CRfore,
    CRback              : Byte;
    LangHdr             : String[40];
    xSendBreak          : Boolean;
{}  ListPath            : String[60];
    FullMsgView         : AskType;
    EMSI_Enable         : AskType;
    EMSI_NewUser        : Boolean;

    EchoChar            : String[1];
    xConnect7200,
    xConnect12000,
    xConnect14400       : String[40];
    Exit7200,
    Exit12000,
    Exit14400           : Byte;
    ChatCommand         : String[60];
    ExtEd               : AskType;
    NewuserLanguage     : Byte;
    LanguagePrompt      : String[40];
    VideoMode           : VideoType;
    AutoDetectANSI      : Boolean;
    xOffHook            : Boolean;
    NewUserDateFormat   : Byte;
    KeyboardPwd         : String[15];
    CapLocation         : Boolean;
    NewuserSub          : Byte;
    PrinterName         : String[4];
    HilitePromptFore,
    HiLitePromptBack    : Byte;
    xInitStr2           : String[70];
    AltJSwap            : Boolean;
    SemPath             : String[60];
    AutoChatCapture     : Boolean;

    FileBasePath        : String[60];
    NewFileTag          : Boolean;
    IgnoreDupeExt       : Boolean;
    TempCDFilePath      : String[60];
    TagFore,
    TagBack             : Byte;
    xConnect16k         : String[40];
    Exit16k,
    FilePayback         : Byte;
    FileLine,
    FileMissingLine     : String[200];
    NewUserULCredit     : Byte;
    NewUserULCreditK    : Word;
    ArcInfo             : Array[1..10] of ARCrecord;
    RAMGRAltFKeys       : Array[1..5] of String[60];
    ArcViewCmd          : String[60];
    xConnectFax         : String[40];
    ExitFax             : Byte;
    UseXMS,
    UseEMS              : Boolean;
    CheckDOB            : Byte;
    EchoCheck           : AskType;
    ccSec,
    ReturnRecSec        : Word;
    HonourNetReq        : Boolean;
    DefaultCombined     : COMBINEDrecord;
    AskForSex,
    AskForAddress       : Boolean;
    DLdesc              : AskType;
    NewPhoneScan        : Boolean;
    FutureExpansion : Array[1..587] of Byte;
  end;


Procedure Bbs10;
Type
  FILESrecord    = record
                     Unused         : Array[1..4] of Byte;
                     Name           : String[40];
                     Attrib         : Byte;

                      { Bit 0 : Include in new files scan
                            1 : Include in upload dupe scan
                            2 : Permit long descriptions
                            3 : Area is on CD-ROM
                            4 : All files are FREE
                            5 : Allow DLs not in FDB
                            6 : Allow users to password uploads
                            7 : Scan uploads }

                     FilePath       : String[40];
                     KillDaysDL,
                     KillDaysFD     : Word;
                     Password       : String[15];
                     MoveArea       : Word;
                     Age,
                     ConvertExt     : Byte;
                     Group          : Word;
                     Attrib2        : Byte;

                      { Bit 0 : Include in all groups }

                     DefCost,
                     UploadArea,
                     UploadSecurity : Word;
                     UploadFlags,
                     UploadNotFlags : Array[1..4] of byte;
                     Security       : Word;
                     Flags,
                     NotFlags       : Array[1..4] of byte;
                     ListSecurity   : Word;
                     ListFlags,
                     ListNotFlags   : Array[1..4] of byte;
                     AltGroup       : Array[1..3] of Word;
                     Device         : Byte;
                     FreeSpace      : Array[1..13] of Byte;
                   end;

Var
  FFile : File of Filesrecord;
  F     : Filesrecord;
  Tel   : Word;
  Con   : Configrecord;
  CFile : File of Configrecord;
Begin
  Writeln('Converting RemoteAccess 2.0x file areas.',#10#13);

  Assign(Cfile,BbsPath + 'CONFIG.RA');
  {$I-} Reset(Cfile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'CONFIG.RA!');
      Halt;
    End;
  {$I-} Read(Cfile,Con); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Error reading CONFIG.RA');
      Halt;
    End;
  Close(Cfile);

  Bbs.Path := Con.FileBasePath;         { filebasepath opslaan in 1e record }
  If last(1,Bbs.Path) <> '\' then Bbs.Path := Bbs.Path + '\';
  AddToFile(false);

  BbsPath := Con.SysPath;               { files.ra staat in het systempath! }
  If Last(1,bbspath) <> '\' then BbsPath := BbsPath + '\';

  Assign(Ffile, BbsPath + 'FILES.RA');
  {$I-} Reset(Ffile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'FILES.RA!');
      Halt;
    End;

  Tel := 0;
  While not eof(ffile) do
    Begin
      {$I-} Read(Ffile,F); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FILES.RA!');
          Halt;
        End;

      Inc(Tel);
      If F.name <> '' then
        Begin
          Inc(Number);
          Bbs.on   := False;
          Bbs.name := F.Name;
          Bbs.nr   := Tel;
          Bbs.path := F.FilePath;
          AddToFile(saveset);
        End;
    End;
  Close(Ffile);
End;

