diff --git a/mystic/bbs_database.pas b/mystic/bbs_database.pas index 1a803d8..739d914 100644 --- a/mystic/bbs_database.pas +++ b/mystic/bbs_database.pas @@ -724,6 +724,7 @@ Begin Close (F); End; +(* Function GetFTNPKTName : String; Var Hour, Min, Sec, hSec : Word; @@ -734,6 +735,31 @@ Begin Result := strZero(Day) + strZero(Hour) + strZero(Min) + strZero(Sec); End; +*) + +Function GetFTNPKTName : String; +Var + Hour, Min, Sec, hSec : Word; + Year, Month, Day, DOW : Word; + SecsPast : Cardinal; +Begin + + // PKT filename format used by Mystic: + // 2 digit day of month + seconds past midnight + hundredths of second + // + // This gives a max possible value of 318640099 and will create unique + // packet names for up to one month accurate to the hundredth of a second. + // A 1/100th second delay when generating the name guarentees uniqueness. + // + // This value is then converted to hex to enforce a maximum of 8 characters. + + WaitMS (10); + GetDate (Year, Month, Day, DOW); + GetTime (Hour, Min, Sec, hSec); + + SecsPast := ((Hour * 60) * 60) + (Min * 60) + Sec; + Result := strI2H(strS2I(strZero(Day) + strPadL(strI2S(SecsPast), 5, '0') + strZero(hSec)), 8); +End; Function GetNodeByIndex (Num: LongInt; Var TempNode: RecEchoMailNode) : Boolean; Var diff --git a/mystic/mis_client_binkp.pas b/mystic/mis_client_binkp.pas index 3077040..e1b8d58 100644 --- a/mystic/mis_client_binkp.pas +++ b/mystic/mis_client_binkp.pas @@ -924,12 +924,12 @@ Begin Continue; End; - If Queue.Add(True, OutPath, DirInfo.Name, FileNewExt(DirInfo.Name, 'pkt')) Then - Queue.QData[Queue.QSize]^.Extra := OutPath; - - //If Queue.Add(True, OutPath, DirInfo.Name, FileNewExt(GetFTNPktName, 'pkt')) Then + //If Queue.Add(True, OutPath, DirInfo.Name, FileNewExt(DirInfo.Name, 'pkt')) Then // Queue.QData[Queue.QSize]^.Extra := OutPath; + If Queue.Add(True, OutPath, DirInfo.Name, GetFTNPKTName + '.pkt') Then + Queue.QData[Queue.QSize]^.Extra := OutPath; + FindNext (DirInfo); End; diff --git a/mystic/whatsnew.txt b/mystic/whatsnew.txt index fec9be7..e207010 100644 --- a/mystic/whatsnew.txt +++ b/mystic/whatsnew.txt @@ -3866,4 +3866,13 @@ ! MUTIL import of FIDOBONE will now replace / and \ characters when calculating the datafile name, if they exist in the echotag. + + Changed the filename format used when Mystic generates PKT filenames in + bundles and when sending ?UT files: + + Old way: Day of month + Hour + Minutes + Seconds + New way: Hex(Day + Seconds past midnight + Hundredth of seconds) + + This allows truely unique names down to the hundred of a second for a one + month period. It solves all collision issues caused by the old way! +