New event editor, etc. Finished configuration

This commit is contained in:
mysticbbs 2013-03-30 03:19:05 -04:00
parent 6a287e4a5b
commit 6a4b0b47d3
13 changed files with 343 additions and 177 deletions

View File

@ -1,127 +1,191 @@
Unit bbs_cfg_Events; Unit BBS_Cfg_Events;
{$I M_OPS.PAS} {$I M_OPS.PAS}
Interface Interface
Procedure Event_Editor; Procedure Configuration_Events;
Implementation Implementation
Uses Uses
m_Strings, m_Strings,
m_DateTime, m_DateTime,
bbs_Core, m_FileIO,
bbs_Common, bbs_Common,
bbs_User; bbs_ansi_MenuBox,
bbs_ansi_MenuForm,
bbs_cfg_Common;
Procedure Event_Editor; Procedure EditEvent (Var Event: RecEvent);
Var Var
A, B : Integer; Box : TAnsiMenuBox;
Form : TAnsiMenuForm;
Hour : Byte;
Min : Byte;
Count : Byte;
Begin Begin
Session.SystemLog ('*EVENT EDITOR*'); Box := TAnsiMenuBox.Create;
Form := TAnsiMenuForm.Create;
Assign (Session.EventFile, Config.DataPath + 'events.dat'); Form.HelpSize := 0;
{$I-} Reset (Session.EventFile); {$I+}
If IoResult <> 0 Then ReWrite(Session.EventFile); Box.Open (11, 6, 69, 20);
VerticalLine (26, 8, 18);
VerticalLine (63, 9, 15);
Hour := Event.ExecTime DIV 60;
Min := Event.ExecTime MOD 60;
Form.AddStr ('D', ' Description' , 13, 8, 28, 8, 13, 30, 40, @Event.Name, '');
Form.AddBol ('A', ' Active' , 18, 9, 28, 9, 8, 3, @Event.Active, '');
Form.AddTog ('Y', ' Exec Type' , 15, 10, 28, 10, 11, 9, 0, 2, 'BBS Semaphore Shell', @Event.ExecType, '');
Form.AddByte ('E', ' Exec Hour' , 15, 11, 28, 11, 11, 2, 0, 23, @Hour, '');
Form.AddByte ('M', ' Exec Min' , 16, 12, 28, 12, 10, 2, 0, 59, @Min, '');
Form.AddStr ('H', ' Shell' , 19, 13, 28, 13, 7, 30, 80, @Event.Shell, '');
Form.AddStr ('S', ' Semaphore' , 15, 14, 28, 14, 11, 30, 40, @Event.SemaFile, '');
Form.AddBol ('F', ' Forced' , 18, 15, 28, 15, 8, 3, @Event.Forced, '');
Form.AddByte ('N', ' Node' , 20, 16, 28, 16, 6, 3, 0, 250, @Event.Node, '');
Form.AddByte ('W', ' Warning' , 17, 17, 28, 17, 9, 3, 0, 255, @Event.Warning, '');
Form.AddByte ('X', ' Exit Level' , 14, 18, 28, 18, 12, 3, 0, 255, @Event.ExecLevel, '');
For Count := 0 to 6 Do
Form.AddBol ('0', ' ' + DayString[Count], 58, 9 + Count, 65, 9 + Count, 5, 3, @Event.ExecDays[Count], '');
Form.Execute;
Event.ExecTime := (Hour * 60) + Min;
Box.Close;
Form.Free;
Box.Free;
End;
Procedure Configuration_Events;
Var
Box : TAnsiMenuBox;
List : TAnsiMenuList;
F : File of RecEvent;
Event : RecEvent;
Copied : RecEvent;
HasCopy : Boolean = False;
Procedure MakeList;
Var
Count : Byte;
DL : String[7] = '';
Hour : Byte;
Min : Byte;
TypeStr : String;
Begin
List.Clear;
Reset(F);
While Not Eof(F) Do Begin
Read (F, Event);
For Count := 0 to 6 Do
If Event.ExecDays[Count] Then
DL := DL + DayString[Count][1]
Else
DL := DL + '-';
Hour := Event.ExecTime DIV 60;
Min := Event.ExecTime MOD 60;
Case Event.ExecType of
0 : TypeStr := 'BBS';
1 : TypeStr := 'Semaphore';
2 : TypeStr := 'Shell';
// 3 : TypeStr := 'PollMail';
// 4 : TypeStr := 'SendMail';
End;
List.Add (strPadR(strYN(Event.Active), 7, ' ') + ' ' + strPadR(TypeStr, 15, ' ') + ' ' + strPadR(Event.Name, 25, ' ') + ' ' + strZero(Hour) + ':' + strZero(Min) + ' ' + DL, 0);
End;
List.Add ('', 2);
End;
Begin
Assign (F, Config.DataPath + 'event.dat');
If Not ioReset(F, SizeOf(Event), fmRWDN) Then
ioReWrite (F, SizeOf(Event), fmRWDN);
Box := TAnsiMenuBox.Create;
List := TAnsiMenuList.Create;
Box.Header := ' Event Editor ';
List.NoWindow := True;
List.LoChars := #13#27#47;
List.SearchY := 20;
Box.Open (6, 5, 75, 20);
WriteXY (8, 7, 112, 'Active Type Description Time Days');
WriteXY (8, 8, 112, strRep('Ä', 66));
WriteXY (8, 18, 112, strRep('Ä', 66));
WriteXY (29, 19, 112, cfgCommandList);
Repeat Repeat
Session.io.OutFullLn ('|CL|14Event Editor|CR|CR|09### Name|CR--- ------------------------------ -----|14'); MakeList;
Reset (Session.EventFile);
While Not Eof(Session.EventFile) do begin
read (Session.EventFile, session.event);
if session.event.active then Session.io.BufAddChar('+') else Session.io.BufAddChar('-');
Session.io.OutFullLn ('|15' + strPadR(strI2S(filepos(Session.EventFile)), 4, ' ') + '|14' + strPadR(session.event.name, 32, ' ') +
strZero(session.event.exectime div 60) + ':' + strZero(session.event.exectime mod 60));
end;
Session.io.OutFull ('|CR|09(I)nsert, (D)elete, (E)dit, (Q)uit? ');
case Session.io.OneKey ('DIEQ', True) of
'D' : begin
Session.io.OutRaw ('Delete which? ');
a := strS2I(Session.io.GetInput(3, 3, 11, ''));
KillRecord (Session.EventFile, A, SizeOf(EventRec));
end;
'I' : begin
Session.io.OutRaw ('Insert before? (1-' + strI2S(filesize(Session.EventFile)+1) + '): ');
a := strS2I(Session.io.GetInput(3, 3, 11, ''));
if (a > 0) and (a <= filesize(Session.EventFile)+1) then begin
AddRecord (Session.EventFile, A, SizeOf(EventRec));
session.event.active := false;
Session.Event.Name := 'New Event';
Session.Event.errlevel := 0;
Session.Event.exectime := 0;
Session.Event.warning := 0;
Session.Event.lastran := 0;
Session.Event.offhook := false;
Session.Event.node := 0;
write (Session.EventFile, Session.event);
end;
end;
'E' : begin
Session.io.OutRaw ('Edit which? ');
a := strS2I(Session.io.GetInput(3, 3, 11, ''));
if (a > 0) and (a <= filesize(Session.EventFile)) then begin
seek (Session.EventFile, a-1);
read (Session.EventFile, Session.event);
repeat
Session.io.OutFullLn ('|CL|14Event ' + strI2S(FilePos(Session.EventFile)) + ' of ' + strI2S(FileSize(Session.EventFile)) + '|CR|03');
Session.io.OutRawln ('!. Active : ' + Session.io.OutYN(Session.Event.active));
Session.io.OutRawln ('A. Description : ' + Session.Event.Name);
Session.io.OutRawln ('B. Forced : ' + Session.io.OutYN(Session.Event.forced));
Session.io.OutRawln ('C. Errorlevel : ' + strI2S(Session.Event.ErrLevel));
Session.io.OutRaw ('D. Execution Time : ');
a := Session.Event.exectime div 60;
b := Session.Event.exectime mod 60;
Session.io.OutRawln (strZero(a) + ':' + strZero(b));
Session.io.OutRawln ('E. Busy Warning : ' + strI2S(Session.Event.Warning));
Session.io.OutRawln ('F. Last Ran on : ' + DateDos2Str(Session.Event.LastRan, Session.User.ThisUser.DateType));
Session.io.OutRawln ('G. Offhook Modem : ' + Session.io.OutYN(Session.Event.Offhook));
Session.io.OutRaw ('H. Node Number : ');
If Session.Event.Node = 0 Then
Session.io.OutRawLn ('All')
Else
Session.io.OutRawLn (strI2S(Session.Event.Node));
Session.io.OutFull ('|CR|09Command (Q/Quit): ');
case Session.io.OneKey('[]!ABCDEFGHQ', True) of
'[' : If FilePos(Session.EventFile) > 1 Then Begin
Seek (Session.EventFile, FilePos(Session.EventFile)-1);
Write (Session.EventFile, Session.Event);
Seek (Session.EventFile, FilePos(Session.EventFile)-2);
Read (Session.EventFile, Session.Event);
End;
']' : If FilePos(Session.EventFile) < FileSize(Session.EventFile) Then Begin
Seek (Session.EventFile, FilePos(Session.EventFile)-1);
Write (Session.EventFile, Session.Event);
Read (Session.EventFile, Session.Event);
End;
'!' : Session.Event.active := not Session.Event.active;
'A' : Session.Event.name := Session.io.InXY(21, 4, 30, 30, 11, Session.Event.name);
'B' : Session.Event.forced := not Session.Event.forced;
'C' : Session.Event.errlevel := strS2I(Session.io.InXY(21, 6, 3, 3, 12, strI2S(Session.Event.errlevel)));
'D' : Begin
a := strS2I(Session.io.InXY(21, 7, 2, 2, 12, ''));
b := strS2I(Session.io.InXY(24, 7, 2, 2, 12, ''));
if (a > -1) and (a < 24) and (b >= 0) and (b < 60) then
Session.Event.exectime := (a * 60) + b;
end;
'E' : Session.Event.Warning := strS2I(Session.io.InXY(21, 8, 2, 2, 12, strI2S(Session.Event.Warning)));
'F' : Session.Event.LastRan := DateStr2Dos(Session.io.InXY(21, 9, 8, 8, 15, DateDos2Str(Session.Event.lastran, Session.User.ThisUser.DateType)));
'G' : Session.Event.Offhook := Not Session.Event.Offhook;
'H' : Session.Event.Node := strS2I(Session.io.InXY(21, 11, 3, 3, 12, strI2S(Session.Event.Node)));
'Q' : Break;
end
until false;
seek (Session.EventFile, filepos(Session.EventFile)-1);
write (Session.EventFile, Session.Event);
end;
end;
'Q' : break;
end;
until False;
Close (Session.EventFile); List.Open (6, 8, 75, 18);
List.Close;
Session.FindNextEvent; Case List.ExitCode of
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
'I' : Begin
AddRecord (F, List.Picked, SizeOf(Event));
FillChar (Event, SizeOf(Event), 0);
Event.Name := 'New Event';
Write (F, Event);
MakeList;
End;
'D' : If List.Picked < List.ListMax Then
If ShowMsgBox(1, 'Delete this entry?') Then Begin
KillRecord (F, List.Picked, SizeOf(Event));
MakeList;
End;
'C' : If List.Picked <> List.ListMax Then Begin
Seek (F, List.Picked - 1);
Read (F, Copied);
HasCopy := True;
End;
'P' : If HasCopy Then Begin
AddRecord (F, List.Picked, SizeOf(Event));
Write (F, Copied);
MakeList;
End;
End;
#13 : If List.Picked <> List.ListMax Then Begin
Seek (F, List.Picked - 1);
Read (F, Event);
EditEvent(Event);
Seek (F, List.Picked - 1);
Write (F, Event);
End;
#27 : Break;
End;
Until False;
Close(F);
Box.Close;
List.Free;
Box.Free;
End; End;
End. End.

