More QWKnet work

This commit is contained in:
mysticbbs 2013-09-05 21:08:36 -04:00
parent 38958c7d1b
commit 8796ac66f4
8 changed files with 180 additions and 88 deletions

View File

@ -137,7 +137,7 @@ Begin
Form.AddStr ('T', ' R Template' , 5, 19, 19, 19, 12, 20, 20, @MBase.RTemplate, Topic + 'Template for full screen reader'); Form.AddStr ('T', ' R Template' , 5, 19, 19, 19, 12, 20, 20, @MBase.RTemplate, Topic + 'Template for full screen reader');
Form.AddStr ('M', ' L Template' , 5, 20, 19, 20, 12, 20, 20, @MBase.ITemplate, Topic + 'Template for lightbar message list'); Form.AddStr ('M', ' L Template' , 5, 20, 19, 20, 12, 20, 20, @MBase.ITemplate, Topic + 'Template for lightbar message list');
Form.AddNone ('0', ' QWK Network' , 4, 21, 19, 21, 13, Topic + 'QWK network associated to this base'); Form.AddNone ('0', ' QWK Network' , 4, 21, 19, 21, 13, Topic + 'QWK network associated to this base');
Form.AddLong ('!', ' QWK Base ID' , 4, 22, 19, 22, 13, 6, 0, 999999, @MBase.QwkConfID, Topic + 'QWK network base ID'); Form.AddWord ('!', ' QWK Base ID' , 4, 22, 19, 22, 13, 5, 0, 65535, @MBase.QwkConfID, Topic + 'QWK network base ID');
Form.AddAttr ('Q', ' Quote Color' , 53, 5, 68, 5, 13, @MBase.ColQuote, Topic + 'Color for quoted text'); Form.AddAttr ('Q', ' Quote Color' , 53, 5, 68, 5, 13, @MBase.ColQuote, Topic + 'Color for quoted text');
Form.AddAttr ('X', ' Text Color' , 54, 6, 68, 6, 12, @MBase.ColText, Topic + 'Color for message text'); Form.AddAttr ('X', ' Text Color' , 54, 6, 68, 6, 12, @MBase.ColText, Topic + 'Color for message text');

View File

@ -30,8 +30,8 @@ Begin
Box.Header := ' Index ' + strI2S(QwkNet.Index) + ' '; Box.Header := ' Index ' + strI2S(QwkNet.Index) + ' ';
Box.Open (16, 5, 65, 16); Box.Open (16, 5, 65, 17);
VerticalLine (32, 7, 14); VerticalLine (32, 7, 15);
Form.AddStr ('D', ' Network Name', 18, 7, 34, 7, 14, 30, 30, @QwkNet.Description, Topic + 'Network name'); Form.AddStr ('D', ' Network Name', 18, 7, 34, 7, 14, 30, 30, @QwkNet.Description, Topic + 'Network name');
Form.AddTog ('M', ' Member Type', 19, 8, 34, 8, 13, 4, 0, 1, 'HUB Node', @QwkNet.MemberType, Topic + 'Are you a HUB or a Node of this network?'); Form.AddTog ('M', ' Member Type', 19, 8, 34, 8, 13, 4, 0, 1, 'HUB Node', @QwkNet.MemberType, Topic + 'Are you a HUB or a Node of this network?');
@ -40,7 +40,8 @@ Begin
Form.AddPass ('P', ' Password', 22, 11, 34, 11, 10, 20, 20, @QwkNet.Password, Topic + 'FTP password'); Form.AddPass ('P', ' Password', 22, 11, 34, 11, 10, 20, 20, @QwkNet.Password, Topic + 'FTP password');
Form.AddBol ('U', ' Use Passive', 19, 12, 34, 12, 13, 3, @QwkNet.UsePassive, Topic + 'Use passive FTP with HUB'); Form.AddBol ('U', ' Use Passive', 19, 12, 34, 12, 13, 3, @QwkNet.UsePassive, Topic + 'Use passive FTP with HUB');
Form.AddStr ('I', ' Packet ID', 21, 13, 34, 13, 11, 20, 20, @QwkNet.PacketID, Topic + 'QWK packet name to use with HUB'); Form.AddStr ('I', ' Packet ID', 21, 13, 34, 13, 11, 20, 20, @QwkNet.PacketID, Topic + 'QWK packet name to use with HUB');
Form.AddBol ('E', ' Use QWKE', 22, 14, 34, 14, 10, 3, @QwkNet.UseQWKE, Topic + 'Create QWKE packets for HUB'); Form.AddCaps ('A', ' Archive Type', 18, 14, 34, 14, 14, 4, 4, @QwkNet.ArcType, Topic + 'Archive type used for packets');
Form.AddBol ('E', ' Use QWKE', 22, 15, 34, 15, 10, 3, @QwkNet.UseQWKE, Topic + 'Create QWKE packets for HUB');
Form.Execute; Form.Execute;
@ -111,6 +112,7 @@ Var
With QwkNet Do Begin With QwkNet Do Begin
Description := 'New QWK Network'; Description := 'New QWK Network';
ArcType := 'ZIP';
Index := GetPermanentIndex(FileSize(QwkFile)); Index := GetPermanentIndex(FileSize(QwkFile));
End; End;

