Update for filebase record changes

This commit is contained in:
mysticbbs 2012-02-26 07:45:21 -05:00
parent 391ac4bef0
commit 0a8502afb1
10 changed files with 44 additions and 38 deletions

View File

@ -630,6 +630,7 @@ Procedure TBufFile.FlushBuffer;
Begin Begin
System.Seek (BufFile, BufFilePos); System.Seek (BufFile, BufFilePos);
System.BlockWrite (BufFile, Buffer^, BufTop, BufTop); System.BlockWrite (BufFile, Buffer^, BufTop, BufTop);
IoResult := System.IoResult; IoResult := System.IoResult;
// BufPos := 0; // BufPos := 0;

View File

@ -1083,6 +1083,8 @@ Begin
If OldFBase.IsCDROM Then FBase.Flags := FBase.Flags OR FBSlowMedia; If OldFBase.IsCDROM Then FBase.Flags := FBase.Flags OR FBSlowMedia;
If OldFBase.IsFREE Then FBase.Flags := FBase.Flags OR FBFreeFiles; If OldFBase.IsFREE Then FBase.Flags := FBase.Flags OR FBFreeFiles;
FBase.Index := 0; // calc this now?
Write (FBaseFile, FBase); Write (FBaseFile, FBase);
End; End;

View File

@ -122,7 +122,7 @@ Begin
List.LoChars := #13#27#47; List.LoChars := #13#27#47;
List.AllowTag := True; List.AllowTag := True;
// If FBaseFile.FileSize = 0 Then InsertRecord; If FBaseFile.FileSize = 0 Then InsertRecord;
Box.Open (15, 5, 65, 21); Box.Open (15, 5, 65, 21);

View File

@ -24,8 +24,6 @@ Begin
Box := TAnsiMenuBox.Create; Box := TAnsiMenuBox.Create;
Form := TAnsiMenuForm.Create; Form := TAnsiMenuForm.Create;
Box.Header := ' Group Editor ';
Box.Open (14, 10, 67, 16); Box.Open (14, 10, 67, 16);
VerticalLine (24, 12, 14); VerticalLine (24, 12, 14);

View File

@ -393,11 +393,11 @@ Procedure UpdateDataFiles;
Var Var
CfgFile : File of RecConfig; CfgFile : File of RecConfig;
MBaseFile : File of MBaseRec; MBaseFile : File of MBaseRec;
FBaseFile : File of FBaseRec; FBaseFile : File of RecFileBase;
LangFile : File of LangRec; LangFile : File of LangRec;
Cfg : RecConfig; Cfg : RecConfig;
MBase : MBaseRec; MBase : MBaseRec;
FBase : FBaseRec; FBase : RecFileBase;
TLang : LangRec; TLang : LangRec;
TF : Text; TF : Text;
Begin Begin

View File

@ -197,8 +197,8 @@ End;
Procedure Sort_File_Bases; Procedure Sort_File_Bases;
Var Var
SortList : TQuickSort; SortList : TQuickSort;
FBaseFile : File of FBaseRec; FBaseFile : File of RecFileBase;
FBase : FBaseRec; FBase : RecFileBase;
FDirFile : File of RecFileList; FDirFile : File of RecFileList;
TFDirFile : File of RecFileList; TFDirFile : File of RecFileList;
FDir : RecFileList; FDir : RecFileList;
@ -267,8 +267,8 @@ Var
FDir : RecFileList; FDir : RecFileList;
DataFile : File; DataFile : File;
TDataFile : File; TDataFile : File;
FBaseFile : File of FBaseRec; FBaseFile : File of RecFileBase;
FBase : FBaseRec; FBase : RecFileBase;
Begin Begin
Write ('Packing File Bases : '); Write ('Packing File Bases : ');
@ -337,8 +337,8 @@ End;
Procedure Check_File_Bases; Procedure Check_File_Bases;
Var Var
FBaseFile : File of FBaseRec; FBaseFile : File of RecFileBase;
FBase : FBaseRec; FBase : RecFileBase;
FDirFile : File of RecFileList; FDirFile : File of RecFileList;
FDir : RecFileList; FDir : RecFileList;
TFDirFile : File of RecFileList; TFDirFile : File of RecFileList;
@ -648,8 +648,8 @@ Var
MBase : MBaseRec; MBase : MBaseRec;
MScanFile : File of MScanRec; MScanFile : File of MScanRec;
MScan : MScanRec; MScan : MScanRec;
FBaseFile : File of FBaseRec; FBaseFile : File of RecFileBase;
FBase : FBaseRec; FBase : RecFileBase;
FScanFile : File of FScanRec; FScanFile : File of FScanRec;
FScan : FScanRec; FScan : FScanRec;
JamLRFile : File of JamLastType; JamLRFile : File of JamLastType;
@ -925,11 +925,11 @@ Procedure Upload_File_Bases;
Const Const
NoDescStr = 'No Description'; NoDescStr = 'No Description';
Var Var
BaseFile : File of FBaseRec; BaseFile : File of RecFileBase;
ListFile : File of RecFileList; ListFile : File of RecFileList;
DescFile : File; DescFile : File;
DizFile : Text; DizFile : Text;
Base : FBaseRec; Base : RecFileBase;
List : RecFileList; List : RecFileList;
DirInfo : SearchRec; DirInfo : SearchRec;
Found : Boolean; Found : Boolean;

