Code cleanup
This commit is contained in:
parent
3f97c8438f
commit
b1e85d5244
|
@ -55,9 +55,11 @@ Begin
|
||||||
FTP := TFTPClient.Create(bbsCfg.inetInterface);
|
FTP := TFTPClient.Create(bbsCfg.inetInterface);
|
||||||
|
|
||||||
If FTP.OpenConnection(QwkNet.HostName) Then Begin
|
If FTP.OpenConnection(QwkNet.HostName) Then Begin
|
||||||
writeln('DEBUG connected');
|
WriteLn (' - Connected');
|
||||||
|
|
||||||
If FTP.Authenticate(QwkNet.Login, QwkNet.Password) Then Begin
|
If FTP.Authenticate(QwkNet.Login, QwkNet.Password) Then Begin
|
||||||
writeln('DEBUG authenticated; sending REP');
|
WriteLn (' - Logged in as ', QwkNet.Login);
|
||||||
|
|
||||||
FTP.SendFile (QwkNet.UsePassive, TempPath + QwkNet.PacketID + '.rep');
|
FTP.SendFile (QwkNet.UsePassive, TempPath + QwkNet.PacketID + '.rep');
|
||||||
|
|
||||||
// if was sent successfully THEN update by setting
|
// if was sent successfully THEN update by setting
|
||||||
|
@ -66,14 +68,17 @@ Begin
|
||||||
// in QWK class if we do this.
|
// in QWK class if we do this.
|
||||||
|
|
||||||
DirClean (TempPath, '');
|
DirClean (TempPath, '');
|
||||||
writeln ('DEBUG downloading QWK packet');
|
|
||||||
FTP.GetFile (QwkNet.UsePassive, TempPath + QwkNet.PacketID + '.qwk');
|
FTP.GetFile (QwkNet.UsePassive, TempPath + QwkNet.PacketID + '.qwk');
|
||||||
writeln ('DEBUG unpacking QWK');
|
|
||||||
|
WriteLn (' - Unpacking QWK packet');
|
||||||
|
|
||||||
ExecuteArchive (TempPath, TempPath + QwkNet.PacketID + '.qwk', QwkNet.ArcType, '*', 2);
|
ExecuteArchive (TempPath, TempPath + QwkNet.PacketID + '.qwk', QwkNet.ArcType, '*', 2);
|
||||||
|
|
||||||
writeln ('DEBUG importing QWK');
|
WriteLn (' - Importing QWK packet');
|
||||||
|
|
||||||
QWK.ImportPacket(True);
|
QWK.ImportPacket(True);
|
||||||
writeln ('DEBUG imported QWK TODO add stats here');
|
|
||||||
|
WriteLn (' - Imported ', QWK.RepOK, ' messages (', QWK.RepFailed, ' failed)');
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -142,7 +147,6 @@ Var
|
||||||
Str : String;
|
Str : String;
|
||||||
F : File;
|
F : File;
|
||||||
QwkNet : RecQwkNetwork;
|
QwkNet : RecQwkNetwork;
|
||||||
Count : Byte = 0;
|
|
||||||
Mode : Byte;
|
Mode : Byte;
|
||||||
Begin
|
Begin
|
||||||
WriteLn;
|
WriteLn;
|
||||||
|
@ -181,8 +185,7 @@ Begin
|
||||||
ioRead (F, QwkNet);
|
ioRead (F, QwkNet);
|
||||||
|
|
||||||
Case Mode of
|
Case Mode of
|
||||||
0 : If PollByQwkNet(QwkNet) Then
|
0 : PollByQwkNet(QwkNet);
|
||||||
Inc (Count);
|
|
||||||
1 : ExportPacket(QwkNet, DirSlash(ParamStr(3)));
|
1 : ExportPacket(QwkNet, DirSlash(ParamStr(3)));
|
||||||
2 : ImportPacket(QwkNet, DirSlash(ParamStr(3)));
|
2 : ImportPacket(QwkNet, DirSlash(ParamStr(3)));
|
||||||
End;
|
End;
|
||||||
|
@ -194,8 +197,7 @@ Begin
|
||||||
If strS2I(Str) > 0 Then Begin
|
If strS2I(Str) > 0 Then Begin
|
||||||
If GetQwkNetByIndex(strS2I(Str), QwkNet) Then
|
If GetQwkNetByIndex(strS2I(Str), QwkNet) Then
|
||||||
Case Mode of
|
Case Mode of
|
||||||
0 : If PollByQwkNet(QwkNet) Then
|
0 : PollByQwkNet(QwkNet);
|
||||||
Inc (Count);
|
|
||||||
1 : ExportPacket(QwkNet, DirSlash(ParamStr(3)));
|
1 : ExportPacket(QwkNet, DirSlash(ParamStr(3)));
|
||||||
2 : ImportPacket(QwkNet, DirSlash(ParamStr(3)));
|
2 : ImportPacket(QwkNet, DirSlash(ParamStr(3)));
|
||||||
End;
|
End;
|
||||||
|
@ -218,6 +220,4 @@ Begin
|
||||||
WriteLn (' for systems that may want to use an alternative transport method');
|
WriteLn (' for systems that may want to use an alternative transport method');
|
||||||
WriteLn;
|
WriteLn;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
WriteLn ('Processed ', Count, ' QWK networks');
|
|
||||||
End.
|
End.
|
||||||
|
|
Loading…
Reference in New Issue