View File

@ -4,6 +4,8 @@ Unit BBS_DataBase;
// replace with this new stuff one at a time. including moving everything // replace with this new stuff one at a time. including moving everything
// to bbscfg. // to bbscfg.
// add generatembase/fbase/userindex functions?
{$I M_OPS.PAS} {$I M_OPS.PAS}
Interface Interface
@ -44,6 +46,7 @@ Function Addr2Str (Addr : RecEchoMailAddr) : String;
Function MBaseOpenCreate (Var Msg: PMsgBaseABS; Var Area: RecMessageBase; TP: String) : Boolean; Function MBaseOpenCreate (Var Msg: PMsgBaseABS; Var Area: RecMessageBase; TP: String) : Boolean;
Function GetOriginLine (Var mArea: RecMessageBase) : String; Function GetOriginLine (Var mArea: RecMessageBase) : String;
Function GetMBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean; Function GetMBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Function GetMBaseByQwkID (QwkNet, QwkConf: LongInt; Var TempBase: RecMessageBase) : Boolean;
Procedure GetMessageScan (UN: Cardinal; TempBase: RecMessageBase; Var TempScan: MScanRec); Procedure GetMessageScan (UN: Cardinal; TempBase: RecMessageBase; Var TempScan: MScanRec);
Procedure PutMessageScan (UN: Cardinal; TempBase: RecMessageBase; TempScan: MScanRec); Procedure PutMessageScan (UN: Cardinal; TempBase: RecMessageBase; TempScan: MScanRec);
Procedure MBaseAssignData (Var User: RecUser; Var Msg: PMsgBaseABS; Var TempBase: RecMessageBase); Procedure MBaseAssignData (Var User: RecUser; Var Msg: PMsgBaseABS; Var TempBase: RecMessageBase);
@ -242,6 +245,31 @@ Begin
Close (F); Close (F);
End; End;
Function GetMBaseByQwkID (QwkNet, QwkConf: LongInt; Var TempBase: RecMessageBase) : Boolean;
Var
F : File;
Begin
Result := False;
Assign (F, bbsCfg.DataPath + 'mbases.dat');
If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit;
While Not Eof(F) Do Begin
ioRead (F, TempBase);
If (TempBase.QwkNetID = QwkNet) and (TempBase.QwkConfID = QwkConf) Then Begin
Result := True;
Break;
End;
End;
writeln ('base result:',result);
Close (F);
End;
Function GetQWKNetByIndex (Num: LongInt; Var TempNet: RecQwkNetwork) : Boolean; Function GetQWKNetByIndex (Num: LongInt; Var TempNet: RecQwkNetwork) : Boolean;
Var Var
F : File; F : File;

View File