View File

@ -28,10 +28,7 @@ Uses
bbs_cfg_UserEdit, bbs_cfg_UserEdit,
bbs_cfg_EchoMail, bbs_cfg_EchoMail,
bbs_cfg_MenuEdit, bbs_cfg_MenuEdit,
bbs_cfg_Events;
// old shit to rewrite
bbs_cfg_events,
bbs_cfg_vote;
Procedure Configuration_ExecuteEditor (Mode: Char); Procedure Configuration_ExecuteEditor (Mode: Char);
Var Var
@ -114,23 +111,6 @@ Var
Box.Free; Box.Free;
End; End;
Procedure ExecuteOldConfiguration (Mode: Char);
Var
TmpImage : TConsoleImageRec;
Begin
Screen.GetScreenImage (1, 1, 79, 24, TmpImage);
Session.io.AnsiColor(7);
Session.io.AnsiClear;
Case Mode of
'E' : Event_Editor;
'V' : Vote_Editor;
End;
Session.io.RemoteRestore(TmpImage);
End;
Begin Begin
Session.io.OutFile(Config.DataPath + 'cfgroot', False, 0); Session.io.OutFile(Config.DataPath + 'cfgroot', False, 0);
@ -258,7 +238,7 @@ Begin
End; End;
End; End;
3 : Begin 3 : Begin
BoxOpen (38, 4, 64, 17); BoxOpen (38, 4, 64, 16);
CoolBoxOpen (39, 'Editors'); CoolBoxOpen (39, 'Editors');
Form.AddNone ('U', ' U User Editor', 39, 5, 39, 5, 25, ''); Form.AddNone ('U', ' U User Editor', 39, 5, 39, 5, 25, '');
@ -272,8 +252,6 @@ Begin
Form.AddNone ('A', ' A Archive Editor', 39, 13, 39, 13, 25, ''); Form.AddNone ('A', ' A Archive Editor', 39, 13, 39, 13, 25, '');
Form.AddNone ('P', ' P Protocol Editor', 39, 14, 39, 14, 25, ''); Form.AddNone ('P', ' P Protocol Editor', 39, 14, 39, 14, 25, '');
Form.AddNone ('E', ' E Event Editor', 39, 15, 39, 15, 25, ''); Form.AddNone ('E', ' E Event Editor', 39, 15, 39, 15, 25, '');
Form.AddNone ('V', ' V Voting Editor', 39, 16, 39, 16, 25, '');
// Form.AddNone ('L', ' L BBS List Editor', 39, 17, 39, 17, 25, '');
Res := Form.Execute; Res := Form.Execute;
MenuPos[3] := Form.ItemPos; MenuPos[3] := Form.ItemPos;
@ -297,8 +275,7 @@ Begin
'S' : Configuration_SecurityEditor(True); 'S' : Configuration_SecurityEditor(True);
'T' : Configuration_ThemeEditor(False); 'T' : Configuration_ThemeEditor(False);
'U' : Configuration_UserEditor; 'U' : Configuration_UserEditor;
'E', 'E' : Configuration_Events;
'V' : ExecuteOldConfiguration(Res);
'X' : Break; 'X' : Break;
Else Else
MenuPtr := 0; MenuPtr := 0;