View File

@ -37,7 +37,7 @@ Type
User : RecUser; User : RecUser;
UserPos : LongInt; UserPos : LongInt;
FBasePos : LongInt; FBasePos : LongInt;
FBase : FBaseRec; FBase : RecFileBase;
SecLevel : RecSecurity; SecLevel : RecSecurity;
FileMask : String; FileMask : String;
@ -46,12 +46,12 @@ Type
Destructor Destroy; Override; Destructor Destroy; Override;
Procedure ResetSession; Procedure ResetSession;
Procedure UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt); Procedure UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt);
Function CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte; Function CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte;
Function OpenDataSession : Boolean; Function OpenDataSession : Boolean;
Procedure CloseDataSession; Procedure CloseDataSession;
Function ValidDirectory (TempBase: FBaseRec) : Boolean; Function ValidDirectory (TempBase: RecFileBase) : Boolean;
Function FindDirectory (Var TempBase: FBaseRec) : LongInt; Function FindDirectory (Var TempBase: RecFileBase) : LongInt;
Procedure cmdUSER; Procedure cmdUSER;
Procedure cmdPASS; Procedure cmdPASS;
@ -129,7 +129,7 @@ Begin
InTransfer := False; InTransfer := False;
End; End;
Procedure TFTPServer.UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt); Procedure TFTPServer.UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt);
Var Var
HistFile: File of HistoryRec; HistFile: File of HistoryRec;
History : HistoryRec; History : HistoryRec;
@ -195,7 +195,7 @@ Begin
Close (HistFile); Close (HistFile);
End; End;
Function TFTPServer.CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte; Function TFTPServer.CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte;
{ 0 = OK to download } { 0 = OK to download }
{ 1 = Offline or Invalid or Failed or NO ACCESS or no file (prompt 224)} { 1 = Offline or Invalid or Failed or NO ACCESS or no file (prompt 224)}
{ 2 = DL per day limit exceeded (prompt 58) } { 2 = DL per day limit exceeded (prompt 58) }
@ -212,7 +212,7 @@ Begin
If (FDir.Flags And FDirInvalid <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLUnvalid) Then Exit; If (FDir.Flags And FDirInvalid <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLUnvalid) Then Exit;
If (FDir.Flags And FDirFailed <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLFailed) Then Exit; If (FDir.Flags And FDirFailed <> 0) And Not CheckAccess(User, True, bbsConfig.AcsDLFailed) Then Exit;
If (FDir.Flags And FDirFree <> 0) or (User.Flags and UserNoRatio <> 0) or (TempFBase.IsFREE) Then Begin If (FDir.Flags And FDirFree <> 0) or (User.Flags and UserNoRatio <> 0) or (TempFBase.Flags and FBFreeFiles <> 0) Then Begin
Result := 0; Result := 0;
Exit; Exit;
End; End;
@ -293,12 +293,12 @@ Begin
End; End;
End; End;
Function TFTPServer.ValidDirectory (TempBase: FBaseRec) : Boolean; Function TFTPServer.ValidDirectory (TempBase: RecFileBase) : Boolean;
Begin Begin
Result := CheckAccess(User, True, TempBase.FtpACS) and (TempBase.FtpName <> ''); Result := CheckAccess(User, True, TempBase.FtpACS) and (TempBase.FtpName <> '');
End; End;
Function TFTPServer.FindDirectory (Var TempBase: FBaseRec) : LongInt; Function TFTPServer.FindDirectory (Var TempBase: RecFileBase) : LongInt;
Var Var
FBaseFile : TBufFile; FBaseFile : TBufFile;
Found : Boolean; Found : Boolean;
@ -327,7 +327,7 @@ Begin
FBaseFile := TBufFile.Create(FileBufSize); FBaseFile := TBufFile.Create(FileBufSize);
If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(FBaseRec)) Then Begin If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin
Found := False; Found := False;
While Not FBaseFile.EOF Do Begin While Not FBaseFile.EOF Do Begin
@ -449,7 +449,7 @@ End;
Procedure TFTPServer.cmdCWD; Procedure TFTPServer.cmdCWD;
Var Var
TempBase : FBaseRec; TempBase : RecFileBase;
TempPos : LongInt; TempPos : LongInt;
Begin Begin
If LoggedIn Then Begin If LoggedIn Then Begin
@ -476,7 +476,7 @@ End;
Procedure TFTPServer.cmdNLST; Procedure TFTPServer.cmdNLST;
Var Var
TempBase : FBaseRec; TempBase : RecFileBase;
TempPos : LongInt; TempPos : LongInt;
DirFile : TBufFile; DirFile : TBufFile;
Dir : RecFileList; Dir : RecFileList;
@ -528,7 +528,7 @@ End;
Procedure TFTPServer.cmdLIST; Procedure TFTPServer.cmdLIST;
Var Var
TempBase : FBaseRec; TempBase : RecFileBase;
TempPos : LongInt; TempPos : LongInt;
FBaseFile : TBufFile; FBaseFile : TBufFile;
DirFile : TBufFile; DirFile : TBufFile;
@ -542,7 +542,7 @@ Begin
FBaseFile := TBufFile.Create(FileBufSize); FBaseFile := TBufFile.Create(FileBufSize);
If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(FBaseRec)) Then Begin If FBaseFile.Open(bbsConfig.DataPath + 'fbases.dat', fmOpen, fmRWDN, SizeOf(RecFileBase)) Then Begin
While Not FBaseFile.EOF Do Begin While Not FBaseFile.EOF Do Begin
FBaseFile.Read(TempBase); FBaseFile.Read(TempBase);
@ -585,7 +585,7 @@ End;
Procedure TFTPServer.cmdRETR; Procedure TFTPServer.cmdRETR;
Var Var
TempPos : LongInt; TempPos : LongInt;
TempBase : FBaseRec; TempBase : RecFileBase;
DirFile : TBufFile; DirFile : TBufFile;
Dir : RecFileList; Dir : RecFileList;
Found : LongInt; Found : LongInt;

