From d9f35518b1591f6a055f9f78e544127b3b4c2970 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Wed, 4 Sep 2013 15:37:09 -0400 Subject: [PATCH] More code reorg... big time restructure likely coming sometime soon --- mystic/mutil.pas | 8 +- mystic/mutil_allfiles.pas | 9 +- mystic/mutil_common.pas | 149 +++++++-------------------------- mystic/mutil_echocore.pas | 5 +- mystic/mutil_echoexport.pas | 8 +- mystic/mutil_echofix.pas | 2 +- mystic/mutil_echoimport.pas | 37 ++++---- mystic/mutil_filesbbs.pas | 13 +-- mystic/mutil_importmsgbase.pas | 21 ++--- mystic/mutil_importna.pas | 19 +++-- mystic/mutil_msgpack.pas | 3 +- mystic/mutil_msgpurge.pas | 3 +- mystic/mutil_status.pas | 3 +- mystic/mutil_toplists.pas | 5 +- mystic/mutil_upload.pas | 17 ++-- 15 files changed, 112 insertions(+), 190 deletions(-) diff --git a/mystic/mutil.pas b/mystic/mutil.pas index fccdd00..b3b53c2 100644 --- a/mystic/mutil.pas +++ b/mystic/mutil.pas @@ -129,10 +129,10 @@ Begin Halt(1); End; - Read (CF, bbsConfig); + Read (CF, bbsCfg); Close (CF); - If bbsConfig.DataChanged <> mysDataChanged Then Begin + If bbsCfg.DataChanged <> mysDataChanged Then Begin ProcessName ('Load configuration', False); ProcessStatus ('Version mismatch', True); ProcessResult (rFATAL, False); @@ -140,7 +140,7 @@ Begin Halt(1); End; - TempPath := bbsConfig.SystemPath + 'temputil' + PathChar; + TempPath := bbsCfg.SystemPath + 'temputil' + PathChar; GetDIR (0, StartPath); @@ -155,7 +155,7 @@ Begin LogFile := INI.ReadString(Header_GENERAL, 'logfile', ''); If (LogFile <> '') and (Pos(PathChar, LogFile) = 0) Then - LogFile := bbsConfig.LogsPath + LogFile; + LogFile := bbsCfg.LogsPath + LogFile; LogLevel := INI.ReadInteger(Header_GENERAL, 'loglevel', 1); diff --git a/mystic/mutil_allfiles.pas b/mystic/mutil_allfiles.pas index 09d7d12..d3d5d4c 100644 --- a/mystic/mutil_allfiles.pas +++ b/mystic/mutil_allfiles.pas @@ -14,7 +14,8 @@ Uses m_FileIO, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Const TotalFiles : Cardinal = 0; @@ -49,7 +50,7 @@ Begin Exit; End; - Assign (BaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (BaseFile, bbsCfg.DataPath + 'fbases.dat'); If Not ioReset (BaseFile, SizeOf(RecFileBase), fmRWDN) Then Begin ProcessStatus ('Cannot open fbases.dat', True); @@ -68,8 +69,8 @@ Begin // If Excludedbase then continue; - Assign (ListFile, bbsConfig.DataPath + Base.FileName + '.dir'); - Assign (DescFile, bbsConfig.DataPath + Base.FileName + '.des'); + Assign (ListFile, bbsCfg.DataPath + Base.FileName + '.dir'); + Assign (DescFile, bbsCfg.DataPath + Base.FileName + '.des'); If Not ioReset (ListFile, SizeOf(RecFileList), fmRWDN) Then Continue; diff --git a/mystic/mutil_common.pas b/mystic/mutil_common.pas index 6d9cb2d..dddb926 100644 --- a/mystic/mutil_common.pas +++ b/mystic/mutil_common.pas @@ -9,18 +9,17 @@ Uses m_IniReader, mUtil_Status, BBS_Records, + BBS_DataBase, BBS_MsgBase_ABS, BBS_MsgBase_Squish, BBS_MsgBase_JAM; Var - Console : TOutput; INI : TINIReader; BarOne : TStatusBar; BarAll : TStatusBar; ProcessTotal : Byte = 0; ProcessPos : Byte = 0; - bbsConfig : RecConfig; TempPath : String; StartPath : String; LogFile : String; @@ -50,8 +49,6 @@ Function IsDupeMBase (FN: String) : Boolean; Function IsDupeFBase (FN: String) : Boolean; Procedure AddMessageBase (Var MBase: RecMessageBase); Procedure AddFileBase (Var FBase: RecFileBase); -Function ShellDOS (ExecPath: String; Command: String) : LongInt; -Procedure ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte); Function GetMBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean; Function GetMBaseByTag (Tag: String; Var TempBase: RecMessageBase) : Boolean; Function GetMBaseByNetZone (Zone: Word; Var TempBase: RecMessageBase) : Boolean; @@ -108,7 +105,7 @@ End; Function GetUserBaseSize : Cardinal; Begin - Result := FileByteSize(bbsConfig.DataPath + 'users.dat'); + Result := FileByteSize(bbsCfg.DataPath + 'users.dat'); If Result > 0 Then Result := Result DIV SizeOf(RecUser); End; @@ -120,7 +117,7 @@ Var Begin Result := False; - Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (MBaseFile, bbsCfg.DataPath + 'mbases.dat'); {$I-} Reset (MBaseFile); {$I+} If IoResult <> 0 Then Exit; @@ -144,7 +141,7 @@ Var Begin Result := False; - Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (FBaseFile, bbsCfg.DataPath + 'fbases.dat'); {$I-} Reset (FBaseFile); {$I+} If IoResult <> 0 Then Exit; @@ -166,7 +163,7 @@ Var MBaseFile : File of RecMessageBase; MBase : RecMessageBase; Begin - Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (MBaseFile, bbsCfg.DataPath + 'mbases.dat'); Reset (MBaseFile); Result := FileSize(MBaseFile); @@ -188,7 +185,7 @@ Var FBaseFile : File of RecFileBase; FBase : RecFileBase; Begin - Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (FBaseFile, bbsCfg.DataPath + 'fbases.dat'); Reset (FBaseFile); Result := FileSize(FBaseFile); @@ -209,7 +206,7 @@ Procedure AddMessageBase (Var MBase: RecMessageBase); Var MBaseFile : File of RecMessageBase; Begin - Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (MBaseFile, bbsCfg.DataPath + 'mbases.dat'); Reset (MBaseFile); Seek (MBaseFile, FileSize(MBaseFile)); Write (MBaseFile, MBase); @@ -220,106 +217,20 @@ Procedure AddFileBase (Var FBase: RecFileBase); Var FBaseFile : File of RecFileBase; Begin - Assign (FBaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (FBaseFile, bbsCfg.DataPath + 'fbases.dat'); Reset (FBaseFile); Seek (FBaseFile, FileSize(FBaseFile)); Write (FBaseFile, FBase); Close (FBaseFile); End; -Function ShellDOS (ExecPath: String; Command: String) : LongInt; -Var - Image : TConsoleImageRec; -Begin - Console.GetScreenImage(1, 1, 80, 25, Image); - - If ExecPath <> '' Then DirChange(ExecPath); - - {$IFDEF UNIX} - Result := Shell(Command); - {$ENDIF} - - {$IFDEF WINDOWS} - If Command <> '' Then Command := '/C' + Command; - - Exec (GetEnv('COMSPEC'), Command); - - Result := DosExitCode; - {$ENDIF} - - DirChange(StartPath); - - Console.PutScreenImage(Image); -End; - -Procedure ExecuteArchive (FName: String; Temp: String; Mask: String; Mode: Byte); -Var - ArcFile : File of RecArchive; - Arc : RecArchive; - Count : LongInt; - Str : String; -Begin - If Temp <> '' Then - Temp := strUpper(Temp) - Else - Temp := strUpper(JustFileExt(FName)); - - Assign (ArcFile, bbsConfig.DataPath + 'archive.dat'); - {$I-} Reset (ArcFile); {$I+} - - If IoResult <> 0 Then Exit; - - Repeat - If Eof(ArcFile) Then Begin - Close (ArcFile); - - Exit; - End; - - Read (ArcFile, Arc); - - If (Not Arc.Active) or ((Arc.OSType <> OSType) and (Arc.OSType <> 3)) Then Continue; - - If strUpper(Arc.Ext) = Temp Then Break; - Until False; - - Close (ArcFile); - - Case Mode of - 1 : Str := Arc.Pack; - 2 : Str := Arc.Unpack; - End; - - If Str = '' Then Exit; - - Temp := ''; - Count := 1; - - While Count <= Length(Str) Do Begin - If Str[Count] = '%' Then Begin - Inc (Count); - - If Str[Count] = '1' Then Temp := Temp + FName Else - If Str[Count] = '2' Then Temp := Temp + Mask Else - If Str[Count] = '3' Then Temp := Temp + TempPath; - End Else - Temp := Temp + Str[Count]; - - Inc (Count); - End; - - Log (3, '!', 'Arc Result (' + strI2S(ShellDOS('', Temp)) + ') ' + Temp); - -// ShellDOS ('', Temp); -End; - Function GetMBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean; Var F : File; Begin Result := False; - Assign (F, bbsConfig.DataPath + 'mbases.dat'); + Assign (F, bbsCfg.DataPath + 'mbases.dat'); If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; @@ -341,7 +252,7 @@ Var Begin Result := False; - Assign (F, bbsConfig.DataPath + 'mbases.dat'); + Assign (F, bbsCfg.DataPath + 'mbases.dat'); If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; @@ -366,7 +277,7 @@ Var Begin Result := False; - Assign (F, bbsConfig.DataPath + 'mbases.dat'); + Assign (F, bbsCfg.DataPath + 'mbases.dat'); If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; @@ -377,7 +288,7 @@ Begin One := TempBase; GotOne := True; - If Zone = bbsConfig.NetAddress[TempBase.NetAddr].Zone Then Begin + If Zone = bbsCfg.NetAddress[TempBase.NetAddr].Zone Then Begin Result := True; Break; @@ -434,19 +345,19 @@ Begin If mArea.NetType > 0 Then Begin If mArea.NetType = 2 Then Begin Msg^.SetMailType (mmtNetMail); - Msg^.SetCrash (bbsConfig.netCrash); - Msg^.SetHold (bbsConfig.netHold); - Msg^.SetKillSent (bbsConfig.netKillSent); + Msg^.SetCrash (bbsCfg.netCrash); + Msg^.SetHold (bbsCfg.netHold); + Msg^.SetKillSent (bbsCfg.netKillSent); Msg^.SetDest (mAddr); End Else Msg^.SetMailType (mmtEchoMail); - Msg^.SetOrig(bbsConfig.NetAddress[mArea.NetAddr]); + Msg^.SetOrig(bbsCfg.NetAddress[mArea.NetAddr]); Case mArea.NetType of - 1 : Assign (SemFile, bbsConfig.SemaPath + fn_SemFileEcho); - 2 : Assign (SemFile, bbsConfig.SemaPath + fn_SemFileNews); - 3 : Assign (SemFile, bbsConfig.SemaPath + fn_SemFileNet); + 1 : Assign (SemFile, bbsCfg.SemaPath + fn_SemFileEcho); + 2 : Assign (SemFile, bbsCfg.SemaPath + fn_SemFileNews); + 3 : Assign (SemFile, bbsCfg.SemaPath + fn_SemFileNet); End; ReWrite (SemFile); @@ -466,7 +377,7 @@ Begin If mArea.NetType > 0 Then Begin Msg^.DoStringLn (#13 + '--- ' + mysSoftwareID + ' BBS v' + mysVersion + ' (' + OSID + ')'); - Msg^.DoStringLn (' * Origin: ' + mArea.Origin + ' (' + strAddr2Str(bbsConfig.NetAddress[mArea.NetAddr]) + ')'); + Msg^.DoStringLn (' * Origin: ' + mArea.Origin + ' (' + strAddr2Str(bbsCfg.NetAddress[mArea.NetAddr]) + ')'); End; Msg^.WriteMsg; @@ -515,9 +426,9 @@ Var Count : Byte; Begin For Count := 1 to 30 Do - If (strUpper(EchoNode.Domain) = strUpper(bbsConfig.NetDomain[Count])) and - (EchoNode.Address.Zone = bbsConfig.NetAddress[Count].Zone) and - (bbsConfig.NetPrimary[Count]) Then Begin + If (strUpper(EchoNode.Domain) = strUpper(bbsCfg.NetDomain[Count])) and + (EchoNode.Address.Zone = bbsCfg.NetAddress[Count].Zone) and + (bbsCfg.NetPrimary[Count]) Then Begin Result := True; Exit; @@ -529,9 +440,9 @@ End; Function GetFTNOutPath (EchoNode: RecEchoMailNode) : String; Begin; If IsFTNPrimary(EchoNode) Then - Result := bbsConfig.OutboundPath + Result := bbsCfg.OutboundPath Else - Result := DirLast(bbsConfig.OutboundPath) + strLower(EchoNode.Domain + '.' + strPadL(strI2H(EchoNode.Address.Zone, 3), 3, '0')) + PathChar; + Result := DirLast(bbsCfg.OutboundPath) + strLower(EchoNode.Domain + '.' + strPadL(strI2H(EchoNode.Address.Zone, 3), 3, '0')) + PathChar; If EchoNode.Address.Point <> 0 Then Result := Result + strI2H((EchoNode.Address.Net SHL 16) OR EchoNode.Address.Node, 8) + '.pnt' + PathChar; @@ -543,7 +454,7 @@ Var Begin Result := False; - Assign (F, bbsConfig.DataPath + 'echonode.dat'); + Assign (F, bbsCfg.DataPath + 'echonode.dat'); If Not ioReset(F, SizeOf(RecEchoMailNode), fmRWDN) Then Exit; @@ -658,7 +569,7 @@ Var Begin Result := False; - Assign (F, bbsConfig.DataPath + 'echonode.dat'); + Assign (F, bbsCfg.DataPath + 'echonode.dat'); If Not ioReset(F, SizeOf(RecEchoMailNode), fmRWDN) Then Exit; @@ -682,9 +593,9 @@ Begin // this? research it someday For Count := 1 to 30 Do Begin - Result := (bbsConfig.NetAddress[Count].Zone = Zone) And - (bbsConfig.NetAddress[Count].Net = Net) And - (bbsConfig.NetAddress[Count].Node = Node); + Result := (bbsCfg.NetAddress[Count].Zone = Zone) And + (bbsCfg.NetAddress[Count].Net = Net) And + (bbsCfg.NetAddress[Count].Node = Node); If Result Then Break; End; diff --git a/mystic/mutil_echocore.pas b/mystic/mutil_echocore.pas index 3d48250..a461f81 100644 --- a/mystic/mutil_echocore.pas +++ b/mystic/mutil_echocore.pas @@ -10,6 +10,7 @@ Uses m_Strings, m_DateTime, BBS_Records, + BBS_DataBase, mUtil_Common; Const @@ -132,7 +133,7 @@ Begin GetMem (DupeData, MaxDupes * SizeOf(RecMsgDupe)); - Assign (F, bbsConfig.DataPath + 'echodupes.dat'); + Assign (F, bbsCfg.DataPath + 'echodupes.dat'); {$I-} Reset (F, 1); {$I+} If IoResult <> 0 Then ReWrite (F, 1); @@ -179,7 +180,7 @@ Destructor TPKTDupe.Destroy; Var F : File; Begin - Assign (F, bbsConfig.DataPath + 'echodupes.dat'); + Assign (F, bbsCfg.DataPath + 'echodupes.dat'); ReWrite (F, 1); BlockWrite (F, DupeData^, TotalDupes * SizeOf(RecMsgDupe)); Close (F); diff --git a/mystic/mutil_echoexport.pas b/mystic/mutil_echoexport.pas index 2454fca..487cd7b 100644 --- a/mystic/mutil_echoexport.pas +++ b/mystic/mutil_echoexport.pas @@ -10,7 +10,6 @@ Implementation Uses DOS, - MKCRAP, m_Strings, m_FileIO, m_DateTime, @@ -18,6 +17,7 @@ Uses mUtil_Status, mUtil_EchoCore, BBS_Records, + BBS_DataBase, BBS_MsgBase_ABS, BBS_MsgBase_JAM, BBS_MsgBase_Squish; @@ -104,7 +104,7 @@ Begin BundleName[Length(BundleName)] := '0'; - ExecuteArchive (BundleName, EchoNode.ArcType, TempPath + PKTName, 1); + ExecuteArchive (TempPath, BundleName, EchoNode.ArcType, TempPath + PKTName, 1); FileErase (TempPath + PKTName); AddToFLOQueue (FLOName, BundleName); End; @@ -291,14 +291,14 @@ Begin DirClean (TempPath, ''); - If Not DirExists(bbsConfig.OutboundPath) Then Begin + If Not DirExists(bbsCfg.OutboundPath) Then Begin ProcessStatus ('Outbound directory does not exist', True); ProcessResult (rFATAL, True); Exit; End; - Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (MBaseFile, bbsCfg.DataPath + 'mbases.dat'); If ioReset(MBaseFile, SizeOf(RecMessageBase), fmRWDN) Then Begin While Not Eof(MBaseFile) Do Begin diff --git a/mystic/mutil_echofix.pas b/mystic/mutil_echofix.pas index 869fb60..3794deb 100644 --- a/mystic/mutil_echofix.pas +++ b/mystic/mutil_echofix.pas @@ -33,7 +33,7 @@ Var Begin Result := False; - Assign (F, bbsConfig.DataPath + 'echonode.dat'); + Assign (F, bbsCfg.DataPath + 'echonode.dat'); If Not ioReset(F, SizeOf(RecEchoMailNode), fmRWDN) Then Exit; diff --git a/mystic/mutil_echoimport.pas b/mystic/mutil_echoimport.pas index 780c20d..46805a6 100644 --- a/mystic/mutil_echoimport.pas +++ b/mystic/mutil_echoimport.pas @@ -14,6 +14,7 @@ Uses m_Strings, AView, BBS_Records, + BBS_DataBase, BBS_MsgBase_ABS, BBS_MsgBase_JAM, BBS_MsgBase_Squish, @@ -168,8 +169,8 @@ Var If Not CreateBases Then Continue; - If FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.sqd') or - FileExist(bbsConfig.MsgsPath + PKT.MsgArea + '.jhr') Then Continue; + If FileExist(bbsCfg.MsgsPath + PKT.MsgArea + '.sqd') or + FileExist(bbsCfg.MsgsPath + PKT.MsgArea + '.jhr') Then Continue; FillChar (MBase, SizeOf(MBase), #0); @@ -179,14 +180,14 @@ Var MBase.NewsName := PKT.MsgArea; MBase.FileName := PKT.MsgArea; MBase.EchoTag := PKT.MsgArea; - MBase.Path := bbsConfig.MsgsPath; + MBase.Path := bbsCfg.MsgsPath; MBase.NetType := 1; - MBase.ColQuote := bbsConfig.ColorQuote; - MBase.ColText := bbsConfig.ColorText; - MBase.ColTear := bbsConfig.ColorTear; - MBase.ColOrigin := bbsConfig.ColorOrigin; - MBase.ColKludge := bbsConfig.ColorKludge; - MBase.Origin := bbsConfig.Origin; + MBase.ColQuote := bbsCfg.ColorQuote; + MBase.ColText := bbsCfg.ColorText; + MBase.ColTear := bbsCfg.ColorTear; + MBase.ColOrigin := bbsCfg.ColorOrigin; + MBase.ColKludge := bbsCfg.ColorKludge; + MBase.Origin := bbsCfg.Origin; MBase.BaseType := INI.ReadInteger(Header_ECHOIMPORT, 'base_type', 0); MBase.ListACS := INI.ReadString (Header_ECHOIMPORT, 'acs_list', ''); MBase.ReadACS := INI.ReadString (Header_ECHOIMPORT, 'acs_read', ''); @@ -203,7 +204,7 @@ Var MBase.NetAddr := 1; For Count := 1 to 30 Do - If bbsConfig.NetAddress[Count].Zone = PKT.PKTHeader.DestZone Then Begin + If bbsCfg.NetAddress[Count].Zone = PKT.PKTHeader.DestZone Then Begin MBase.NetAddr := Count; Break; End; @@ -273,14 +274,14 @@ Var Begin PKTMatched := False; - Assign (NodeFile, bbsConfig.DataPath + 'echonode.dat'); + Assign (NodeFile, bbsCfg.DataPath + 'echonode.dat'); If ioReset(NodeFile, Sizeof(RecEchoMailNode), fmRWDN) Then Begin While Not Eof(NodeFile) Do Begin Read (NodeFile, EchoNode); For Count := 1 to 30 Do Begin - If strUpper(JustFileName(PktBundle)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsConfig.NetAddress[Count])) Then Begin + If strUpper(JustFileName(PktBundle)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsCfg.NetAddress[Count])) Then Begin PKTMatched := True; ArcType := EchoNode.ArcType; @@ -293,7 +294,7 @@ Var End; If Not PKTMatched Then Begin - Case GetArchiveType(bbsConfig.InboundPath + PktBundle) of + Case GetArchiveType(bbsCfg.InboundPath + PktBundle) of 'A' : ArcType := 'ARJ'; 'R' : ArcType := 'RAR'; 'Z' : ArcType := 'ZIP'; @@ -309,7 +310,7 @@ Var ProcessStatus ('Extracting ' + PktBundle, False); - ExecuteArchive (bbsConfig.InboundPath + PktBundle, ArcType, '*', 2); + ExecuteArchive (TempPath, bbsCfg.InboundPath + PktBundle, ArcType, '*', 2); FindFirst (TempPath + '*', AnyFile, DirInfo); @@ -330,7 +331,7 @@ Var If Not PKTFound Then Log (2, '!', ' Unable to extract bundle; skipping') Else - FileErase (bbsConfig.InboundPath + PktBundle); + FileErase (bbsCfg.InboundPath + PktBundle); End; Var @@ -347,7 +348,7 @@ Begin DirClean (TempPath, ''); - If Not DirExists(bbsConfig.InboundPath) Then Begin + If Not DirExists(bbsCfg.InboundPath) Then Begin ProcessStatus ('Inbound directory does not exist', True); ProcessResult (rFATAL, True); @@ -385,14 +386,14 @@ Begin If Not GetMBaseByIndex (DupeIndex, DupeMBase) Then DupeIndex := -1; - FindFirst (bbsConfig.InboundPath + '*', AnyFile, DirInfo); + FindFirst (bbsCfg.InboundPath + '*', AnyFile, DirInfo); While DosError = 0 Do Begin If DirInfo.Attr And Directory = 0 Then Begin FileExt := Copy(strUpper(JustFileExt(DirInfo.Name)), 1, 2); If FileExt = 'PK' Then - ImportPacketFile(bbsConfig.InboundPath + DirInfo.Name) + ImportPacketFile(bbsCfg.InboundPath + DirInfo.Name) Else If (FileExt = 'SU') or (FileExt = 'MO') or diff --git a/mystic/mutil_filesbbs.pas b/mystic/mutil_filesbbs.pas index 0cc62cb..5770e50 100644 --- a/mystic/mutil_filesbbs.pas +++ b/mystic/mutil_filesbbs.pas @@ -14,7 +14,8 @@ Uses m_DateTime, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Procedure uImportFilesBBS; Var @@ -43,9 +44,9 @@ Var Var Count : Byte; Begin - Assign (DescFile, bbsConfig.DataPath + Base.FileName + '.des'); + Assign (DescFile, bbsCfg.DataPath + Base.FileName + '.des'); - If FileExist(bbsConfig.DataPath + Base.FileName + '.des') Then + If FileExist(bbsCfg.DataPath + Base.FileName + '.des') Then Reset (DescFile, 1) Else ReWrite (DescFile, 1); @@ -70,7 +71,7 @@ Var If FSize = -1 Then Exit; - Assign (ListFile, bbsConfig.DataPath + Base.FileName + '.dir'); + Assign (ListFile, bbsCfg.DataPath + Base.FileName + '.dir'); {$I-} Reset(ListFile); {$I+} If IoResult <> 0 Then ReWrite(ListFile); @@ -127,7 +128,7 @@ Begin If DescChar = '' Then DescChar := ' '; - Assign (BaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (BaseFile, bbsCfg.DataPath + 'fbases.dat'); {$I-} Reset (BaseFile); {$I+} If IoResult = 0 Then Begin @@ -157,7 +158,7 @@ Begin DescLines := 1; Desc[1] := strStripB(Copy(OneLine, strWordPos(2, OneLine, ' '), 255), ' '); End Else Begin - If DescLines < bbsConfig.MaxFileDesc Then Begin + If DescLines < bbsCfg.MaxFileDesc Then Begin Inc (DescLines); Desc[DescLines] := strStripB(Copy(OneLine, DescPos, 255), ' '); End; diff --git a/mystic/mutil_importmsgbase.pas b/mystic/mutil_importmsgbase.pas index 9e106de..6df7b0e 100644 --- a/mystic/mutil_importmsgbase.pas +++ b/mystic/mutil_importmsgbase.pas @@ -14,7 +14,8 @@ Uses m_Strings, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Procedure uImportMessageBases; Var @@ -28,7 +29,7 @@ Begin ProcessName ('Import Message Bases', True); ProcessResult (rWORKING, False); - FindFirst (bbsConfig.MsgsPath + '*', AnyFile, Info); + FindFirst (bbsCfg.MsgsPath + '*', AnyFile, Info); While DosError = 0 Do Begin BaseName := JustFileName(Info.Name); @@ -46,14 +47,14 @@ Begin MBase.NewsName := strReplace(BaseName, ' ', '.'); MBase.EchoTag := BaseName; MBase.FileName := BaseName; - MBase.Path := bbsConfig.MsgsPath; + MBase.Path := bbsCfg.MsgsPath; MBase.NetType := INI.ReadInteger(Header_IMPORTMB, 'net_type', 0); - MBase.ColQuote := bbsConfig.ColorQuote; - MBase.ColText := bbsConfig.ColorText; - MBase.ColTear := bbsConfig.ColorTear; - MBase.ColOrigin := bbsConfig.ColorOrigin; - MBase.ColKludge := bbsConfig.ColorKludge; - MBase.Origin := bbsConfig.Origin; + MBase.ColQuote := bbsCfg.ColorQuote; + MBase.ColText := bbsCfg.ColorText; + MBase.ColTear := bbsCfg.ColorTear; + MBase.ColOrigin := bbsCfg.ColorOrigin; + MBase.ColKludge := bbsCfg.ColorKludge; + MBase.Origin := bbsCfg.Origin; MBase.BaseType := Ord(BaseExt = 'SQD'); MBase.ListACS := INI.ReadString(Header_IMPORTMB, 'acs_list', ''); MBase.ReadACS := INI.ReadString(Header_IMPORTMB, 'acs_read', ''); @@ -70,7 +71,7 @@ Begin MBase.NetAddr := 1; For Count := 1 to 30 Do - If strAddr2Str(bbsConfig.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin + If strAddr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin MBase.NetAddr := Count; Break; diff --git a/mystic/mutil_importna.pas b/mystic/mutil_importna.pas index 6c4bdb1..4df886b 100644 --- a/mystic/mutil_importna.pas +++ b/mystic/mutil_importna.pas @@ -12,7 +12,8 @@ Uses m_Strings, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Procedure uImportNA; Var @@ -62,14 +63,14 @@ Begin MBase.NewsName := strReplace(BaseName, ' ', '.'); MBase.EchoTag := TagName; MBase.FileName := TagName; - MBase.Path := bbsConfig.MsgsPath; + MBase.Path := bbsCfg.MsgsPath; MBase.NetType := 1; - MBase.ColQuote := bbsConfig.ColorQuote; - MBase.ColText := bbsConfig.ColorText; - MBase.ColTear := bbsConfig.ColorTear; - MBase.ColOrigin := bbsConfig.ColorOrigin; - MBase.ColKludge := bbsConfig.ColorKludge; - MBase.Origin := bbsConfig.Origin; + MBase.ColQuote := bbsCfg.ColorQuote; + MBase.ColText := bbsCfg.ColorText; + MBase.ColTear := bbsCfg.ColorTear; + MBase.ColOrigin := bbsCfg.ColorOrigin; + MBase.ColKludge := bbsCfg.ColorKludge; + MBase.Origin := bbsCfg.Origin; MBase.BaseType := strS2I(INI.ReadString(Header_IMPORTNA, 'base_format', '0')); MBase.ListACS := INI.ReadString(Header_IMPORTNA, 'acs_list', ''); MBase.ReadACS := INI.ReadString(Header_IMPORTNA, 'acs_read', ''); @@ -86,7 +87,7 @@ Begin MBase.NetAddr := 1; For Count := 1 to 30 Do - If strAddr2Str(bbsConfig.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin + If strAddr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin MBase.NetAddr := Count; Break; End; diff --git a/mystic/mutil_msgpack.pas b/mystic/mutil_msgpack.pas index 824f07c..c66856b 100644 --- a/mystic/mutil_msgpack.pas +++ b/mystic/mutil_msgpack.pas @@ -13,6 +13,7 @@ Uses m_FileIO, mUtil_Common, mUtil_Status, + BBS_DataBase, bbs_MsgBase_ABS, bbs_MsgBase_JAM, bbs_MsgBase_Squish; @@ -248,7 +249,7 @@ Begin ProcessName ('Packing Message Bases', True); ProcessResult (rWORKING, False); - Assign (BaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (BaseFile, bbsCfg.DataPath + 'mbases.dat'); If ioReset (BaseFile, SizeOf(Base), fmRWDN) Then Begin While Not Eof(BaseFile) Do Begin diff --git a/mystic/mutil_msgpurge.pas b/mystic/mutil_msgpurge.pas index 0f363c5..c95df13 100644 --- a/mystic/mutil_msgpurge.pas +++ b/mystic/mutil_msgpurge.pas @@ -14,6 +14,7 @@ Uses mUtil_Common, mUtil_Status, bbs_Records, + BBS_DataBase, bbs_MsgBase_ABS, bbs_MsgBase_JAM, bbs_MsgBase_Squish; @@ -29,7 +30,7 @@ Begin ProcessName ('Purging Message Bases', True); ProcessResult (rWORKING, False); - Assign (BaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (BaseFile, bbsCfg.DataPath + 'mbases.dat'); {$I-} Reset (BaseFile); {$I+} If IoResult = 0 Then Begin diff --git a/mystic/mutil_status.pas b/mystic/mutil_status.pas index b656eac..f23a32c 100644 --- a/mystic/mutil_status.pas +++ b/mystic/mutil_status.pas @@ -26,7 +26,8 @@ Implementation Uses m_Strings, - mutil_Common; + BBS_DataBase, + mUtil_Common; Procedure ProcessName (Str: String; Start: Boolean); Begin diff --git a/mystic/mutil_toplists.pas b/mystic/mutil_toplists.pas index faad854..f06f282 100644 --- a/mystic/mutil_toplists.pas +++ b/mystic/mutil_toplists.pas @@ -14,7 +14,8 @@ Uses m_FileIO, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Type TopListType = (TopCall, TopPost, TopDL, TopUL, TopPCR); @@ -181,7 +182,7 @@ Begin Sort := TQuickSort.Create; - Assign (UserFile, bbsConfig.DataPath + 'users.dat'); + Assign (UserFile, bbsCfg.DataPath + 'users.dat'); If ioReset(UserFile, SizeOf(RecUser), fmRWDN) Then Begin While Not EOF(UserFile) Do Begin diff --git a/mystic/mutil_upload.pas b/mystic/mutil_upload.pas index 49accfd..f71921f 100644 --- a/mystic/mutil_upload.pas +++ b/mystic/mutil_upload.pas @@ -13,7 +13,8 @@ Uses m_DateTime, mUtil_Common, mUtil_Status, - BBS_Records; + BBS_Records, + BBS_DataBase; Procedure uMassUpload; Var @@ -68,7 +69,7 @@ Begin // get the show on the road - Assign (BaseFile, bbsConfig.DataPath + 'fbases.dat'); + Assign (BaseFile, bbsCfg.DataPath + 'fbases.dat'); {$I-} Reset (BaseFile); {$I+} If IoResult = 0 Then Begin @@ -91,9 +92,9 @@ Begin // should technically rename the file like Mystic does if > 70 chars - Assign (ListFile, bbsConfig.DataPath + Base.FileName + '.dir'); + Assign (ListFile, bbsCfg.DataPath + Base.FileName + '.dir'); - If FileExist(bbsConfig.DataPath + Base.FileName + '.dir') Then + If FileExist(bbsCfg.DataPath + Base.FileName + '.dir') Then ioReset (ListFile, SizeOf(RecFileList), fmRWDN) Else ReWrite (ListFile); @@ -135,7 +136,7 @@ Begin If INI.ReadString(Header_UPLOAD, 'import_fileid', '1') = '1' Then Begin - ExecuteArchive (Base.Path + List.FileName, '', 'file_id.diz', 2); + ExecuteArchive (TempPath, Base.Path + List.FileName, '', 'file_id.diz', 2); DizName := FileFind(TempPath + 'file_id.diz'); @@ -153,7 +154,7 @@ Begin If Length(Desc[List.DescLines]) > mysMaxFileDescLen Then Desc[List.DescLines][0] := Chr(mysMaxFileDescLen); - If List.DescLines = bbsConfig.MaxFileDesc Then Break; + If List.DescLines = bbsCfg.MaxFileDesc Then Break; End; Close (DizFile); @@ -174,9 +175,9 @@ Begin Desc[1] := INI.ReadString(Header_UPLOAD, 'no_description', 'No Description'); End; - Assign (DescFile, bbsConfig.DataPath + Base.FileName + '.des'); + Assign (DescFile, bbsCfg.DataPath + Base.FileName + '.des'); - If FileExist(bbsConfig.DataPath + Base.FileName + '.des') Then + If FileExist(bbsCfg.DataPath + Base.FileName + '.des') Then Reset (DescFile, 1) Else ReWrite (DescFile, 1);