View File

@ -126,6 +126,7 @@ Const
// VOTING BOOTH MENU COMMANDS // VOTING BOOTH MENU COMMANDS
( Name: 'VA'; Desc: 'Create voting poll' ), ( Name: 'VA'; Desc: 'Create voting poll' ),
( Name: 'VD'; Desc: 'Delete voting poll' ),
( Name: 'VN'; Desc: 'Vote on new polls' ), ( Name: 'VN'; Desc: 'Vote on new polls' ),
( Name: 'VR'; Desc: 'See poll results' ), ( Name: 'VR'; Desc: 'See poll results' ),
( Name: 'VV'; Desc: 'Vote on a poll' ), ( Name: 'VV'; Desc: 'Vote on a poll' ),
@ -159,8 +160,7 @@ Const
( Name: '*P'; Desc: '(SYS) Protocol editor' ), ( Name: '*P'; Desc: '(SYS) Protocol editor' ),
( Name: '*R'; Desc: '(SYS) File group editor' ), ( Name: '*R'; Desc: '(SYS) File group editor' ),
( Name: '*S'; Desc: '(SYS) System configuration' ), ( Name: '*S'; Desc: '(SYS) System configuration' ),
( Name: '*U'; Desc: '(SYS) User editor' ), ( Name: '*U'; Desc: '(SYS) User editor' )
( Name: '*V'; Desc: '(SYS) Voting booth editor' )
); {123456789012345678901234567890} ); {123456789012345678901234567890}
Var Var

