Some code reorg

This commit is contained in:
mysticbbs 2012-06-30 20:23:39 -04:00
parent 9750310b9b
commit 3e5b558071
21 changed files with 356 additions and 405 deletions

View File

@ -284,7 +284,7 @@ Begin
Template := strWordGet(2, Str, ';'); Template := strWordGet(2, Str, ';');
Keyword := strWordGet(3, Str, ';'); Keyword := strWordGet(3, Str, ';');
If Pos(PathChar, FN) = 0 Then FN := Session.Lang.TextPath + FN; If Pos(PathChar, FN) = 0 Then FN := Session.Theme.TextPath + FN;
Assign (HelpFile, FN + '.hlp'); Assign (HelpFile, FN + '.hlp');
{$I-} Reset (HelpFile); {$I+} {$I-} Reset (HelpFile); {$I+}

View File

@ -124,7 +124,7 @@ Begin
'T' : Begin 'T' : Begin
Inc (Count, 2); Inc (Count, 2);
Session.io.BufAddStr(Session.io.Attr2Ansi(Session.Lang.Colors[strS2I(Code[2])])); Session.io.BufAddStr(Session.io.Attr2Ansi(Session.Theme.Colors[strS2I(Code[2])]));
End; End;
Else Else
Session.io.BufAddChar(S[Count]); Session.io.BufAddChar(S[Count]);

View File

@ -192,7 +192,7 @@ Begin
Until false; Until false;
Session.io.OutFullLn ('|14Saving...'); Session.io.OutFullLn ('|14Saving...');
assign (menufile, Session.lang.menupath + Session.Menu.menuname + '.mnu'); assign (menufile, Session.Theme.menupath + Session.Menu.menuname + '.mnu');
rewrite (menufile); rewrite (menufile);
writeln (menufile, Session.Menu.Menu.header); writeln (menufile, Session.Menu.Menu.header);
writeln (menufile, Session.Menu.Menu.prompt); writeln (menufile, Session.Menu.Menu.prompt);
@ -231,21 +231,21 @@ Var
DirInfo: SearchRec; DirInfo: SearchRec;
A : Byte; {format dir output} A : Byte; {format dir output}
Begin Begin
If session.lang.filename = '' then exit; If session.Theme.filename = '' then exit;
Old := Session.Menu.MenuName; Old := Session.Menu.MenuName;
OldLang := Session.Lang; OldLang := Session.Theme;
Session.SystemLog ('*MENU EDITOR*'); Session.SystemLog ('*MENU EDITOR*');
Session.io.OutFull ('|CL'); Session.io.OutFull ('|CL');
Session.User.GetLanguage; Session.User.GetLanguage;
Repeat Repeat
Session.io.OutFullLn ('|CL|14Menu Editor (Language: ' + Session.Lang.Desc + ')|CR'); Session.io.OutFullLn ('|CL|14Menu Editor (Language: ' + Session.Theme.Desc + ')|CR');
Session.io.OutFullLn ('|08Directory of ' + Session.lang.MenuPath + '*.MNU|CR|03'); Session.io.OutFullLn ('|08Directory of ' + Session.Theme.MenuPath + '*.MNU|CR|03');
a := 0; a := 0;
FindFirst (Session.lang.MenuPath + '*.mnu', Archive, DirInfo); FindFirst (Session.Theme.MenuPath + '*.mnu', Archive, DirInfo);
While DosError = 0 Do Begin While DosError = 0 Do Begin
inc (a); inc (a);
Session.io.OutRaw (strPadR(DirInfo.Name, 25, ' ')); Session.io.OutRaw (strPadR(DirInfo.Name, 25, ' '));
@ -264,7 +264,7 @@ Begin
Session.io.OutRaw ('Menu Name: '); Session.io.OutRaw ('Menu Name: ');
Session.menu.MenuName := Session.io.GetInput(mysMaxMenuNameLen, mysMaxMenuNameLen, 11, ''); Session.menu.MenuName := Session.io.GetInput(mysMaxMenuNameLen, mysMaxMenuNameLen, 11, '');
If Session.Menu.MenuName <> '' Then Begin If Session.Menu.MenuName <> '' Then Begin
Assign (MenuFile, Session.Lang.MenuPath + Session.Menu.MenuName + '.mnu'); Assign (MenuFile, Session.Theme.MenuPath + Session.Menu.MenuName + '.mnu');
{$I-} Reset(MenuFile); {$I+} {$I-} Reset(MenuFile); {$I+}
If IoResult = 0 Then If IoResult = 0 Then
Session.io.OutRawLn ('Menu already exists') Session.io.OutRawLn ('Menu already exists')
@ -289,15 +289,15 @@ Begin
'D' : Begin 'D' : Begin
Session.io.OutRaw ('Menu to delete: '); Session.io.OutRaw ('Menu to delete: ');
Session.Menu.MenuName := Session.io.GetInput(mysMaxMenuNameLen, mysMaxMenuNameLen, 11, ''); Session.Menu.MenuName := Session.io.GetInput(mysMaxMenuNameLen, mysMaxMenuNameLen, 11, '');
FileErase(Session.Lang.MenuPath + Session.Menu.MenuName + '.mnu'); FileErase(Session.Theme.MenuPath + Session.Menu.MenuName + '.mnu');
End; End;
'Q' : Break; 'Q' : Break;
End; End;
Until False; Until False;
Session.Menu.MenuName := Old; Session.Menu.MenuName := Old;
Session.Lang := OldLang; Session.Theme := OldLang;
Close (Session.PromptFile); Close (Session.PromptFile);
Assign (Session.PromptFile, Config.DataPath + Session.Lang.FileName + '.thm'); Assign (Session.PromptFile, Config.DataPath + Session.Theme.FileName + '.thm');
Reset (Session.PromptFile); Reset (Session.PromptFile);
End; End;

View File

@ -415,9 +415,9 @@ Begin
Session.io.AnsiColor(7); Session.io.AnsiColor(7);
Session.io.AnsiClear; Session.io.AnsiClear;
SavedTheme := Session.Lang; SavedTheme := Session.Theme;
Move (Theme.Colors, Session.Lang.Colors, SizeOf(Theme.Colors)); Move (Theme.Colors, Session.Theme.Colors, SizeOf(Theme.Colors));
Box := TAnsiMenuBox.Create; Box := TAnsiMenuBox.Create;
Input := TAnsiMenuInput.Create; Input := TAnsiMenuInput.Create;
@ -553,7 +553,7 @@ Begin
Session.io.RemoteRestore(Image); Session.io.RemoteRestore(Image);
Session.Lang := SavedTheme; Session.Theme := SavedTheme;
End; End;
Procedure EditBars (Var Theme: RecTheme); Procedure EditBars (Var Theme: RecTheme);

View File

