From 0a8502afb13f9e3c1520eb2bd3ebf4ba17f035a5 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Sun, 26 Feb 2012 07:45:21 -0500 Subject: [PATCH] Update for filebase record changes --- mdl/m_fileio.pas | 5 +++-- mystic/109to110.pas | 2 ++ mystic/bbs_cfg_filebase.pas | 2 +- mystic/bbs_cfg_groups.pas | 2 -- mystic/install.pas | 4 ++-- mystic/mbbsutil.pas | 20 ++++++++++---------- mystic/mis_client_ftp.pas | 32 ++++++++++++++++---------------- mystic/mystic.pas | 5 +++-- mystic/records.pas | 9 ++++++--- mystic/todo.pas | 1 + 10 files changed, 44 insertions(+), 38 deletions(-) diff --git a/mdl/m_fileio.pas b/mdl/m_fileio.pas index 1fa16ea..ef48be4 100644 --- a/mdl/m_fileio.pas +++ b/mdl/m_fileio.pas @@ -618,7 +618,7 @@ End; Procedure TBufFile.FillBuffer; Begin - System.Seek (BufFile, BufFilePos); + System.Seek (BufFile, BufFilePos); System.BlockRead (BufFile, Buffer^, BufSize, BufTop); IoResult := System.IoResult; @@ -628,8 +628,9 @@ End; Procedure TBufFile.FlushBuffer; Begin - System.Seek (BufFile, BufFilePos); + System.Seek (BufFile, BufFilePos); System.BlockWrite (BufFile, Buffer^, BufTop, BufTop); + IoResult := System.IoResult; // BufPos := 0; diff --git a/mystic/109to110.pas b/mystic/109to110.pas index 8d7a54d..ccdae5d 100644 --- a/mystic/109to110.pas +++ b/mystic/109to110.pas @@ -1083,6 +1083,8 @@ Begin If OldFBase.IsCDROM Then FBase.Flags := FBase.Flags OR FBSlowMedia; If OldFBase.IsFREE Then FBase.Flags := FBase.Flags OR FBFreeFiles; + FBase.Index := 0; // calc this now? + Write (FBaseFile, FBase); End; diff --git a/mystic/bbs_cfg_filebase.pas b/mystic/bbs_cfg_filebase.pas index bcc4e15..05044d7 100644 --- a/mystic/bbs_cfg_filebase.pas +++ b/mystic/bbs_cfg_filebase.pas @@ -122,7 +122,7 @@ Begin List.LoChars := #13#27#47; List.AllowTag := True; -// If FBaseFile.FileSize = 0 Then InsertRecord; + If FBaseFile.FileSize = 0 Then InsertRecord; Box.Open (15, 5, 65, 21); diff --git a/mystic/bbs_cfg_groups.pas b/mystic/bbs_cfg_groups.pas index b78d6e5..aa19915 100644 --- a/mystic/bbs_cfg_groups.pas +++ b/mystic/bbs_cfg_groups.pas @@ -24,8 +24,6 @@ Begin Box := TAnsiMenuBox.Create; Form := TAnsiMenuForm.Create; - Box.Header := ' Group Editor '; - Box.Open (14, 10, 67, 16); VerticalLine (24, 12, 14); diff --git a/mystic/install.pas b/mystic/install.pas index 6f6a0ee..d8092c5 100644 --- a/mystic/install.pas +++ b/mystic/install.pas @@ -393,11 +393,11 @@ Procedure UpdateDataFiles; Var CfgFile : File of RecConfig; MBaseFile : File of MBaseRec; - FBaseFile : File of FBaseRec; + FBaseFile : File of RecFileBase; LangFile : File of LangRec; Cfg : RecConfig; MBase : MBaseRec; - FBase : FBaseRec; + FBase : RecFileBase; TLang : LangRec; TF : Text; Begin diff --git a/mystic/mbbsutil.pas b/mystic/mbbsutil.pas index 3eca466..7d3f86a 100644 --- a/mystic/mbbsutil.pas +++ b/mystic/mbbsutil.pas @@ -197,8 +197,8 @@ End; Procedure Sort_File_Bases; Var SortList : TQuickSort; - FBaseFile : File of FBaseRec; - FBase : FBaseRec; + FBaseFile : File of RecFileBase; + FBase : RecFileBase; FDirFile : File of RecFileList; TFDirFile : File of RecFileList; FDir : RecFileList; @@ -267,8 +267,8 @@ Var FDir : RecFileList; DataFile : File; TDataFile : File; - FBaseFile : File of FBaseRec; - FBase : FBaseRec; + FBaseFile : File of RecFileBase; + FBase : RecFileBase; Begin Write ('Packing File Bases : '); @@ -337,8 +337,8 @@ End; Procedure Check_File_Bases; Var - FBaseFile : File of FBaseRec; - FBase : FBaseRec; + FBaseFile : File of RecFileBase; + FBase : RecFileBase; FDirFile : File of RecFileList; FDir : RecFileList; TFDirFile : File of RecFileList; @@ -648,8 +648,8 @@ Var MBase : MBaseRec; MScanFile : File of MScanRec; MScan : MScanRec; - FBaseFile : File of FBaseRec; - FBase : FBaseRec; + FBaseFile : File of RecFileBase; + FBase : RecFileBase; FScanFile : File of FScanRec; FScan : FScanRec; JamLRFile : File of JamLastType; @@ -925,11 +925,11 @@ Procedure Upload_File_Bases; Const NoDescStr = 'No Description'; Var - BaseFile : File of FBaseRec; + BaseFile : File of RecFileBase; ListFile : File of RecFileList; DescFile : File; DizFile : Text; - Base : FBaseRec; + Base : RecFileBase; List : RecFileList; DirInfo : SearchRec; Found : Boolean; diff --git a/mystic/mis_client_ftp.pas b/mystic/mis_client_ftp.pas index 0376a85..774e01d 100644 --- a/mystic/mis_client_ftp.pas +++ b/mystic/mis_client_ftp.pas @@ -37,7 +37,7 @@ Type User : RecUser; UserPos : LongInt; FBasePos : LongInt; - FBase : FBaseRec; + FBase : RecFileBase; SecLevel : RecSecurity; FileMask : String; @@ -46,12 +46,12 @@ Type Destructor Destroy; Override; Procedure ResetSession; - Procedure UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt); - Function CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte; + Procedure UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt); + Function CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte; Function OpenDataSession : Boolean; Procedure CloseDataSession; - Function ValidDirectory (TempBase: FBaseRec) : Boolean; - Function FindDirectory (Var TempBase: FBaseRec) : LongInt; + Function ValidDirectory (TempBase: RecFileBase) : Boolean; + Function FindDirectory (Var TempBase: RecFileBase) : LongInt; Procedure cmdUSER; Procedure cmdPASS; @@ -129,7 +129,7 @@ Begin InTransfer := False; End; -Procedure TFTPServer.UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt); +Procedure TFTPServer.UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt); Var HistFile: File of HistoryRec; History : HistoryRec; @@ -195,7 +195,7 @@ Begin Close (HistFile); End; -Function TFTPServer.CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte; +Function TFTPServer.CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte; { 0 = OK to download } { 1 = Offline or Invalid or Failed or NO ACCESS or no file (prompt 224)} { 2 = DL per day limit exceeded (prompt 58) } @@ -212,7 +212,7 @@ Begin If (FDir.Flags And FDirInvalid <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLUnvalid) Then Exit; If (FDir.Flags And FDirFailed <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLFailed) Then Exit; - If (FDir.Flags And FDirFree <> 0) or (User.Flags and UserNoRatio <> 0) or (TempFBase.IsFREE) Then Begin + If (FDir.Flags And FDirFree <> 0) or (User.Flags and UserNoRatio <> 0) or (TempFBase.Flags and FBFreeFiles <> 0) Then Begin Result := 0; Exit; End; @@ -293,12 +293,12 @@ Begin End; End; -Function TFTPServer.ValidDirectory (TempBase: FBaseRec) : Boolean; +Function TFTPServer.ValidDirectory (TempBase: RecFileBase) : Boolean; Begin Result := CheckAccess(User, True, TempBase.FtpACS) and (TempBase.FtpName <> ''); End; -Function TFTPServer.FindDirectory (Var TempBase: FBaseRec) : LongInt; +Function TFTPServer.FindDirectory (Var TempBase: RecFileBase) : LongInt; Var FBaseFile : TBufFile; Found : Boolean; @@ -327,7 +327,7 @@ Begin FBaseFile := TBufFile.Create(FileBufSize); - If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(FBaseRec)) Then Begin + If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin Found := False; While Not FBaseFile.EOF Do Begin @@ -449,7 +449,7 @@ End; Procedure TFTPServer.cmdCWD; Var - TempBase : FBaseRec; + TempBase : RecFileBase; TempPos : LongInt; Begin If LoggedIn Then Begin @@ -476,7 +476,7 @@ End; Procedure TFTPServer.cmdNLST; Var - TempBase : FBaseRec; + TempBase : RecFileBase; TempPos : LongInt; DirFile : TBufFile; Dir : RecFileList; @@ -528,7 +528,7 @@ End; Procedure TFTPServer.cmdLIST; Var - TempBase : FBaseRec; + TempBase : RecFileBase; TempPos : LongInt; FBaseFile : TBufFile; DirFile : TBufFile; @@ -542,7 +542,7 @@ Begin FBaseFile := TBufFile.Create(FileBufSize); - If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(FBaseRec)) Then Begin + If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin While Not FBaseFile.EOF Do Begin FBaseFile.Read(TempBase); @@ -585,7 +585,7 @@ End; Procedure TFTPServer.cmdRETR; Var TempPos : LongInt; - TempBase : FBaseRec; + TempBase : RecFileBase; DirFile : TBufFile; Dir : RecFileList; Found : LongInt; diff --git a/mystic/mystic.pas b/mystic/mystic.pas index 53db541..0a26c6c 100644 --- a/mystic/mystic.pas +++ b/mystic/mystic.pas @@ -83,6 +83,7 @@ Begin If ErrorAddr <> NIL Then Begin Session.io.OutFull('|CR|12System Error #' + strI2S(ExitCode)); Session.SystemLog ('ERROR #' + strI2S(ExitCode)); + ExitCode := 1; End; @@ -105,12 +106,14 @@ Begin Reset (Session.EventFile); While Not Eof(Session.EventFile) Do Begin Read (Session.EventFile, Session.Event); + If Session.Event.Name = Session.NextEvent.Name Then Begin Session.Event.LastRan := CurDateDos; Seek (Session.EventFile, FilePos(Session.EventFile) - 1); Write (Session.EventFile, Session.Event); End; End; + Close (Session.EventFile); End; @@ -219,8 +222,6 @@ Begin If IoResult <> 0 Then; {$I+} -{ ----------------------- } - Assign (RoomFile, Config.DataPath + 'chatroom.dat'); {$I-} Reset (RoomFile); {$I+} If IoResult <> 0 Then Begin diff --git a/mystic/records.pas b/mystic/records.pas index c721efe..b718204 100644 --- a/mystic/records.pas +++ b/mystic/records.pas @@ -257,7 +257,7 @@ Const // expand header filename[20] // add template[20] // add msgbase sponser[30] -// add newsname[80] +// add newsname[60] // add colorkludge[b] // add flags[l] merge in useReal // flags: @@ -279,6 +279,7 @@ Const // add script path? // compare to mystic 2 for fallback stuff? // rename to THEME +// help percent bar // horizontal/vertical percent bars Type @@ -448,6 +449,7 @@ Const Type RecFileBase = Record + Index : Word; Name : String[40]; FtpName : String[60]; FileName : String[40]; @@ -459,10 +461,11 @@ Type ULACS : String[30]; CommentACS : String[30]; SysOpACS : String[30]; - Path : String[120]; - Password : String[20]; + Path : String[80]; + Password : String[15]; DefScan : Byte; Flags : LongInt; + Res : Array[1..36] of Byte; End; (* The file directory listing are stored as .DIR in *) diff --git a/mystic/todo.pas b/mystic/todo.pas index 0083a5c..47d10f4 100644 --- a/mystic/todo.pas +++ b/mystic/todo.pas @@ -95,6 +95,7 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES - Default protocol per user - ANSI message upload post processor option: Auto/Disabled/Ask - Prompt for disconect after UL or DL (and add option to filebase settings) +- Finish optional user prompts RANDOM DRUNKEN BRAINDUMP AKA DESIGN DETAILS ===========================================