View File

@ -35,15 +35,15 @@ Type
Menu : TMenuEngine; Menu : TMenuEngine;
IO : TBBSIO; IO : TBBSIO;
Pipe : TPipe; Pipe : TPipe;
EventFile : File of EventRec; EventFile : File of RecEvent;
ThemeFile : File of RecTheme; ThemeFile : File of RecTheme;
VoteFile : File of VoteRec; VoteFile : File of VoteRec;
Vote : VoteRec; Vote : VoteRec;
CommHandle : LongInt; CommHandle : LongInt;
ShutDown : Boolean; ShutDown : Boolean;
TempPath : String; TempPath : String;
Event : EventRec; Event : RecEvent;
NextEvent : EventRec; NextEvent : RecEvent;
Theme : RecTheme; Theme : RecTheme;
LocalMode : Boolean; LocalMode : Boolean;
Baud : LongInt; Baud : LongInt;
@ -222,23 +222,19 @@ Begin
MinCheck := -1; MinCheck := -1;
Assign (EventFile, Config.DataPath + 'events.dat'); Assign (EventFile, Config.DataPath + 'event.dat');
ioReset (EventFile, SizeOf(EventRec), fmRWDN);
If IoResult <> 0 Then ioReWrite (EventFile, SizeOf(EventRec), fmRWDN); If Not ioReset (EventFile, SizeOf(RecEvent), fmRWDN) Then
ioReWrite (EventFile, SizeOf(RecEvent), fmRWDN);
While Not Eof(EventFile) Do Begin While Not Eof(EventFile) Do Begin
ioRead (EventFile, Event); ioRead (EventFile, Event);
If MinCheck = -1 Then Begin If (MinCheck = -1) or ((MinCheck <> -1) and (MinutesUntilEvent(Event.ExecTime) < MinCheck)) Then Begin
If Event.Active and ((Event.Node = 0) or (Event.Node = NodeNum)) Then begin If Event.Active and (Event.ExecType = 0) and ((Event.Node = 0) or (Event.Node = NodeNum)) and (Event.ExecDays[DayOfWeek(CurDateDos)]) Then Begin
MinCheck := MinutesUntilEvent(Event.ExecTime); MinCheck := MinutesUntilEvent(Event.ExecTime);
NextEvent := Event; NextEvent := Event;
End; End;
End Else
If (Event.Active) and ((Event.Node = 0) or (Event.Node = NodeNum)) and (MinutesUntilEvent(Event.ExecTime) < MinCheck) Then Begin
MinCheck := MinutesUntilEvent(Event.ExecTime);
NextEvent := Event;
End; End;
End; End;
@ -320,7 +316,7 @@ Begin {exits if 0 mins}
SystemLog('Event: ' + NextEvent.Name); SystemLog('Event: ' + NextEvent.Name);
Halt (NextEvent.ErrLevel); Halt (NextEvent.ExecLevel);
End Else End Else
EventRunAfter := True; EventRunAfter := True;
End; End;