@ -809,7 +809,7 @@ Var
While Not Eof(MBaseFile) Do Begin While Not Eof(MBaseFile) Do Begin
Read (MBaseFile, MBase); Read (MBaseFile, MBase);
If QwkNet And (MBase.Flags AND MBAllowQWKNet = 0) Then Continue; If QwkNet And (MBase.QwkNetID <> Session.User.ThisUser.QwkNetwork) Then Continue;
If Session.User.Access(MBase.ListACS) Then Begin If Session.User.Access(MBase.ListACS) Then Begin
Inc (Total); Inc (Total);
@ -3304,14 +3304,7 @@ Var
Begin Begin
Found := False; Found := False;
Case TempBase.BaseType of If MBaseOpenCreate (MsgBase, TempBase, Session.TempPath) Then Begin
0 : MsgBase := New(PMsgBaseJAM, Init);
1 : MsgBase := New(PMsgBaseSquish, Init);
End;
MsgBase^.SetMsgPath (TempBase.Path + TempBase.FileName);
If MsgBase^.OpenMsgBase Then Begin
MsgBase^.SeekFirst(1); MsgBase^.SeekFirst(1);
While MsgBase^.SeekFound Do Begin While MsgBase^.SeekFound Do Begin
@ -3319,9 +3312,12 @@ Var
If DateStr2Dos(MsgBase^.GetDate) >= NewDate Then Begin If DateStr2Dos(MsgBase^.GetDate) >= NewDate Then Begin
MsgBase^.SetLastRead(Session.User.UserNum, MsgBase^.GetMsgNum - 1); MsgBase^.SetLastRead(Session.User.UserNum, MsgBase^.GetMsgNum - 1);
Found := True; Found := True;
Break; Break;
End; End;
MsgBase^.SeekNext; MsgBase^.SeekNext;
End; End;
@ -3359,6 +3355,8 @@ Begin
UpdateBase; UpdateBase;
End; End;
Close (MBaseFile);
End Else Begin End Else Begin
TempBase := MBase; TempBase := MBase;
@ -4162,7 +4160,7 @@ Begin
Write (tFile, bbsCfg.SysopName + CRLF); Write (tFile, bbsCfg.SysopName + CRLF);
Write (tFile, '0,' + bbsCfg.qwkBBSID + CRLF); Write (tFile, '0,' + bbsCfg.qwkBBSID + CRLF);
Write (tFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + CRLF); Write (tFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + CRLF);
Write (tFile, strUpper(Session.User.ThisUser.Handle) + CRLF); Write (tFile, Session.User.ThisUser.Handle + CRLF);
Write (tFile, CRLF); Write (tFile, CRLF);
Write (tFile, '0' + CRLF); Write (tFile, '0' + CRLF);
Write (tFile, TotalMsgs, CRLF); {TOTAL MSG IN PACKET} Write (tFile, TotalMsgs, CRLF); {TOTAL MSG IN PACKET}
@ -4303,9 +4301,9 @@ Begin
strPadR(strI2S(MsgBase^.GetMsgNum), 7, ' ') + strPadR(strI2S(MsgBase^.GetMsgNum), 7, ' ') +
MsgBase^.GetDate + MsgBase^.GetDate +
MsgBase^.GetTime + MsgBase^.GetTime +
strPadR(strUpper(MsgBase^.GetTo), 25, ' ') + strPadR(MsgBase^.GetTo, 25, ' ') +
strPadR(strUpper(MsgBase^.GetFrom), 25, ' ') + strPadR(MsgBase^.GetFrom, 25, ' ') +
strPadR(strUpper(MsgBase^.GetSubj), 25, ' ') + strPadR(MsgBase^.GetSubj, 25, ' ') +
strPadR('', 12, ' ') + strPadR('', 12, ' ') +
strPadR(strI2S(MsgBase^.GetRefer), 8, ' ') + strPadR(strI2S(MsgBase^.GetRefer), 8, ' ') +
strPadR(strI2S(Chunks), 6, ' ') + strPadR(strI2S(Chunks), 6, ' ') +

View File

