diff --git a/mystic/bbs_cfg_archive.pas b/mystic/bbs_cfg_archive.pas index b2e0b4b..6ce3a2c 100644 --- a/mystic/bbs_cfg_archive.pas +++ b/mystic/bbs_cfg_archive.pas @@ -51,7 +51,7 @@ Procedure Configuration_ArchiveEditor; Var Box : TAnsiMenuBox; List : TAnsiMenuList; - F : TBufFile; + ArcFile : File of RecArchive; Arc : RecArchive; Copied : RecArchive; HasCopy : Boolean = False; @@ -62,9 +62,10 @@ Var Begin List.Clear; - F.Reset; - While Not F.Eof Do Begin - F.Read (Arc); + ioReset (ArcFile, SizeOf(RecArchive), fmRWDN); + + While Not Eof(ArcFile) Do Begin + Read (ArcFile, Arc); Case Arc.OSType of 0 : OS := 'Windows'; @@ -80,9 +81,11 @@ Var End; Begin - F := TBufFile.Create(SizeOf(RecArchive)); + Assign (ArcFile, Config.DataPath + 'archive.dat'); - F.Open (Config.DataPath + 'archive.dat', fmOpenCreate, fmReadWrite + fmDenyNone, SizeOf(RecArchive)); + If Not ioReset(ArcFile, SizeOf(RecArchive), fmRWDN) Then + If Not ioReWrite(ArcFile, SizeOf(RecArchive), fmRWDN) Then + Exit; Box := TAnsiMenuBox.Create; List := TAnsiMenuList.Create; @@ -108,7 +111,7 @@ Begin Case List.ExitCode of '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : Begin - F.RecordInsert (List.Picked); + AddRecord (ArcFile, List.Picked, SizeOf(RecArchive)); Arc.OSType := OSType; Arc.Active := False; @@ -118,42 +121,42 @@ Begin Arc.Unpack := ''; Arc.View := ''; - F.Write (Arc); + Write (ArcFile, Arc); MakeList; End; 'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin - F.RecordDelete (List.Picked); + KillRecord (ArcFile, List.Picked, SizeOf(RecArchive)); + MakeList; End; 'C' : If List.Picked <> List.ListMax Then Begin - F.Seek (List.Picked - 1); - F.Read (Copied); + Seek (ArcFile, List.Picked - 1); + Read (ArcFile, Copied); HasCopy := True; End; 'P' : If HasCopy Then Begin - F.RecordInsert (List.Picked); - F.Write (Copied); + AddRecord (ArcFile, List.Picked, SizeOf(RecArchive)); + Write (ArcFile, Copied); MakeList; End; End; #13 : If List.Picked <> List.ListMax Then Begin - F.Seek (List.Picked - 1); - F.Read (Arc); + Seek (ArcFile, List.Picked - 1); + Read (ArcFile, Arc); EditArchive(Arc); - F.Seek (List.Picked - 1); - F.Write (Arc); + Seek (ArcFile, List.Picked - 1); + Write (ArcFile, Arc); End; #27 : Break; End; Until False; - F.Close; - F.Free; + Close (ArcFile); Box.Close; List.Free; diff --git a/mystic/bbs_cfg_groups.pas b/mystic/bbs_cfg_groups.pas index 5a1f565..ff200d1 100644 --- a/mystic/bbs_cfg_groups.pas +++ b/mystic/bbs_cfg_groups.pas @@ -43,7 +43,7 @@ Procedure Configuration_GroupEditor (Msg: Boolean); Var Box : TAnsiMenuBox; List : TAnsiMenuList; - GroupFile : TBufFile; + GroupFile : File of RecGroup; Group : RecGroup; Copied : RecGroup; HasCopy : Boolean = False; @@ -52,31 +52,26 @@ Var Begin List.Clear; - GroupFile.Reset; + ioReset (GroupFile, SizeOf(RecGroup), fmRWDN); - While Not GroupFile.EOF Do Begin - GroupFile.Read (Group); + While Not EOF(GroupFile) Do Begin + Read (GroupFile, Group); - List.Add(strPadR(strI2S(GroupFile.FilePos), 3, ' ') + ' ' + strStripPipe(Group.Name), 0); + List.Add(strPadR(strI2S(FilePos(GroupFile)), 3, ' ') + ' ' + strStripPipe(Group.Name), 0); End; List.Add('', 2); End; Begin - GroupFile := TBufFile.Create(2048); + If Msg Then + Assign (GroupFile, Config.DataPath + 'groups_g.dat') + Else + Assign (GroupFile, Config.DataPath + 'groups_f.dat'); - If Msg Then Begin - If Not GroupFile.Open(Config.DataPath + 'groups_g.dat', fmOpenCreate, fmReadWrite + fmDenyNone, SizeOf(RecGroup)) Then Begin - GroupFile.Free; + If Not ioReset(GroupFile, SizeOf(RecGroup), fmRWDN) Then + If Not ioReWrite(GroupFile, SizeOf(RecGroup), fmRWDN) Then Exit; - End; - End Else Begin - If Not GroupFile.Open(Config.DataPath + 'groups_f.dat', fmOpenCreate, fmReadWrite + fmDenyNone, SizeOf(RecGroup)) Then Begin - GroupFile.Free; - Exit; - End; - End; Box := TAnsiMenuBox.Create; List := TAnsiMenuList.Create; @@ -110,56 +105,56 @@ Begin Case List.ExitCode of '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : If List.Picked > 0 Then Begin - GroupFile.RecordInsert (List.Picked); + AddRecord (GroupFile, List.Picked, SizeOf(RecGroup)); Group.Name := 'New Group'; Group.ACS := ''; Group.Hidden := False; - GroupFile.Write (Group); + Write (GroupFile, Group); MakeList; End; 'D' : If (List.Picked < List.ListMax) Then If ShowMsgBox(1, 'Delete this entry?') Then Begin - GroupFile.Seek (List.Picked - 1); - GroupFile.Read (Group); + Seek (GroupFile, List.Picked - 1); + Read (GroupFile, Group); - GroupFile.RecordDelete (List.Picked); + KillRecord (GroupFile, List.Picked, SizeOf(RecGroup)); MakeList; End; 'C' : If List.Picked <> List.ListMax Then Begin - GroupFile.Seek (List.Picked - 1); - GroupFile.Read (Copied); + Seek (GroupFile, List.Picked - 1); + Read (GroupFile, Copied); HasCopy := True; End; 'P' : If HasCopy Then Begin - GroupFile.RecordInsert (List.Picked); - GroupFile.Write (Copied); + AddRecord (GroupFile, List.Picked, SizeOf(RecGroup)); + Write (GroupFile, Copied); MakeList; End; End; #13 : If List.Picked <> List.ListMax Then Begin - GroupFile.Seek (List.Picked - 1); - GroupFile.Read (Group); + Seek (GroupFile, List.Picked - 1); + Read (GroupFile, Group); EditGroup(Group); - GroupFile.Seek (List.Picked - 1); - GroupFile.Write (Group); + Seek (GroupFile, List.Picked - 1); + Write (GroupFile, Group); End; #27 : Break; End; Until False; Box.Close; - - GroupFile.Free; List.Free; Box.Free; + + Close (GroupFile); End; End. diff --git a/mystic/bbs_cfg_protocol.pas b/mystic/bbs_cfg_protocol.pas index 89ca71f..bceaeb2 100644 --- a/mystic/bbs_cfg_protocol.pas +++ b/mystic/bbs_cfg_protocol.pas @@ -49,12 +49,12 @@ End; Procedure Configuration_ProtocolEditor; Var - Box : TAnsiMenuBox; - List : TAnsiMenuList; - F : TBufFile; - Prot : RecProtocol; - Copied : RecProtocol; - HasCopy : Boolean = False; + Box : TAnsiMenuBox; + List : TAnsiMenuList; + ProtFile : File of RecProtocol; + Prot : RecProtocol; + Copied : RecProtocol; + HasCopy : Boolean = False; Procedure MakeList; Var @@ -62,10 +62,10 @@ Var Begin List.Clear; - F.Reset; + ioReset (ProtFile, SizeOf(RecProtocol), fmRWDN); - While Not F.Eof Do Begin - F.Read (Prot); + While Not EOF(ProtFile) Do Begin + Read (ProtFile, Prot); Case Prot.OSType of 0 : OS := 'Windows'; @@ -83,9 +83,11 @@ Var End; Begin - F := TBufFile.Create(SizeOf(RecProtocol)); + Assign (ProtFile, Config.DataPath + 'protocol.dat'); - F.Open (Config.DataPath + 'protocol.dat', fmOpenCreate, fmReadWrite + fmDenyNone, SizeOf(RecProtocol)); + If Not ioReset(ProtFile, SizeOf(RecProtocol), fmRWDN) Then + If Not ioReWrite(ProtFile, SizeOf(RecProtocol), fmRWDN) Then + Exit; Box := TAnsiMenuBox.Create; List := TAnsiMenuList.Create; @@ -111,7 +113,7 @@ Begin Case List.ExitCode of '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : Begin - F.RecordInsert (List.Picked); + AddRecord (ProtFile, List.Picked, SizeOf(RecProtocol)); Prot.OSType := OSType; Prot.Desc := 'New protocol'; @@ -121,44 +123,43 @@ Begin Prot.SendCmd := ''; Prot.RecvCmd := ''; - F.Write (Prot); + Write (ProtFile, Prot); MakeList; End; 'D' : If List.Picked < List.ListMax Then If ShowMsgBox(1, 'Delete this entry?') Then Begin - F.RecordDelete (List.Picked); + KillRecord (ProtFile, List.Picked, SizeOf(RecProtocol)); MakeList; End; 'C' : If List.Picked <> List.ListMax Then Begin - F.Seek (List.Picked - 1); - F.Read (Copied); + Seek (ProtFile, List.Picked - 1); + Read (ProtFile, Copied); HasCopy := True; End; 'P' : If HasCopy Then Begin - F.RecordInsert (List.Picked); - F.Write (Copied); + AddRecord (ProtFile, List.Picked, SizeOf(RecProtocol)); + Write (ProtFile, Copied); MakeList; End; End; #13 : If List.Picked <> List.ListMax Then Begin - F.Seek (List.Picked - 1); - F.Read (Prot); + Seek (ProtFile, List.Picked - 1); + Read (ProtFile, Prot); EditProtocol(Prot); - F.Seek (List.Picked - 1); - F.Write (Prot); + Seek (ProtFile, List.Picked - 1); + Write (ProtFile, Prot); End; #27 : Break; End; Until False; - F.Close; - F.Free; + Close (ProtFile); Box.Close; List.Free; diff --git a/mystic/bbs_cfg_theme.pas b/mystic/bbs_cfg_theme.pas index 6f14210..45d34b6 100644 --- a/mystic/bbs_cfg_theme.pas +++ b/mystic/bbs_cfg_theme.pas @@ -734,17 +734,16 @@ Function Configuration_ThemeEditor (Select: Boolean) : String; Var Box : TAnsiMenuBox; List : TAnsiMenuList; - ThemeFile : TBufFile; + ThemeFile : File of RecTheme; Theme : RecTheme; Copied : RecTheme; HasCopy : Boolean = False; Begin - ThemeFile := TBufFile.Create(SizeOf(RecTheme)); + Assign (ThemeFile, Config.DataPath + 'theme.dat'); - If Not ThemeFile.Open(Config.DataPath + 'theme.dat', fmOpenCreate, fmReadWrite + fmDenyNone, SizeOf(RecTheme)) Then Begin - ThemeFile.Free; - Exit; - End; + If Not ioReset(ThemeFile, Sizeof(RecTheme), fmRWDN) Then + If Not ioReWrite(ThemeFile, SizeOf(RecTheme), fmRWDN) Then + Exit; Box := TAnsiMenuBox.Create; List := TAnsiMenuList.Create; @@ -764,10 +763,10 @@ Begin Repeat List.Clear; - ThemeFile.Reset; + Reset(ThemeFile); - While Not ThemeFile.EOF Do Begin - ThemeFile.Read(Theme); + While Not EOF(ThemeFile) Do Begin + Read (ThemeFile, Theme); List.Add (strPadR(Theme.FileName, 20, ' ') + ' ' + Theme.Desc, 0); End; @@ -780,7 +779,7 @@ Begin Case List.ExitCode of '/' : Case GetCommandOption(9, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : Begin - ThemeFile.RecordInsert(List.Picked); + AddRecord (ThemeFile, List.Picked, SizeOf(RecTheme)); FillChar(Theme, SizeOf(Theme), 0); @@ -837,26 +836,26 @@ Begin MAreaList := VotingBar; End; - ThemeFile.Write(Theme); + Write (ThemeFile, Theme); End; 'D' : If List.Picked <> List.ListMax Then If ShowMsgBox(1, 'Delete this entry?') Then - ThemeFile.RecordDelete (List.Picked); + KillRecord (ThemeFile, List.Picked, SizeOf(RecTheme)); 'C' : If List.Picked <> List.ListMax Then Begin - ThemeFile.Seek (List.Picked - 1); - ThemeFile.Read (Copied); + Seek (ThemeFile, List.Picked - 1); + Read (ThemeFile, Copied); HasCopy := True; End; 'P' : If HasCopy Then Begin - ThemeFile.RecordInsert (List.Picked); - ThemeFile.Write (Copied); + AddRecord (ThemeFile, List.Picked, SizeOf(RecTheme)); + Write (ThemeFile, Copied); End; End; #13 : If (List.ListMax > 0) And (List.Picked <> List.ListMax) Then If Select Then Begin - ThemeFile.Seek (List.Picked - 1); - ThemeFile.Read (Theme); + Seek (ThemeFile, List.Picked - 1); + Read (ThemeFile, Theme); Result := strStripB(Copy(List.List[List.Picked]^.Name, 1, 20), ' '); @@ -864,24 +863,26 @@ Begin End Else Begin Box.Hide; - ThemeFile.Seek (List.Picked - 1); - ThemeFile.Read (Theme); + Seek (ThemeFile, List.Picked - 1); + Read (ThemeFile, Theme); EditTheme (Theme); - ThemeFile.Seek (List.Picked - 1); - ThemeFile.Write (Theme); + Seek (ThemeFile, List.Picked - 1); + Write (ThemeFile, Theme); Box.Show; End; #27 : Break; End; + Until False; + Close (ThemeFile); + Box.Close; Box.Free; List.Free; - ThemeFile.Free; End; End. diff --git a/mystic/bbs_cfg_useredit.pas b/mystic/bbs_cfg_useredit.pas index 2856b90..b16825b 100644 --- a/mystic/bbs_cfg_useredit.pas +++ b/mystic/bbs_cfg_useredit.pas @@ -253,17 +253,17 @@ Procedure Configuration_UserEditor; Var Box : TAnsiMenuBox; List : TAnsiMenuList; - UserFile : TBufFile; + UserFile : File of RecUser; User : RecUser; Procedure MakeList; Begin List.Clear; - UserFile.Reset; + ioReset (UserFile, SizeOf(RecUser), fmRWDN); - While Not UserFile.EOF Do Begin - UserFile.Read (User); + While Not EOF(UserFile) Do Begin + Read (UserFile, User); If User.Flags AND UserDeleted <> 0 Then List.Add (strPadR(User.Handle, 37, ' ') + 'DELETED', 0) @@ -275,12 +275,12 @@ Var End; Begin - UserFile := TBufFile.Create(8192); + Assign (UserFile, Config.DataPath + 'users.dat'); - If Not UserFile.Open(Config.DataPath + 'users.dat', fmOpenCreate, fmRWDN, SizeOf(RecUser)) Then Begin - UserFile.Free; - Exit; - End; + If Not ioReset(UserFile, SizeOf(RecUser), fmRWDN) Then + If (FileExist(Config.DataPath + 'users.dat')) OR NOT + (ioReWrite(UserFile, SizeOf(RecUser), fmRWDN)) Then + Exit; Box := TAnsiMenuBox.Create; List := TAnsiMenuList.Create; @@ -303,21 +303,21 @@ Begin Case List.ExitCode of #13 : If List.ListMax <> 0 Then Begin - UserFile.Seek (List.Picked - 1); - UserFile.Read (User); + Seek (UserFile, List.Picked - 1); + Read (UserFile, User); Configuration_EditUser(User); - UserFile.Seek (List.Picked - 1); - UserFile.Write (User); + Seek (UserFile, List.Picked - 1); + Write (UserFile, User); End; #27 : Break; End; Until False; - Box.Close; + Close (UserFile); - UserFile.Free; + Box.Close; List.Free; Box.Free; End; diff --git a/mystic/bbs_filebase.pas b/mystic/bbs_filebase.pas index 7082d91..e05b994 100644 --- a/mystic/bbs_filebase.pas +++ b/mystic/bbs_filebase.pas @@ -26,6 +26,8 @@ Uses AView, {$IFDEF USEALTPROT} m_Prot_Base, +// m_Prot_Xmodem, +// m_Prot_Ymodem, m_Prot_Zmodem; {$ELSE} m_Protocol_Queue, @@ -297,6 +299,13 @@ Var Command := strStripB(strUpper(Command), ' '); +// If Command = '@XMODEM' Then +// Protocol := New(XmodemProtocolPTR, Init(Client, False, False, 0)) +// Else +// If Command = '@YMODEM' Then +// Protocol := New(YmodemProtocolPTR, Init(Client, False, False, 0)) +// Else + If Command = '@ZMODEM' Then Protocol := New(ZmodemProtocolPTR, Init(Client, False)) Else @@ -2400,6 +2409,7 @@ Var Session.io.PromptInfo[3] := strI2S(FDir.Downloads); Session.io.PromptInfo[4] := Str; Session.io.PromptInfo[5] := FDir.Uploader; + Session.io.PromptInfo[6] := strI2S(FDir.Downloads); OK := ShowText(strDesc); End Else Begin diff --git a/mystic/bbs_general.pas b/mystic/bbs_general.pas index 12478b5..92fced0 100644 --- a/mystic/bbs_general.pas +++ b/mystic/bbs_general.pas @@ -60,11 +60,11 @@ Var Begin Editor := TEditorANSI.Create(Pointer(Session), Template); + Editor.Subject := Subj; + For Count := 1 to Lines Do Editor.SetLineText (Count, Session.Msgs.MsgText[Count]); - Editor.Subject := Subj; - Result := Editor.Edit; Subj := Editor.Subject; diff --git a/mystic/bbs_io.pas b/mystic/bbs_io.pas index 332021d..120c408 100644 --- a/mystic/bbs_io.pas +++ b/mystic/bbs_io.pas @@ -1261,10 +1261,18 @@ Begin If BufPos MOD BaudEmulator = 0 Then WaitMS(6); End; +(* + If AllowAbort And (BufPos MOD 128 = 0) Then + If InKey(0) = #32 Then Begin + AnsiColor(7); + Break; + End; + If AllowAbort And (InKey(0) = #32) Then Begin AnsiColor(7); Break; End; +*) Case Ch of #10 : Begin @@ -2136,9 +2144,9 @@ Var FillSize : Byte; Attr : Byte; Begin - Attr := Screen.TextAttr; +// Attr := Screen.TextAttr; -// Screen.TextAttr := 0; // kludge to force it to return full ansi codes + Screen.TextAttr := 0; // kludge to force it to return full ansi codes If Part > Whole Then Part := Whole; diff --git a/mystic/bbs_msgbase.pas b/mystic/bbs_msgbase.pas index b31abf1..4b58296 100644 --- a/mystic/bbs_msgbase.pas +++ b/mystic/bbs_msgbase.pas @@ -383,7 +383,7 @@ Begin If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; While Not Eof(F) Do Begin - ioRead(F, TempBase); + ioRead (F, TempBase); If TempBase.Index = Num Then Begin Result := True; @@ -1179,6 +1179,7 @@ Var Total : LongInt; ReplyBase : RecMessageBase; IsPrivate : Boolean; + IsIgnore : Boolean; Begin ReplyBase := MBase; @@ -1192,10 +1193,14 @@ Begin Else Session.io.OutFull(Session.GetPrompt(510)); - Case Session.io.OneKey (#13#27 + 'QBNE', True) of + Case Session.io.OneKey (#13#27 + 'QBE', True) of 'Q', #27 : Exit; 'B' : Begin + IsIgnore := Session.User.IgnoreGroup; + + Session.User.IgnoreGroup := True; + Total := ListAreas(Config.MCompress); Repeat @@ -1203,15 +1208,24 @@ Begin Case Session.io.OneKeyRange(#13 + '?Q', 1, Total) of #13, - 'Q': Exit; + 'Q': Begin + Session.User.IgnoreGroup := IsIgnore; + + Exit; + End; '?': Total := ListAreas(Config.MCompress); Else Break; End; Until False; - If Not GetBaseCompressed(Session.io.RangeValue, ReplyBase) Then + If Not GetBaseCompressed(Session.io.RangeValue, ReplyBase) Then Begin + Session.User.IgnoreGroup := IsIgnore; + Exit; + End; + + Session.User.IgnoreGroup := IsIgnore; End; 'E' : Begin Reset (MBaseFile); @@ -1571,8 +1585,11 @@ Var MsgNew : PMsgBaseABS; Str : String; Addr : RecEchoMailAddr; + Ignore : Boolean; Begin - Result := False; + Result := False; + Ignore := Session.User.IgnoreGroup; + Session.User.IgnoreGroup := True; Repeat @@ -1646,7 +1663,7 @@ Var End; Until False; - Session.User.IgnoreGroup := False; + Session.User.IgnoreGroup := Ignore; End; Procedure ExportMessage; @@ -4341,17 +4358,7 @@ Begin Session.io.OutFullLn (Session.GetPrompt(235)); End Else Begin -// Session.SystemLog('DEBUG: Arc QWK: Nonlocal mode'); - Session.FileBase.ExecuteArchive (Session.TempPath + Temp, Session.User.ThisUser.Archive, Session.TempPath + '*', 1); - -// If FileExist(Session.TempPath + Temp) Then -// Session.SystemLog('DEBUG: QWK successfully archived') -// Else -// Session.SystemLog('DEBUG: Could not find QWK archived packet'); - -// Session.SystemLog('DEBUG: QWK calling SendFile on "' + Temp + '"'); - Session.FileBase.SendFile (Session.TempPath + Temp); End; diff --git a/mystic/default.txt b/mystic/default.txt index ada8773..47558ad 100644 --- a/mystic/default.txt +++ b/mystic/default.txt @@ -868,6 +868,7 @@ 451 |CR|09Subject: |XX ; standard quote header 452 |15Quote mode: Select a range of text to quote|CR +; node chat: show users in chat footer 453 |09|$D77Ä|CR|PA ; no history data 454 |CR|12No history data available.|CR|CR|PA diff --git a/mystic/mbbsutil.pas b/mystic/mbbsutil.pas index f66f7c5..d62bb36 100644 --- a/mystic/mbbsutil.pas +++ b/mystic/mbbsutil.pas @@ -868,7 +868,7 @@ End; Procedure ExportAreasBBS; Var - MBaseFile : TBufFile; + MBaseFile : TFileBuffer; MBase : RecMessageBase; OutFile : Text; Begin @@ -879,13 +879,13 @@ Begin If IoResult <> 0 Then Exit; - MBaseFile := TBufFile.Create(8192); + MBaseFile := TFileBuffer.Create(8192); - If MBaseFile.Open(Config.DataPath + 'mbases.dat', fmOpen, fmRWDN, SizeOf(RecMessageBase)) Then Begin - MBaseFile.Read(MBase); + If MBaseFile.OpenStream (Config.DataPath + 'mbases.dat', fmOpen, fmRWDN) Then Begin + MBaseFile.BlockRead (MBase, SizeOf(MBase)); While Not MBaseFile.EOF Do Begin - MBaseFile.Read(MBase); + MBaseFile.BlockRead (MBase, SizeOf(MBase)); Update_Bar (MBaseFile.FilePos, MBaseFile.FileSize); Update_Status (strStripPipe(MBase.Name)); diff --git a/mystic/mis.pas b/mystic/mis.pas index f052a6f..3b03613 100644 --- a/mystic/mis.pas +++ b/mystic/mis.pas @@ -76,17 +76,17 @@ Var Procedure ReadConfiguration; Var - FileConfig : TBufFile; + FileConfig : TFileBuffer; DatLoc : String; Begin - FileConfig := TBufFile.Create(SizeOf(RecConfig)); + FileConfig := TFileBuffer.Create(SizeOf(RecConfig)); - If Not FileConfig.Open('mystic.dat', fmOpen, fmReadWrite + fmDenyNone, SizeOf(RecConfig)) Then Begin + If Not FileConfig.OpenStream ('mystic.dat', fmOpen, fmRWDN) Then Begin DatLoc := GetEnv('mysticbbs'); If DatLoc <> '' Then DatLoc := DirSlash(DatLoc); - If Not FileConfig.Open(DatLoc + 'mystic.dat', fmOpen, fmReadWrite + fmDenyNone, SizeOf(RecConfig)) Then Begin + If Not FileConfig.OpenStream (DatLoc + 'mystic.dat', fmOpen, fmRWDN) Then Begin If Not DaemonMode Then Begin Console.WriteLine (#13#10 + 'ERROR: Unable to read MYSTIC.DAT. This file must exist in the same'); Console.WriteLine ('directory as MIS'); @@ -101,7 +101,7 @@ Begin End; End; - FileConfig.Read(bbsConfig); + FileConfig.BlockRead (bbsConfig, SizeOf(bbsConfig)); FileConfig.Free; If bbsConfig.DataChanged <> mysDataChanged Then Begin diff --git a/mystic/mis_client_ftp.pas b/mystic/mis_client_ftp.pas index 8d26b0c..7859e68 100644 --- a/mystic/mis_client_ftp.pas +++ b/mystic/mis_client_ftp.pas @@ -323,7 +323,7 @@ End; Function TFTPServer.FindDirectory (Var TempBase: RecFileBase) : LongInt; Var - FBaseFile : TBufFile; + FBaseFile : TFileBuffer; Found : Boolean; Begin Result := FBasePos; @@ -348,13 +348,13 @@ Begin If Data = '' Then Exit; - FBaseFile := TBufFile.Create(FileBufSize); + FBaseFile := TFileBuffer.Create(FileBufSize); - If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin + If FBaseFile.OpenStream (bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN) Then Begin Found := False; While Not FBaseFile.EOF Do Begin - FBaseFile.Read(TempBase); + FBaseFile.BlockRead(TempBase, SizeOf(TempBase)); If (strUpper(TempBase.FtpName) = strUpper(Data)) and ValidDirectory(TempBase) Then Begin Result := FBaseFile.FilePos; @@ -520,7 +520,7 @@ Procedure TFTPServer.cmdNLST; Var TempBase : RecFileBase; TempPos : LongInt; - DirFile : TBufFile; + DirFile : TFileBuffer; Dir : RecFileList; Begin If LoggedIn Then Begin @@ -535,11 +535,11 @@ Begin OpenDataSession; - DirFile := TBufFile.Create(FileBufSize); + DirFile := TFileBuffer.Create(FileBufSize); - If DirFile.Open(bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN, SizeOf(RecFileList)) Then Begin + If DirFile.OpenStream (bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN) Then Begin While Not DirFile.EOF Do Begin - DirFile.Read(Dir); + DirFile.BlockRead(Dir, SizeOf(RecFileList)); If (Dir.Flags And FDirDeleted <> 0) Then Continue; If (Dir.Flags And FDirInvalid <> 0) And (Not CheckAccess(User, True, bbsConfig.AcsSeeUnvalid)) Then Continue; @@ -572,8 +572,8 @@ Procedure TFTPServer.cmdLIST; Var TempBase : RecFileBase; TempPos : LongInt; - FBaseFile : TBufFile; - DirFile : TBufFile; + FBaseFile : TFileBuffer; + DirFile : TFileBuffer; Dir : RecFileList; Begin {$IFDEF FTPDEBUG} LOG('LIST Calling FindDirectory'); {$ENDIF} @@ -590,11 +590,11 @@ Begin {$IFDEF FTPDEBUG} LOG('Back from data session'); {$ENDIF} - FBaseFile := TBufFile.Create(FileBufSize); + FBaseFile := TFileBuffer.Create(FileBufSize); - If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin + If FBaseFile.OpenStream (bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN) Then Begin While Not FBaseFile.EOF Do Begin - FBaseFile.Read(TempBase); + FBaseFile.BlockRead(TempBase, SizeOf(RecFileBase)); If ValidDirectory(TempBase) and WildMatch(FileMask, TempBase.FtpName, False) Then DataSocket.WriteLine('drwxr-xr-x 1 ftp ftp 0 Jul 11 23:35 ' + TempBase.FtpName) @@ -610,11 +610,11 @@ Begin OpenDataSession; - DirFile := TBufFile.Create(FileBufSize); + DirFile := TFileBuffer.Create(FileBufSize); - If DirFile.Open(bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN, SizeOf(RecFileList)) Then Begin + If DirFile.OpenStream (bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN) Then Begin While Not DirFile.EOF Do Begin - DirFile.Read(Dir); + DirFile.BlockRead(Dir, SizeOf(RecFileList)); If (Dir.Flags And FDirDeleted <> 0) Then Continue; If (Dir.Flags and FDirOffline <> 0) And (Not CheckAccess(User, True, bbsConfig.AcsSeeOffline)) Then Continue; @@ -637,7 +637,7 @@ Procedure TFTPServer.cmdRETR; Var TempPos : LongInt; TempBase : RecFileBase; - DirFile : TBufFile; + DirFile : TFileBuffer; Dir : RecFileList; Found : LongInt; F : File; @@ -653,12 +653,12 @@ Begin Exit; End; - DirFile := TBufFile.Create(FileBufSize); + DirFile := TFileBuffer.Create(FileBufSize); Found := -1; - If DirFile.Open(bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN, SizeOf(RecFileList)) Then Begin + If DirFile.OpenStream (bbsConfig.DataPath + TempBase.FileName + '.dir', fmOpenCreate, fmRWDN) Then Begin While Not DirFile.EOF Do Begin - DirFile.Read(Dir); + DirFile.BlockRead (Dir, SizeOf(RecFileList)); If WildMatch(FileMask, Dir.FileName, False) Then Begin Found := DirFile.FilePos; diff --git a/mystic/mis_client_nntp.pas b/mystic/mis_client_nntp.pas index d189916..e42a2d0 100644 --- a/mystic/mis_client_nntp.pas +++ b/mystic/mis_client_nntp.pas @@ -155,7 +155,7 @@ End; Procedure TNNTPServer.cmd_GROUP; Var - MBaseFile : TBufFile; + MBaseFile : TFileBuffer; TempBase : RecMessageBase; MsgBase : PMsgBaseABS; Active : LongInt = 0; @@ -168,13 +168,13 @@ Begin Exit; End; - MBaseFile := TBufFile.Create(FileReadBuffer); + MBaseFile := TFileBuffer.Create(FileReadBuffer); - If MBaseFile.Open(bbsConfig.DataPath + 'mbases.dat', fmOpen, fmRWDN, SizeOf(RecMessageBase)) Then Begin - MBaseFile.Read(TempBase); + If MBaseFile.OpenStream (bbsConfig.DataPath + 'mbases.dat', fmOpen, fmRWDN) Then Begin + MBaseFile.BlockRead(TempBase, SizeOf(TempBase)); While Not MBaseFile.EOF Do Begin - MBaseFile.Read(TempBase); + MBaseFile.BlockRead(TempBase, SizeOf(TempBase)); If (TempBase.NewsName = Data) and CheckAccess(User, True, TempBase.ReadACS) Then Begin Found := True; @@ -214,7 +214,7 @@ End; Procedure TNNTPServer.cmd_LIST; Var - MBaseFile : TBufFile; + MBaseFile : TFileBuffer; TempBase : RecMessageBase; MsgBase : PMsgBaseABS; LowMessage : LongInt; @@ -241,13 +241,13 @@ Begin Exit; End; - MBaseFile := TBufFile.Create(FileReadBuffer); + MBaseFile := TFileBuffer.Create(FileReadBuffer); - If MBaseFile.Open(bbsConfig.DataPath + 'mbases.dat', fmOpen, fmRWDN, SizeOf(RecMessageBase)) Then Begin - MBaseFile.Read(TempBase); + If MBaseFile.OpenStream (bbsConfig.DataPath + 'mbases.dat', fmOpen, fmRWDN) Then Begin + MBaseFile.BlockRead(TempBase, SizeOf(TempBase)); While Not MBaseFile.EOF Do Begin - MBaseFile.Read(TempBase); + MBaseFile.BlockRead(TempBase, SizeOf(TempBase)); If TempBase.NewsName = '' Then Continue; diff --git a/mystic/mis_client_telnet.pas b/mystic/mis_client_telnet.pas index 9affea7..ece589a 100644 --- a/mystic/mis_client_telnet.pas +++ b/mystic/mis_client_telnet.pas @@ -4,12 +4,14 @@ Unit MIS_Client_Telnet; Interface -{$IFDEF LINUX} - {$IFDEF CPU32} - {$LinkLib libutil.a} - {$ENDIF} - {$IFDEF CPU64} - {$LinkLib libutil.a} +{$IFNDEF CPUARM} + {$IFDEF LINUX} + {$IFDEF CPU32} + {$LinkLib libutil.a} + {$ENDIF} + {$IFDEF CPU64} + {$LinkLib libutil.a} + {$ENDIF} {$ENDIF} {$ENDIF} diff --git a/mystic/mis_common.pas b/mystic/mis_common.pas index 9b94d73..7fcac9b 100644 --- a/mystic/mis_common.pas +++ b/mystic/mis_common.pas @@ -29,18 +29,18 @@ Uses Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt) : Boolean; Var - UserFile : TBufFile; + UserFile : TFileBuffer; Begin Result := False; UN := strUpper(UN); If UN = '' Then Exit; - UserFile := TBufFile.Create(4096); + UserFile := TFileBuffer.Create (8 * 1024); - If UserFile.Open(bbsConfig.DataPath + 'users.dat', fmOpen, fmRWDN, SizeOf(RecUser)) Then + If UserFile.OpenStream (bbsConfig.DataPath + 'users.dat', fmOpen, fmRWDN) Then While Not UserFile.EOF Do Begin - UserFile.Read(Rec); + UserFile.BlockRead(Rec, SizeOf(Rec)); If Rec.Flags AND UserDeleted <> 0 Then Continue; diff --git a/mystic/mpl_compile.pas b/mystic/mpl_compile.pas index b5440e8..24fe011 100644 --- a/mystic/mpl_compile.pas +++ b/mystic/mpl_compile.pas @@ -7,8 +7,7 @@ Interface Uses DOS, m_Strings, - m_FileIO, - MPL_FileIO; + m_FileIO; {$DEFINE MPLPARSER} @@ -39,7 +38,7 @@ Type TParserUpdateProc = Procedure (Mode: TParserUpdateInfo); TParserSourceFile = Record - DataFile : TCharFile; + DataFile : TFileBuffer; Position : LongInt; PosSaved : LongInt; Size : LongInt; @@ -272,7 +271,7 @@ Begin UpdateInfo.ErrorLine := 1; UpdateInfo.ErrorCol := 0; - If InFile[CurFile].DataFile.Opened Then Begin + If Assigned(InFile[CurFile].DataFile) And InFile[CurFile].DataFile.IsOpened Then Begin InFile[CurFile].DataFile.Seek(0); While Not InFile[CurFile].DataFile.EOF And (InFile[CurFile].DataFile.FilePos < InFile[CurFile].Position) Do Begin @@ -2829,10 +2828,11 @@ Begin Else UpdateStatus(StatusInclude); - InFile[CurFile].DataFile.Init(4096); + InFile[CurFile].DataFile := TFileBuffer.Create(8 * 1024); - If Not InFile[CurFile].DataFile.Open(FN) Then Begin - InFile[CurFile].DataFile.Done; + If Not InFile[CurFile].DataFile.OpenStream(FN, fmOpen, fmRWDN) Then Begin + InFile[CurFile].DataFile.Free; + InFile[CurFile].DataFile := NIL; Error (mpsFileNotFound, FN); @@ -2851,8 +2851,8 @@ Begin If (UpdateInfo.ErrorType = 0) Then UpdateStatus(StatusUpdate); - InFile[CurFile].DataFile.Close; - InFile[CurFile].DataFile.Done; + InFile[CurFile].DataFile.Free; + InFile[CurFile].DataFile := NIL; Dec(CurFile); End; @@ -2887,12 +2887,8 @@ Begin CloseSourceFile; - For Count := 1 to CurFile Do Begin - InFile[Count].DataFile.Close; - InFile[Count].DataFile.Done; - - If IoResult <> 0 Then ; - End; + For Count := 1 to CurFile Do + InFile[Count].DataFile.Free; UpdateStatus(StatusDone); diff --git a/mystic/mpl_execute.pas b/mystic/mpl_execute.pas index 76a5876..7ede605 100644 --- a/mystic/mpl_execute.pas +++ b/mystic/mpl_execute.pas @@ -6,7 +6,7 @@ Interface Uses DOS, - MPL_FileIO, + m_FileIO, BBS_Common; {$I MPL_TYPES.PAS} @@ -19,7 +19,7 @@ Type Owner : Pointer; ErrStr : String; ErrNum : Byte; - DataFile : PCharFile; + DataFile : TFileBuffer; CurVarNum : Word; CurVarID : Word; VarData : VarDataRec; @@ -119,7 +119,6 @@ Uses m_Strings, m_DateTime, m_Types, - m_FileIO, BBS_Core, BBS_IO, BBS_General, @@ -395,24 +394,24 @@ End; Procedure TInterpEngine.MoveToPos (Num: LongInt); Begin - DataFile^.Seek (Num + mplVerLength); + DataFile.Seek (Num + mplVerLength); End; Function TInterpEngine.CurFilePos : LongInt; Begin - Result := DataFile^.FilePos - mplVerLength; + Result := DataFile.FilePos - mplVerLength; End; Procedure TInterpEngine.NextChar; Begin - Ch := DataFile^.Read; + Ch := DataFile.Read; End; Procedure TInterpEngine.NextWord; Var Res : LongInt; Begin - DataFile^.BlockRead (W, 2, Res); + DataFile.BlockRead (W, 2, Res); End; Procedure TInterpEngine.PrevChar; @@ -695,7 +694,7 @@ Begin opOpenString : Begin NextChar; Result[0] := Ch; - DataFile^.BlockRead (Result[1], Byte(Ch), Res); + DataFile.BlockRead (Result[1], Byte(Ch), Res); End; opProcExec : Case ExecuteProcedure(@Result) of iChar : Begin // convert to string if its a char @@ -2314,7 +2313,7 @@ Begin Else Error (mpxUnknownOp, strI2S(Ord(Ch))); End; - Until (ErrNum <> 0) or Done or DataFile^.EOF; + Until (ErrNum <> 0) or Done or DataFile.EOF; {$IFDEF LOGGING} Session.SystemLog('[' + strI2S(Depth) + '] ExecBlock KILL VAR: ' + strI2S(CurVarNum) + ' to ' + strI2S(StartVar + 1)); @@ -2366,7 +2365,7 @@ Begin SavedMCI := Session.io.AllowMCI; SavedGroup := Session.User.IgnoreGroup; SavedArrow := Session.io.AllowArrow; - DataFile := New(PCharFile, Init(mplExecuteBuffer)); + DataFile := TFileBuffer.Create(mplExecuteBuffer); Session.io.AllowArrow := True; @@ -2387,31 +2386,29 @@ Begin MPEName := FN; - If Not DataFile^.Open(FN) Then Begin - Dispose(DataFile, Done); + If Not DataFile.OpenStream(FN, fmOpen, fmRWDN) Then Begin + DataFile.Free; Exit; End; Result := 1; - If DataFile^.FileSize < mplVerLength Then Begin - DataFile^.Close; + If DataFile.FileSize < mplVerLength Then Begin + DataFile.Free; - Error (mpxInvalidFile, FN); - Dispose (DataFile, Done); + Error (mpxInvalidFile, FN); Exit; End; - DataFile^.BlockRead (VerStr[1], mplVerLength, Res); + DataFile.BlockRead (VerStr[1], mplVerLength, Res); VerStr[0] := Chr(mplVerLength); If VerStr <> mplVersion Then Begin - DataFile^.Close; + DataFile.Free; - Error (mpxVerMismatch, VerStr); - Dispose (DataFile, Done); + Error (mpxVerMismatch, VerStr); Exit; End; @@ -2419,9 +2416,7 @@ Begin InitProcedures (Owner, Self, VarData, CurVarNum, CurVarID, 0); ExecuteBlock (CurVarNum); - DataFile^.Close; - - Dispose(DataFile, Done); + DataFile.Free; Session.io.AllowMCI := SavedMCI; Session.User.IgnoreGroup := SavedGroup; diff --git a/mystic/mutil_echocore.pas b/mystic/mutil_echocore.pas index 39251fb..d6e011e 100644 --- a/mystic/mutil_echocore.pas +++ b/mystic/mutil_echocore.pas @@ -9,7 +9,6 @@ Uses m_FileIO, m_Strings, m_DateTime, - MPL_FileIO, BBS_Common, mUtil_Common; @@ -96,7 +95,7 @@ Type Orig : RecEchoMailAddr; Dest : RecEchoMailAddr; MsgHdr : RecPKTMessageHdr; - MsgFile : PCharFile; + MsgFile : TFileBuffer; MsgTo : String[50]; MsgFrom : String[50]; MsgSubj : String[80]; @@ -194,16 +193,13 @@ Constructor TPKTReader.Create; Begin Opened := False; MsgLines := 0; - MsgFile := New (PCharFile, Init(1024 * 16)); + MsgFile := TFileBuffer.Create(16 * 1024); End; Destructor TPKTReader.Destroy; Begin DisposeText; - - If MsgFile.Opened Then MsgFile.Close; - - Dispose (MsgFile, Done); + MsgFile.Free; Inherited Destroy; End; @@ -222,7 +218,7 @@ Procedure TPKTReader.Close; Begin DisposeText; - If MsgFile.Opened Then MsgFile.Close; + If MsgFile.IsOpened Then MsgFile.CloseStream; End; Function TPKTReader.Open (FN: String) : Boolean; @@ -231,12 +227,12 @@ Var Begin Result := False; - If Not MsgFile.Open(FN) Then Exit; + If Not MsgFile.OpenStream (FN, fmOpen, fmRWDN) Then Exit; MsgFile.BlockRead (PKTHeader, SizeOf(PKTHeader), Res); If (Res <> SizeOf(PKTHeader)) or (PKTHeader.PKTType <> $0002) Then Begin - MsgFile.Close; + MsgFile.CloseStream; Opened := False; End Else Begin diff --git a/mystic/mutil_msgpack.pas b/mystic/mutil_msgpack.pas index fed3461..48b0320 100644 --- a/mystic/mutil_msgpack.pas +++ b/mystic/mutil_msgpack.pas @@ -27,19 +27,20 @@ Type End; Var - LinkFile : TBufFile; + LinkFile : TFileBuffer; BaseKills : Cardinal = 0; BaseTotal : Cardinal = 0; TotalKills : Cardinal = 0; Function GetMessageLink (OldNum: Cardinal; Zero: Boolean) : Cardinal; Var - L : RecMsgLink; + L : RecMsgLink; + Res : LongInt; Begin - LinkFile.Reset; + LinkFile.Seek(0); While Not LinkFile.EOF Do Begin - LinkFile.Read(L); + LinkFile.BlockRead(L, SizeOf(L), Res); If L.OldNum = OldNum Then Begin Result := L.NewNum; @@ -107,9 +108,9 @@ Var Exit; End; - LinkFile := TBufFile.Create (8 * 1024); + LinkFile := TFileBuffer.Create (8 * 1024); - LinkFile.Open (TempPath + TempName + '.tmp', fmCreate, fmRWDN, SizeOf(RecMsgLink)); + LinkFile.OpenStream (TempPath + TempName + '.tmp', fmCreate, fmRWDN); MsgData^.SeekFirst(1); @@ -162,7 +163,7 @@ Var Link.OldNum := MsgData^.GetMsgNum; Link.NewNum := NewData^.GetHighMsgNum; - LinkFile.Write (Link); + LinkFile.BlockWrite (Link, SizeOf(Link)); End; MsgData^.SeekNext; diff --git a/mystic/mutil_toplists.pas b/mystic/mutil_toplists.pas index 9980b5d..c244b09 100644 --- a/mystic/mutil_toplists.pas +++ b/mystic/mutil_toplists.pas @@ -24,7 +24,7 @@ Var Function GenerateList (ListType: TopListType) : Boolean; Var - UserFile : TBufFile; + UserFile : File of RecUser; User : RecUser; Sort : TQuickSort; @@ -124,8 +124,8 @@ Var If (CodeVal[1] in ['0'..'9']) And (CodeVal[2] in ['0'..'9']) Then Begin If Sort.Data[strS2I(CodeVal)] <> NIL Then Begin - UserFile.Seek (Pred(Sort.Data[strS2I(CodeVal)]^.Ptr)); - UserFile.Read (User); + Seek (UserFile, Pred(Sort.Data[strS2I(CodeVal)]^.Ptr)); + Read (UserFile, User); End Else Begin FillChar (User, SizeOf(User), 0); @@ -178,16 +178,17 @@ Begin BarOne.Reset; - UserFile := TBufFile.Create(8192); - Sort := TQuickSort.Create; + Sort := TQuickSort.Create; - If UserFile.Open(bbsConfig.DataPath + 'users.dat', fmOpen, fmRWDN, SizeOf(RecUser)) Then Begin - While Not UserFile.EOF Do Begin - UserFile.Read (User); + Assign (UserFile, bbsConfig.DataPath + 'users.dat'); + + If ioReset(UserFile, SizeOf(RecUser), fmRWDN) Then Begin + While Not EOF(UserFile) Do Begin + Read (UserFile, User); If User.Flags And UserDeleted <> 0 Then Continue; - BarOne.Update(UserFile.FilePos, UserFile.FileSize); + BarOne.Update(FilePos(UserFile), FileSize(UserFile)); Excluded := False; @@ -213,19 +214,19 @@ Begin End; If Not Excluded Then - Sort.Conditional(strPadL(strI2S(GetValue), 10, '0'), UserFile.FilePos, 99, SortMode); + Sort.Conditional(strPadL(strI2S(GetValue), 10, '0'), FilePos(UserFile), 99, SortMode); End; Sort.Sort (1, Sort.Total, SortMode); GenerateOutput; + Close (UserFile); End Else Result := False; BarOne.Update(100, 100); - UserFile.Free; Sort.Free; End; diff --git a/mystic/whatsnew.txt b/mystic/whatsnew.txt index 5a7800c..ecd5f66 100644 --- a/mystic/whatsnew.txt +++ b/mystic/whatsnew.txt @@ -3310,7 +3310,7 @@ + MUTIL now properly exports echomail and netmail for BSO-style point nodes. - + FIDOPOLL now supports sending/receiving echomail from point systems. + + FIDOPOLL now supports sending/receiving echomail for point systems. ! Fixed a bug in the QWK download system that could cause some networked message bases to get corrupted. @@ -3318,7 +3318,22 @@ + Mystic now allows the network interface to be defined for its MIS servers. If you want it to work the same as before, you MUST set the "Interface" value in "System Configuration -> Internet Options" to "0.0.0.0" without - the quotes. + the quotes. ALPHA TESTERS: DO NOT SKIP THIS STEP! USE CTRL-Y WHEN + EDITING THIS FIELD AND VALIDATE THAT IT IS BLANK BEFORE SETTING THE + VALUE TO 0.0.0.0 (ie no spaces before or after etc). + If you specify 0.0.0.0 Mystic will try to accept ANY connection on a + specified port for all adapters. If you specify one in particular Mystic + will only bind, accept, and use connections from that network interface. + + + Added some new file buffer functions to replace the old stuff. In areas + where this is used (very few for now) there should be some speed up. Be + on the lookout for broken things. + + + When selecting message base during a reply, Mystic will now list all bases + the user has access to, instead of just the current group. + + ! Fixed a rare bug that could ocassionally cause some strange behavior + during global new scans IF a message was moved.