View File

@ -494,7 +494,8 @@ Begin
Dec (CurLine); Dec (CurLine);
Dec (CurY); Dec (CurY);
If CurX > GetLineLength(ANSI.Data[CurLine], 80) Then CurX := GetLineLength(ANSI.Data[CurLine], 80) + 1; If CurX > GetLineLength(ANSI.Data[CurLine], 80) Then
CurX := GetLineLength(ANSI.Data[CurLine], 80) + 1;
If CurY < 1 Then Begin If CurY < 1 Then Begin
ScrollUp; ScrollUp;
@ -514,7 +515,8 @@ Begin
If Reset Then CurX := 1; If Reset Then CurX := 1;
If CurX > GetLineLength(ANSI.Data[CurLine], 80) Then CurX := GetLineLength(ANSI.Data[CurLine], 80) + 1; If CurX > GetLineLength(ANSI.Data[CurLine], 80) Then
CurX := GetLineLength(ANSI.Data[CurLine], 80) + 1;
If CurY > WinSize Then Begin If CurY > WinSize Then Begin
Result := True; Result := True;

View File

@ -39,6 +39,7 @@ Procedure Add_Booth;
Procedure Voting_Booth (Forced: Boolean; Num: Integer); Procedure Voting_Booth (Forced: Boolean; Num: Integer);
Procedure Voting_Result (Data: Integer); Procedure Voting_Result (Data: Integer);
Procedure Voting_Booth_New; Procedure Voting_Booth_New;
Procedure Voting_Booth_Delete;
Procedure View_Directory (Data: String; ViewType: Byte); Procedure View_Directory (Data: String; ViewType: Byte);
Procedure AnsiViewer (Bar: RecPercent; Data: String); Procedure AnsiViewer (Bar: RecPercent; Data: String);
@ -898,6 +899,60 @@ Begin
If Session.io.GetYN (Session.GetPrompt(248), True) Then Voting_Result(VPos); If Session.io.GetYN (Session.GetPrompt(248), True) Then Voting_Result(VPos);
End; End;
Procedure Voting_Booth_Delete;
Var
Max : LongInt;
A : LongInt;
C : LongInt;
Begin
Max := Voting_List;
Session.io.OutFull('|CR|09Delete which question? ');
A := strS2I(Session.io.GetInput(2, 2, 12, ''));
If (A > 0) and (A <= Max) Then Begin
Max := 0;
Reset (Session.VoteFile);
Repeat
Read (Session.VoteFile, Session.Vote);
If Session.User.Access(Session.Vote.ACS) Then Inc(Max);
Until Max = A;
A := FilePos(Session.VoteFile);
Session.io.OutFullLn ('|CR|12Deleting...');
KillRecord (Session.VoteFile, A, SizeOf(VoteRec));
Close (Session.VoteFile);
Reset (Session.User.UserFile);
While Not Eof(Session.User.UserFile) Do Begin
Read (Session.User.UserFile, Session.User.TempUser);
For C := A To 19 Do
Session.User.TempUser.Vote[C] := Session.User.TempUser.Vote[C+1];
Session.User.TempUser.Vote[20] := 0;
Seek (Session.User.UserFile, FilePos(Session.User.UserFile) - 1);
Write (Session.User.UserFile, Session.User.TempUser);
End;
Close (Session.User.UserFile);
For C := A to 19 Do
Session.User.ThisUser.Vote[C] := Session.User.ThisUser.Vote[C+1];
Session.User.ThisUser.Vote[20] := 0;
End;
End;
Procedure ShowBBSHistory (LastDays: Word); Procedure ShowBBSHistory (LastDays: Word);
Var Var
Temp : RecHistory; Temp : RecHistory;

