From 565f513d299a78976543efaa04b2b473a3a72a75 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Tue, 19 Mar 2013 01:48:11 -0400 Subject: [PATCH] A30 --- mystic/bbs_cfg_echomail.pas | 2 +- mystic/bbs_core.pas | 2 +- mystic/bbs_doors.pas | 6 +- mystic/bbs_filebase.pas | 4 +- mystic/bbs_general.pas | 4 +- mystic/bbs_io.pas | 2 +- mystic/bbs_msgbase.pas | 6 +- mystic/bbs_msgbase_jam.pas | 10 +-- mystic/bbs_msgbase_squish.pas | 12 ++-- mystic/bbs_sysopchat.pas | 4 +- mystic/bbs_user.pas | 6 +- mystic/mis_common.pas | 4 +- mystic/mis_server.pas | 2 +- mystic/mkcrap.pas | 87 +++++++++-------------- mystic/mpl_execute.pas | 10 +-- mystic/mpl_types.pas | 2 +- mystic/mutil.ini | 8 ++- mystic/mutil.pas | 15 +++- mystic/mutil_common.pas | 60 +++++++++++++--- mystic/mutil_echoexport.pas | 128 ++++++++++++++++++++++++---------- mystic/mutil_msgpack.pas | 3 +- mystic/mutil_status.pas | 2 + mystic/records.pas | 50 ------------- mystic/todo.pas | 4 ++ mystic/whatsnew.txt | 14 ++++ 25 files changed, 253 insertions(+), 194 deletions(-) diff --git a/mystic/bbs_cfg_echomail.pas b/mystic/bbs_cfg_echomail.pas index 41549c9..f62c228 100644 --- a/mystic/bbs_cfg_echomail.pas +++ b/mystic/bbs_cfg_echomail.pas @@ -178,7 +178,7 @@ Var Read (MBaseFile, MBase); If IsExportNode(MBase, Node.Index) Then - List.Add(strPadR(strI2S(MBase.Index), 6, ' ') + ' ' + strPadR(strStripPipe(MBase.Name), 40, ' '), 0); + List.Add(strPadR(strI2S(MBase.Index), 6, ' ') + ' ' + strPadR('(' + MBase.EchoTag + ') ' + strStripPipe(MBase.Name), 40, ' '), 0); End; End; diff --git a/mystic/bbs_core.pas b/mystic/bbs_core.pas index 3123730..981100f 100644 --- a/mystic/bbs_core.pas +++ b/mystic/bbs_core.pas @@ -292,7 +292,7 @@ Begin If Str = '-' Then WriteLn (tLOG, strRep('-', 40)) Else - WriteLn (tLOG, DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, False) + ' ' + Str); + WriteLn (tLOG, DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, 0) + ' ' + Str); Close (tLOG); End; diff --git a/mystic/bbs_doors.pas b/mystic/bbs_doors.pas index bf16b0f..0c76679 100644 --- a/mystic/bbs_doors.pas +++ b/mystic/bbs_doors.pas @@ -190,15 +190,15 @@ Begin Write (tFile, Config.MsgsPath + Ending); Write (tFile, Config.SysopName + Ending); Write (tFile, Session.User.ThisUser.Handle + Ending); - Write (tFile, TimeDos2Str(Session.NextEvent.ExecTime, False) + Ending); {next event start time hh:mm} + Write (tFile, TimeDos2Str(Session.NextEvent.ExecTime, 0) + Ending); {next event start time hh:mm} Write (tFile, 'Y' + Ending); {error-free connection} Write (tFile, 'N' + Ending); {ansi in NG mode} Write (tFile, 'Y' + Ending); {record locking} Write (tFile, '3' + Ending); {default BBS color} Write (tFile, '0' + Ending); {time credits per minute} Write (tFile, '00/00/00' + Ending); {last new filescan date} - Write (tFile, TimeDos2Str(Session.User.ThisUser.LastOn, False) + Ending); {time of this call} - Write (tFile, TimeDos2Str(Session.User.ThisUser.LastOn, False) + Ending); {time of last call} + Write (tFile, TimeDos2Str(Session.User.ThisUser.LastOn, 0) + Ending); {time of this call} + Write (tFile, TimeDos2Str(Session.User.ThisUser.LastOn, 0) + Ending); {time of last call} Write (tFile, '32768' + Ending); {max daily files (??) } Write (tFile, Session.User.ThisUser.DLsToday, Ending); Write (tFile, Session.User.ThisUser.ULk, Ending); diff --git a/mystic/bbs_filebase.pas b/mystic/bbs_filebase.pas index f42c508..f319653 100644 --- a/mystic/bbs_filebase.pas +++ b/mystic/bbs_filebase.pas @@ -1002,7 +1002,7 @@ Begin Session.io.PromptInfo[2] := strComma(SR.Size); Session.io.PromptInfo[3] := DateDos2Str(SR.Time, Session.User.ThisUser.DateType); - Session.io.PromptInfo[4] := TimeDos2Str(SR.Time, True); + Session.io.PromptInfo[4] := TimeDos2Str(SR.Time, 1); Session.io.OutFullLn (Session.GetPrompt(193)); @@ -1092,7 +1092,7 @@ Begin ExecuteArchive (FName, '', Mask, 2); If FileExist(Session.TempPath + Mask) Then Begin - Case CheckFileLimits (1, GetFileSize(Session.TempPath + Mask) DIV 1024) of + Case CheckFileLimits (1, FileByteSize(Session.TempPath + Mask) DIV 1024) of 0 : If SendFile (Session.TempPath + Mask) Then Begin; Session.SystemLog ('Download from ' + FName + ': ' + Mask); diff --git a/mystic/bbs_general.pas b/mystic/bbs_general.pas index fa96d5a..850143c 100644 --- a/mystic/bbs_general.pas +++ b/mystic/bbs_general.pas @@ -507,7 +507,7 @@ Begin Session.io.PromptInfo[2] := strI2S(LastOn.Node); Session.io.PromptInfo[3] := LastOn.City; Session.io.PromptInfo[4] := DateDos2Str(LastOn.DateTime, Session.User.ThisUser.DateType); - Session.io.PromptInfo[5] := TimeDos2Str(LastOn.DateTime, True); + Session.io.PromptInfo[5] := TimeDos2Str(LastOn.DateTime, 1); Session.io.PromptInfo[7] := strI2S(LastOn.CallNum); Session.io.PromptInfo[8] := LastOn.Address; Session.io.PromptInfo[9] := LastOn.UserInfo; @@ -1105,7 +1105,7 @@ Var Session.io.PromptInfo[1] := DirList[BarPos]^.Desc; Session.io.PromptInfo[2] := strComma(DirList[BarPos]^.Size); Session.io.PromptInfo[3] := DateDos2Str(DirList[BarPos]^.Date, Session.User.ThisUser.DateType); - Session.io.PromptInfo[7] := TimeDos2Str(DirList[BarPos]^.Date, True); + Session.io.PromptInfo[7] := TimeDos2Str(DirList[BarPos]^.Date, 1); If DirList[BarPos]^.IsDir Then Begin Session.io.PromptInfo[4] := ''; diff --git a/mystic/bbs_io.pas b/mystic/bbs_io.pas index 79b3587..db88b54 100644 --- a/mystic/bbs_io.pas +++ b/mystic/bbs_io.pas @@ -718,7 +718,7 @@ Begin 'B' : LastMCIValue := strI2S(TBBSCore(Core).User.ThisUser.TimeBank); 'C' : LastMCIValue := strI2S(Config.SystemCalls); 'E' : If Graphics = 1 Then LastMCIValue := 'Ansi' Else LastMCIValue := 'Ascii'; //++lang - 'I' : LastMCIValue := TimeDos2Str(CurDateDos, True); + 'I' : LastMCIValue := TimeDos2Str(CurDateDos, 1); 'L' : LastMCIValue := strI2S(TBBSCore(Core).TimeLeft); 'O' : LastMCIValue := strI2S(TBBSCore(Core).ElapsedTime); End; diff --git a/mystic/bbs_msgbase.pas b/mystic/bbs_msgbase.pas index 8cf2e16..5e871d9 100644 --- a/mystic/bbs_msgbase.pas +++ b/mystic/bbs_msgbase.pas @@ -614,7 +614,7 @@ Begin Msg^.SetPriv (TempBase.Flags and MBPrivate <> 0); Msg^.SetDate (DateDos2Str(CurDateDos, 1)); - Msg^.SetTime (TimeDos2Str(CurDateDos, False)); + Msg^.SetTime (TimeDos2Str(CurDateDos, 0)); End; Procedure TMsgBase.ChangeArea (Data: String); @@ -3580,7 +3580,7 @@ Begin Msg^.SetPriv (mArea.Flags And MBPrivate <> 0); Msg^.SetDate (DateDos2Str(CurDateDos, 1)); - Msg^.SetTime (TimeDos2Str(CurDateDos, False)); + Msg^.SetTime (TimeDos2Str(CurDateDos, 0)); Msg^.SetFrom (mFrom); Msg^.SetTo (mTo); Msg^.SetSubj (mSubj); @@ -3853,7 +3853,7 @@ Begin Write (tFile, CRLF); Write (tFile, Config.SysopName + CRLF); Write (tFile, '0,' + Config.qwkBBSID + CRLF); - Write (tFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, False) + CRLF); + Write (tFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + CRLF); Write (tFile, strUpper(Session.User.ThisUser.Handle) + CRLF); Write (tFile, CRLF); Write (tFile, '0' + CRLF); diff --git a/mystic/bbs_msgbase_jam.pas b/mystic/bbs_msgbase_jam.pas index 18ca1bc..099022f 100644 --- a/mystic/bbs_msgbase_jam.pas +++ b/mystic/bbs_msgbase_jam.pas @@ -1444,7 +1444,7 @@ Begin FillChar(JM^.Dest, SizeOf(JM^.Dest), #0); JM^.MsgDate := DateDos2Str(CurDateDos, 1); - JM^.MsgTime := TimeDos2Str(CurDateDos, False); + JM^.MsgTime := TimeDos2Str(CurDateDos, 0); End; @@ -1541,18 +1541,18 @@ Begin TmpHdr^.BaseMsgNum := 1; TmpHdr^.Created := ToUnixDate(CurDateDos); TmpHdr^.PwdCrc := -1; - CreateError := SaveFile(JM^.MsgPath + '.jhr', TmpHdr^, SizeOf(TmpHdr^)); + CreateError := SaveFilePos(JM^.MsgPath + '.jhr', TmpHdr^, SizeOf(TmpHdr^), 0); Dispose(TmpHdr); If CreateError = 0 Then - CreateError := SaveFile(JM^.MsgPath + '.jlr', CreateError, 0); + CreateError := SaveFilePos(JM^.MsgPath + '.jlr', CreateError, 0, 0); If CreateError = 0 Then - CreateError := SaveFile(JM^.MsgPath + '.jdt', CreateError, 0); + CreateError := SaveFilePos(JM^.MsgPath + '.jdt', CreateError, 0, 0); If CreateError = 0 Then - CreateError := SaveFile(JM^.MsgPath + '.jdx', CreateError , 0); + CreateError := SaveFilePos(JM^.MsgPath + '.jdx', CreateError , 0, 0); If IoResult <> 0 Then; End; diff --git a/mystic/bbs_msgbase_squish.pas b/mystic/bbs_msgbase_squish.pas index f90a05c..64ca4a9 100644 --- a/mystic/bbs_msgbase_squish.pas +++ b/mystic/bbs_msgbase_squish.pas @@ -421,10 +421,10 @@ Begin SqInfo^.SqBase.KeepDays := MaxDays; SqInfo^.SqBase.EndFrame := SqInfo^.SqBase.Len; - CreateMsgBase := (SaveFile(SqInfo^.FN + '.sqd', SqInfo^.SqBase, SqInfo^.SqBase.Len) = 0); + CreateMsgBase := (SaveFilePos(SqInfo^.FN + '.sqd', SqInfo^.SqBase, SqInfo^.SqBase.Len, 0) = 0); - SaveFile (SqInfo^.FN + '.sqi', SqInfo^.SqBase, 0); - SaveFile (SqInfo^.FN + '.sql', SqInfo^.SqBase, 0); + SaveFilePos (SqInfo^.FN + '.sqi', SqInfo^.SqBase, 0, 0); + SaveFilePos (SqInfo^.FN + '.sql', SqInfo^.SqBase, 0, 0); End Else CreateMsgBase := False; End; @@ -556,7 +556,7 @@ Var TmpDate: LongInt; Begin TmpDate := (SqInfo^.MsgHdr.DateWritten shr 16) + ((SqInfo^.MsgHdr.DateWritten and $ffff) shl 16); - GetTime := TimeDos2Str(TmpDate, False); + GetTime := TimeDos2Str(TmpDate, 0); End; Procedure TMsgBaseSquish.SetDate(Str: String); @@ -1483,7 +1483,7 @@ Function TMsgBaseSquish.NumberOfMsgs: LongInt; Var TmpBase: SqBaseType; Begin - If LoadFile(SqInfo^.FN + '.sqd', TmpBase, SizeOf(TmpBase)) = 0 Then + If LoadFilePos(SqInfo^.FN + '.sqd', TmpBase, SizeOf(TmpBase), 0) = 0 Then NumberOfMsgs := TmpBase.NumMsg Else NumberOfMsgs := 0; @@ -1497,7 +1497,7 @@ End; Procedure TMsgBaseSquish.SetLastRead (UNum: LongInt; LR: LongInt); Begin - If ((UNum + 1) * SizeOf(LR)) > GetFileSize(SqInfo^.FN + '.sql') Then + If ((UNum + 1) * SizeOf(LR)) > FileByteSize(SqInfo^.FN + '.sql') Then ExtendFile (SqInfo^.FN + '.sql', (UNum + 1) * SizeOf(LR)); SaveFilePos (SqInfo^.FN + '.sql', LR, SizeOf(LR), UNum * SizeOf(LR)); diff --git a/mystic/bbs_sysopchat.pas b/mystic/bbs_sysopchat.pas index 54c1be7..1e98eef 100644 --- a/mystic/bbs_sysopchat.pas +++ b/mystic/bbs_sysopchat.pas @@ -269,7 +269,7 @@ Begin If IoResult <> 0 Then ReWrite (tFile); WriteLn (tFile, ''); - WriteLn (tFile, 'Chat recorded ' + DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, True) + + WriteLn (tFile, 'Chat recorded ' + DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, 1) + ' with ' + Session.User.ThisUser.Handle); WriteLn (tFile, strRep('-', 70)); End; @@ -289,4 +289,4 @@ Begin UpdateStatusLine (StatusPtr, ''); End; -End. \ No newline at end of file +End. diff --git a/mystic/bbs_user.pas b/mystic/bbs_user.pas index d5b7bb1..ddfa8cc 100644 --- a/mystic/bbs_user.pas +++ b/mystic/bbs_user.pas @@ -156,8 +156,8 @@ Var Exit; End Else Res := ThisUser.LastMGroup = strS2I(Data); - 'H' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, False), 1, 2)); - 'M' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, False), 4, 2)); + 'H' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, 0), 1, 2)); + 'M' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, 0), 4, 2)); 'N' : Res := strS2I(Data) = Session.NodeNum; 'O' : Case Data[1] of 'A' : Res := Chat.Available; @@ -1189,7 +1189,7 @@ Begin Session.SystemLog ('-'); Session.SystemLog ('Connect from ' + Session.UserIPInfo + ' (' + Session.UserHostInfo + ')'); - Session.HistoryHour := strS2I(Copy(TimeDos2Str(CurDateDos, False), 1, 2)); + Session.HistoryHour := strS2I(Copy(TimeDos2Str(CurDateDos, 0), 1, 2)); If Config.SystemPW <> '' Then If Not Session.io.GetPW(Session.GetPrompt(4), Session.GetPrompt(417), Config.SystemPW) Then Begin diff --git a/mystic/mis_common.pas b/mystic/mis_common.pas index 58813e4..2520948 100644 --- a/mystic/mis_common.pas +++ b/mystic/mis_common.pas @@ -87,8 +87,8 @@ Var Exit; End Else Res := User.LastMGroup = strS2I(Data); - 'H' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, False), 1, 2)); - 'M' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, False), 4, 2)); + 'H' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, 0), 1, 2)); + 'M' : Res := strS2I(Data) < strS2I(Copy(TimeDos2Str(CurDateDos, 0), 4, 2)); 'N' : Res := True; 'O' : Case Data[1] of 'A' : Res := True; diff --git a/mystic/mis_server.pas b/mystic/mis_server.pas index 098ab0c..9104357 100644 --- a/mystic/mis_server.pas +++ b/mystic/mis_server.pas @@ -173,7 +173,7 @@ Begin If ServerStatus.Count > MaxStatusText Then ServerStatus.Delete(0); - Res := '(' + Copy(DateDos2Str(CurDateDos, 1), 1, 5) + ' ' + TimeDos2Str(CurDateDos, False) + ') ' + Str; + Res := '(' + Copy(DateDos2Str(CurDateDos, 1), 1, 5) + ' ' + TimeDos2Str(CurDateDos, 0) + ') ' + Str; If Length(Res) > 74 Then Begin ServerStatus.Add(Copy(Res, 1, 74)); diff --git a/mystic/mkcrap.pas b/mystic/mkcrap.pas index 8148823..05aa196 100644 --- a/mystic/mkcrap.pas +++ b/mystic/mkcrap.pas @@ -1,6 +1,6 @@ -{$I M_OPS.PAS} +Unit MKCRAP; -Unit mkcrap; +{$I M_OPS.PAS} // this is various functions and procedures used by JAM/Squish... // these should be removed and/or incorporated into mystic's code base as @@ -8,24 +8,21 @@ Unit mkcrap; // CHANGE JAM TEMP BUFFER.. ADD SETBUFFERFILE METHOD TO MSGBASE OBJECTS!!!! -interface +Interface -uses - dos; +Uses + DOS; -Function ToUnixDate(FDate: LongInt): LongInt; -Function DTToUnixDate(DT: DateTime): LongInt; -Procedure UnixToDT(SecsPast: LongInt; Var Dt: DateTime); -Function SaveFile(FN: String; Var Rec; FS: Word): Word; -Procedure Str2Az(Str: String; MaxLen: Byte; Var AZStr); {Convert string to asciiz} -Function FormattedDate(DT: DateTime; Mask: String): String; -Function LoadFile(FN: String; Var Rec; FS: Word): Word; -Function LoadFilePos(FN: String; Var Rec; FS: Word; FPos: LongInt): Word; -Function GetFileSize (FN : String) : LongInt; -Function ExtendFile(FN: String; ToSize: LongInt): Word; -Function SaveFilePos(FN: String; Var Rec; FS: Word; FPos: LongInt): Word; +Function ToUnixDate (FDate: LongInt): LongInt; +Function DTToUnixDate (DT: DateTime): LongInt; +Procedure UnixToDT (SecsPast: LongInt; Var Dt: DateTime); +Procedure Str2Az (Str: String; MaxLen: Byte; Var AZStr); {Convert string to asciiz} +Function FormattedDate (DT: DateTime; Mask: String): String; +Function LoadFilePos (FN: String; Var Rec; FS: Word; FPos: LongInt): Word; +Function ExtendFile (FN: String; ToSize: LongInt): Word; +Function SaveFilePos (FN: String; Var Rec; FS: Word; FPos: LongInt): Word; -implementation +Implementation Uses m_FileIO, @@ -38,7 +35,7 @@ Const // DATED1 = 146097; // DATED2 = 1721119; -Function DTToUnixDate(DT: DateTime): LongInt; +Function DTToUnixDate (DT: DateTime): LongInt; Var SecsPast, DaysPast: LongInt; Begin @@ -51,15 +48,16 @@ Begin DTToUnixDate := SecsPast; End; -Function ToUnixDate(FDate: LongInt): LongInt; +Function ToUnixDate (FDate: LongInt): LongInt; Var DT: DateTime; Begin UnpackTime(Fdate, DT); - ToUnixDate := DTToUnixDate(Dt); + + ToUnixDate := DTToUnixDate(DT); End; -Procedure UnixToDT(SecsPast: LongInt; Var Dt: DateTime); +Procedure UnixToDT (SecsPast: LongInt; Var DT: DateTime); Var DateNum : LongInt; //might be able to remove this Begin @@ -76,21 +74,23 @@ Begin DT.Sec := SecsPast Mod 60; End; -Function SaveFilePos(FN: String; Var Rec; FS: Word; FPos: LongInt): Word; +Function SaveFilePos (FN: String; Var Rec; FS: Word; FPos: LongInt): Word; Var - F: File; - Error: Word; - temp:longint; + F : File; + Error : Word; + Temp : LongInt; Begin Error := 0; - assign (f, fn); + + Assign (F, FN); FileMode := fmReadWrite + fmDenyNone; - If FileExist(FN) Then Begin - reset(f,1); - if ioresult <> 0 then error := ioresult; + + If FileExist (FN) Then Begin + Reset (F, 1); + If IoResult <> 0 Then Error := IoResult; End Else Begin - ReWrite(F,1); + ReWrite (F,1); Error := IoResult; End; If Error = 0 Then Begin @@ -108,13 +108,6 @@ Begin SaveFilePos := Error; End; -Function SaveFile(FN: String; Var Rec; FS: Word): Word; - Begin - SaveFile := SaveFilePos(FN, Rec, FS, 0); - End; - - - Procedure Str2Az(Str: String; MaxLen: Byte; Var AZStr); {Convert string to asciiz} Begin If Length(Str) >= MaxLen Then Begin @@ -164,12 +157,12 @@ Begin DStr := Copy(strPadL(strI2S(Dt.Day), 2, '0'), 1, 2); MStr := Copy(strPadL(strI2S(Dt.Month), 2, '0'), 1, 2); YStr := Copy(strPadL(strI2S(Dt.Year), 4, '0'), 1, 4); - HourStr := Copy(strPadL(strI2S(Dt.Hour), 2, ' '), 1, 2); + HourStr := Copy(strPadL(strI2S(Dt.Hour), 2, '0'), 1, 2); MinStr := Copy(strPadL(strI2S(Dt.Min), 2, '0'), 1, 2); SecStr := Copy(strPadL(strI2S(Dt.Sec), 2, '0'), 1, 2); MNStr := MonthStr(Dt.Month); - If (Pos('YYYY', Mask) = 0) Then YStr := Copy(YStr,3,2); + If (Pos('YYYY', Mask) = 0) Then YStr := Copy(YStr, 3, 2); CurrPos := Pos('DD', Mask); If CurrPos > 0 Then @@ -236,22 +229,6 @@ Begin LoadFilePos := Error; End; -Function LoadFile(FN: String; Var Rec; FS: Word): Word; - Begin - LoadFile := LoadFilePos(FN, Rec, FS, 0); - End; - -Function GetFileSize (FN : String) : LongInt; -Var - SR : SearchRec; -Begin - FindFirst (FN, AnyFile, SR); - If DosError = 0 Then - GetFileSize := SR.Size - Else - GetFileSize := -1; -End; - Function ExtendFile(FN: String; ToSize: LongInt): Word; {Pads file with nulls to specified size} Type diff --git a/mystic/mpl_execute.pas b/mystic/mpl_execute.pas index d3f6e5b..55449ab 100644 --- a/mystic/mpl_execute.pas +++ b/mystic/mpl_execute.pas @@ -377,7 +377,7 @@ Begin mpxInvalidFile : Result := 'Invalid executable: ' + ErrStr; mpxVerMismatch : Result := 'Version mismatch: ' + ErrStr + ' / ' + mplVersion; mpxUnknownOp : Result := 'Unknown Token: ' + ErrStr; - mpxMultiInit : Result := 'Unable to initialize variable'; + mpxBadInit : Result := 'Unable to initialize variable'; mpxDivisionByZero : Result := 'Division by zero'; mpxMathematical : Result := 'Parsing error'; End; @@ -1110,7 +1110,7 @@ Begin NextWord; If FindVariable(W) > 0 Then Begin - Error (mpxMultiInit, ''); + Error (mpxBadInit, ''); Exit; End; @@ -1627,7 +1627,7 @@ Begin Store (TempBool, 1); End; 56 : Begin - TempStr := TimeDos2Str(Param[1].L, Param[2].O); + TempStr := TimeDos2Str(Param[1].L, Ord(Param[2].O)); Store (TempStr, 256); End; 57 : Begin @@ -1953,7 +1953,7 @@ Begin NextWord; { procedure var id } If FindVariable(W) > 0 Then Begin /// ???????????????????? - Error (mpxMultiInit, ''); + Error (mpxBadInit, ''); Exit; End; @@ -2430,7 +2430,7 @@ Begin Result := Script.Execute(Str); If Script.ErrNum > 0 Then Begin - ErrStr := 'MPX ERROR: ' + Script.GetErrorMsg; + ErrStr := strStripLow('MPX ERROR: ' + Script.GetErrorMsg); Session.SystemLog(ErrStr + '(' + Str + ')'); Session.io.OutFullLn ('|CR|12' + ErrStr); diff --git a/mystic/mpl_types.pas b/mystic/mpl_types.pas index e603ace..97ca4c0 100644 --- a/mystic/mpl_types.pas +++ b/mystic/mpl_types.pas @@ -108,7 +108,7 @@ Const mpxInvalidFile = 2; mpxVerMismatch = 3; mpxUnknownOp = 4; - mpxMultiInit = 5; + mpxBadInit = 5; mpxDivisionByZero = 6; mpxMathematical = 7; {$ELSE} diff --git a/mystic/mutil.ini b/mystic/mutil.ini index 7ecae1c..066500d 100644 --- a/mystic/mutil.ini +++ b/mystic/mutil.ini @@ -17,6 +17,8 @@ ; ; Current abilities (enabled/disabled in the General header below): ; +; - Export Binkley-style FLO echomail/netmail +; - Import Binkley-style FLO echomail/netmail ; - Import Message Bases (by datafile analysis) ; - Import FIDONET.NA into Message bases ; - Import FILEBONE.NA into File bases @@ -51,6 +53,7 @@ ; Level 1 = basic ; Level 2 = verbose + ; Level 3 = debug loglevel=2 @@ -66,7 +69,8 @@ PurgeMessageBases = false PostTextFiles = false PackMessageBases = false - ExportEchoMail = true + ImportEchoMail = false + ExportEchoMail = false ; ========================================================================== ; ========================================================================== @@ -367,4 +371,6 @@ new_scan = 1 qwk_scan = 1 +[ImportEchoMail] + [ExportEchoMail] diff --git a/mystic/mutil.pas b/mystic/mutil.pas index b54e4d5..c3e397a 100644 --- a/mystic/mutil.pas +++ b/mystic/mutil.pas @@ -46,6 +46,7 @@ Uses mUtil_MsgPack, mUtil_MsgPost, mUtil_EchoExport, + mUtil_EchoImport, bbs_Common; {$I MUTIL_ANSI.PAS} @@ -59,7 +60,7 @@ Begin Log (2, '+', ' EXEC ' + pName); End Else - Log (2, '+', ' SKIP ' + pName); + Log (3, '+', ' SKIP ' + pName); End; Procedure ApplicationShutdown; @@ -86,6 +87,7 @@ Procedure ApplicationStartup; Var FN : String; CF : File of RecConfig; + F : File; Begin ExitProc := @ApplicationShutdown; Console := TOutput.Create(strUpper(ParamStr(2)) <> '-NOSCREEN'); @@ -155,6 +157,12 @@ Begin BarOne := TStatusBar.Create(3); BarAll := TStatusBar.Create(6); + + If LogFile <> '' Then Begin + Assign (F, LogFile); + If Not ioReset(F, 1, fmRWDN) Then ReWrite(F); + Close (F); + End; End; Var @@ -165,6 +173,7 @@ Var DoTopLists : Boolean; DoAllFiles : Boolean; DoEchoExport : Boolean; + DoEchoImport : Boolean; DoMsgPurge : Boolean; DoMsgPack : Boolean; DoMsgPost : Boolean; @@ -184,6 +193,7 @@ Begin DoFilesBBS := CheckProcess(Header_FILESBBS); DoAllFiles := CheckProcess(Header_ALLFILES); DoEchoExport := CheckProcess(Header_ECHOEXPORT); + DoEchoImport := CheckProcess(Header_ECHOIMPORT); DoMsgPurge := CheckProcess(Header_MSGPURGE); DoMsgPack := CheckProcess(Header_MSGPACK); DoMsgPost := CheckProcess(Header_MSGPOST); @@ -201,14 +211,15 @@ Begin // We're good lets execute this stuff! If DoImportNA Then uImportNA; - If DoImportMB Then uImportMessageBases; If DoFileBone Then uImportFileBone; If DoFilesBBS Then uImportFilesBBS; If DoMassUpload Then uMassUpload; If DoTopLists Then uTopLists; If DoAllFiles Then uAllFilesList; If DoEchoExport Then uEchoExport; + If DoEchoImport Then uEchoImport; If DoMsgPurge Then uPurgeMessageBases; If DoMsgPack Then uPackMessageBases; If DoMsgPost Then uPostMessages; + If DoImportMB Then uImportMessageBases; End. diff --git a/mystic/mutil_common.pas b/mystic/mutil_common.pas index 2271412..9686876 100644 --- a/mystic/mutil_common.pas +++ b/mystic/mutil_common.pas @@ -31,6 +31,7 @@ Const Header_IMPORTNA = 'Import_FIDONET.NA'; Header_IMPORTMB = 'Import_MessageBase'; Header_ECHOEXPORT = 'ExportEchoMail'; + Header_ECHOIMPORT = 'ImportEchoMail'; Header_FILEBONE = 'Import_FILEBONE.NA'; Header_FILESBBS = 'Import_FILES.BBS'; Header_UPLOAD = 'MassUpload'; @@ -52,6 +53,8 @@ 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; Function MessageBaseOpen (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean; Function SaveMessage (mArea: RecMessageBase; mFrom, mTo, mSubj: String; mAddr: RecEchoMailAddr; mText: RecMessageText; mLines: Integer) : Boolean; Function GetFTNPKTName : String; @@ -75,22 +78,15 @@ Procedure Log (Level: Byte; Code: Char; Str: String); Var T : Text; Begin - If LogFile = '' Then Exit; - - If LogLevel < Level Then Exit; - - FileMode := 66; + If (LogLevel < Level) or (LogFile = '') Then Exit; Assign (T, LogFile); Append (T); - If IoResult <> 0 Then - If IoResult = 5 Then Exit Else ReWrite(T); - If Str = '' Then WriteLn (T, '') Else - WriteLn (T, Code + ' ' + DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, False) + ' ' + Str); + WriteLn (T, Code + ' ' + DateDos2Str(CurDateDos, 1) + ' ' + TimeDos2Str(CurDateDos, 2) + ' ' + Str); Close (T); End; @@ -334,6 +330,50 @@ Begin Close (F); End; +Function GetMBaseByTag (Tag: String; Var TempBase: RecMessageBase) : Boolean; +Var + F : File; +Begin + Result := False; + + Assign (F, bbsConfig.DataPath + 'mbases.dat'); + + If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; + + While Not Eof(F) Do Begin + ioRead(F, TempBase); + + If Tag = strUpper(TempBase.EchoTag) Then Begin + Result := True; + Break; + End; + End; + + Close (F); +End; + +Function GetMBaseByNetZone (Zone: Word; Var TempBase: RecMessageBase) : Boolean; +Var + F : File; +Begin + Result := False; + + Assign (F, bbsConfig.DataPath + 'mbases.dat'); + + If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit; + + While Not Eof(F) Do Begin + ioRead(F, TempBase); + + If (Zone = bbsConfig.NetAddress[TempBase.NetAddr].Zone) and (TempBase.NetType = 3) Then Begin + Result := True; + Break; + End; + End; + + Close (F); +End; + Function MessageBaseOpen (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean; Begin Result := False; @@ -397,7 +437,7 @@ Begin Msg^.SetPriv (mArea.Flags And MBPrivate <> 0); Msg^.SetDate (DateDos2Str(CurDateDos, 1)); - Msg^.SetTime (TimeDos2Str(CurDateDos, False)); + Msg^.SetTime (TimeDos2Str(CurDateDos, 0)); Msg^.SetFrom (mFrom); Msg^.SetTo (mTo); Msg^.SetSubj (mSubj); diff --git a/mystic/mutil_echoexport.pas b/mystic/mutil_echoexport.pas index 8590674..22a450a 100644 --- a/mystic/mutil_echoexport.pas +++ b/mystic/mutil_echoexport.pas @@ -16,11 +16,44 @@ Uses m_DateTime, mUtil_Common, mUtil_Status, + mUtil_EchoCore, bbs_Common, bbs_MsgBase_ABS, bbs_MsgBase_JAM, bbs_MsgBase_Squish; +Procedure AddToFLOQueue (FloName, PacketFN: String); +Var + T : Text; + Str : String; +Begin + FileMode := 66; + + {$I-} + + Assign (T, FloName); + Reset (T); + + If IoResult <> 0 Then + ReWrite(T); + + While Not Eof(T) Do Begin + ReadLn (T, Str); + + If strUpper(Str) = '^' + strUpper(PacketFN) Then Begin + Close (T); + Exit; + End; + End; + + log(3, '+', 'flo close and append'); + + Close (T); + Append (T); + WriteLn (T, '^' + PacketFN); + Close (T); +End; + Procedure BundleMessages; Var F : File; @@ -34,8 +67,6 @@ Var FLOName : String; OrigAddr : RecEchoMailAddr; Begin - //update/create .FLO or whatever... need to research - FindFirst (TempPath + '*', AnyFile, DirInfo); While DosError = 0 Do Begin @@ -56,7 +87,7 @@ Begin OrigAddr.Net := PH.OrigNet; OrigAddr.Node := PH.OrigNode; - // TODO: if crash etc change char F in FLO extension + // if echonode.echomail.crash etc change char F in FLO extension FLOName := bbsConfig.OutboundPath + GetFTNFlowName(EchoNode.Address) + '.flo'; BundleName := bbsConfig.OutboundPath + GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + DayString[DayOfWeek(CurDateDos)]; @@ -67,15 +98,7 @@ Begin FileErase (TempPath + PKTName); - {$I-} - - Assign (T, FLOName); - Append (T); - - If IoResult <> 0 Then ReWrite(T); - - WriteLn (T, '^' + BundleName); - Close (T); + AddToFLOQueue (FLOName, BundleName); End; FindNext (DirInfo); @@ -86,14 +109,15 @@ End; Procedure uEchoExport; Var - TotalMessages : LongInt; - MBaseFile : File of RecMessageBase; - MBase : RecMessageBase; - ExportFile : File of RecEchoMailExport; - ExportIndex : RecEchoMailExport; - EchoNode : RecEchoMailNode; - PKTBase : String; - MsgBase : PMsgBaseABS; + TotalEcho : LongInt; + TotalNet : LongInt; + MBaseFile : File of RecMessageBase; + MBase : RecMessageBase; + ExportFile : File of RecEchoMailExport; + ExportIndex : RecEchoMailExport; + EchoNode : RecEchoMailNode; + PKTBase : String; + MsgBase : PMsgBaseABS; Procedure ExportMessage; Var @@ -117,19 +141,37 @@ Var End; Var - TempStr : String; + TempStr1 : String; + TempStr2 : String; Begin - Inc (TotalMessages); + If (EchoNode.Address.Zone = MsgBase^.GetOrigAddr.Zone) and + (EchoNode.Address.Net = MsgBase^.GetOrigAddr.Net) and + (EchoNode.Address.Node = MsgBase^.GetOrigAddr.Node) Then Exit; Log (2, '+', ' Export Msg #' + strI2S(MsgBase^.GetMsgNum) + ' to ' + strAddr2Str(EchoNode.Address)); - GetDate (DT.Year, DT.Month, DT.Day, Temp); - GetTime (DT.Hour, DT.Min, DT.Sec, Temp); + GetDate (DT.Year, DT.Month, DT.Day, Temp); + GetTime (DT.Hour, DT.Min, DT.Sec, Temp); - Assign (F, TempPath + PKTBase + '.' + strI2S(EchoNode.Index)); + If MBase.NetType = 3 Then Begin + TempStr1 := bbsConfig.OutboundPath + GetFTNFlowName(EchoNode.Address) + '.out'; + TempStr2 := bbsConfig.OutboundPath + GetFTNFlowName(EchoNode.Address) + '.flo'; + + // change extensions based on crash etc from echonode + + Assign (F, TempStr1); + + AddToFloQueue (TempStr2, TempStr1); + + Inc (TotalNet); + End Else Begin + Assign (F, TempPath + PKTBase + '.' + strI2S(EchoNode.Index)); + + Inc (TotalEcho); + End; If ioReset(F, 1, fmRWDN) Then Begin - ioSeek (F, FileSize(F)); + ioSeek (F, FileSize(F) - 2); // we want to overwrite packet term chars End Else Begin ioReWrite (F, 1, fmRWDN); @@ -156,14 +198,14 @@ Var FillChar (MH, SizeOf(MH), 0); - MH.MsgType := $0200; + MH.MsgType := 2; MH.OrigNode := bbsConfig.NetAddress[MBase.NetAddr].Node; MH.DestNode := EchoNode.Address.Node; MH.OrigNet := bbsConfig.NetAddress[MBase.NetAddr].Net; MH.DestNet := EchoNode.Address.Net; - TempStr := FormattedDate(DT, 'DD NNN YY HH:MM:SS'); - Move (TempStr[1], MH.DateTime[0], 19); + TempStr1 := FormattedDate(DT, 'DD NNN YY HH:MM:SS') + #0; + Move (TempStr1[1], MH.DateTime[0], 20); If MsgBase^.IsLocal Then MH.Attribute := MH.Attribute OR pktLocal; If MsgBase^.IsCrash Then MH.Attribute := MH.Attribute OR pktCrash; @@ -176,7 +218,9 @@ Var WriteStr (MsgBase^.GetTo, #0); WriteStr (MsgBase^.GetFrom, #0); WriteStr (MsgBase^.GetSubj, #0); - WriteStr ('AREA:' + MBase.EchoTag, #13); + + If MBase.NetType <> 3 Then + WriteStr ('AREA:' + MBase.EchoTag, #13); WriteStr (#1 + 'INTL ' + strAddr2Str(EchoNode.Address) + ' ' + strAddr2Str(bbsConfig.NetAddress[MBase.NetAddr]), #13); WriteStr (#1 + 'TID: Mystic BBS ' + mysVersion, #13); @@ -186,16 +230,26 @@ Var While Not MsgBase^.EOM Do WriteStr (MsgBase^.GetString(79), #13); - WriteStr('', #0); + TempStr1 := 'SEEN-BY: ' + strI2S(bbsConfig.NetAddress[MBase.NetAddr].Net) + '/' + strI2S(bbsConfig.NetAddress[MBase.NetAddr].Node) + ' '; + + If bbsConfig.NetAddress[MBase.NetAddr].Net <> EchoNode.Address.Net Then + TempStr1 := TempStr1 + strI2S(EchoNode.Address.Net) + '/'; + + TempStr1 := TempStr1 + strI2S(EchoNode.Address.Node); + + WriteStr (TempStr1, #13); + WriteStr (#1 + 'PATH: ' + strI2S(bbsConfig.NetAddress[MBase.NetAddr].Net) + '/' + strI2S(bbsConfig.NetAddress[MBase.NetAddr].Node), #13); + WriteStr (#0#0, #0); Close (F); End; Begin - TotalMessages := 0; - PKTBase := GetFTNPKTName; + TotalEcho := 0; + TotalNet := 0; + PKTBase := GetFTNPKTName; - ProcessName ('Exporting Echomail', True); + ProcessName ('Exporting EchoMail', True); ProcessResult (rWORKING, False); DirClean (TempPath, ''); @@ -207,7 +261,7 @@ Begin Exit; End; - Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); + Assign (MBaseFile, bbsConfig.DataPath + 'mbases.dat'); If ioReset(MBaseFile, SizeOf(RecMessageBase), fmRWDN) Then Begin While Not Eof(MBaseFile) Do Begin @@ -232,7 +286,7 @@ Begin While MsgBase^.SeekFound Do Begin MsgBase^.MsgStartUp; - If MsgBase^.IsLocal And Not MsgBase^.IsSent Then Begin + If {MsgBase^.IsLocal And } Not MsgBase^.IsSent Then Begin Assign (ExportFile, MBase.Path + MBase.FileName + '.lnk'); If ioReset(ExportFile, SizeOf(RecEchoMailExport), fmRWDN) Then Begin @@ -264,7 +318,7 @@ Begin BundleMessages; - ProcessStatus ('Exported |15' + strI2S(TotalMessages) + ' |07msgs', True); + ProcessStatus ('Total |15' + strI2S(TotalEcho) + ' |07echo |15' + strI2S(TotalNet) + ' |07net', True); ProcessResult (rDONE, True); End; diff --git a/mystic/mutil_msgpack.pas b/mystic/mutil_msgpack.pas index 4126502..893714b 100644 --- a/mystic/mutil_msgpack.pas +++ b/mystic/mutil_msgpack.pas @@ -194,6 +194,7 @@ Var If (Link.OldNum <> NewData^.GetRefer) or (Link.NewNum <> NewData^.GetSeeAlso) Then Begin NewData^.SetRefer (Link.OldNum); NewData^.SetSeeAlso (Link.NewNum); + NewData^.ReWriteHdr; End; @@ -266,4 +267,4 @@ Begin ProcessResult (rDONE, True); End; -End. +End. \ No newline at end of file diff --git a/mystic/mutil_status.pas b/mystic/mutil_status.pas index 7612bab..b656eac 100644 --- a/mystic/mutil_status.pas +++ b/mystic/mutil_status.pas @@ -37,6 +37,8 @@ Begin BarOne.Reset; + Console.WriteXY (71, 10, 8, strPadL('(' + strI2S(ProcessPos) + '/' + strI2S(ProcessTotal) + ')', 7, ' ')); + Log (1, '+', 'Process: ' + Str); End; End; diff --git a/mystic/records.pas b/mystic/records.pas index d20cec4..bb29853 100644 --- a/mystic/records.pas +++ b/mystic/records.pas @@ -78,56 +78,6 @@ Type AccessFlagType = Set of 1..26; -Const - pktPrivate = $0001; - pktCrash = $0002; - pktReceived = $0004; - pktSent = $0008; - pktFileAttach = $0010; - pktInTransit = $0020; - pktOrphan = $0040; - pktKillSent = $0080; - pktLocal = $0100; - pktHold = $0200; - pktUnused = $0400; - pktFileReq = $0800; - pktReturnReq = $1000; - pktIsReceipt = $2000; - pktAuditReq = $4000; - pktFileUpdate = $8000; - -Type - RecPKTMessageHdr = Record - MsgType, - OrigNode : System.Word; - DestNode : System.Word; - OrigNet : System.Word; - DestNet : System.Word; - Attribute : System.Word; - Cost : System.Word; - DateTime : String[19]; - End; - - RecPKTHeader = Record - OrigNode : System.Word; - DestNode : System.Word; - Year : System.Word; - Month : System.Word; - Day : System.Word; - Hour : System.Word; - Minute : System.Word; - Second : System.Word; - Baud : System.Word; - PKTType : System.Word; - OrigNet : System.Word; - DestNet : System.Word; - ProdCode : System.Word; // Apply to FTSC for code? - Password : Array[1..8] of Char; - OrigZone : System.Word; - DestZone : System.Word; - Filler : Array[1..20] of Char; - End; - RecEchoMailAddr = Record Zone, Net, diff --git a/mystic/todo.pas b/mystic/todo.pas index 071a3b7..824f297 100644 --- a/mystic/todo.pas +++ b/mystic/todo.pas @@ -8,6 +8,7 @@ design elements/issues. BUGS AND POSSIBLE ISSUES ======================== +! GE option 32 (change def protocol) might be broken ! LBP menus arent scrolling correctly in Linux ! MUTIL FILESBBS import is not skipping FILES.BBS? ! Make sure MIS in Linux works with DOSEMU @@ -28,6 +29,9 @@ BUGS AND POSSIBLE ISSUES FUTURE / IDEAS / WORK IN PROGRESS / NOTES ========================================= +- Amiga .readme and .TIC processing (similar) +- New files list to MUTIL based X number of days +- All/new file list template files like TOP XX - MUTIL create FILES.BBS in the file base directory - MUTILs new DIR import of msg bases could have optional config to reference a series of .NA files to get the name/description of bases. diff --git a/mystic/whatsnew.txt b/mystic/whatsnew.txt index 65e51ca..5dd953e 100644 --- a/mystic/whatsnew.txt +++ b/mystic/whatsnew.txt @@ -2898,3 +2898,17 @@ + + Added new INBOUND and OUTBOUND echomail directories into the System + Configuration. + + + Added new Echomail node editor. This allows you to configure nodes which + you are going to exchange echomail from, either an uplink or downlink. + + + Message bases now have a echomail TAG option which is intended to include + the bases's echomail tag from the .NA files. + + + Message bases now have an "Export To" option where up to 2 million + echomail nodes can be linked to each message base. + + + The echomail node editor now has an editor where message bases can be + list, linked, and unlinked from each configured node.