@ -22,36 +22,42 @@ var
Temp : String[2]; Temp : String[2];
Begin Begin
Session.SystemLog ('*VOTE EDITOR*'); Session.SystemLog ('*VOTE EDITOR*');
Repeat Repeat
Session.io.OutFullLn ('|CL|14Voting Booth Editor|CR|CR|15## Question|CR|09-- ---------------------------------------'); Session.io.OutFullLn ('|CL|14Voting Booth Editor|CR|CR|15## Question|CR|09-- ---------------------------------------');
Reset (VoteFile); Reset (Session.VoteFile);
While Not Eof(VoteFile) do begin
Read (VoteFile, Vote); While Not Eof(Session.VoteFile) Do Begin
Session.io.OutFullLn ('|15' + strPadR(strI2S(filepos(VoteFile)), 4, ' ') + '|14' + Vote.Question); Read (Session.VoteFile, Session.Vote);
Session.io.OutFullLn ('|15' + strPadR(strI2S(FilePos(Session.VoteFile)), 4, ' ') + '|14' + Session.Vote.Question);
End; End;
Session.io.OutFull ('|CR|09(A)dd, (D)elete, (E)dit, (Q)uit? '); Session.io.OutFull ('|CR|09(A)dd, (D)elete, (E)dit, (Q)uit? ');
case Session.io.OneKey ('ADEQ', True) of
'A' : If FileSize(VoteFile) = mysMaxVoteQuestion Then Case Session.io.OneKey ('ADEQ', True) of
'A' : If FileSize(Session.VoteFile) = mysMaxVoteQuestion Then
Session.io.OutFullLn ('|CR|14Max # of questions is ' + strI2S(mysMaxVoteQuestion)) Session.io.OutFullLn ('|CR|14Max # of questions is ' + strI2S(mysMaxVoteQuestion))
Else Begin Else Begin
Vote.Votes := 0; Session.Vote.Votes := 0;
Vote.AnsNum := 1; Session.Vote.AnsNum := 1;
Vote.ACS := 's999'; Session.Vote.ACS := 's999';
Vote.AddACS := 's999'; Session.Vote.AddACS := 's999';
Vote.ForceACS := 's999'; Session.Vote.ForceACS := 's999';
Vote.Question := 'New Question'; Session.Vote.Question := 'New Question';
Vote.Answer[1].Text := 'New voting answer'; Session.Vote.Answer[1].Text := 'New voting answer';
Vote.Answer[1].Votes := 0; Session.Vote.Answer[1].Votes := 0;
Seek (VoteFile, FileSize(VoteFile));
Write (VoteFile, Vote); Seek (Session.VoteFile, FileSize(Session.VoteFile));
Write (Session.VoteFile, Session.Vote);
End; End;
'D' : begin 'D' : begin
Session.io.OutRaw ('Delete which? '); Session.io.OutRaw ('Delete which? ');
a := strS2I(Session.io.GetInput(3, 3, 11, '')); a := strS2I(Session.io.GetInput(3, 3, 11, ''));
If (A > 0) And (A <= FileSize(VoteFile)) Then Begin If (A > 0) And (A <= FileSize(Session.VoteFile)) Then Begin
Session.io.OutFullLn ('|CRDeleting...'); Session.io.OutFullLn ('|CRDeleting...');
KillRecord (VoteFile, A, SizeOf(VoteRec)); KillRecord (Session.VoteFile, A, SizeOf(VoteRec));
Reset (Session.User.UserFile); Reset (Session.User.UserFile);
While Not Eof(Session.User.UserFile) Do Begin While Not Eof(Session.User.UserFile) Do Begin
@ -70,76 +76,78 @@ Begin
end; end;
'E' : begin 'E' : begin
Session.io.OutRaw ('Edit which? '); Session.io.OutRaw ('Edit which? ');
a := strS2I(Session.io.GetInput(3, 3, 11, '')); A := strS2I(Session.io.GetInput(3, 3, 11, ''));
if (a > 0) and (a <= filesize(VoteFile)) then begin If (A > 0) And (A <= FileSize(Session.VoteFile)) then begin
seek (VoteFile, a-1); Seek (Session.VoteFile, A - 1);
read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
repeat repeat
Session.io.OutFullLn ('|CL|14Question ' + strI2S(FilePos(VoteFile)) + ' of ' + strI2S(FileSize(VoteFile)) + '|CR|03'); Session.io.OutFullLn ('|CL|14Question ' + strI2S(FilePos(Session.VoteFile)) + ' of ' + strI2S(FileSize(Session.VoteFile)) + '|CR|03');
Session.io.OutRawln ('A. Question : ' + strPadR(Vote.Question, 60, ' ')); Session.io.OutRawln ('A. Question : ' + strPadR(Session.Vote.Question, 60, ' '));
Session.io.OutRawLn ('B. Votes : ' + strI2S(Vote.Votes)); Session.io.OutRawLn ('B. Votes : ' + strI2S(Session.Vote.Votes));
Session.io.OutRawLn ('C. Vote ACS : ' + Vote.ACS); Session.io.OutRawLn ('C. Vote ACS : ' + Session.Vote.ACS);
Session.io.OutRawLn ('E. Add ACS : ' + Vote.AddACS); Session.io.OutRawLn ('E. Add ACS : ' + Session.Vote.AddACS);
Session.io.OutRawLn ('F. Forced ACS : ' + Vote.ForceACS); Session.io.OutRawLn ('F. Forced ACS : ' + Session.Vote.ForceACS);
Session.io.OutFullLn ('|CR|15## Answer ## Answer'); Session.io.OutFullLn ('|CR|15## Answer ## Answer');
Session.io.OutFullLn ('|09-- ----------------------------------- -- ------------------------------------'); Session.io.OutFullLn ('|09-- ----------------------------------- -- ------------------------------------');
For B := 1 to Vote.AnsNum Do Begin
Session.io.OutFull ('|11' + strZero(B) + ' |14' + strPadR(Vote.Answer[B].Text, 35, ' ') + ' '); For B := 1 to Session.Vote.AnsNum Do Begin
If (B Mod 2 = 0) or (B = Vote.AnsNum) Then Session.io.OutRawLn (''); Session.io.OutFull ('|11' + strZero(B) + ' |14' + strPadR(Session.Vote.Answer[B].Text, 35, ' ') + ' ');
If (B Mod 2 = 0) or (B = Session.Vote.AnsNum) Then Session.io.OutRawLn ('');
End; End;
Session.io.OutFull ('|CR|09(D)elete, (I)nsert, (Q)uit: '); Session.io.OutFull ('|CR|09(D)elete, (I)nsert, (Q)uit: ');
Temp := Session.io.GetInput(2, 2, 12, ''); Temp := Session.io.GetInput(2, 2, 12, '');
If Temp = 'A' Then Vote.Question := Session.io.InXY(17, 3, 60, 70, 11, Vote.Question) Else If Temp = 'A' Then Session.Vote.Question := Session.io.InXY(17, 3, 60, 70, 11, Session.Vote.Question) Else
If Temp = 'B' Then Vote.Votes := strS2I(Session.io.InXY(17, 4, 5, 5, 12, strI2S(Vote.Votes))) Else If Temp = 'B' Then Session.Vote.Votes := strS2I(Session.io.InXY(17, 4, 5, 5, 12, strI2S(Session.Vote.Votes))) Else
If Temp = 'C' Then Vote.ACS := Session.io.InXY(17, 5, 20, 20, 11, Vote.ACS) Else If Temp = 'C' Then Session.Vote.ACS := Session.io.InXY(17, 5, 20, 20, 11, Session.Vote.ACS) Else
If Temp = 'D' Then Begin If Temp = 'D' Then Begin
Session.io.OutFull ('Delete which answer? '); Session.io.OutFull ('Delete which answer? ');
A := strS2I(Session.io.GetInput(2, 2, 12, '')); A := strS2I(Session.io.GetInput(2, 2, 12, ''));
If (A > 0) and (A <= Vote.AnsNum) Then Begin If (A > 0) and (A <= Session.Vote.AnsNum) Then Begin
For C := A to Vote.AnsNum-1 Do For C := A to Session.Vote.AnsNum-1 Do
Vote.Answer[C] := Vote.Answer[C+1]; Session.Vote.Answer[C] := Session.Vote.Answer[C+1];
Dec (Vote.AnsNum); Dec (Session.Vote.AnsNum);
Reset (Session.User.UserFile); Reset (Session.User.UserFile);
While Not Eof(Session.User.UserFile) Do Begin While Not Eof(Session.User.UserFile) Do Begin
Read (Session.User.UserFile, Session.User.TempUser); Read (Session.User.UserFile, Session.User.TempUser);
If Session.User.TempUser.Vote[FilePos(VoteFile)] = A Then Begin If Session.User.TempUser.Vote[FilePos(Session.VoteFile)] = A Then Begin
Session.User.TempUser.Vote[FilePos(VoteFile)] := 0; Session.User.TempUser.Vote[FilePos(Session.VoteFile)] := 0;
Seek (Session.User.UserFile, FilePos(Session.User.UserFile) - 1); Seek (Session.User.UserFile, FilePos(Session.User.UserFile) - 1);
Write (Session.User.UserFile, Session.User.TempUser); Write (Session.User.UserFile, Session.User.TempUser);
End; End;
End; End;
Close (Session.User.UserFile); Close (Session.User.UserFile);
If Session.User.ThisUser.Vote[FilePos(VoteFile)] = A Then If Session.User.ThisUser.Vote[FilePos(Session.VoteFile)] = A Then
Session.User.ThisUser.Vote[FilePos(VoteFile)] := 0; Session.User.ThisUser.Vote[FilePos(Session.VoteFile)] := 0;
End; End;
End Else End Else
If Temp = 'E' Then Vote.AddACS := Session.io.InXY(17, 6, 20, 20, 11, Vote.AddACS) Else If Temp = 'E' Then Session.Vote.AddACS := Session.io.InXY(17, 6, 20, 20, 11, Session.Vote.AddACS) Else
If Temp = 'F' Then Vote.ForceACS := Session.io.InXY(17, 7, 20, 20, 11, Vote.ForceACS) Else If Temp = 'F' Then Session.Vote.ForceACS := Session.io.InXY(17, 7, 20, 20, 11, Session.Vote.ForceACS) Else
If (Temp = 'I') and (Vote.AnsNum < 15) Then Begin If (Temp = 'I') and (Session.Vote.AnsNum < 15) Then Begin
Inc (Vote.AnsNum); Inc (Session.Vote.AnsNum);
Vote.Answer[Vote.AnsNum].Text := ''; Session.Vote.Answer[Session.Vote.AnsNum].Text := '';
Vote.Answer[Vote.AnsNum].Votes := 0; Session.Vote.Answer[Session.Vote.AnsNum].Votes := 0;
End Else End Else
If Temp = 'Q' Then Break Else Begin If Temp = 'Q' Then Break Else Begin
A := strS2I(Temp); A := strS2I(Temp);
If (A > 0) and (A < 21) Then Begin If (A > 0) and (A < 21) Then Begin
Session.io.OutRaw ('Answer: '); Session.io.OutRaw ('Answer: ');
Vote.Answer[A].Text := Session.io.GetInput (40, 40, 11, Vote.Answer[A].Text); Session.Vote.Answer[A].Text := Session.io.GetInput (40, 40, 11, Session.Vote.Answer[A].Text);
Session.io.OutRaw ('Votes : '); Session.io.OutRaw ('Votes : ');
Vote.Answer[A].Votes := strS2I(Session.io.GetInput(5, 5, 12, strI2S(Vote.Answer[A].Votes))); Session.Vote.Answer[A].Votes := strS2I(Session.io.GetInput(5, 5, 12, strI2S(Session.Vote.Answer[A].Votes)));
End; End;
End; End;
until false; until false;
seek (VoteFile, filepos(VoteFile)-1); seek (Session.VoteFile, filepos(Session.VoteFile)-1);
write (VoteFile, Vote); write (Session.VoteFile, Session.Vote);
end; end;
end; end;
'Q' : break; 'Q' : break;
end; end;
until False; Until False;
close (VoteFile);
Close (Session.VoteFile);
End; End;
End. End.

View File