@ -57,7 +57,7 @@ Type
WorkPath : String; WorkPath : String;
PacketID : String; PacketID : String;
UserRecord : RecUser; UserRecord : RecUser;
UserNumber : Cardinal; UserNumber : LongInt;
TotalMessages : LongInt; TotalMessages : LongInt;
TotalBases : LongInt; TotalBases : LongInt;
RepOK : LongInt; RepOK : LongInt;
@ -71,15 +71,15 @@ Type
QwkLRFile : File of QwkLRRec; QwkLRFile : File of QwkLRRec;
MsgBase : PMsgBaseABS; MsgBase : PMsgBaseABS;
Constructor Create (QwkPath, QwkID: String; UN: Cardinal; UR: RecUser); Constructor Create (QwkPath, QwkID: String; UN: LongInt; UR: RecUser);
Procedure LONG2MSB (Index: LongInt; Var MS: BSingle); Procedure LONG2MSB (Index: LongInt; Var MS: BSingle);
Procedure WriteDOORID; Procedure WriteDOORID;
Procedure WriteTOREADEREXT; Procedure WriteTOREADEREXT;
Procedure WriteCONTROLDAT; Procedure WriteCONTROLDAT;
Function WriteMSGDAT : LongInt; Function WriteMSGDAT (IsRep: Boolean) : LongInt;
Procedure UpdateLastReadPointers; Procedure UpdateLastReadPointers;
Procedure CreatePacket; Procedure ExportPacket (IsRep: Boolean);
Function ProcessReply : Boolean; Function ImportPacket (IsQwk: Boolean) : Boolean;
End; End;
Implementation Implementation
@ -88,7 +88,7 @@ Uses
m_Strings, m_Strings,
m_DateTime; m_DateTime;
Constructor TQWKEngine.Create (QwkPath, QwkID: String; UN: Cardinal; UR: RecUser); Constructor TQWKEngine.Create (QwkPath, QwkID: String; UN: LongInt; UR: RecUser);
Begin Begin
Inherited Create; Inherited Create;
@ -215,7 +215,7 @@ Begin
Write (TempFile, bbsCfg.SysopName + QWK_EOL); Write (TempFile, bbsCfg.SysopName + QWK_EOL);
Write (TempFile, '0,' + PacketID + QWK_EOL); Write (TempFile, '0,' + PacketID + QWK_EOL);
Write (TempFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + QWK_EOL); Write (TempFile, DateDos2Str(CurDateDos, 1), ',', TimeDos2Str(CurDateDos, 0) + QWK_EOL);
Write (TempFile, strUpper(UserRecord.Handle) + QWK_EOL); Write (TempFile, UserRecord.Handle + QWK_EOL);
Write (TempFile, QWK_EOL); Write (TempFile, QWK_EOL);
Write (TempFile, '0' + QWK_EOL); Write (TempFile, '0' + QWK_EOL);
Write (TempFile, TotalMessages, QWK_EOL); Write (TempFile, TotalMessages, QWK_EOL);
@ -227,6 +227,9 @@ Begin
ioRead (BaseFile, Base); ioRead (BaseFile, Base);
If HasAccess(Self, Base.ReadACS) Then Begin If HasAccess(Self, Base.ReadACS) Then Begin
If IsNetworked Then
Write (TempFile, Base.QwkConfID, QWK_EOL)
Else
Write (TempFile, Base.Index, QWK_EOL); Write (TempFile, Base.Index, QWK_EOL);
If IsExtended Then If IsExtended Then
@ -246,7 +249,7 @@ Begin
Close (TempFile); Close (TempFile);
End; End;
Function TQWKEngine.WriteMSGDAT : LongInt; Function TQWKEngine.WriteMSGDAT (IsRep: Boolean) : LongInt;
Var Var
NdxFile : File of QwkNdxHdr; NdxFile : File of QwkNdxHdr;
NdxHdr : QwkNdxHdr; NdxHdr : QwkNdxHdr;
@ -280,24 +283,38 @@ Begin
If Not MBaseOpenCreate(MsgBase, MBase, WorkPath) Then Exit; If Not MBaseOpenCreate(MsgBase, MBase, WorkPath) Then Exit;
If IsRep Then
LastRead := 1
Else
LastRead := MsgBase^.GetLastRead(UserNumber) + 1; LastRead := MsgBase^.GetLastRead(UserNumber) + 1;
MsgBase^.SeekFirst (LastRead); MsgBase^.SeekFirst (LastRead);
While MsgBase^.SeekFound Do Begin While MsgBase^.SeekFound Do Begin
If Not IsNetworked Then
If ((bbsCfg.QwkMaxBase > 0) and (MsgAdded = bbsCfg.QwkMaxBase)) or If ((bbsCfg.QwkMaxBase > 0) and (MsgAdded = bbsCfg.QwkMaxBase)) or
((bbsCfg.QwkMaxPacket > 0) and (TotalMessages = bbsCfg.QwkMaxPacket)) Then Break; ((bbsCfg.QwkMaxPacket > 0) and (TotalMessages = bbsCfg.QwkMaxPacket)) Then Break;
MsgBase^.MsgStartUp; MsgBase^.MsgStartUp;
If IsRep And MsgBase^.IsSent Then Begin
MsgBase^.SeekNext;
Continue;
End;
If Not IsNetworked Then
If MsgBase^.IsPriv And Not IsThisUser(UserRecord, MsgBase^.GetTo) Then Begin If MsgBase^.IsPriv And Not IsThisUser(UserRecord, MsgBase^.GetTo) Then Begin
MsgBase^.SeekNext; MsgBase^.SeekNext;
Continue; Continue;
End; End;
If IsRep Then Begin
MsgBase^.SetSent(True);
MsgBase^.ReWriteHdr;
End;
Inc (MsgAdded); Inc (MsgAdded);
Inc (TotalMessages); Inc (TotalMessages);
@ -327,9 +344,9 @@ Begin
strPadR(strI2S(MsgBase^.GetMsgNum), 7, ' ') + strPadR(strI2S(MsgBase^.GetMsgNum), 7, ' ') +
MsgBase^.GetDate + MsgBase^.GetDate +
MsgBase^.GetTime + MsgBase^.GetTime +
strPadR(strUpper(MsgBase^.GetTo), 25, ' ') + strPadR(MsgBase^.GetTo, 25, ' ') +
strPadR(strUpper(MsgBase^.GetFrom), 25, ' ') + strPadR(MsgBase^.GetFrom, 25, ' ') +
strPadR(strUpper(MsgBase^.GetSubj), 25, ' ') + strPadR(MsgBase^.GetSubj, 25, ' ') +
strPadR('', 12, ' ') + strPadR('', 12, ' ') +
strPadR(strI2S(MsgBase^.GetRefer), 8, ' ') + strPadR(strI2S(MsgBase^.GetRefer), 8, ' ') +
strPadR(strI2S(Chunks), 6, ' ') + strPadR(strI2S(Chunks), 6, ' ') +
@ -338,6 +355,11 @@ Begin
' ' + ' ' +
' '; ' ';
If IsNetworked Then
Move (Word(MBase.QwkConfID), Header[124], 2)
Else
Move (Word(MBase.Index), Header[124], 2);
If Not IsNetworked Then Begin If Not IsNetworked Then Begin
If MsgAdded = 1 Then Begin If MsgAdded = 1 Then Begin
Assign (NdxFile, WorkPath + strPadL(strI2S(MBase.Index), 3, '0') + '.ndx'); Assign (NdxFile, WorkPath + strPadL(strI2S(MBase.Index), 3, '0') + '.ndx');
@ -425,15 +447,23 @@ Begin
Close (MBaseFile); Close (MBaseFile);
End; End;
Procedure TQWKEngine.CreatePacket; Procedure TQWKEngine.ExportPacket (IsRep: Boolean);
Var Var
Temp : String; Temp : String;
MScan : MScanRec; MScan : MScanRec;
Begin Begin
If IsRep Then
Temp := PacketID + '.msg'
Else
Temp := 'messages.dat';
DataFile := TFileBuffer.Create(4 * 1024); DataFile := TFileBuffer.Create(4 * 1024);
DataFile.OpenStream (WorkPath + 'messages.dat', 1, fmCreate, fmRWDN); DataFile.OpenStream (WorkPath + Temp, 1, fmCreate, fmRWDN);
If IsRep Then
Temp := strPadR(PacketID, 128, ' ')
Else
Temp := strPadR('Produced By ' + mysSoftwareID + ' v' + mysVersion + '. ' + mysCopyNotice, 128, ' '); Temp := strPadR('Produced By ' + mysSoftwareID + ' v' + mysVersion + '. ' + mysCopyNotice, 128, ' ');
DataFile.WriteBlock (Temp[1], 128); DataFile.WriteBlock (Temp[1], 128);
@ -449,18 +479,21 @@ Begin
While Not Eof(MBaseFile) Do Begin While Not Eof(MBaseFile) Do Begin
ioRead (MBaseFile, MBase); ioRead (MBaseFile, MBase);
If IsNetworked And (MBase.Flags AND MBAllowQWKNet = 0) Then If IsNetworked And ((MBase.QwkNetID <> UserRecord.QwkNetwork) or (UserRecord.QwkNetwork = 0)) Then
Continue; Continue;
If HasAccess(Self, MBase.ReadACS) Then Begin If IsRep Or (HasAccess(Self, MBase.ReadACS)) Then Begin
If IsRep Then
MScan.QwkScan := 1
Else
GetMessageScan (UserNumber, MBase, MScan); GetMessageScan (UserNumber, MBase, MScan);
If MScan.QwkScan > 0 Then Begin If MScan.QwkScan > 0 Then Begin
Inc (TotalBases); Inc (TotalBases);
QwkLR.Base := FilePos(MBaseFile); QwkLR.Base := FilePos(MBaseFile);
QwkLR.Pos := WriteMSGDAT; QwkLR.Pos := WriteMSGDAT(IsRep);
Write (QwkLRFile, QwkLR); Write (QwkLRFile, QwkLR);
End; End;
@ -474,14 +507,12 @@ Begin
DataFile.Free; DataFile.Free;
If Not IsNetworked Then Begin
WriteControlDAT; WriteControlDAT;
WriteDOORID; WriteDOORID;
WriteTOREADEREXT; WriteTOREADEREXT;
End;
End; End;
Function TQWKEngine.ProcessReply : Boolean; Function TQWKEngine.ImportPacket (IsQwk: Boolean) : Boolean;
Procedure QwkControl (Idx: LongInt; Mode: Byte); Procedure QwkControl (Idx: LongInt; Mode: Byte);
Var Var
@ -511,12 +542,18 @@ Var
ExtFile : Text; ExtFile : Text;
Count1 : SmallInt; Count1 : SmallInt;
Count2 : SmallInt; Count2 : SmallInt;
BaseFound : Boolean;
Begin Begin
Result := False; Result := False;
If IsQwk Then
Line := 'messages.dat'
Else
Line := PacketID + '.msg';
DataFile := TFileBuffer.Create(4 * 1024); DataFile := TFileBuffer.Create(4 * 1024);
If Not DataFile.OpenStream (FileFind(WorkPath + PacketID + '.msg'), 1, fmOpen, fmRWDN) Then Begin If Not DataFile.OpenStream (FileFind(WorkPath + Line), 1, fmOpen, fmRWDN) Then Begin
DataFile.Free; DataFile.Free;
DirClean (WorkPath, ''); DirClean (WorkPath, '');
@ -525,8 +562,10 @@ Begin
End; End;
DataFile.ReadBlock(QwkBlock[1], 128); DataFile.ReadBlock(QwkBlock[1], 128);
QwkBlock[0] := #128; QwkBlock[0] := #128;
If Not IsQwk Then
If Pos(strUpper(PacketID), strUpper(QwkBlock)) = 0 Then Begin If Pos(strUpper(PacketID), strUpper(QwkBlock)) = 0 Then Begin
DataFile.Free; DataFile.Free;
@ -538,20 +577,29 @@ Begin
While Not DataFile.EOF Do Begin While Not DataFile.EOF Do Begin
DataFile.ReadBlock(QwkHeader, SizeOf(QwkHeader)); DataFile.ReadBlock(QwkHeader, SizeOf(QwkHeader));
Move (QwkHeader.MsgNum, QwkBlock[1], 7); Move (QwkHeader.NumChunk, QwkBlock[1], 6);
QwkBlock[0] := #6;
QwkBlock[0] := #7; Chunks := strS2I(QwkBlock) - 1;
If GetMBaseByIndex(strS2I(QwkBlock), MBase) Then Begin If IsNetworked Then
BaseFound := GetMBaseByQwkID (UserRecord.QwkNetwork, QwkHeader.ConfNum, MBase)
// when polling userrecord.qwknetwork needs to be set to qwknetwork ID
Else
BaseFound := GetMBaseByIndex (QwkHeader.ConfNum, MBase);
If BaseFound Then Begin
If MBaseOpenCreate(MsgBase, MBase, WorkPath) Then Begin If MBaseOpenCreate(MsgBase, MBase, WorkPath) Then Begin
MBaseAssignData(UserRecord, MsgBase, MBase); MBaseAssignData(UserRecord, MsgBase, MBase);
If IsNetworked Then If IsNetworked Then Begin
MsgBase^.SetLocal(False); MsgBase^.SetLocal(False);
// need to think this stuff through for both HUB and node
// situations QwkBlock[0] := #25;
Move (QwkHeader.UpFrom, QwkBlock[1], 25);
MsgBase^.SetFrom(strStripR(QwkBlock, ' '));
End;
QwkBlock[0] := #25; QwkBlock[0] := #25;
Move (QwkHeader.UpTo, QwkBlock[1], 25); Move (QwkHeader.UpTo, QwkBlock[1], 25);
@ -565,15 +613,13 @@ Begin
MsgBase^.SetRefer(strS2I(strStripR(QwkBlock, ' '))); MsgBase^.SetRefer(strS2I(strStripR(QwkBlock, ' ')));
Move (QwkHeader.NumChunk, QwkBlock[1], 6);
Chunks := strS2I(QwkBlock) - 1;
Line := ''; Line := '';
LineCount := 0; LineCount := 0;
IsControl := MsgBase^.GetTo = QWK_CONTROL; IsControl := MsgBase^.GetTo = QWK_CONTROL;
GotControl := False; GotControl := False;
// disable control in network packets (for now?) // disable control in network packets (for now?)
// prob need to skip controls not just ignore?
If IsNetworked Then If IsNetworked Then
IsControl := False; IsControl := False;
@ -597,7 +643,7 @@ Begin
// ignore from name unless its networked // ignore from name unless its networked
If IsNetworked Then If IsNetworked Then
MsgBase^.SetTo(strStripB(Copy(Line, 6, Length(Line)), ' ')); MsgBase^.SetFrom(strStripB(Copy(Line, 6, Length(Line)), ' '));
End Else End Else
If (LineCount < 4) and (Copy(Line, 1, 3) = 'To:') Then Begin If (LineCount < 4) and (Copy(Line, 1, 3) = 'To:') Then Begin
MsgBase^.SetTo(strStripB(Copy(Line, 4, Length(Line)), ' ')); MsgBase^.SetTo(strStripB(Copy(Line, 4, Length(Line)), ' '));
@ -621,19 +667,18 @@ Begin
If Line <> '' Then If Line <> '' Then
MsgBase^.DoStringLn(Line); MsgBase^.DoStringLn(Line);
If Not IsNetworked Then
If MBase.NetType > 0 Then Begin If MBase.NetType > 0 Then Begin
If IsNetworked Then Begin
MsgBase^.DoStringLn (#13 + '--- ' + mysSoftwareID + '/QWK v' + mysVersion + ' (' + OSID + ')');
MsgBase^.DoStringLn (' * Origin: ' + GetOriginLine(MBase));
End Else Begin
MsgBase^.DoStringLn (#13 + '--- ' + mysSoftwareID + '/QWK v' + mysVersion + ' (' + OSID + ')'); MsgBase^.DoStringLn (#13 + '--- ' + mysSoftwareID + '/QWK v' + mysVersion + ' (' + OSID + ')');
MsgBase^.DoStringLn (' * Origin: ' + GetOriginLine(MBase) + ' (' + Addr2Str(MsgBase^.GetOrigAddr) + ')'); MsgBase^.DoStringLn (' * Origin: ' + GetOriginLine(MBase) + ' (' + Addr2Str(MsgBase^.GetOrigAddr) + ')');
End; End;
End;
If Not IsControl Then Begin If Not IsControl Then Begin
If HasAccess(Self, MBase.PostACS) Then Begin If ((IsQwk) or (HasAccess(Self, MBase.PostACS))) and
((IsNetworked And (UserRecord.QwkNetwork = MBase.QwkNetID)) or (Not IsNetworked)) Then Begin
MsgBase^.WriteMsg; MsgBase^.WriteMsg;
Inc (RepOK); // must increase user and history posts by repOK Inc (RepOK); // must increase user and history posts by repOK
End Else End Else
Inc (RepFailed); Inc (RepFailed);
@ -642,10 +687,18 @@ Begin
MsgBase^.CloseMsgBase; MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done); Dispose (MsgBase, Done);
End Else End Else Begin
Inc (RepFailed); Inc (RepFailed);
End Else
For Count1 := 1 to Chunks Do
DataFile.ReadBlock (QwkBlock[1], 128);
End;
End Else Begin
Inc (RepFailed); Inc (RepFailed);
For Count1 := 1 to Chunks Do
DataFile.ReadBlock (QwkBlock[1], 128);
End;
End; End;
DataFile.Free; DataFile.Free;

View File

@ -56,7 +56,7 @@ Type
Function FindDirectory (Var TempBase: RecFileBase) : LongInt; Function FindDirectory (Var TempBase: RecFileBase) : LongInt;
Function GetQWKName : String; Function GetQWKName : String;
Function GetFTPDate (DD: LongInt) : String; Function GetFTPDate (DD: LongInt) : String;
Procedure SendFile (Str: String); Function SendFile (Str: String) : Boolean;
Function RecvFile (Str: String; IsAppend: Boolean) : Boolean; Function RecvFile (Str: String; IsAppend: Boolean) : Boolean;
Function QWKCreatePacket : Boolean; Function QWKCreatePacket : Boolean;
@ -484,7 +484,7 @@ Begin
InTransfer := False; InTransfer := False;
End; End;
Procedure TFTPServer.SendFile (Str: String); Function TFTPServer.SendFile (Str: String) : Boolean;
Var Var
F : File; F : File;
Buf : Array[1..FileXferSize] of Byte; Buf : Array[1..FileXferSize] of Byte;
@ -512,8 +512,11 @@ Begin
Close (F); Close (F);
Server.Status(ProcessID, 'Send complete'); Result := Res = 0;
// need to send failed here if failed what do we send?
Server.Status(ProcessID, 'Send complete');
Client.WriteLine (re_XferOK); Client.WriteLine (re_XferOK);
CloseDataSession; CloseDataSession;
@ -537,15 +540,17 @@ Begin
QWK := TQwkEngine.Create(TempPath, GetQWKName, UserPos, User); QWK := TQwkEngine.Create(TempPath, GetQWKName, UserPos, User);
QWK.HasAccess := @QWKHasAccess; QWK.HasAccess := @QWKHasAccess;
QWK.IsNetworked := User.Flags AND UserQWKNetwork <> 0; QWK.IsNetworked := (User.Flags AND UserQWKNetwork <> 0);
QWK.IsExtended := User.QwkExtended; QWK.IsExtended := User.QwkExtended;
QWK.CreatePacket; QWK.ExportPacket(False);
QWK.UpdateLastReadPointers;
QWK.Free;
ExecuteArchive (TempPath, TempPath + GetQWKName + '.qwk', User.Archive, TempPath + '*', 1); ExecuteArchive (TempPath, TempPath + GetQWKName + '.qwk', User.Archive, TempPath + '*', 1);
SendFile (TempPath + GetQWKName + '.qwk');
If SendFile (TempPath + GetQWKName + '.qwk') Then
QWK.UpdateLastReadPointers;
QWK.Free;
DirClean (TempPath, ''); DirClean (TempPath, '');
End; End;
@ -567,7 +572,7 @@ Begin
QWK.IsNetworked := User.Flags AND UserQWKNetwork <> 0; QWK.IsNetworked := User.Flags AND UserQWKNetwork <> 0;
QWK.IsExtended := User.QwkExtended; QWK.IsExtended := User.QwkExtended;
QWK.ProcessReply; QWK.ImportPacket(False);
QWK.Free; QWK.Free;
// update user stats posts and bbs history if not networked // update user stats posts and bbs history if not networked
@ -600,6 +605,9 @@ Begin
GetSecurityLevel(User.Security, SecLevel); GetSecurityLevel(User.Security, SecLevel);
Server.Status (ProcessID, User.Handle + ' logged in'); 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 End Else
Client.WriteLine(re_BadPW); Client.WriteLine(re_BadPW);
End; End;

View File

@ -141,7 +141,8 @@ Type
HostName : String[60]; HostName : String[60];
Login : String[20]; Login : String[20];
Password : String[20]; Password : String[20];
Res : Array[1..80] of Byte; ArcType : String[4];
Res : Array[1..75] of Byte;
End; End;
RecSauceInfo = Packed Record RecSauceInfo = Packed Record
@ -511,7 +512,6 @@ Const
MBNoAttach = $00000008; // 4 MBNoAttach = $00000008; // 4
MBPrivate = $00000010; // 5 MBPrivate = $00000010; // 5
MBPrivReply = $00000020; // 6 MBPrivReply = $00000020; // 6
MBAllowQWKNet = $00000040; // 7
Type Type
RecMessageBase = Record // MBASES.DAT RecMessageBase = Record // MBASES.DAT
@ -549,8 +549,8 @@ Type
Created : LongInt; Created : LongInt;
EchoTag : String[40]; // EchoMail Tag EchoTag : String[40]; // EchoMail Tag
QwkNetID : LongInt; QwkNetID : LongInt;
QwkConfID : LongInt; QwkConfID : Word;
Res : Array[1..27] of Byte; // RESERVED Res : Array[1..29] of Byte; // RESERVED
End; End;
FScanRec = Record { <Data Path> *.SCN } FScanRec = Record { <Data Path> *.SCN }

View File

@ -3638,4 +3638,7 @@
This defines the QWK network message bases that they have access to if This defines the QWK network message bases that they have access to if
they are flagged as a QWK network account. they are flagged as a QWK network account.
+ Mystic's QWK system no longer forces all upper case user names and
subjects.
<ALPHA 37 RELEASED> <ALPHA 37 RELEASED>