View File

@ -83,6 +83,7 @@ Begin
If ErrorAddr <> NIL Then Begin If ErrorAddr <> NIL Then Begin
Session.io.OutFull('|CR|12System Error #' + strI2S(ExitCode)); Session.io.OutFull('|CR|12System Error #' + strI2S(ExitCode));
Session.SystemLog ('ERROR #' + strI2S(ExitCode)); Session.SystemLog ('ERROR #' + strI2S(ExitCode));
ExitCode := 1; ExitCode := 1;
End; End;
@ -105,12 +106,14 @@ Begin
Reset (Session.EventFile); Reset (Session.EventFile);
While Not Eof(Session.EventFile) Do Begin While Not Eof(Session.EventFile) Do Begin
Read (Session.EventFile, Session.Event); Read (Session.EventFile, Session.Event);
If Session.Event.Name = Session.NextEvent.Name Then Begin If Session.Event.Name = Session.NextEvent.Name Then Begin
Session.Event.LastRan := CurDateDos; Session.Event.LastRan := CurDateDos;
Seek (Session.EventFile, FilePos(Session.EventFile) - 1); Seek (Session.EventFile, FilePos(Session.EventFile) - 1);
Write (Session.EventFile, Session.Event); Write (Session.EventFile, Session.Event);
End; End;
End; End;
Close (Session.EventFile); Close (Session.EventFile);
End; End;
@ -219,8 +222,6 @@ Begin
If IoResult <> 0 Then; If IoResult <> 0 Then;
{$I+} {$I+}
{ ----------------------- }
Assign (RoomFile, Config.DataPath + 'chatroom.dat'); Assign (RoomFile, Config.DataPath + 'chatroom.dat');
{$I-} Reset (RoomFile); {$I+} {$I-} Reset (RoomFile); {$I+}
If IoResult <> 0 Then Begin If IoResult <> 0 Then Begin

View File

@ -257,7 +257,7 @@ Const
// expand header filename[20] // expand header filename[20]
// add template[20] // add template[20]
// add msgbase sponser[30] // add msgbase sponser[30]
// add newsname[80] // add newsname[60]
// add colorkludge[b] // add colorkludge[b]
// add flags[l] merge in useReal // add flags[l] merge in useReal
// flags: // flags:
@ -279,6 +279,7 @@ Const
// add script path? // add script path?
// compare to mystic 2 for fallback stuff? // compare to mystic 2 for fallback stuff?
// rename to THEME // rename to THEME
// help percent bar
// horizontal/vertical percent bars // horizontal/vertical percent bars
Type Type
@ -448,6 +449,7 @@ Const
Type Type
RecFileBase = Record RecFileBase = Record
Index : Word;
Name : String[40]; Name : String[40];
FtpName : String[60]; FtpName : String[60];
FileName : String[40]; FileName : String[40];
@ -459,10 +461,11 @@ Type
ULACS : String[30]; ULACS : String[30];
CommentACS : String[30]; CommentACS : String[30];
SysOpACS : String[30]; SysOpACS : String[30];
Path : String[120]; Path : String[80];
Password : String[20]; Password : String[15];
DefScan : Byte; DefScan : Byte;
Flags : LongInt; Flags : LongInt;
Res : Array[1..36] of Byte;
End; End;
(* The file directory listing are stored as <FBaseRec.FileName>.DIR in *) (* The file directory listing are stored as <FBaseRec.FileName>.DIR in *)

View File

@ -95,6 +95,7 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES
- Default protocol per user - Default protocol per user
- ANSI message upload post processor option: Auto/Disabled/Ask - ANSI message upload post processor option: Auto/Disabled/Ask
- Prompt for disconect after UL or DL (and add option to filebase settings) - Prompt for disconect after UL or DL (and add option to filebase settings)
- Finish optional user prompts
RANDOM DRUNKEN BRAINDUMP AKA DESIGN DETAILS RANDOM DRUNKEN BRAINDUMP AKA DESIGN DETAILS
=========================================== ===========================================