From f30bf00834ed1d459bbc17c35b3a26ceab56e233 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Fri, 6 Sep 2013 16:32:58 -0400 Subject: [PATCH] QWK networking hub tested/working --- mystic/bbs_database.pas | 2 -- mystic/bbs_msgbase_qwk.pas | 31 ++++++++++++++++++++++++++----- mystic/mis_client_ftp.pas | 5 +---- mystic/mutil_echoexport.pas | 3 ++- mystic/qwkpoll.pas | 24 +++++++++++++++++++++--- mystic/todo.pas | 2 ++ mystic/whatsnew.txt | 8 +++++++- 7 files changed, 59 insertions(+), 16 deletions(-) diff --git a/mystic/bbs_database.pas b/mystic/bbs_database.pas index a139188..0f84f16 100644 --- a/mystic/bbs_database.pas +++ b/mystic/bbs_database.pas @@ -265,8 +265,6 @@ Begin End; End; -writeln ('base result:',result); - Close (F); End; diff --git a/mystic/bbs_msgbase_qwk.pas b/mystic/bbs_msgbase_qwk.pas index dfd8779..7f711d3 100644 --- a/mystic/bbs_msgbase_qwk.pas +++ b/mystic/bbs_msgbase_qwk.pas @@ -278,6 +278,7 @@ Var Var TempStr : String; + SkipMsg : Boolean; Begin MsgAdded := 0; @@ -315,25 +316,38 @@ Begin MsgBase^.ReWriteHdr; End; - Inc (MsgAdded); - Inc (TotalMessages); - LastRead := MsgBase^.GetMsgNum; Chunks := 0; BufStr := ''; TooBig := False; QwkIndex := DataFile.FileSizeRaw DIV 128 + 1; + SkipMsg := False; MsgBase^.MsgTxtStartUp; - While Not MsgBase^.EOM Do Begin + While Not MsgBase^.EOM And Not SkipMsg Do Begin TempStr := MsgBase^.GetString(79); - If TempStr[1] = #1 Then Continue; + If TempStr[1] = #1 Then Begin + // Do not export msgs to a node if the msg came from the node + If IsNetworked And Not IsRep And (Copy(TempStr, 2, 4) = 'QSRC') Then + SkipMsg := strUpper(strWordGet(2, TempStr, ' ')) = strUpper(PacketID); + + Continue; + End; Inc (Chunks, Length(TempStr)); End; + If SkipMsg Then Begin + MsgBase^.SeekNext; + + Continue; + End; + + Inc (MsgAdded); + Inc (TotalMessages); + If Chunks MOD 128 = 0 Then Chunks := Chunks DIV 128 + 1 Else @@ -596,6 +610,8 @@ Begin If IsNetworked Then Begin MsgBase^.SetLocal(False); + If IsQwk Then MsgBase^.SetSent(True); + QwkBlock[0] := #25; Move (QwkHeader.UpFrom, QwkBlock[1], 25); MsgBase^.SetFrom(strStripR(QwkBlock, ' ')); @@ -675,8 +691,13 @@ Begin End; If Not IsControl Then Begin + // ISQWK = a node importing from HUB If ((IsQwk) or (HasAccess(Self, MBase.PostACS))) and ((IsNetworked And (UserRecord.QwkNetwork = MBase.QwkNetID)) or (Not IsNetworked)) Then Begin + + If IsNetworked And Not IsQWK Then + MsgBase^.DoStringLn (#1'QSRC ' + PacketID); + MsgBase^.WriteMsg; Inc (RepOK); // must increase user and history posts by repOK diff --git a/mystic/mis_client_ftp.pas b/mystic/mis_client_ftp.pas index f865740..0c5eb04 100644 --- a/mystic/mis_client_ftp.pas +++ b/mystic/mis_client_ftp.pas @@ -569,7 +569,7 @@ Begin QWK := TQwkEngine.Create(TempPath, GetQWKName, UserPos, User); QWK.HasAccess := @QWKHasAccess; - QWK.IsNetworked := User.Flags AND UserQWKNetwork <> 0; + QWK.IsNetworked := (User.Flags AND UserQWKNetwork <> 0); QWK.IsExtended := User.QwkExtended; QWK.ImportPacket(False); @@ -605,9 +605,6 @@ Begin GetSecurityLevel(User.Security, SecLevel); Server.Status (ProcessID, User.Handle + ' logged in'); - server.status (processID, 'DEBUG Pos ' + strI2S(UserPos)); - if user.flags and userqwknetwork <> 0 then - server.status (processID, 'DEBUG has networking'); End Else Client.WriteLine(re_BadPW); End; diff --git a/mystic/mutil_echoexport.pas b/mystic/mutil_echoexport.pas index 487cd7b..e04c50f 100644 --- a/mystic/mutil_echoexport.pas +++ b/mystic/mutil_echoexport.pas @@ -22,6 +22,7 @@ Uses BBS_MsgBase_JAM, BBS_MsgBase_Squish; +// Adds packet name into a FLO-type file if it does not exist already Procedure AddToFLOQueue (FloName, PacketFN: String); Var T : Text; @@ -95,7 +96,7 @@ Begin 0 : FLOName := FLOName + '.flo'; 1 : FLOName := FLOName + '.clo'; 2 : FLOName := FLOName + '.dlo'; - 3 : FlOName := FLOName + '.hlo'; + 3 : FLOName := FLOName + '.hlo'; End; // TODO diff --git a/mystic/qwkpoll.pas b/mystic/qwkpoll.pas index 1e8965f..832b109 100644 --- a/mystic/qwkpoll.pas +++ b/mystic/qwkpoll.pas @@ -75,6 +75,7 @@ Var F : File; QwkNet : RecQwkNetwork; Count : Byte = 0; + Mode : Byte; Begin WriteLn; WriteLn ('QWKPOLL Version ' + mysVersion); @@ -96,6 +97,14 @@ Begin Str := strUpper(strStripB(ParamStr(1), ' ')); + If strUpper(ParamStr(2)) = 'EXPORT' Then + Mode := 1 + Else + If strUpper(ParamStr(2)) = 'IMPORT' Then + Mode := 2 + Else + Mode := 0; + If (Str = 'ALL') Then Begin Assign (F, bbsCfg.DataPath + 'qwknet.dat'); @@ -117,10 +126,19 @@ Begin End Else Begin WriteLn ('Invalid command line.'); WriteLn; - WriteLn ('Syntax: QWKPOLL [ALL] or [Qwk Network Index]'); + WriteLn ('Syntax: QWKPOLL [ALL]'); + WriteLn (' [Qwk Network Index]'); + WriteLn (' [EXPORT] [QwkNet Index] [PATH TO CREATE REP]'); + WriteLn (' [IMPORT] [QwkNet Index] [PATH OF QWK PACKET]'); WriteLn; - WriteLn ('Ex: QWKPOLL ALL - Exchange with ALL configured QWK hubs via FTP'); - WriteLn (' QWKPOLL 1 - Exchange with only Qwk Network #1'); + WriteLn ('Ex: QWKPOLL ALL - Exchange with ALL QWK hubs via FTP'); + WriteLn (' QWKPOLL 1 - Exchange with only Qwk Network #1'); + WriteLn (' QWKPOLL 1 EXPORT /bbs/qwknet - Create REP packet in /bbs/qwknet'); + WriteLn (' QWKPOLL 1 IMPORT /bbs/qwknet - Import QWK packet from /bbs/qwknet'); + WriteLn; + WriteLn ('NOTE: QWKPOLL automatically deals with QWK and REP packets during polling'); + WriteLn (' The export and import functions are not needed, and only provided'); + WriteLn (' for systems that may want to use an alternative transport method'); WriteLn; End; diff --git a/mystic/todo.pas b/mystic/todo.pas index c7d3e57..b9012a5 100644 --- a/mystic/todo.pas +++ b/mystic/todo.pas @@ -42,6 +42,8 @@ BUGS AND POSSIBLE ISSUES FUTURE / IDEAS / WORK IN PROGRESS / NOTES ========================================= +- when editing an already posted message with reference linkage, export the + quote data from the original message... - in file listing jump to files by typing the file number - remove console class code from mutil since its in bbs_database ^ same with keyboard diff --git a/mystic/whatsnew.txt b/mystic/whatsnew.txt index 0afb8e9..896dab3 100644 --- a/mystic/whatsnew.txt +++ b/mystic/whatsnew.txt @@ -3028,7 +3028,13 @@ I know all of this is confusing and stupid, but I didn't create the standard I'm only dealing with it! :) - 8. At your own risk: Delete FastEcho, GEcho, CrashMail, etc. :) + 8. At your own risk: Delete FastEcho, GEcho, CrashMail, etc. :) + + NOTE that the first time you run the export function of MUTIL it may + toss all messages in your bases, depending on what tosser you used + before Mystic's tosser. You can just delete all the packets in your + outbound directory after running it the first time. This problem will + go away once tossing is finished. ! Fixed a bug that could cause the user editor to crash directly after a new install if you didn't create your SysOp account first.