View File

@ -60,8 +60,7 @@ Uses
BBS_Ansi_Help, BBS_Ansi_Help,
BBS_Cfg_Main, BBS_Cfg_Main,
BBS_Cfg_Events, BBS_Cfg_Events,
BBS_Cfg_UserEdit, BBS_Cfg_UserEdit;
BBS_Cfg_Vote;
Constructor TMenuEngine.Create (O: Pointer); Constructor TMenuEngine.Create (O: Pointer);
Begin Begin
@ -300,6 +299,7 @@ Begin
End; End;
'V' : Case Cmd[2] of 'V' : Case Cmd[2] of
'A' : Add_Booth; 'A' : Add_Booth;
'D' : Voting_Booth_Delete;
'N' : Voting_Booth_New; 'N' : Voting_Booth_New;
'R' : Voting_Result (strS2I(CmdData)); 'R' : Voting_Result (strS2I(CmdData));
'V' : Voting_Booth (False, strS2I(CmdData)); 'V' : Voting_Booth (False, strS2I(CmdData));
@ -340,7 +340,7 @@ Begin
Result := True; Result := True;
End; End;
'A' : Configuration_ExecuteEditor('A'); 'A' : Configuration_ExecuteEditor('A');
'E' : Event_Editor; 'E' : Configuration_Events;
'F' : Configuration_ExecuteEditor('F'); 'F' : Configuration_ExecuteEditor('F');
'G' : Configuration_ExecuteEditor('G'); 'G' : Configuration_ExecuteEditor('G');
'L' : Configuration_ExecuteEditor('L'); 'L' : Configuration_ExecuteEditor('L');
@ -349,7 +349,6 @@ Begin
'R' : Configuration_ExecuteEditor('R'); 'R' : Configuration_ExecuteEditor('R');
'S' : Configuration_MainMenu; 'S' : Configuration_MainMenu;
'U' : Configuration_UserEditor; 'U' : Configuration_UserEditor;
'V' : Vote_Editor;
End; End;
End; End;
End; End;