@ -26,7 +26,6 @@ Const
WinConsoleTitle = 'Mystic Node '; WinConsoleTitle = 'Mystic Node ';
CopyID = 'Copyright (C) ' + mysCopyYear + ' By James Coyle. All Rights Reserved.'; CopyID = 'Copyright (C) ' + mysCopyYear + ' By James Coyle. All Rights Reserved.';
DateTypeStr : Array[1..4] of String[8] = ('MM/DD/YY', 'DD/MM/YY', 'YY/DD/MM', 'Ask '); DateTypeStr : Array[1..4] of String[8] = ('MM/DD/YY', 'DD/MM/YY', 'YY/DD/MM', 'Ask ');
GetKeyFunc : Function (Forced : Boolean) : Boolean = NIL;
Var Var
Screen : TOutput; Screen : TOutput;
@ -35,8 +34,6 @@ Var
ConfigFile : File of RecConfig; ConfigFile : File of RecConfig;
ChatFile : File of ChatRec; ChatFile : File of ChatRec;
RoomFile : File of RoomRec; RoomFile : File of RoomRec;
VoteFile : File of VoteRec;
Vote : VoteRec;
Chat : ChatRec; Chat : ChatRec;
Room : RoomRec; Room : RoomRec;
LastOnFile : File of RecLastOn; LastOnFile : File of RecLastOn;
@ -44,9 +41,6 @@ Var
Config : RecConfig; Config : RecConfig;
StatusPtr : Byte = 1; StatusPtr : Byte = 1;
Procedure EditAccessFlags (Var Flags : AccessFlagType);
Function DrawAccessFlags (Var Flags : AccessFlagType) : String;
Function NoGetKeyFunc (Forced : Boolean) : Boolean;
Procedure KillRecord (Var dFile; RecNum: LongInt; RecSize: Word); Procedure KillRecord (Var dFile; RecNum: LongInt; RecSize: Word);
Procedure AddRecord (var dFile; RecNum: LongInt; RecSize: Word); Procedure AddRecord (var dFile; RecNum: LongInt; RecSize: Word);
Function Bool_Search (Mask: String; Str: String) : Boolean; Function Bool_Search (Mask: String; Str: String) : Boolean;
@ -71,37 +65,6 @@ Uses
bbs_General, bbs_General,
MPL_Execute; MPL_Execute;
Function DrawAccessFlags (Var Flags : AccessFlagType) : String;
Var
S : String;
Ch : Char;
Begin
S := '';
For Ch := 'A' to 'Z' Do
If Ord(Ch) - 64 in Flags Then S := S + Ch Else S := S + '-';
DrawAccessFlags := S;
End;
Procedure EditAccessFlags (Var Flags : AccessFlagType);
Var
Ch : Char;
Begin
Repeat
Session.io.OutFull ('Toggle: [' + DrawAccessFlags(Flags) + '] (Enter/Done): ');
Ch := Session.io.OneKey('ABCDEFGHIJKLMNOPQRSTUVWXYZ'#13, True);
If Ch = #13 Then Break;
If Ord(Ch) - 64 in Flags Then
Flags := Flags - [Ord(Ch) - 64]
Else
Flags := Flags + [Ord(Ch) - 64];
Until False;
End;
Procedure AddRecord (var dFile; RecNum: LongInt; RecSize: Word); Procedure AddRecord (var dFile; RecNum: LongInt; RecSize: Word);
Var Var
F : File Absolute dFile; F : File Absolute dFile;
@ -155,7 +118,9 @@ Function Bool_Search (Mask: String; Str: String) : Boolean;
{ to search } { to search }
Begin Begin
Bool_Search := True; Bool_Search := True;
If Mask = '' Then Exit; If Mask = '' Then Exit;
Bool_Search := Pos(strUpper(Mask), strUpper(Str)) > 0; Bool_Search := Pos(strUpper(Mask), strUpper(Str)) > 0;
End; End;
@ -203,19 +168,14 @@ Begin
Result := Temp; Result := Temp;
End; End;
Function NoGetKeyFunc (Forced : Boolean): Boolean;
Begin
Result := False;
End;
Function ShellDOS (ExecPath: String; Command: String) : LongInt; Function ShellDOS (ExecPath: String; Command: String) : LongInt;
{$IFNDEF UNIX} {$IFNDEF UNIX}
Var Var
Image : TConsoleImageRec; Image : TConsoleImageRec;
{$ENDIF} {$ENDIF}
Begin Begin
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
ExecInheritsHandles := True; ExecInheritsHandles := True;
{$ENDIF} {$ENDIF}
If Session.User.UserNum <> -1 Then Begin If Session.User.UserNum <> -1 Then Begin
@ -226,10 +186,10 @@ Begin
End; End;
{$IFNDEF UNIX} {$IFNDEF UNIX}
Screen.GetScreenImage(1, 1, 80, 25, Image); Screen.GetScreenImage(1, 1, 80, 25, Image);
Screen.SetWindow (1, 1, 80, 25, False); Screen.SetWindow (1, 1, 80, 25, False);
Screen.TextAttr := 7; Screen.TextAttr := 7;
Screen.ClearScreen; Screen.ClearScreen;
{$ENDIF} {$ENDIF}
{$IFDEF UNIX} {$IFDEF UNIX}
@ -268,15 +228,29 @@ Begin
Reset (Session.PromptFile); Reset (Session.PromptFile);
{$IFNDEF UNIX} {$IFNDEF UNIX}
Screen.PutScreenImage(Image); Screen.PutScreenImage(Image);
UpdateStatusLine(StatusPtr, ''); UpdateStatusLine(StatusPtr, '');
{$ENDIF} {$ENDIF}
Session.TimeOut := TimerSeconds; Session.TimeOut := TimerSeconds;
End; End;
{$IFNDEF UNIX} {$IFNDEF UNIX}
Procedure UpdateStatusLine (Mode: Byte; Str: String); Procedure UpdateStatusLine (Mode: Byte; Str: String);
Function DrawAccessFlags (Var Flags : AccessFlagType) : String;
Var
S : String;
Ch : Char;
Begin
S := '';
For Ch := 'A' to 'Z' Do
If Ord(Ch) - 64 in Flags Then S := S + Ch Else S := S + '-';
Result := S;
End;
Begin Begin
If Not Config.UseStatusBar Then Exit; If Not Config.UseStatusBar Then Exit;
@ -377,6 +351,4 @@ Begin
End; End;
{$ENDIF} {$ENDIF}
Begin
GetKeyFunc := NoGetKeyFunc;
End. End.

View File

@ -29,13 +29,15 @@ Type
IO : TBBSIO; IO : TBBSIO;
Client : TSocketClass; Client : TSocketClass;
EventFile : File of EventRec; EventFile : File of EventRec;
LangFile : File of RecTheme; ThemeFile : File of RecTheme;
VoteFile : File of VoteRec;
Vote : VoteRec;
CommHandle : LongInt; CommHandle : LongInt;
ShutDown : Boolean; ShutDown : Boolean;
TempPath : String; TempPath : String;
Event : EventRec; Event : EventRec;
NextEvent : EventRec; NextEvent : EventRec;
Lang : RecTheme; Theme : RecTheme;
LocalMode : Boolean; LocalMode : Boolean;
Baud : LongInt; Baud : LongInt;
ExitLevel : Byte; ExitLevel : Byte;
@ -336,23 +338,23 @@ Function TBBSCore.LoadThemeData (Str: String) : Boolean;
Begin Begin
Result := False; Result := False;
Reset (LangFile); Reset (ThemeFile);
While Not Eof(LangFile) Do Begin While Not Eof(ThemeFile) Do Begin
Read (LangFile, Lang); Read (ThemeFile, Theme);
{$IFDEF FS_SENSITIVE} {$IFDEF FS_SENSITIVE}
If Lang.FileName = Str Then Begin If Lang.FileName = Str Then Begin
{$ELSE} {$ELSE}
If strUpper(Lang.FileName) = strUpper(Str) Then Begin If strUpper(Theme.FileName) = strUpper(Str) Then Begin
{$ENDIF} {$ENDIF}
If Not FileExist(Config.DataPath + Lang.FileName + '.thm') Then Break; If Not FileExist(Config.DataPath + Theme.FileName + '.thm') Then Break;
{$I-} Close (PromptFile); {$I+} {$I-} Close (PromptFile); {$I+}
If IoResult <> 0 Then; If IoResult <> 0 Then;
Assign (PromptFile, Config.DataPath + Lang.FileName + '.thm'); Assign (PromptFile, Config.DataPath + Theme.FileName + '.thm');
Result := ioReset(PromptFile, SizeOf(RecPrompt), fmRWDN); Result := ioReset(PromptFile, SizeOf(RecPrompt), fmRWDN);
@ -360,7 +362,7 @@ Begin
End; End;
End; End;
Close (LangFile); Close (ThemeFile);
End; End;
End. End.

View File

@ -121,7 +121,7 @@ Begin
Write (tFile, Session.io.Graphics, Ending); Write (tFile, Session.io.Graphics, Ending);
Write (tFile, Ord(Not Session.LocalMode), Ending); Write (tFile, Ord(Not Session.LocalMode), Ending);
Write (tFile, (Session.TimeLeft * 60), Ending); Write (tFile, (Session.TimeLeft * 60), Ending);
Write (tFile, Session.Lang.TextPath + Ending); Write (tFile, Session.Theme.TextPath + Ending);
Write (tFile, Config.DataPath + Ending); Write (tFile, Config.DataPath + Ending);
Write (tFile, 'SYSOP.', Session.NodeNum, Ending); Write (tFile, 'SYSOP.', Session.NodeNum, Ending);
If Session.LocalMode Then If Session.LocalMode Then

View File

@ -514,7 +514,7 @@ Var
Begin Begin
Session.io.AnsiGotoXY (1, QuoteCurLine + Session.io.ScreenInfo[2].Y); Session.io.AnsiGotoXY (1, QuoteCurLine + Session.io.ScreenInfo[2].Y);
If On Then If On Then
Session.io.AnsiColor (Session.Lang.QuoteColor) Session.io.AnsiColor (Session.Theme.QuoteColor)
Else Else
Session.io.AnsiColor (Session.io.ScreenInfo[2].A); Session.io.AnsiColor (Session.io.ScreenInfo[2].A);

View File

@ -1642,7 +1642,7 @@ Var
Screen.TextAttr := 255; Screen.TextAttr := 255;
Insert ( Insert (
Session.io.Attr2Ansi(Session.Lang.FileDescLo), Session.io.Attr2Ansi(Session.Theme.FileDescLo),
Temp, Temp,
Pos(Data, strUpper(Temp)) + Length(Data) Pos(Data, strUpper(Temp)) + Length(Data)
); );
@ -1650,7 +1650,7 @@ Var
Screen.TextAttr := 255; Screen.TextAttr := 255;
Insert ( Insert (
Session.io.Attr2Ansi(Session.Lang.FileDescHi), Session.io.Attr2Ansi(Session.Theme.FileDescHi),
Temp, Temp,
Pos(Data, strUpper(Temp))); Pos(Data, strUpper(Temp)));
@ -1855,7 +1855,7 @@ Var
For A := 1 to BatchNum Do For A := 1 to BatchNum Do
If Batch[A].FileName = FDir.FileName Then Begin If Batch[A].FileName = FDir.FileName Then Begin
List[ListSize + 1].Batch := True; List[ListSize + 1].Batch := True;
Session.io.PromptInfo[3] := Session.Lang.TagChar; Session.io.PromptInfo[3] := Session.Theme.TagChar;
Break; Break;
End; End;
@ -1920,7 +1920,7 @@ Var
BotPage := FilePos(FDirFile) - 1; BotPage := FilePos(FDirFile) - 1;
LastPage := Eof(FDirFile) And (BotDesc = 0) And Not IsNotLast; LastPage := Eof(FDirFile) And (BotDesc = 0) And Not IsNotLast;
IsNotLast := False; IsNotLast := False;
Str := Session.io.DrawPercent(Session.Lang.FileBar, BotPage, FileSize(FDirFile), A); Str := Session.io.DrawPercent(Session.Theme.FileBar, BotPage, FileSize(FDirFile), A);
If Found Then Begin If Found Then Begin
If (ListType = 1) and (Session.io.ScreenInfo[5].Y <> 0) Then Begin If (ListType = 1) and (Session.io.ScreenInfo[5].Y <> 0) Then Begin
@ -1944,7 +1944,7 @@ Var
Session.io.PromptInfo[2] := List[CurPos].FileName; Session.io.PromptInfo[2] := List[CurPos].FileName;
If List[CurPos].Batch Then If List[CurPos].Batch Then
Session.io.PromptInfo[3] := Session.Lang.TagChar Session.io.PromptInfo[3] := Session.Theme.TagChar
Else Else
Session.io.PromptInfo[3] := ' '; Session.io.PromptInfo[3] := ' ';
@ -1979,7 +1979,7 @@ Var
Session.io.PromptInfo[2] := List[CurPos].FileName; Session.io.PromptInfo[2] := List[CurPos].FileName;
If List[CurPos].Batch Then If List[CurPos].Batch Then
Session.io.PromptInfo[3] := Session.Lang.TagChar Session.io.PromptInfo[3] := Session.Theme.TagChar
Else Else
Session.io.PromptInfo[3] := ' '; Session.io.PromptInfo[3] := ' ';

View File

@ -597,17 +597,18 @@ Var
Begin Begin
If Not Session.io.GetYN (Session.GetPrompt(275), True) Then Exit; If Not Session.io.GetYN (Session.GetPrompt(275), True) Then Exit;
Reset (VoteFile); Reset (Session.VoteFile);
If FileSize (VoteFile) = mysMaxVoteQuestion Then Begin If FileSize (Session.VoteFile) = mysMaxVoteQuestion Then Begin
Close (VoteFile); Close (Session.VoteFile);
Session.io.OutFull (Session.GetPrompt(276)); Session.io.OutFull (Session.GetPrompt(276));
Exit; Exit;
End; End;
Close (VoteFile); Close (Session.VoteFile);
Session.io.OutFull (Session.GetPrompt(277)); Session.io.OutFull (Session.GetPrompt(277));
Vote.Question := Session.io.GetInput(78, 78, 11, ''); Session.Vote.Question := Session.io.GetInput(78, 78, 11, '');
If Vote.Question = '' Then Exit;
If Session.Vote.Question = '' Then Exit;
Session.io.OutFullLn (Session.GetPrompt(278)); Session.io.OutFullLn (Session.GetPrompt(278));
@ -616,30 +617,30 @@ Begin
While A <= 15 Do Begin While A <= 15 Do Begin
Session.io.PromptInfo[1] := strI2S(A); Session.io.PromptInfo[1] := strI2S(A);
Session.io.OutFull (Session.GetPrompt(279)); Session.io.OutFull (Session.GetPrompt(279));
Vote.Answer[A].Text := Session.io.GetInput(40, 40, 11, ''); Session.Vote.Answer[A].Text := Session.io.GetInput(40, 40, 11, '');
If Vote.Answer[A].Text = '' Then Begin If Session.Vote.Answer[A].Text = '' Then Begin
Dec (A); Dec (A);
Break; Break;
End; End;
Vote.Answer[A].Votes := 0; Session.Vote.Answer[A].Votes := 0;
Inc(A); Inc(A);
End; End;
If A = 0 Then Exit; If A = 0 Then Exit;
Vote.AnsNum := A; Session.Vote.AnsNum := A;
Vote.Votes := 0; Session.Vote.Votes := 0;
Vote.ACS := ''; Session.Vote.ACS := '';
Vote.AddACS := 's999'; Session.Vote.AddACS := 's999';
Vote.ForceACS := 's999'; Session.Vote.ForceACS := 's999';
If Session.io.GetYN(Session.GetPrompt(280), True) Then Vote.AddACS := ''; If Session.io.GetYN(Session.GetPrompt(280), True) Then Session.Vote.AddACS := '';
If Session.io.GetYN(Session.GetPrompt(281), True) Then Begin If Session.io.GetYN(Session.GetPrompt(281), True) Then Begin
Reset (VoteFile); Reset (Session.VoteFile);
Seek (VoteFile, FileSize(VoteFile)); Seek (Session.VoteFile, FileSize(Session.VoteFile));
Write (VoteFile, Vote); Write (Session.VoteFile, Session.Vote);
Close (VoteFile); Close (Session.VoteFile);
End; End;
End; End;
@ -649,25 +650,26 @@ Function Voting_List : Byte;
Var Var
Total : Byte; Total : Byte;
Begin Begin
Reset (VoteFile); Reset (Session.VoteFile);
Session.io.OutFullLn (Session.GetPrompt(241)); Session.io.OutFullLn (Session.GetPrompt(241));
Total := 0; Total := 0;
While Not Eof(VoteFile) Do Begin
Read (VoteFile, Vote); While Not Eof(Session.VoteFile) Do Begin
If Session.User.Access(Vote.ACS) Then Begin Read (Session.VoteFile, Session.Vote);
If Session.User.Access(Session.Vote.ACS) Then Begin
Inc (Total); Inc (Total);
Session.io.PromptInfo[1] := strI2S(Total); Session.io.PromptInfo[1] := strI2S(Total);
Session.io.PromptInfo[2] := Vote.Question; Session.io.PromptInfo[2] := Session.Vote.Question;
If Session.User.ThisUser.Vote[FilePos(VoteFile)] = 0 Then If Session.User.ThisUser.Vote[FilePos(Session.VoteFile)] = 0 Then
Session.io.PromptInfo[3] := '*' //++lang Session.io.PromptInfo[3] := '*' //++lang
Else Else
Session.io.PromptInfo[3] := ' '; Session.io.PromptInfo[3] := ' ';
Session.io.OutFullLn (Session.GetPrompt(242)); Session.io.OutFullLn (Session.GetPrompt(242));
End; End;
End; End;
Close (VoteFile); Close (Session.VoteFile);
If Total = 0 Then Session.io.OutFullLn (Session.GetPrompt(243)); If Total = 0 Then Session.io.OutFullLn (Session.GetPrompt(243));
Voting_List := Total; Voting_List := Total;
@ -678,12 +680,12 @@ Var
A : SmallInt; A : SmallInt;
P : SmallInt; P : SmallInt;
Begin Begin
Reset (VoteFile); Reset (Session.VoteFile);
If (Data > 0) and (Data <= FileSize(VoteFile)) Then Begin If (Data > 0) and (Data <= FileSize(Session.VoteFile)) Then Begin
Seek (VoteFile, Data - 1); Seek (Session.VoteFile, Data - 1);
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
Close (VoteFile); Close (Session.VoteFile);
End Else Begin End Else Begin
A := Voting_List; A := Voting_List;
If A = 0 Then Exit; If A = 0 Then Exit;
@ -696,27 +698,27 @@ Begin
If P <= A Then Break; If P <= A Then Break;
Until False; Until False;
Reset (VoteFile); Reset (Session.VoteFile);
A := 0; A := 0;
Repeat Repeat
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
If Session.User.Access(Vote.ACS) Then Inc(A); If Session.User.Access(Session.Vote.ACS) Then Inc(A);
Until A = P; Until A = P;
Close (VoteFile); Close (Session.VoteFile);
End; End;
Session.io.PromptInfo[1] := Vote.Question; Session.io.PromptInfo[1] := Session.Vote.Question;
Session.io.PromptInfo[2] := strI2S(Vote.Votes); Session.io.PromptInfo[2] := strI2S(Session.Vote.Votes);
Session.io.OutFullLn (Session.GetPrompt(249)); Session.io.OutFullLn (Session.GetPrompt(249));
For A := 1 to Vote.AnsNum Do Begin For A := 1 to Session.Vote.AnsNum Do Begin
Session.io.PromptInfo[1] := strI2S(A); Session.io.PromptInfo[1] := strI2S(A);
Session.io.PromptInfo[2] := Vote.Answer[A].Text; Session.io.PromptInfo[2] := Session.Vote.Answer[A].Text;
Session.io.PromptInfo[3] := strI2S(Vote.Answer[A].Votes); Session.io.PromptInfo[3] := strI2S(Session.Vote.Answer[A].Votes);
If Vote.Votes = 0 Then Begin If Session.Vote.Votes = 0 Then Begin
Session.io.PromptInfo[4] := '0'; Session.io.PromptInfo[4] := '0';
Session.io.PromptInfo[5] := ''; Session.io.PromptInfo[5] := '';
End Else Begin End Else Begin
Session.io.PromptInfo[5] := Session.io.DrawPercent(Session.Lang.VotingBar, Vote.Answer[A].Votes, Vote.Votes, P); Session.io.PromptInfo[5] := Session.io.DrawPercent(Session.Theme.VotingBar, Session.Vote.Answer[A].Votes, Session.Vote.Votes, P);
Session.io.PromptInfo[4] := strI2S(P); Session.io.PromptInfo[4] := strI2S(P);
End; End;
Session.io.OutFullLn (Session.GetPrompt(250)); Session.io.OutFullLn (Session.GetPrompt(250));
@ -729,15 +731,15 @@ Var
NewQues : Array[1..mysMaxVoteQuestion] of Boolean; NewQues : Array[1..mysMaxVoteQuestion] of Boolean;
Pos : Byte; Pos : Byte;
Begin Begin
Reset (VoteFile); Reset (Session.VoteFile);
While Not Eof(VoteFile) Do Begin While Not Eof(Session.VoteFile) Do Begin
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
If Session.User.Access(Vote.ACS) Then If Session.User.Access(Session.Vote.ACS) Then
NewQues[FilePos(VoteFile)] := (Session.User.ThisUser.Vote[FilePos(VoteFile)] = 0) NewQues[FilePos(Session.VoteFile)] := (Session.User.ThisUser.Vote[FilePos(Session.VoteFile)] = 0)
Else Else
NewQues[FilePos(VoteFile)] := False; NewQues[FilePos(Session.VoteFile)] := False;
End; End;
Close (VoteFile); Close (Session.VoteFile);
For Pos := 1 to mysMaxVoteQuestion Do For Pos := 1 to mysMaxVoteQuestion Do
If NewQues[Pos] Then Voting_Booth (False, Pos); If NewQues[Pos] Then Voting_Booth (False, Pos);
@ -764,29 +766,29 @@ Begin
Until False; Until False;
Total := 0; Total := 0;
Reset (VoteFile); Reset (Session.VoteFile);
Repeat Repeat
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
If Session.User.Access(Vote.ACS) Then Inc(Total); If Session.User.Access(Session.Vote.ACS) Then Inc(Total);
Until Total = Temp; Until Total = Temp;
End Else Begin End Else Begin
Reset (VoteFile); Reset (Session.VoteFile);
If Num > FileSize(VoteFile) Then Begin If Num > FileSize(Session.VoteFile) Then Begin
Close (VoteFile); Close (Session.VoteFile);
Exit; Exit;
End; End;
Seek (VoteFile, Num - 1); Seek (Session.VoteFile, Num - 1);
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
End; End;
VPos := FilePos(VoteFile); VPos := FilePos(Session.VoteFile);
Repeat Repeat
Session.io.PromptInfo[1] := Vote.Question; Session.io.PromptInfo[1] := Session.Vote.Question;
Session.io.OutFullLn (Session.GetPrompt(245)); Session.io.OutFullLn (Session.GetPrompt(245));
For Temp := 1 to Vote.AnsNum Do Begin For Temp := 1 to Session.Vote.AnsNum Do Begin
Session.io.PromptInfo[1] := strI2S(Temp); Session.io.PromptInfo[1] := strI2S(Temp);
Session.io.PromptInfo[2] := Vote.Answer[Temp].Text; Session.io.PromptInfo[2] := Session.Vote.Answer[Temp].Text;
If Session.User.ThisUser.Vote[VPos] = Temp Then If Session.User.ThisUser.Vote[VPos] = Temp Then
Session.io.PromptInfo[3] := '*' //++lang Session.io.PromptInfo[3] := '*' //++lang
Else Else
@ -794,8 +796,8 @@ Begin
Session.io.OutFullLn (Session.GetPrompt(246)); Session.io.OutFullLn (Session.GetPrompt(246));
End; End;
If Session.User.Access(Vote.AddACS) and (Vote.AnsNum < 15) Then Begin If Session.User.Access(Session.Vote.AddACS) and (Session.Vote.AnsNum < 15) Then Begin
Session.io.PromptInfo[1] := strI2S(Vote.AnsNum + 1); Session.io.PromptInfo[1] := strI2S(Session.Vote.AnsNum + 1);
Session.io.PromptInfo[2] := Session.GetPrompt(252); Session.io.PromptInfo[2] := Session.GetPrompt(252);
Session.io.PromptInfo[3] := ' '; Session.io.PromptInfo[3] := ' ';
Session.io.OutFullLn (Session.GetPrompt(246)); Session.io.OutFullLn (Session.GetPrompt(246));
@ -804,33 +806,33 @@ Begin
Session.io.OutFull (Session.GetPrompt(247)); Session.io.OutFull (Session.GetPrompt(247));
Temp := strS2I(Session.io.GetInput(2, 2, 12, '')); Temp := strS2I(Session.io.GetInput(2, 2, 12, ''));
If (Vote.AnsNum < 15) and Session.User.Access(Vote.AddACS) and (Temp = Succ(Vote.AnsNum)) Then Begin If (Session.Vote.AnsNum < 15) and Session.User.Access(Session.Vote.AddACS) and (Temp = Succ(Session.Vote.AnsNum)) Then Begin
Session.io.OutFull (Session.GetPrompt(253)); Session.io.OutFull (Session.GetPrompt(253));
Str := Session.io.GetInput (40, 40, 11, ''); Str := Session.io.GetInput (40, 40, 11, '');
If Str <> '' Then Begin If Str <> '' Then Begin
Inc (Vote.AnsNum); Inc (Session.Vote.AnsNum);
Vote.Answer[Vote.AnsNum].Text := Str; Session.Vote.Answer[Session.Vote.AnsNum].Text := Str;
Vote.Answer[Vote.AnsNum].Votes := 0; Session.Vote.Answer[Session.Vote.AnsNum].Votes := 0;
End; End;
End; End;
If (Temp > 0) and (Temp <= Vote.AnsNum) Then Begin If (Temp > 0) and (Temp <= Session.Vote.AnsNum) Then Begin
If Session.User.ThisUser.Vote[VPos] <> 0 Then Begin If Session.User.ThisUser.Vote[VPos] <> 0 Then Begin
Dec (Vote.Answer[Session.User.ThisUser.Vote[VPos]].Votes); Dec (Session.Vote.Answer[Session.User.ThisUser.Vote[VPos]].Votes);
Dec (Vote.Votes); Dec (Session.Vote.Votes);
End; End;
Inc(Vote.Answer[Temp].Votes); Inc(Session.Vote.Answer[Temp].Votes);
Inc(Vote.Votes); Inc(Session.Vote.Votes);
Session.User.ThisUser.Vote[VPos] := Temp; Session.User.ThisUser.Vote[VPos] := Temp;
Seek (VoteFile, VPos - 1); Seek (Session.VoteFile, VPos - 1);
Write (VoteFile, Vote); Write (Session.VoteFile, Session.Vote);
Break; Break;
End Else End Else
If Forced Then Session.io.OutFull (Session.GetPrompt(254)) Else Break; If Forced Then Session.io.OutFull (Session.GetPrompt(254)) Else Break;
Until False; Until False;
Close (VoteFile); Close (Session.VoteFile);
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;
@ -1099,7 +1101,7 @@ Var
If CurPos > CurBot Then CurPos := CurBot; If CurPos > CurBot Then CurPos := CurBot;
Session.io.PromptInfo[1] := Session.io.DrawPercent(Session.Lang.GalleryBar, CurBot, DirCount, Count); Session.io.PromptInfo[1] := Session.io.DrawPercent(Session.Theme.GalleryBar, CurBot, DirCount, Count);
Session.io.PromptInfo[2] := strI2S(Count); Session.io.PromptInfo[2] := strI2S(Count);
Session.io.OutFull(Session.GetPrompt(472)); Session.io.OutFull(Session.GetPrompt(472));

View File

@ -21,36 +21,39 @@ Const
MaxPromptInfo = 15; MaxPromptInfo = 15;
Type Type
TGetKeyCallBack = Function (Forced: Boolean) : Boolean Is Nested;
TBBSIO = Class TBBSIO = Class
Core : Pointer; Core : Pointer;
Term : TTermAnsi; Term : TTermAnsi;
ScreenInfo : Array[0..9] of Record X, Y, A : Byte; End; ScreenInfo : Array[0..9] of Record X, Y, A : Byte; End;
PromptInfo : Array[1..MaxPromptInfo] of String[89]; PromptInfo : Array[1..MaxPromptInfo] of String[89];
FmtString : Boolean; FmtString : Boolean;
FmtLen : Byte; FmtLen : Byte;
FmtType : Byte; FmtType : Byte;
InMacro : Boolean; InMacro : Boolean;
InMacroPos : Byte; InMacroPos : Byte;
InMacroStr : String; InMacroStr : String;
BaudEmulator : Byte; BaudEmulator : Byte;
AllowPause : Boolean; AllowPause : Boolean;
AllowMCI : Boolean; AllowMCI : Boolean;
LocalInput : Boolean; LocalInput : Boolean;
AllowArrow : Boolean; AllowArrow : Boolean;
IsArrow : Boolean; IsArrow : Boolean;
UseInField : Boolean; UseInField : Boolean;
UseInLimit : Boolean; UseInLimit : Boolean;
UseInSize : Boolean; UseInSize : Boolean;
InLimit : Byte; InLimit : Byte;
InSize : Byte; InSize : Byte;
AllowAbort : Boolean; AllowAbort : Boolean;
Aborted : Boolean; Aborted : Boolean;
NoFile : Boolean; NoFile : Boolean;
Graphics : Byte; Graphics : Byte;
PausePtr : Byte; PausePtr : Byte;
InputData : Array[1..mysMaxInputHistory] of String[255]; InputData : Array[1..mysMaxInputHistory] of String[255];
LastMCIValue : String; LastMCIValue : String;
InputPos : Byte; InputPos : Byte;
GetKeyCallBack : TGetKeyCallBack;
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
OutBuffer : Array[0..TBBSIOBufferSize] of Char; OutBuffer : Array[0..TBBSIOBufferSize] of Char;
@ -585,7 +588,7 @@ Begin
End; End;
'T' : Case Code[2] of 'T' : Case Code[2] of
'0'.. '0'..
'9' : LastMCIValue := Attr2Ansi(Session.Lang.Colors[strS2I(Code[2])]); '9' : LastMCIValue := Attr2Ansi(Session.Theme.Colors[strS2I(Code[2])]);
'B' : LastMCIValue := strI2S(TBBSCore(Core).User.ThisUser.TimeBank); 'B' : LastMCIValue := strI2S(TBBSCore(Core).User.ThisUser.TimeBank);
'C' : LastMCIValue := strI2S(Config.SystemCalls); 'C' : LastMCIValue := strI2S(Config.SystemCalls);
'E' : If Graphics = 1 Then LastMCIValue := 'Ansi' Else LastMCIValue := 'Ascii'; //++lang 'E' : If Graphics = 1 Then LastMCIValue := 'Ansi' Else LastMCIValue := 'Ascii'; //++lang
@ -622,7 +625,7 @@ Begin
1 : LastMCIValue := 'Lightbar'; {++lang} 1 : LastMCIValue := 'Lightbar'; {++lang}
End; End;
'K' : LastMCIValue := TBBSCore(Core).User.ThisUser.Email; 'K' : LastMCIValue := TBBSCore(Core).User.ThisUser.Email;
'L' : LastMCIValue := TBBSCore(Core).Lang.Desc; 'L' : LastMCIValue := TBBSCore(Core).Theme.Desc;
'M' : LastMCIValue := OutON(TBBSCore(Core).User.ThisUser.UseLBMIdx); 'M' : LastMCIValue := OutON(TBBSCore(Core).User.ThisUser.UseLBMIdx);
'N' : LastMCIValue := TBBSCore(Core).User.ThisUser.RealName; 'N' : LastMCIValue := TBBSCore(Core).User.ThisUser.RealName;
'P' : LastMCIValue := TBBSCore(Core).User.ThisUser.HomePhone; 'P' : LastMCIValue := TBBSCore(Core).User.ThisUser.HomePhone;
@ -716,7 +719,7 @@ Begin
Inc (B); Inc (B);
FSplit (strStripLOW(Copy(Str, A + 1, B - A - 1)), D, N, E); FSplit (strStripLOW(Copy(Str, A + 1, B - A - 1)), D, N, E);
OutFile (TBBSCore(Core).Lang.TextPath + N + E, True, 0); OutFile (TBBSCore(Core).Theme.TextPath + N + E, True, 0);
A := B; A := B;
@ -947,7 +950,7 @@ Var
Begin Begin
If Pos(PathChar, FName) = 0 Then If Pos(PathChar, FName) = 0 Then
FName := TBBSCore(Core).Lang.TextPath + FName; FName := TBBSCore(Core).Theme.TextPath + FName;
If Pos('.', FName) > 0 Then If Pos('.', FName) > 0 Then
Ext := '' Ext := ''
@ -1027,7 +1030,7 @@ Begin
Str := Str + GetChar; Str := Str + GetChar;
End; End;
OutFile (TBBSCore(Core).Lang.TextPath + strStripLOW(Str), True, 0); OutFile (TBBSCore(Core).Theme.TextPath + strStripLOW(Str), True, 0);
Continue; Continue;
End; End;
@ -1249,10 +1252,11 @@ Begin
Repeat Repeat
If LastSec <> TimerSeconds Then Begin If LastSec <> TimerSeconds Then Begin
If GetKeyFunc(False) Then Begin If Assigned(GetKeyCallBack) Then
Result := #02; If GetKeyCallBack(False) Then Begin
Exit; Result := #02;
End; Exit;
End;
LastSec := TimerSeconds; LastSec := TimerSeconds;
@ -1377,7 +1381,7 @@ End;
Function TBBSIO.GetYN (Str: String; Yes: Boolean) : Boolean; Function TBBSIO.GetYN (Str: String; Yes: Boolean) : Boolean;
Begin Begin
If (TBBSCore(Core).Lang.Flags AND ThmLightbarYN <> 0) and (Graphics = 1) Then Begin If (TBBSCore(Core).Theme.Flags AND ThmLightbarYN <> 0) and (Graphics = 1) Then Begin
GetYN := GetYNL(Str, Yes); GetYN := GetYNL(Str, Yes);
Exit; Exit;
End; End;
@ -1407,7 +1411,9 @@ Begin
Repeat Repeat
OutFull (Str); OutFull (Str);
Temp := GetInput(15, 15, 16, ''); Temp := GetInput(15, 15, 16, '');
If Temp = PW Then If Temp = PW Then
Exit Exit
Else Begin Else Begin
@ -1467,7 +1473,7 @@ Var
Procedure pWrite (Str : String); Procedure pWrite (Str : String);
Begin Begin
If (Mode = 6) and (Str <> '') Then If (Mode = 6) and (Str <> '') Then
BufAddStr (strRep(TBBSCore(Core).Lang.EchoChar, Length(Str))) BufAddStr (strRep(TBBSCore(Core).Theme.EchoChar, Length(Str)))
Else Else
BufAddStr (Str); BufAddStr (Str);
End; End;
@ -1477,9 +1483,9 @@ Var
AnsiMoveX (xPos); AnsiMoveX (xPos);
pWrite (Copy(Str, Junk, Field)); pWrite (Copy(Str, Junk, Field));
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor2); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor2);
pWrite (strRep(FieldCh, Field - Length(Copy(Str, Junk, Field)))); pWrite (strRep(FieldCh, Field - Length(Copy(Str, Junk, Field))));
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor1); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor1);
AnsiMoveX (xPos + CurPos - 1); AnsiMoveX (xPos + CurPos - 1);
End; End;
@ -1487,9 +1493,9 @@ Var
Procedure ReDrawPart; Procedure ReDrawPart;
Begin Begin
pWrite (Copy(Str, StrPos, Field - CurPos + 1)); pWrite (Copy(Str, StrPos, Field - CurPos + 1));
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor2); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor2);
pWrite (strRep(FieldCh, (Field - CurPos + 1) - Length(Copy(Str, StrPos, Field - CurPos + 1)))); pWrite (strRep(FieldCh, (Field - CurPos + 1) - Length(Copy(Str, StrPos, Field - CurPos + 1))));
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor1); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor1);
AnsiMoveX (xPos + CurPos - 1); AnsiMoveX (xPos + CurPos - 1);
End; End;
@ -1546,11 +1552,11 @@ Begin
Dec (Mode, 10); Dec (Mode, 10);
If UseInField and (Graphics = 1) Then Begin If UseInField and (Graphics = 1) Then Begin
FieldCh := TBBSCore(Core).Lang.FieldChar; FieldCh := TBBSCore(Core).Theme.FieldChar;
AnsiColor (TBBSCore(Core).Lang.FieldColor2); AnsiColor (TBBSCore(Core).Theme.FieldColor2);
BufAddStr (strRep(FieldCh, Field)); BufAddStr (strRep(FieldCh, Field));
AnsiColor (TBBSCore(Core).Lang.FieldColor1); AnsiColor (TBBSCore(Core).Theme.FieldColor1);
AnsiMoveX (xPos); AnsiMoveX (xPos);
End Else End Else
UseInField := False; UseInField := False;
@ -1654,9 +1660,9 @@ Begin
ScrollLeft ScrollLeft
Else Else
If StrPos = Length(Str) + 1 Then Begin If StrPos = Length(Str) + 1 Then Begin
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor2); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor2);
BufAddStr (#8 + FieldCh + #8); BufAddStr (#8 + FieldCh + #8);
If UseInField Then AnsiColor(TBBSCore(Core).Lang.FieldColor1); If UseInField Then AnsiColor(TBBSCore(Core).Theme.FieldColor1);
Dec (CurPos); Dec (CurPos);
End Else Begin End Else Begin
BufAddChar (#8); BufAddChar (#8);

View File

@ -232,7 +232,7 @@ Begin
'?' : Begin '?' : Begin
// online ANSI help system (BBSHTML) prototype // online ANSI help system (BBSHTML) prototype
Help := TAnsiMenuHelp.Create; Help := TAnsiMenuHelp.Create;
Help.OpenHelp (Session.Lang.TextPath + Data + ';ansihelp;INDEX'); Help.OpenHelp (Session.Theme.TextPath + Data + ';ansihelp;INDEX');
Help.Free; Help.Free;
End; End;
End; End;
@ -345,7 +345,7 @@ Begin
{$IFDEF LOGGING} Session.SystemLog('Load menu: ' + MenuName); {$ENDIF} {$IFDEF LOGGING} Session.SystemLog('Load menu: ' + MenuName); {$ENDIF}
Assign (MenuFile, Session.Lang.MenuPath + MenuName + '.mnu'); Assign (MenuFile, Session.Theme.MenuPath + MenuName + '.mnu');
{$I-} Reset (MenuFile); {$I+} {$I-} Reset (MenuFile); {$I+}
If IoResult <> 0 Then Begin If IoResult <> 0 Then Begin
@ -648,7 +648,7 @@ Var
Session.io.PurgeInputBuffer; Session.io.PurgeInputBuffer;
Listed := 0; Listed := 0;
Session.io.AllowArrow := True; Session.io.AllowArrow := True;
If HotKeys Then Begin If HotKeys Then Begin
@ -663,6 +663,7 @@ Var
Session.io.BufAddChar (Temp[1]); Session.io.BufAddChar (Temp[1]);
Repeat Repeat
Ch := UpCase(Session.io.GetKey); Ch := UpCase(Session.io.GetKey);
Case Ch of Case Ch of
#08 : If Length(Temp) > 0 Then Begin #08 : If Length(Temp) > 0 Then Begin
Dec (Temp[0]); Dec (Temp[0]);

View File

@ -158,8 +158,8 @@ Var
Count : Integer; Count : Integer;
Temp : MScanRec; Temp : MScanRec;
Begin Begin
Temp.NewScan := MBase.DefNScan; Temp.NewScan := MBase.DefNScan;
Temp.QwkScan := MBase.DefQScan; Temp.QwkScan := MBase.DefQScan;
Assign (MScanFile, MBase.Path + MBase.FileName + '.scn'); Assign (MScanFile, MBase.Path + MBase.FileName + '.scn');
{$I-} Reset (MScanFile); {$I+} {$I-} Reset (MScanFile); {$I+}
@ -1083,7 +1083,7 @@ Begin
If Not Session.LocalMode Then FileErase(FN); If Not Session.LocalMode Then FileErase(FN);
DirClean(Session.TempPath, 'msgtmp'); DirClean (Session.TempPath, 'msgtmp');
Session.io.PromptInfo[1] := T1; Session.io.PromptInfo[1] := T1;
Session.io.PromptInfo[2] := T2; Session.io.PromptInfo[2] := T2;
@ -1408,7 +1408,7 @@ Var
Session.io.OutRawLn (''); Session.io.OutRawLn ('');
End; End;
Temp := Session.io.DrawPercent(Session.Lang.MsgBar, PageEnd - 1, Lines, A); Temp := Session.io.DrawPercent(Session.Theme.MsgBar, PageEnd - 1, Lines, A);
If Session.io.ScreenInfo[4].Y <> 0 Then Begin If Session.io.ScreenInfo[4].Y <> 0 Then Begin
Session.io.AnsiGotoXY (Session.io.ScreenInfo[4].X, Session.io.ScreenInfo[4].Y); Session.io.AnsiGotoXY (Session.io.ScreenInfo[4].X, Session.io.ScreenInfo[4].Y);
@ -1716,7 +1716,7 @@ Var
Session.io.PromptInfo[4] := MsgTo; Session.io.PromptInfo[4] := MsgTo;
If NewMsgs Then If NewMsgs Then
Session.io.PromptInfo[5] := Session.Lang.NewMsgChar Session.io.PromptInfo[5] := Session.Theme.NewMsgChar
Else Else
Session.io.PromptInfo[5] := ' '; Session.io.PromptInfo[5] := ' ';
End; End;
@ -1824,7 +1824,7 @@ Var
Session.io.PromptInfo[4] := MsgInfo[PagePos].MsgTo; Session.io.PromptInfo[4] := MsgInfo[PagePos].MsgTo;
If MsgInfo[PagePos].NewMsgs Then If MsgInfo[PagePos].NewMsgs Then
Session.io.PromptInfo[5] := Session.Lang.NewMsgChar Session.io.PromptInfo[5] := Session.Theme.NewMsgChar
Else Else
Session.io.PromptInfo[5] := ' '; Session.io.PromptInfo[5] := ' ';
@ -2689,7 +2689,7 @@ Begin
End; End;
Session.User.IgnoreGroup := Pos('/G', Data) > 0; Session.User.IgnoreGroup := Pos('/G', Data) > 0;
WereMsgs := False; WereMsgs := False;
Session.io.OutRawLn (''); Session.io.OutRawLn ('');
@ -2768,12 +2768,12 @@ Begin
End; End;
End; End;
Session.io.OutFull (Session.GetPrompt(311)); Session.io.OutFull (Session.GetPrompt(311));
Close (MBaseFile); Close (MBaseFile);
End; End;
Session.User.IgnoreGroup := False; Session.User.IgnoreGroup := False;
MBase := OLD; MBase := OLD;
End; End;
Procedure TMsgBase.SendMassEmail; Procedure TMsgBase.SendMassEmail;
@ -3416,10 +3416,9 @@ Begin
End; End;
Procedure TMsgBase.MessageQuickScan (Data: String); Procedure TMsgBase.MessageQuickScan (Data: String);
// defaults to ALL mode // defaults to ALL groups/bases
// /CURRENT = scan only current message base // /CURRENT = scan only current message base
// /GROUP = scan only current group bases // /GROUP = scan only current group bases
// /ALL = scan all bases in all groups
// options: // options:
// /NOSCAN = do not show "scanning" prompt // /NOSCAN = do not show "scanning" prompt
// /NOFOOT = do not show "end of scan" prompt // /NOFOOT = do not show "end of scan" prompt
@ -3538,6 +3537,7 @@ Begin
If Session.User.Access(MBase.ReadACS) Then Begin If Session.User.Access(MBase.ReadACS) Then Begin
GetMessageScan; GetMessageScan;
If MScan.NewScan > 0 Then ScanBase; If MScan.NewScan > 0 Then ScanBase;
End; End;
End; End;

View File

@ -390,7 +390,7 @@ Begin
Session.AllowMessages := False; Session.AllowMessages := False;
GetKeyFunc := GetKeyNodeChatFunc; Session.io.GetKeyCallBack := GetKeyNodeChatFunc;
Repeat Repeat
Session.io.PromptInfo[1] := Session.User.ThisUser.Handle; Session.io.PromptInfo[1] := Session.User.ThisUser.Handle;
@ -405,7 +405,7 @@ Begin
Str := Session.io.GetInput (79 - Screen.CursorX + 1, 250, 11, ''); Str := Session.io.GetInput (79 - Screen.CursorX + 1, 250, 11, '');
If Str[1] = '/' Then Begin If Str[1] = '/' Then Begin
GetKeyFunc := NoGetKeyFunc; Session.io.GetKeyCallBack := NIL;
Str2 := strUpper(strWordGet(1, Str, ' ')); Str2 := strUpper(strWordGet(1, Str, ' '));
@ -465,7 +465,7 @@ Begin
Send_Node_Message (7, '0;Topic changed to "' + Room.Name + '"', CurRoom); // ++lang Send_Node_Message (7, '0;Topic changed to "' + Room.Name + '"', CurRoom); // ++lang
End; End;
GetKeyFunc := GetKeyNodeChatFunc; Session.io.GetKeyCallBack := GetKeyNodeChatFunc;
End Else End Else
If Str <> '' Then Begin If Str <> '' Then Begin
Send_Node_Message (1, '0;' + Str, CurRoom); Send_Node_Message (1, '0;' + Str, CurRoom);
@ -474,7 +474,8 @@ Begin
End; End;
Until False; Until False;
GetKeyFunc := NoGetKeyFunc; Session.io.GetKeyCallBack := NIL;
Chat.InChat := False; Chat.InChat := False;
Chat.Available := Avail; Chat.Available := Avail;

View File

@ -413,7 +413,7 @@ Procedure TBBSUser.DetectGraphics;
Var Var
Loop : Byte; Loop : Byte;
Begin Begin
If Session.Lang.Flags AND ThmAllowANSI = 0 Then Begin If Session.Theme.Flags AND ThmAllowANSI = 0 Then Begin
Session.io.Graphics := 0; Session.io.Graphics := 0;
Exit; Exit;
End; End;
@ -803,20 +803,20 @@ Var
A : Byte; A : Byte;
Begin Begin
T := 0; T := 0;
Old := Session.Lang; Old := Session.Theme;
Session.io.OutFullLn (Session.GetPrompt(182)); Session.io.OutFullLn (Session.GetPrompt(182));
Reset (Session.LangFile); Reset (Session.ThemeFile);
Repeat Repeat
Read (Session.LangFile, Session.Lang); Read (Session.ThemeFile, Session.Theme);
If ((Session.Lang.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or If ((Session.Theme.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or
((Session.Lang.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then Continue; ((Session.Theme.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then Continue;
Inc (T); Inc (T);
Session.io.PromptInfo[1] := strI2S(T); Session.io.PromptInfo[1] := strI2S(T);
Session.io.PromptInfo[2] := Session.Lang.Desc; Session.io.PromptInfo[2] := Session.Theme.Desc;
Session.io.OutFullLn (Session.GetPrompt(183)); Session.io.OutFullLn (Session.GetPrompt(183));
Until Eof(Session.LangFile); Until Eof(Session.ThemeFile);
{ Lang := Old; } { Lang := Old; }
@ -827,25 +827,23 @@ Begin
If (A < 1) or (A > T) Then A := 1; If (A < 1) or (A > T) Then A := 1;
T := 0; T := 0;
Reset (Session.LangFile); Reset (Session.ThemeFile);
Repeat Repeat
Read (Session.LangFile, Session.Lang); Read (Session.ThemeFile, Session.Theme);
If ((Session.Lang.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or If ((Session.Theme.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or
((Session.Lang.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then Continue; ((Session.Theme.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then Continue;
Inc (T); Inc (T);
Until T = A; Until T = A;
{ Close (Session.LangFile);} { Close (Session.LangFile);}
If Not Session.LoadThemeData(Session.Lang.FileName) Then Begin If Not Session.LoadThemeData(Session.Theme.FileName) Then Begin
Session.io.OutFullLn (Session.GetPrompt(185)); Session.io.OutFullLn (Session.GetPrompt(185));
Session.Lang := Old; Session.Theme := Old;
End Else End Else
ThisUser.Theme := Session.Lang.FileName; ThisUser.Theme := Session.Theme.FileName;
End; End;
Procedure TBBSUser.CreateNewUser (DefName: String); Procedure TBBSUser.CreateNewUser (DefName: String);
Const
ExecMPE : Boolean = False; {placeholder for apply.mpx dev}
Begin Begin
If Not Config.AllowNewUsers Then Begin If Not Config.AllowNewUsers Then Begin
Session.io.OutFile ('nonewusr', True, 0); Session.io.OutFile ('nonewusr', True, 0);
@ -1045,18 +1043,18 @@ Begin
{ Check for forced voting questions } { Check for forced voting questions }
Reset (VoteFile); Reset (Session.VoteFile);
While Not Eof(VoteFile) Do Begin While Not Eof(Session.VoteFile) Do Begin
Read (VoteFile, Vote); Read (Session.VoteFile, Session.Vote);
If Access(Vote.ACS) and Access(Vote.ForceACS) and (ThisUser.Vote[FilePos(VoteFile)] = 0) Then Begin If Access(Session.Vote.ACS) and Access(Session.Vote.ForceACS) and (ThisUser.Vote[FilePos(Session.VoteFile)] = 0) Then Begin
Count := FilePos(VoteFile); Count := FilePos(Session.VoteFile);
Close (VoteFile); Close (Session.VoteFile);
Voting_Booth (True, Count); Voting_Booth (True, Count);
Reset (VoteFile); Reset (Session.VoteFile);
Seek (VoteFile, Count); Seek (Session.VoteFile, Count);
End; End;
End; End;
Close (VoteFile); Close (Session.VoteFile);
{ END forced voting check } { END forced voting check }
End; End;
@ -1201,12 +1199,12 @@ Begin
If FileExist(Config.ScriptPath + 'startup.mpx') Then If FileExist(Config.ScriptPath + 'startup.mpx') Then
ExecuteMPL(NIL, 'startup'); ExecuteMPL(NIL, 'startup');
If (Session.Lang.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0) Then Begin If (Session.Theme.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0) Then Begin
Session.io.OutFullLn (Session.GetPrompt(321)); Session.io.OutFullLn (Session.GetPrompt(321));
Session.SystemLog ('ASCII login disabled'); Session.SystemLog ('ASCII login disabled');
Halt(0); Halt(0);
End Else End Else
If (Session.Lang.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1) Then Begin If (Session.Theme.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1) Then Begin
Session.io.OutFullLn (Session.GetPrompt(322)); Session.io.OutFullLn (Session.GetPrompt(322));
Session.SystemLog ('ANSI login disabled'); Session.SystemLog ('ANSI login disabled');
Halt(0); Halt(0);
@ -1305,7 +1303,7 @@ Begin
8 : GetDateFormat(True); 8 : GetDateFormat(True);
9 : Repeat 9 : Repeat
GetGraphics; GetGraphics;
If ((Session.Lang.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or ((Session.Lang.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then If ((Session.Theme.Flags AND ThmAllowASCII = 0) and (Session.io.Graphics = 0)) or ((Session.Theme.Flags AND ThmAllowANSI = 0) and (Session.io.Graphics = 1)) Then
Session.io.OutFullLn (Session.GetPrompt(325)) Session.io.OutFullLn (Session.GetPrompt(325))
Else Else
Break; Break;

View File

@ -81,13 +81,13 @@ Var
InRemote := 1; InRemote := 1;
Session.io.AnsiColor (Session.Lang.LineChat1); Session.io.AnsiColor (Session.Theme.LineChat1);
End Else Begin End Else Begin
Ch := Session.io.InKey(200); Ch := Session.io.InKey(200);
If Ch = #255 Then Continue; If Ch = #255 Then Continue;
Session.io.AnsiColor (Session.Lang.LineChat2); Session.io.AnsiColor (Session.Theme.LineChat2);
BlockWrite (fOut, Ch, 1); BlockWrite (fOut, Ch, 1);
@ -154,4 +154,4 @@ Begin
Session.io.OutFullLn(Session.GetPrompt(484)); Session.io.OutFullLn(Session.GetPrompt(484));
End; End;
End. End.

View File

@ -1,13 +1,12 @@
{$I M_OPS.PAS}
Unit MIS_Client_HTTP; Unit MIS_Client_HTTP;
// placeholder for HTTP server if Mystic needs one? {$I M_OPS.PAS}
// based off off initial POP3 server footprint
Interface Interface
Uses Uses
MD5,
Classes,
SysUtils, SysUtils,
m_Strings, m_Strings,
m_FileIO, m_FileIO,
@ -15,112 +14,66 @@ Uses
m_DateTime, m_DateTime,
MIS_Server, MIS_Server,
MIS_NodeData, MIS_NodeData,
MIS_Common; MIS_Common,
BBS_MsgBase_ABS,
BBS_MsgBase_JAM,
BBS_MsgBase_Squish;
Function CreatePOP3 (Owner: TServerManager; ND: TNodeData; CliSock: TSocketClass) : TServerClient; Function CreateHTTP (Owner: TServerManager; Config: RecConfig; ND: TNodeData; CliSock: TSocketClass) : TServerClient;
Type Type
TPOP3Server = Class(TServerClient) THTTPServer = Class(TServerClient)
Server : TServerManager; Server : TServerManager;
UserName : String[40]; UserName : String[30];
Password : String[20]; LoggedIn : Boolean;
LoggedIn : Boolean; GotQuit : Boolean;
Cmd : String; Cmd : String;
Data : String; Data : String;
User : UserRec;
UserPos : LongInt;
Constructor Create (Owner: TServerManager; CliSock: TSocketClass); Constructor Create (Owner: TServerManager; CliSock: TSocketClass);
Procedure Execute; Override; Procedure Execute; Override;
Destructor Destroy; Override; Destructor Destroy; Override;
Procedure ResetSession; Procedure ResetSession;
Procedure cmdUSER;
Procedure cmdPASS;
End; End;
Implementation Implementation
Const Function CreateHTTP (Owner: TServerManager; Config: RecConfig; ND: TNodeData; CliSock: TSocketClass) : TServerClient;
POP3TimeOut = 120;
FileBufSize = 8 * 1024;
re_OK = '+OK ';
re_Error = '-ERR ';
re_UnknownCommand = re_Error + 'Unknown command';
re_UnknownUser = re_Error + 'Unknown user';
re_BadLogin = re_Error + 'Bad credentials';
re_Greeting = 'Mystic POP3 Server';
re_Goodbye = re_OK + 'Goodbye';
re_SendUserPass = re_OK + 'Send user password';
re_LoggedIn = re_OK + 'Welcome';
Function CreatePOP3 (Owner: TServerManager; ND: TNodeData; CliSock: TSocketClass) : TServerClient;
Begin Begin
Result := TPOP3Server.Create(Owner, CliSock); Result := THTTPServer.Create(Owner, CliSock);
End; End;
Constructor TPOP3Server.Create (Owner: TServerManager; CliSock: TSocketClass); Constructor THTTPServer.Create (Owner: TServerManager; CliSock: TSocketClass);
Begin Begin
Inherited Create(Owner, CliSock); Inherited Create(Owner, CliSock);
Server := Owner; Server := Owner;
End; End;
Procedure TPOP3Server.ResetSession; Procedure THTTPServer.ResetSession;
Var
Count : LongInt;
Begin Begin
LoggedIn := False; LoggedIn := False;
UserName := ''; GotQuit := False;
Password := '';
UserPos := -1;
End; End;
Procedure TPOP3Server.cmdUSER; Procedure THTTPServer.Execute;
Begin
ResetSession;
If SearchForUser(Data, User, UserPos) Then Begin
Client.WriteLine(re_SendUserPass);
UserName := Data;
End Else
Client.WriteLine(re_UnknownUser);
End;
Procedure TPOP3Server.cmdPASS;
Begin
If (UserName = '') or (UserPos = -1) Then Begin
Client.WriteLine(re_UnknownUser);
Exit;
End;
If strUpper(Data) = User.Password Then Begin
LoggedIn := True;
Client.WriteLine(re_LoggedIn);
End Else
Client.WriteLine(re_BadLogin);
End;
Procedure TPOP3Server.Execute;
Var Var
Str : String; Str : String;
Begin Begin
ResetSession; ResetSession;
Client.WriteLine(re_Greeting); // Client.WriteLine(re_Greeting);
Repeat Repeat
If Client.WaitForData(POP3TimeOut * 1000) = 0 Then Break; If Client.WaitForData(60 * 1000) = 0 Then Break;
If Terminated Then Exit; If Terminated Then Exit;
If Client.ReadLine(Str) = -1 Then Exit; If Client.ReadLine(Str) = -1 Then Exit;
server.server.status(str);
Cmd := strUpper(strWordGet(1, Str, ' ')); Cmd := strUpper(strWordGet(1, Str, ' '));
If Pos(' ', Str) > 0 Then If Pos(' ', Str) > 0 Then
@ -128,17 +81,24 @@ server.server.status(str);
Else Else
Data := ''; Data := '';
If Cmd = 'PASS' Then cmdPASS Else If Cmd = 'QUIT' Then Begin
If Cmd = 'QUIT' Then Break Else GotQuit := True;
If Cmd = 'USER' Then cmdUSER Else Break;
End Else
Client.WriteLine(re_UnknownCommand); Client.WriteLine(re_UnknownCommand);
Until Terminated; Until Terminated;
If Not Terminated Then Client.WriteLine(re_Goodbye); If GotQuit Then Begin
Client.WriteLine(re_Goodbye);
Server.Server.Status (User.Handle + ' logged out');
End;
End; End;
Destructor TPOP3Server.Destroy; Destructor THTTPServer.Destroy;
Begin Begin
ResetSession;
Inherited Destroy; Inherited Destroy;
End; End;

View File

@ -335,8 +335,8 @@ Begin
AddPointer ({$IFDEF MPLPARSER} 'cfgmsgspath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.MsgsPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgmsgspath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.MsgsPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgattpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.AttachPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgattpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.AttachPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgqwkpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.QwkPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgqwkpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.QwkPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgmenupath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.Lang.MenuPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgmenupath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.Theme.MenuPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgtextpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.Lang.TextPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgtextpath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.Theme.TextPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgmpepath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.ScriptPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgmpepath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Config.ScriptPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgtemppath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.TempPath {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgtemppath', {$ENDIF} iString, mysMaxPathSize, {$IFNDEF MPLPARSER} @Session.TempPath {$ELSE} NIL {$ENDIF});
AddPointer ({$IFDEF MPLPARSER} 'cfgtimeout', {$ENDIF} iWord, 4, {$IFNDEF MPLPARSER} @Config.Inactivity {$ELSE} NIL {$ENDIF}); AddPointer ({$IFDEF MPLPARSER} 'cfgtimeout', {$ENDIF} iWord, 4, {$IFNDEF MPLPARSER} @Config.Inactivity {$ELSE} NIL {$ENDIF});

View File

@ -223,3 +223,4 @@
top_pcr_desc = Posts Per Call top_pcr_desc = Posts Per Call
top_pcr_namelen = 30 top_pcr_namelen = 30
top_pcr_datalen = 10 top_pcr_datalen = 10

View File

@ -244,19 +244,19 @@ Begin
End; End;
Close (Session.User.UserFile); Close (Session.User.UserFile);
Assign (VoteFile, Config.DataPath + 'votes.dat'); Assign (Session.VoteFile, Config.DataPath + 'votes.dat');
{$I-} Reset (VoteFile); {$I+} {$I-} Reset (Session.VoteFile); {$I+}
If IoResult <> 0 Then ReWrite (VoteFile); If IoResult <> 0 Then ReWrite (Session.VoteFile);
Close (VoteFile); Close (Session.VoteFile);
Assign (Session.LangFile, Config.DataPath + 'theme.dat'); Assign (Session.ThemeFile, Config.DataPath + 'theme.dat');
{$I-} Reset (Session.LangFile); {$I+} {$I-} Reset (Session.ThemeFile); {$I+}
If IoResult <> 0 Then Begin If IoResult <> 0 Then Begin
Screen.WriteLine ('ERROR: No theme configuration.'); Screen.WriteLine ('ERROR: No theme configuration.');
DisposeClasses; DisposeClasses;
Halt(1); Halt(1);
End; End;
Close (Session.LangFile); Close (Session.ThemeFile);
If Not Session.LoadThemeData(Config.DefThemeFile) Then Begin If Not Session.LoadThemeData(Config.DefThemeFile) Then Begin
If Not Session.ConfigMode Then Begin If Not Session.ConfigMode Then Begin