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

@ -618,7 +618,7 @@ End;
Procedure TBufFile.FillBuffer;
Begin
System.Seek (BufFile, BufFilePos);
System.Seek (BufFile, BufFilePos);
System.BlockRead (BufFile, Buffer^, BufSize, BufTop);
IoResult := System.IoResult;
@ -628,8 +628,9 @@ End;
Procedure TBufFile.FlushBuffer;
Begin
System.Seek (BufFile, BufFilePos);
System.Seek (BufFile, BufFilePos);
System.BlockWrite (BufFile, Buffer^, BufTop, BufTop);
IoResult := System.IoResult;
// BufPos := 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ Type
User : RecUser;
UserPos : LongInt;
FBasePos : LongInt;
FBase : FBaseRec;
FBase : RecFileBase;
SecLevel : RecSecurity;
FileMask : String;
@ -46,12 +46,12 @@ Type
Destructor Destroy; Override;
Procedure ResetSession;
Procedure UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt);
Function CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte;
Procedure UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt);
Function CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte;
Function OpenDataSession : Boolean;
Procedure CloseDataSession;
Function ValidDirectory (TempBase: FBaseRec) : Boolean;
Function FindDirectory (Var TempBase: FBaseRec) : LongInt;
Function ValidDirectory (TempBase: RecFileBase) : Boolean;
Function FindDirectory (Var TempBase: RecFileBase) : LongInt;
Procedure cmdUSER;
Procedure cmdPASS;
@ -129,7 +129,7 @@ Begin
InTransfer := False;
End;
Procedure TFTPServer.UpdateUserStats (TFBase: FBaseRec; FDir: RecFileList; DirPos: LongInt);
Procedure TFTPServer.UpdateUserStats (TFBase: RecFileBase; FDir: RecFileList; DirPos: LongInt);
Var
HistFile: File of HistoryRec;
History : HistoryRec;
@ -195,7 +195,7 @@ Begin
Close (HistFile);
End;
Function TFTPServer.CheckFileLimits (TempFBase: FBaseRec; FDir: RecFileList) : Byte;
Function TFTPServer.CheckFileLimits (TempFBase: RecFileBase; FDir: RecFileList) : Byte;
{ 0 = OK to download }
{ 1 = Offline or Invalid or Failed or NO ACCESS or no file (prompt 224)}
{ 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 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;
Exit;
End;
@ -293,12 +293,12 @@ Begin
End;
End;
Function TFTPServer.ValidDirectory (TempBase: FBaseRec) : Boolean;
Function TFTPServer.ValidDirectory (TempBase: RecFileBase) : Boolean;
Begin
Result := CheckAccess(User, True, TempBase.FtpACS) and (TempBase.FtpName <> '');
End;
Function TFTPServer.FindDirectory (Var TempBase: FBaseRec) : LongInt;
Function TFTPServer.FindDirectory (Var TempBase: RecFileBase) : LongInt;
Var
FBaseFile : TBufFile;
Found : Boolean;
@ -327,7 +327,7 @@ Begin
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;
While Not FBaseFile.EOF Do Begin
@ -449,7 +449,7 @@ End;
Procedure TFTPServer.cmdCWD;
Var
TempBase : FBaseRec;
TempBase : RecFileBase;
TempPos : LongInt;
Begin
If LoggedIn Then Begin
@ -476,7 +476,7 @@ End;
Procedure TFTPServer.cmdNLST;
Var
TempBase : FBaseRec;
TempBase : RecFileBase;
TempPos : LongInt;
DirFile : TBufFile;
Dir : RecFileList;
@ -528,7 +528,7 @@ End;
Procedure TFTPServer.cmdLIST;
Var
TempBase : FBaseRec;
TempBase : RecFileBase;
TempPos : LongInt;
FBaseFile : TBufFile;
DirFile : TBufFile;
@ -542,7 +542,7 @@ Begin
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
FBaseFile.Read(TempBase);
@ -585,7 +585,7 @@ End;
Procedure TFTPServer.cmdRETR;
Var
TempPos : LongInt;
TempBase : FBaseRec;
TempBase : RecFileBase;
DirFile : TBufFile;
Dir : RecFileList;
Found : LongInt;

View File

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

View File

@ -257,7 +257,7 @@ Const
// expand header filename[20]
// add template[20]
// add msgbase sponser[30]
// add newsname[80]
// add newsname[60]
// add colorkludge[b]
// add flags[l] merge in useReal
// flags:
@ -279,6 +279,7 @@ Const
// add script path?
// compare to mystic 2 for fallback stuff?
// rename to THEME
// help percent bar
// horizontal/vertical percent bars
Type
@ -448,6 +449,7 @@ Const
Type
RecFileBase = Record
Index : Word;
Name : String[40];
FtpName : String[60];
FileName : String[40];
@ -459,10 +461,11 @@ Type
ULACS : String[30];
CommentACS : String[30];
SysOpACS : String[30];
Path : String[120];
Password : String[20];
Path : String[80];
Password : String[15];
DefScan : Byte;
Flags : LongInt;
Res : Array[1..36] of Byte;
End;
(* 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
- ANSI message upload post processor option: Auto/Disabled/Ask
- Prompt for disconect after UL or DL (and add option to filebase settings)
- Finish optional user prompts
RANDOM DRUNKEN BRAINDUMP AKA DESIGN DETAILS
===========================================