View File

@ -121,7 +121,7 @@ Begin
WriteLn ('-BPACK Pack all BBS lists'); WriteLn ('-BPACK Pack all BBS lists');
WriteLn ('-BSORT <ID> <Type> Sorts and packs BBS list by <type>'); WriteLn ('-BSORT <ID> <Type> Sorts and packs BBS list by <type>');
WriteLn ('-FCHECK <KILL> Check filelist for correct size/status'); WriteLn ('-FCHECK <KILL> Check filelist for correct size/status');
WriteLn ('-FIXINDEX Fix broken permanent index for msg/file bases'); WriteLn ('-FIXINDEX Fix wrong perm index for user/msg/file bases');
WriteLn ('-FPACK Pack file bases'); WriteLn ('-FPACK Pack file bases');
WriteLn ('-FSORT Sort file base entries by filename'); WriteLn ('-FSORT Sort file base entries by filename');
WriteLn ('-MTRASH <File> Delete messages to/from users listed in <File>'); WriteLn ('-MTRASH <File> Delete messages to/from users listed in <File>');
@ -910,9 +910,11 @@ Var
ConfigFile : File of RecConfig; ConfigFile : File of RecConfig;
MBaseFile : File of RecMessageBase; MBaseFile : File of RecMessageBase;
FBaseFile : File of RecFileBase; FBaseFile : File of RecFileBase;
UserFile : File of RecUser;
Config : RecConfig; Config : RecConfig;
MBase : RecMessageBase; MBase : RecMessageBase;
FBase : RecFileBase; FBase : RecFileBase;
User : RecUser;
Function IsDupeMBaseIndex (SavedPos, Idx: LongInt) : Boolean; Function IsDupeMBaseIndex (SavedPos, Idx: LongInt) : Boolean;
Var Var
@ -934,6 +936,28 @@ Var
Seek (MBaseFile, SavedPos); Seek (MBaseFile, SavedPos);
End; End;
Function IsDupeUserIndex (SavedPos, Idx: LongInt) : Boolean;
Var
TempUser : RecUser;
Begin
Result := False;
// Close (UserFile);
Reset (UserFile);
While Not Eof(UserFile) Do Begin
Read (UserFile, TempUser);
If (TempUser.PermIdx = Idx) and (FilePos(UserFile) <> SavedPos) Then Begin
Result := True;
Break;
End;
End;
// Reset (UserFile);
Seek (UserFile, SavedPos);
End;
Function IsDupeFBaseIndex (SavedPos, Idx: LongInt) : Boolean; Function IsDupeFBaseIndex (SavedPos, Idx: LongInt) : Boolean;
Var Var
TempBase : RecFileBase; TempBase : RecFileBase;
@ -956,6 +980,7 @@ Var
Var Var
NewIndex : Cardinal; NewIndex : Cardinal;
MaxUser : Cardinal;
Begin Begin
Write ('Fixing Indexes :'); Write ('Fixing Indexes :');
@ -1030,6 +1055,43 @@ Begin
Close (FBaseFile); Close (FBaseFile);
Assign (UserFile, Config.DataPath + 'users.dat');
Reset (UserFile);
MaxUser := 0;
While Not Eof(UserFile) Do Begin
Read (UserFile, User);
If User.PermIdx > MaxUser Then MaxUser := User.PermIdx;
Update_Bar (FilePos(UserFile), FileSize(UserFile));
If IsDupeUserIndex(FilePos(UserFile), User.PermIdx) Then Begin
NewIndex := 0;
While IsDupeUserIndex(FilePos(UserFile), NewIndex) Do
Inc (NewIndex);
User.PermIdx := NewIndex;
If User.PermIdx > MaxUser Then MaxUser := User.PermIdx;
End;
Seek (UserFile, FilePos(UserFile) - 1);
Write (UserFile, User);
End;
Close (UserFile);
If MaxUser <> Config.UserIdxPos Then Begin
Config.UserIdxPos := MaxUser + 1;
Reset (ConfigFile);
Write (ConfigFile, Config);
Close (ConfigFile);
End;
Update_Bar(100, 100); Update_Bar(100, 100);
Update_Status('Completed'); Update_Status('Completed');

