{
 $Id$
}

{concord 0.01 gamma 2}
{Concord 1.06 ..  should work with this version as well as no changes }

type

  fFlagType     = Array [1..10] of Byte;    (* Flags, bitmapped *)

  Security     = Record
    Bpsrate  : Word;                      (* Current BPS rate div 100 *)
    Age      : Byte;                      (* Age  . . . . . . . . . . *)
    SecLvl   : Word;                      (* Security Level . . . . . *)
    Flags    : FflagType;                  (* Flags ON . . . . . . . . *)
    NotFlags : FflagType;                  (* Flags OFF  . . . . . . . *)
  end;                                    (* Size 25 bytes  . . . . . *)

  FAreaRec = Record          (* File area entry                       *)
   {000}  Id           : LongInt;  (* Always ID_CFG_FAREA                   *)
   {004}  Attrib       : LongInt;  (* File area attributes.                 *)
   {008}  Name         : String[60]; (* File area name.                       *)
   {069}  DownloadSec  : Security; (* Sec needed to download files.         *)
   {094}  UploadSec    : Security; (* Sec needed to upload files.           *)
   {119}  FileListSec  : Security; (* Sec needed to list files.             *)
   {144}  Password     : String[15];  (* Password needed to enter file area.   *)
   {160}  DownloadPath : String[67];   (* Download path.                        *)
   {228}  Basename     : String[8];  (* Filebase file name w/out extension    *)
   {237}  EmptySpace   : Array [1..51] of Byte;
   {288}  SubDirNum    : Word;     (* Current subdirectory number           *)
   {290}  JumpDirNum   : Word;     (* If FAREA_JUMP, where to jump          *)
   {292}  UploadArea   : LongInt;  (* If empty : Current area               *)
   {296}  Group        : String[3]; (* Filearea group                        *)
   {300}  ArchiveFmt   : Byte;     (* Convert files to this archive format. *)
   {301}  KillDaysDL   : Word;     (* Kill file if not dl'd in last n days. *)
   {303}  KillDaysFD   : Word;     (* Kill file if older than n days.       *)
   {305}  FilePoints   : Word;     (* Default file points per file dl'd.    *)
   {307}  OpenFrom     : Word;  (* Opening time in minutes after 00:00   *)
   {309}  OpenTo       : Word;  (* Closing time in minutes after 00:00   *)
   {311}  FILESBBS     : String[79];  (* Name of FILES.BBS                     *)
   {391}
     end;


Procedure Bbs15;
Var
  Ffile : file of farearec;
  f     : farearec;
  Tel   : Word;

Begin
  Writeln('Converting Concord 0.01 fareas.dat file.',#10#13);
  Writeln('Converting Concord 1.06 fareas.dat file.',#10#13);

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

  AddToFile(false);

  Tel := 0;
  While not eof(ffile) do
    Begin

      inc(tel);
      {$I-} Read(Ffile,f); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FAREAS.DAT!');
          Halt;
        End;

      if f.jumpdirnum = 0 then
        Begin

          fillchar(bbs,sizeof(bbs),#0);

          inc(number);

          Bbs.Name := f.name;
          Bbs.Path := f.filesbbs;
          Bbs.on   := False;
          Bbs.nr   := Tel;

          AddToFile(saveset);
        End;
    End;
  Close(Ffile);
End;