View File

@ -84,19 +84,20 @@ Begin
OrigAddr.Net := PH.OrigNet; OrigAddr.Net := PH.OrigNet;
OrigAddr.Node := PH.OrigNode; OrigAddr.Node := PH.OrigNode;
// TODO
// if echonode.echomail.crash etc change char F in FLO extension // if echonode.echomail.crash etc change char F in FLO extension
FLOName := bbsConfig.OutboundPath + GetFTNFlowName(EchoNode.Address) + '.flo'; FLOName := bbsConfig.OutboundPath + GetFTNFlowName(EchoNode.Address) + '.flo';
BundleName := bbsConfig.OutboundPath + GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + DayString[DayOfWeek(CurDateDos)]; BundleName := bbsConfig.OutboundPath + GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + DayString[DayOfWeek(CurDateDos)];
// TODO
// check for existance, packet size limitations, etc and increment // check for existance, packet size limitations, etc and increment
// from 0-9 A-Z // from 0-9 A-Z
BundleName[Length(BundleName)] := '0'; BundleName[Length(BundleName)] := '0';
ExecuteArchive (BundleName, EchoNode.ArcType, TempPath + PKTName, 1); ExecuteArchive (BundleName, EchoNode.ArcType, TempPath + PKTName, 1);
FileErase (TempPath + PKTName); FileErase (TempPath + PKTName);
AddToFLOQueue (FLOName, BundleName); AddToFLOQueue (FLOName, BundleName);
End; End;

View File

@ -137,7 +137,7 @@ Begin
End; End;
If Session.ExitLevel <> 0 Then ExitCode := Session.ExitLevel; If Session.ExitLevel <> 0 Then ExitCode := Session.ExitLevel;
If Session.EventRunAfter Then ExitCode := Session.NextEvent.ErrLevel; If Session.EventRunAfter Then ExitCode := Session.NextEvent.ExecLevel;
FileMode := 66; FileMode := 66;

View File

@ -405,22 +405,20 @@ Type
Reserved : Array[1..388] of Byte; Reserved : Array[1..388] of Byte;
End; End;
// day of week RecEvent = Record
// sema file Active : Boolean;
// event type [bbs exit/bbs exec/mis event] Name : String[40];
// execcmd ExecType : Byte; // 0=BBS, 1=Semaphore, 2=Shell, 3=Poll Nodes, 4=SendEcho
// remove offhook ExecTime : SmallInt;
ExecDays : Array[0..6] of Boolean;
EventRec = Record { EVENTS.DAT } ExecLevel : Byte;
Active : Boolean; { Is event active? } Shell : String[80];
Name : String[30]; { Event Name } SemaFile : String[80];
Forced : Boolean; { Is this a forced event } Forced : Boolean;
ErrLevel : Byte; { Errorlevel to Exit } Node : Byte;
ExecTime : SmallInt; { Minutes after midnight } Warning : Byte;
Warning : Byte; { Warn user before the event } LastRan : LongInt;
Offhook : Boolean; { Offhook modem for event? } Res : Array[1..34] of Byte;
Node : Byte; { Node number. 0 = all }
LastRan : LongInt; { Last time event was ran }
End; End;
(* SECURITY.DAT in the data directory holds 255 records, one for each *) (* SECURITY.DAT in the data directory holds 255 records, one for each *)

View File

@ -2987,3 +2987,15 @@
! Fixed a bug that could cause the user editor to crash directly after a ! 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. new install if you didn't create your SysOp account first.
+ The MBBSUTIL -fixindex function will now also check users for duplicate
perm index and attempt to fix them (along with the file/msg bases).
+ Added new event editor to replace the old crappy one. You should delete
event*.dat from your DATA directory. You will have to reconfigure your
events unfortunately (as if anyone even used them ever).
+ BBS events can now be executed on specific days of the week.
+ Old Voting booth editor has been replaced with the VD menu command used
to delete voting questions.