Code cleanup
This commit is contained in:
parent
287f96b784
commit
c85aee2753
|
@ -4,10 +4,6 @@ Unit bbs_General;
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
|
|
||||||
// more ancient come from my teenage years lol this stuff needs to be
|
|
||||||
// sorted out / cleaned up and passed a session pointer or relocate to
|
|
||||||
// one of the classes
|
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
m_Strings,
|
m_Strings,
|
||||||
m_DateTime,
|
m_DateTime,
|
||||||
|
@ -27,17 +23,18 @@ Procedure Add_BBS_List (Name : String);
|
||||||
Procedure AutoSig_Edit;
|
Procedure AutoSig_Edit;
|
||||||
Procedure AutoSig_View;
|
Procedure AutoSig_View;
|
||||||
|
|
||||||
Procedure List_Users (Data: String);
|
Procedure ShowUserList (Data: String);
|
||||||
Procedure Last_Callers;
|
Procedure ShowLastCallers;
|
||||||
|
Procedure ShowBBSHistory (LastDays: Word);
|
||||||
|
Procedure ShowOneLiners (Data: String);
|
||||||
|
Procedure ShowRandomQuote;
|
||||||
|
|
||||||
Procedure Add_TimeBank;
|
Procedure Add_TimeBank;
|
||||||
Procedure Get_TimeBank;
|
Procedure Get_TimeBank;
|
||||||
Procedure One_Liners (Data : String);
|
|
||||||
Procedure Display_Quote;
|
|
||||||
Procedure Add_Booth;
|
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 View_History (LastDays: Word);
|
|
||||||
Procedure View_Directory (Data: String; ViewType: Byte);
|
Procedure View_Directory (Data: String; ViewType: Byte);
|
||||||
|
|
||||||
{$IFNDEF UNIX}
|
{$IFNDEF UNIX}
|
||||||
|
@ -110,10 +107,12 @@ Begin
|
||||||
If Session.User.ThisUser.SigLength > 0 Then Begin
|
If Session.User.ThisUser.SigLength > 0 Then Begin
|
||||||
Reset (DF, 1);
|
Reset (DF, 1);
|
||||||
Seek (DF, Session.User.ThisUser.SigOffset);
|
Seek (DF, Session.User.ThisUser.SigOffset);
|
||||||
|
|
||||||
For Lines := 1 to Session.User.ThisUser.SigLength Do Begin
|
For Lines := 1 to Session.User.ThisUser.SigLength Do Begin
|
||||||
BlockRead (DF, Session.Msgs.MsgText[Lines][0], 1);
|
BlockRead (DF, Session.Msgs.MsgText[Lines][0], 1);
|
||||||
BlockRead (DF, Session.Msgs.MsgText[Lines][1], Ord(Session.Msgs.MsgText[Lines][0]));
|
BlockRead (DF, Session.Msgs.MsgText[Lines][1], Ord(Session.Msgs.MsgText[Lines][0]));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Close (DF);
|
Close (DF);
|
||||||
End Else
|
End Else
|
||||||
Lines := 0;
|
Lines := 0;
|
||||||
|
@ -122,12 +121,17 @@ Begin
|
||||||
|
|
||||||
If Editor (Lines, 78, Config.MaxAutoSig, True, False, Str) Then Begin
|
If Editor (Lines, 78, Config.MaxAutoSig, True, False, Str) Then Begin
|
||||||
{$I-} Reset (DF, 1); {$I+}
|
{$I-} Reset (DF, 1); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then ReWrite (DF, 1);
|
If IoResult <> 0 Then ReWrite (DF, 1);
|
||||||
|
|
||||||
Session.User.ThisUser.SigLength := Lines;
|
Session.User.ThisUser.SigLength := Lines;
|
||||||
Session.User.ThisUser.SigOffset := FileSize(DF);
|
Session.User.ThisUser.SigOffset := FileSize(DF);
|
||||||
|
|
||||||
Seek (DF, Session.User.ThisUser.SigOffset);
|
Seek (DF, Session.User.ThisUser.SigOffset);
|
||||||
|
|
||||||
For Lines := 1 to Lines Do
|
For Lines := 1 to Lines Do
|
||||||
BlockWrite (DF, Session.Msgs.MsgText[Lines][0], Length(Session.Msgs.MsgText[Lines]) + 1);
|
BlockWrite (DF, Session.Msgs.MsgText[Lines][0], Length(Session.Msgs.MsgText[Lines]) + 1);
|
||||||
|
|
||||||
Close (DF);
|
Close (DF);
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -146,6 +150,7 @@ Begin
|
||||||
For A := 1 to Session.User.ThisUser.SigLength Do Begin
|
For A := 1 to Session.User.ThisUser.SigLength Do Begin
|
||||||
BlockRead (DF, S[0], 1);
|
BlockRead (DF, S[0], 1);
|
||||||
BlockRead (DF, S[1], Ord(S[0]));
|
BlockRead (DF, S[1], Ord(S[0]));
|
||||||
|
|
||||||
Session.io.OutFullLn (S);
|
Session.io.OutFullLn (S);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -154,22 +159,26 @@ Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(336));
|
Session.io.OutFull (Session.GetPrompt(336));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure Display_Quote;
|
Procedure ShowRandomQuote;
|
||||||
Var
|
Var
|
||||||
TF : Text;
|
TF : Text;
|
||||||
TxtBuf : Array[1..1024] of Char;
|
TxtBuf : Array[1..2048] of Char;
|
||||||
Total,
|
Total : Integer;
|
||||||
Count : Integer;
|
Count : Integer;
|
||||||
Str : String;
|
Str : String;
|
||||||
Begin
|
Begin
|
||||||
Assign (TF, Config.DataPath + 'quotes.dat');
|
Assign (TF, Config.DataPath + 'quotes.dat');
|
||||||
{$I-} Reset (TF); {$I+}
|
|
||||||
If IoResult <> 0 Then Exit;
|
|
||||||
SetTextBuf (TF, TxtBuf);
|
SetTextBuf (TF, TxtBuf);
|
||||||
|
|
||||||
|
{$I-} Reset (TF); {$I+}
|
||||||
|
|
||||||
|
If IoResult <> 0 Then Exit;
|
||||||
|
|
||||||
Total := 0;
|
Total := 0;
|
||||||
|
|
||||||
While Not Eof(TF) Do Begin
|
While Not Eof(TF) Do Begin
|
||||||
ReadLn (TF, Str);
|
ReadLn (TF, Str);
|
||||||
|
|
||||||
If Str[1] = '*' Then Inc(Total);
|
If Str[1] = '*' Then Inc(Total);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -182,6 +191,7 @@ Begin
|
||||||
Total := 0;
|
Total := 0;
|
||||||
|
|
||||||
Reset (TF);
|
Reset (TF);
|
||||||
|
|
||||||
While Total <> Count Do Begin
|
While Total <> Count Do Begin
|
||||||
ReadLn (TF, Str);
|
ReadLn (TF, Str);
|
||||||
If Str[1] = '*' Then Inc(Total);
|
If Str[1] = '*' Then Inc(Total);
|
||||||
|
@ -191,6 +201,7 @@ Begin
|
||||||
ReadLn (TF, Str);
|
ReadLn (TF, Str);
|
||||||
If Str[1] = '*' Then Break Else Session.io.OutFullLn (Str);
|
If Str[1] = '*' Then Break Else Session.io.OutFullLn (Str);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Close (TF);
|
Close (TF);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -367,6 +378,7 @@ Begin
|
||||||
'Q' : Break;
|
'Q' : Break;
|
||||||
'V' : If Session.io.GetYN(Session.GetPrompt(266), False) Then Begin
|
'V' : If Session.io.GetYN(Session.GetPrompt(266), False) Then Begin
|
||||||
BBSList.Verified := CurDateDos;
|
BBSList.Verified := CurDateDos;
|
||||||
|
|
||||||
Seek (BBSFile, FilePos(BBSFile) - 1);
|
Seek (BBSFile, FilePos(BBSFile) - 1);
|
||||||
Write (BBSFile, BBSList);
|
Write (BBSFile, BBSList);
|
||||||
End;
|
End;
|
||||||
|
@ -382,16 +394,17 @@ Begin
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Close (BBSFile);
|
Close (BBSFile);
|
||||||
|
|
||||||
If Not Long Then
|
If Not Long Then
|
||||||
Session.io.OutFullLn (Session.GetPrompt(262));
|
Session.io.OutFullLn (Session.GetPrompt(262));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure List_Users (Data : String);
|
Procedure ShowUserList (Data: String);
|
||||||
Var
|
Var
|
||||||
Total : Integer;
|
Total : Integer;
|
||||||
tUser : RecUser;
|
TempUser : RecUser;
|
||||||
Begin
|
Begin
|
||||||
If Data = 'SEARCH' Then Begin
|
If Data = 'SEARCH' Then Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(32));
|
Session.io.OutFull (Session.GetPrompt(32));
|
||||||
|
@ -408,24 +421,24 @@ Begin
|
||||||
Total := 0;
|
Total := 0;
|
||||||
|
|
||||||
While Not Eof(Session.User.UserFile) Do Begin
|
While Not Eof(Session.User.UserFile) Do Begin
|
||||||
Read (Session.User.UserFile, tUser);
|
Read (Session.User.UserFile, TempUser);
|
||||||
|
|
||||||
If tUser.Flags AND UserDeleted <> 0 Then Continue;
|
If TempUser.Flags AND UserDeleted <> 0 Then Continue;
|
||||||
|
|
||||||
Session.io.PromptInfo[1] := tUser.Handle;
|
Session.io.PromptInfo[1] := TempUser.Handle;
|
||||||
Session.io.PromptInfo[2] := tUser.City;
|
Session.io.PromptInfo[2] := TempUser.City;
|
||||||
Session.io.PromptInfo[3] := DateDos2Str(tUser.LastOn, Session.User.ThisUser.DateType);
|
Session.io.PromptInfo[3] := DateDos2Str(TempUser.LastOn, Session.User.ThisUser.DateType);
|
||||||
Session.io.PromptInfo[4] := tUser.Gender;
|
Session.io.PromptInfo[4] := TempUser.Gender;
|
||||||
Session.io.PromptInfo[5] := strI2S(tUser.Security);
|
Session.io.PromptInfo[5] := strI2S(TempUser.Security);
|
||||||
Session.io.PromptInfo[6] := tUser.Address;
|
Session.io.PromptInfo[6] := TempUser.Address;
|
||||||
Session.io.PromptInfo[7] := strI2S(DaysAgo(tUser.Birthday) DIV 365);
|
Session.io.PromptInfo[7] := strI2S(DaysAgo(TempUser.Birthday) DIV 365);
|
||||||
Session.io.PromptInfo[8] := tUser.Email;
|
Session.io.PromptInfo[8] := TempUser.Email;
|
||||||
Session.io.PromptInfo[9] := tUser.UserInfo;
|
Session.io.PromptInfo[9] := TempUser.UserInfo;
|
||||||
Session.io.PromptInfo[10] := tUser.Optional[1];
|
Session.io.PromptInfo[10] := TempUser.Optional[1];
|
||||||
Session.io.PromptInfo[11] := tUser.Optional[2];
|
Session.io.PromptInfo[11] := TempUser.Optional[2];
|
||||||
Session.io.PromptInfo[12] := tUser.Optional[3];
|
Session.io.PromptInfo[12] := TempUser.Optional[3];
|
||||||
|
|
||||||
If (Data = '') or (Pos(Data, strUpper(tUser.Handle)) > 0) Then Begin
|
If (Data = '') or (Pos(Data, strUpper(TempUser.Handle)) > 0) Then Begin
|
||||||
Session.io.OutFullLn (Session.GetPrompt(30));
|
Session.io.OutFullLn (Session.GetPrompt(30));
|
||||||
Inc (Total);
|
Inc (Total);
|
||||||
|
|
||||||
|
@ -444,12 +457,15 @@ Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(31));
|
Session.io.OutFull (Session.GetPrompt(31));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure Last_Callers;
|
Procedure ShowLastCallers;
|
||||||
Begin
|
Begin
|
||||||
Session.io.OutFullLn (Session.GetPrompt(141));
|
Session.io.OutFullLn (Session.GetPrompt(141));
|
||||||
|
|
||||||
Reset (LastOnFile);
|
Reset (LastOnFile);
|
||||||
|
|
||||||
While Not Eof(LastOnFile) Do Begin
|
While Not Eof(LastOnFile) Do Begin
|
||||||
Read (LastOnFile, LastOn);
|
Read (LastOnFile, LastOn);
|
||||||
|
|
||||||
Session.io.PromptInfo[1] := LastOn.Handle;
|
Session.io.PromptInfo[1] := LastOn.Handle;
|
||||||
Session.io.PromptInfo[2] := strI2S(LastOn.Node);
|
Session.io.PromptInfo[2] := strI2S(LastOn.Node);
|
||||||
Session.io.PromptInfo[3] := LastOn.City;
|
Session.io.PromptInfo[3] := LastOn.City;
|
||||||
|
@ -463,9 +479,12 @@ Begin
|
||||||
Session.io.PromptInfo[11] := LastOn.Option1;
|
Session.io.PromptInfo[11] := LastOn.Option1;
|
||||||
Session.io.PromptInfo[12] := LastOn.Option2;
|
Session.io.PromptInfo[12] := LastOn.Option2;
|
||||||
Session.io.PromptInfo[13] := LastOn.Option3;
|
Session.io.PromptInfo[13] := LastOn.Option3;
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(142));
|
Session.io.OutFullLn (Session.GetPrompt(142));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Close (LastOnFile);
|
Close (LastOnFile);
|
||||||
|
|
||||||
Session.io.OutFull (Session.GetPrompt(143));
|
Session.io.OutFull (Session.GetPrompt(143));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -474,14 +493,18 @@ Var
|
||||||
A : Integer;
|
A : Integer;
|
||||||
Begin
|
Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(172));
|
Session.io.OutFull (Session.GetPrompt(172));
|
||||||
|
|
||||||
A := strS2I(Session.io.GetInput(4, 4, 11, ''));
|
A := strS2I(Session.io.GetInput(4, 4, 11, ''));
|
||||||
|
|
||||||
If A > 0 Then
|
If A > 0 Then
|
||||||
If (A < Session.TimeLeft - 4) Then Begin
|
If (A < Session.TimeLeft - 4) Then Begin
|
||||||
If (Session.User.Security.MaxTB > 0) and (Session.User.ThisUser.TimeBank + A > Session.User.Security.MaxTB) Then Begin
|
If (Session.User.Security.MaxTB > 0) and (Session.User.ThisUser.TimeBank + A > Session.User.Security.MaxTB) Then Begin
|
||||||
Session.io.OutFullLn (Session.GetPrompt(209));
|
Session.io.OutFullLn (Session.GetPrompt(209));
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Inc (Session.User.ThisUser.TimeBank, A);
|
Inc (Session.User.ThisUser.TimeBank, A);
|
||||||
|
|
||||||
Session.SetTimeLeft (Session.TimeLeft - A);
|
Session.SetTimeLeft (Session.TimeLeft - A);
|
||||||
End Else
|
End Else
|
||||||
Session.io.OutFullLn (Session.GetPrompt(210));
|
Session.io.OutFullLn (Session.GetPrompt(210));
|
||||||
|
@ -492,14 +515,17 @@ Var
|
||||||
A : Integer;
|
A : Integer;
|
||||||
Begin
|
Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(173));
|
Session.io.OutFull (Session.GetPrompt(173));
|
||||||
|
|
||||||
A := strS2I(Session.io.GetInput(4, 4, 11, ''));
|
A := strS2I(Session.io.GetInput(4, 4, 11, ''));
|
||||||
|
|
||||||
If (A > 0) and (A <= Session.User.ThisUser.TimeBank) Then Begin
|
If (A > 0) and (A <= Session.User.ThisUser.TimeBank) Then Begin
|
||||||
Dec (Session.User.ThisUser.TimeBank, A);
|
Dec (Session.User.ThisUser.TimeBank, A);
|
||||||
|
|
||||||
Session.SetTimeLeft (Session.TimeLeft + A);
|
Session.SetTimeLeft (Session.TimeLeft + A);
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure One_Liners (Data : String);
|
Procedure ShowOneLiners (Data : String);
|
||||||
Const
|
Const
|
||||||
MaxLines : Byte = 9;
|
MaxLines : Byte = 9;
|
||||||
MaxLen : Byte = 75;
|
MaxLen : Byte = 75;
|
||||||
|
@ -511,16 +537,20 @@ Var
|
||||||
A : Byte;
|
A : Byte;
|
||||||
Begin
|
Begin
|
||||||
A := Pos(';', Data);
|
A := Pos(';', Data);
|
||||||
|
|
||||||
If A > 0 Then Begin
|
If A > 0 Then Begin
|
||||||
MaxLines := strS2I(Copy(Data, 1, A - 1)) - 1;
|
MaxLines := strS2I(Copy(Data, 1, A - 1)) - 1;
|
||||||
|
|
||||||
Delete (Data, 1, A);
|
Delete (Data, 1, A);
|
||||||
A := Pos(';', Data);
|
A := Pos(';', Data);
|
||||||
|
|
||||||
MaxLen := strS2I(Copy(Data, 1, A - 1));
|
MaxLen := strS2I(Copy(Data, 1, A - 1));
|
||||||
MaxField := strS2I(Copy(Data, A + 1, Length(Data)));
|
MaxField := strS2I(Copy(Data, A + 1, Length(Data)));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Assign (OneLineFile, Config.DataPath + 'oneliner.dat');
|
Assign (OneLineFile, Config.DataPath + 'oneliner.dat');
|
||||||
{$I-} Reset (OneLineFile); {$I+}
|
{$I-} Reset (OneLineFile); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then ReWrite (OneLineFile);
|
If IoResult <> 0 Then ReWrite (OneLineFile);
|
||||||
|
|
||||||
Repeat
|
Repeat
|
||||||
|
@ -529,17 +559,22 @@ Begin
|
||||||
|
|
||||||
While Not Eof(OneLineFile) Do Begin
|
While Not Eof(OneLineFile) Do Begin
|
||||||
Read (OneLineFile, OneLine);
|
Read (OneLineFile, OneLine);
|
||||||
|
|
||||||
Session.io.PromptInfo[1] := OneLine.Text;
|
Session.io.PromptInfo[1] := OneLine.Text;
|
||||||
Session.io.PromptInfo[2] := OneLine.From;
|
Session.io.PromptInfo[2] := OneLine.From;
|
||||||
Session.io.PromptInfo[3] := OneLine.From[1];
|
Session.io.PromptInfo[3] := OneLine.From[1];
|
||||||
|
|
||||||
If Pos(' ', OneLine.From) > 0 Then
|
If Pos(' ', OneLine.From) > 0 Then
|
||||||
Session.io.PromptInfo[3] := Session.io.PromptInfo[3] + OneLine.From[Pos(' ', OneLine.From) + 1];
|
Session.io.PromptInfo[3] := Session.io.PromptInfo[3] + OneLine.From[Pos(' ', OneLine.From) + 1];
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(337));
|
Session.io.OutFullLn (Session.GetPrompt(337));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If Session.io.GetYN(Session.GetPrompt(189), False) Then Begin
|
If Session.io.GetYN(Session.GetPrompt(189), False) Then Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(190));
|
Session.io.OutFull (Session.GetPrompt(190));
|
||||||
|
|
||||||
Str := Session.io.GetInput (MaxField, MaxLen, 11, '');
|
Str := Session.io.GetInput (MaxField, MaxLen, 11, '');
|
||||||
|
|
||||||
If Str <> '' Then Begin
|
If Str <> '' Then Begin
|
||||||
If FileSize(OneLineFile) > MaxLines Then
|
If FileSize(OneLineFile) > MaxLines Then
|
||||||
KillRecord (OneLineFile, 1, SizeOf(OneLineRec));
|
KillRecord (OneLineFile, 1, SizeOf(OneLineRec));
|
||||||
|
@ -800,13 +835,14 @@ 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 View_History (LastDays: Word);
|
Procedure ShowBBSHistory (LastDays: Word);
|
||||||
Var
|
Var
|
||||||
Temp : HistoryRec;
|
Temp : HistoryRec;
|
||||||
Days : Word;
|
Days : Word;
|
||||||
Begin
|
Begin
|
||||||
Assign (Session.HistoryFile, Config.DataPath + 'history.dat');
|
Assign (Session.HistoryFile, Config.DataPath + 'history.dat');
|
||||||
{$I-} Reset(Session.HistoryFile); {$I+}
|
{$I-} Reset(Session.HistoryFile); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then
|
If IoResult <> 0 Then
|
||||||
Session.io.OutFullLn (Session.GetPrompt(454))
|
Session.io.OutFullLn (Session.GetPrompt(454))
|
||||||
Else Begin
|
Else Begin
|
||||||
|
@ -1371,14 +1407,15 @@ Begin
|
||||||
|
|
||||||
MessageBeep(0);
|
MessageBeep(0);
|
||||||
|
|
||||||
If Input.KeyPressed Then If Input.ReadKey = #0 Then Begin
|
If Input.KeyPressed Then
|
||||||
Case Input.ReadKey of
|
If Input.ReadKey = #0 Then Begin
|
||||||
#31 : OpenChat(True);
|
Case Input.ReadKey of
|
||||||
#46 : OpenChat(False);
|
#31 : OpenChat(True);
|
||||||
End;
|
#46 : OpenChat(False);
|
||||||
|
End;
|
||||||
|
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
WaitMS(1000);
|
WaitMS(1000);
|
||||||
End;
|
End;
|
||||||
|
|
|
@ -547,7 +547,7 @@ Begin
|
||||||
'Q' : Case Code[2] of
|
'Q' : Case Code[2] of
|
||||||
'A' : LastMCIValue := TBBSCore(Core).User.ThisUser.Archive;
|
'A' : LastMCIValue := TBBSCore(Core).User.ThisUser.Archive;
|
||||||
'L' : LastMCIValue := OutYN (TBBSCore(Core).User.ThisUser.QwkFiles);
|
'L' : LastMCIValue := OutYN (TBBSCore(Core).User.ThisUser.QwkFiles);
|
||||||
'O' : Display_Quote;
|
'O' : ShowRandomQuote;
|
||||||
End;
|
End;
|
||||||
'R' : Case Code[2] of
|
'R' : Case Code[2] of
|
||||||
'D' : LastMCIValue := strI2S(TBBSCore(Core).User.Security.DLRatio);
|
'D' : LastMCIValue := strI2S(TBBSCore(Core).User.Security.DLRatio);
|
||||||
|
|
|
@ -175,7 +175,7 @@ Begin
|
||||||
'S' : View_BBS_List (False, Data);
|
'S' : View_BBS_List (False, Data);
|
||||||
End;
|
End;
|
||||||
'G' : Case Cmd[2] of
|
'G' : Case Cmd[2] of
|
||||||
'1' : View_History(strS2I(Data));
|
'1' : ShowBBSHistory(strS2I(Data));
|
||||||
'A' : View_Directory(Data, 0);
|
'A' : View_Directory(Data, 0);
|
||||||
'D' : Session.io.OutFile (Data, True, 0);
|
'D' : Session.io.OutFile (Data, True, 0);
|
||||||
'E' : Session.User.Edit_User_Settings(strS2I(Data));
|
'E' : Session.User.Edit_User_Settings(strS2I(Data));
|
||||||
|
@ -192,13 +192,13 @@ Begin
|
||||||
Session.SystemLog ('User logged off');
|
Session.SystemLog ('User logged off');
|
||||||
Halt(0);
|
Halt(0);
|
||||||
End;
|
End;
|
||||||
'L' : Last_Callers;
|
'L' : ShowLastCallers;
|
||||||
'O' : Begin
|
'O' : Begin
|
||||||
MenuOld := MenuName;
|
MenuOld := MenuName;
|
||||||
MenuName := Data;
|
MenuName := Data;
|
||||||
Result := True;
|
Result := True;
|
||||||
End;
|
End;
|
||||||
'N' : One_Liners (Data);
|
'N' : ShowOneLiners (Data);
|
||||||
'P' : {$IFNDEF UNIX} PageForSysopChat (Pos('/F', strUpper(Data)) > 0) {$ENDIF};
|
'P' : {$IFNDEF UNIX} PageForSysopChat (Pos('/F', strUpper(Data)) > 0) {$ENDIF};
|
||||||
'R' : Begin
|
'R' : Begin
|
||||||
If StackNum > 0 Then Begin
|
If StackNum > 0 Then Begin
|
||||||
|
@ -226,7 +226,7 @@ Begin
|
||||||
Result := True;
|
Result := True;
|
||||||
End;
|
End;
|
||||||
'T' : Session.io.OutFull (Data);
|
'T' : Session.io.OutFull (Data);
|
||||||
'U' : List_Users (strUpper(Data));
|
'U' : ShowUserList (strUpper(Data));
|
||||||
'X' : Result := ExecuteMPL(NIL, Data) = 2;
|
'X' : Result := ExecuteMPL(NIL, Data) = 2;
|
||||||
'?' : Begin
|
'?' : Begin
|
||||||
// online ANSI help system (BBSHTML) prototype
|
// online ANSI help system (BBSHTML) prototype
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
Unit bbs_NodeInfo; { Multinode functions }
|
Unit bbs_NodeInfo;
|
||||||
|
|
||||||
{$I M_OPS.PAS}
|
{$I M_OPS.PAS}
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
|
|
||||||
Function Is_User_Online (Name : String) : Word;
|
Function Is_User_Online (Name : String) : Word;
|
||||||
Procedure Set_Node_Action (Action: String);
|
|
||||||
Procedure Show_Whos_Online;
|
Procedure Show_Whos_Online;
|
||||||
Procedure Send_Node_Message (MsgType: Byte; Data: String; Room: Byte);
|
Procedure Send_Node_Message (MsgType: Byte; Data: String; Room: Byte);
|
||||||
Function CheckNodeMessages : Boolean;
|
Function CheckNodeMessages : Boolean;
|
||||||
|
Procedure Set_Node_Action (Action: String);
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
|
@ -19,22 +19,25 @@ Uses
|
||||||
bbs_Core,
|
bbs_Core,
|
||||||
bbs_User;
|
bbs_User;
|
||||||
|
|
||||||
Function Is_User_Online (Name : String) : Word;
|
Function Is_User_Online (Name: String) : Word;
|
||||||
Var
|
Var
|
||||||
TempChat : ChatRec;
|
TempChat : ChatRec;
|
||||||
Count : Word;
|
Count : Word;
|
||||||
Begin
|
Begin
|
||||||
Is_User_Online := 0;
|
Result := 0;
|
||||||
|
|
||||||
For Count := 1 to Config.INetTNNodes Do Begin
|
For Count := 1 to Config.INetTNNodes Do Begin
|
||||||
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(Count) + '.dat');
|
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(Count) + '.dat');
|
||||||
|
|
||||||
{$I-} Reset(ChatFile); {$I+}
|
{$I-} Reset(ChatFile); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then Continue;
|
If IoResult <> 0 Then Continue;
|
||||||
|
|
||||||
Read (ChatFile, TempChat);
|
Read (ChatFile, TempChat);
|
||||||
Close (ChatFile);
|
Close (ChatFile);
|
||||||
|
|
||||||
If (Count <> Session.NodeNum) and (TempChat.Active) and (TempChat.Name = Name) Then Begin
|
If (Count <> Session.NodeNum) and (TempChat.Active) and (TempChat.Name = Name) Then Begin
|
||||||
Is_User_Online := Count;
|
Result := Count;
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -75,19 +78,22 @@ End;
|
||||||
Procedure Show_Whos_Online;
|
Procedure Show_Whos_Online;
|
||||||
Var
|
Var
|
||||||
TChat : ChatRec;
|
TChat : ChatRec;
|
||||||
A : Word;
|
Count : Word;
|
||||||
Begin
|
Begin
|
||||||
Session.io.OutFullLn (Session.GetPrompt(138));
|
Session.io.OutFullLn (Session.GetPrompt(138));
|
||||||
|
|
||||||
For A := 1 to Config.INetTNNodes Do Begin
|
For Count := 1 to Config.INetTNNodes Do Begin
|
||||||
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(A) + '.dat');
|
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(Count) + '.dat');
|
||||||
|
|
||||||
{$I-} Reset(ChatFile); {$I+}
|
{$I-} Reset(ChatFile); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then Continue;
|
If IoResult <> 0 Then Continue;
|
||||||
|
|
||||||
Read (ChatFile, TChat);
|
Read (ChatFile, TChat);
|
||||||
Close (ChatFile);
|
Close (ChatFile);
|
||||||
|
|
||||||
If TChat.Active and ((Not TChat.Invisible) or (TChat.Invisible and Session.User.Access(Config.AcsSeeInvis))) Then Begin
|
If TChat.Active and ((Not TChat.Invisible) or (TChat.Invisible and Session.User.Access(Config.AcsSeeInvis))) Then Begin
|
||||||
Session.io.PromptInfo[1] := strI2S(A);
|
Session.io.PromptInfo[1] := strI2S(Count);
|
||||||
Session.io.PromptInfo[2] := TChat.Name;
|
Session.io.PromptInfo[2] := TChat.Name;
|
||||||
Session.io.PromptInfo[3] := TChat.Action;
|
Session.io.PromptInfo[3] := TChat.Action;
|
||||||
Session.io.PromptInfo[4] := TChat.Location;
|
Session.io.PromptInfo[4] := TChat.Location;
|
||||||
|
@ -95,9 +101,11 @@ Begin
|
||||||
Session.io.PromptInfo[6] := TChat.Gender;
|
Session.io.PromptInfo[6] := TChat.Gender;
|
||||||
Session.io.PromptInfo[7] := strI2S(TChat.Age);
|
Session.io.PromptInfo[7] := strI2S(TChat.Age);
|
||||||
Session.io.PromptInfo[8] := Session.io.OutYN(TChat.Available);
|
Session.io.PromptInfo[8] := Session.io.OutYN(TChat.Available);
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(139));
|
Session.io.OutFullLn (Session.GetPrompt(139));
|
||||||
End Else Begin
|
End Else Begin
|
||||||
Session.io.PromptInfo[1] := strI2S(A);
|
Session.io.PromptInfo[1] := strI2S(Count);
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(268));
|
Session.io.OutFullLn (Session.GetPrompt(268));
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -130,15 +138,15 @@ Begin
|
||||||
C := ToNode;
|
C := ToNode;
|
||||||
End Else Begin
|
End Else Begin
|
||||||
If Pos(';', Data) = 0 Then Exit;
|
If Pos(';', Data) = 0 Then Exit;
|
||||||
|
|
||||||
ToNode := strS2I(Copy(Data, 1, Pos(';', Data)-1));
|
ToNode := strS2I(Copy(Data, 1, Pos(';', Data)-1));
|
||||||
|
|
||||||
Delete (Data, 1, Pos(';', Data));
|
Delete (Data, 1, Pos(';', Data));
|
||||||
|
|
||||||
If ToNode = 0 Then Begin
|
If ToNode = 0 Then Begin
|
||||||
B := 1;
|
B := 1;
|
||||||
C := Config.INetTNNodes;
|
C := Config.INetTNNodes;
|
||||||
If MsgType = 3 Then MsgType := 2;
|
If MsgType = 3 Then MsgType := 2;
|
||||||
{ If Not (MsgType in [1, 4..7]) Then MsgType := 2;}
|
|
||||||
{ used line above comment now... see if that does anything }
|
|
||||||
|
|
||||||
End Else Begin
|
End Else Begin
|
||||||
B := ToNode;
|
B := ToNode;
|
||||||
C := ToNode;
|
C := ToNode;
|
||||||
|
@ -146,12 +154,14 @@ Begin
|
||||||
End;
|
End;
|
||||||
|
|
||||||
For A := B to C Do Begin
|
For A := B to C Do Begin
|
||||||
|
FileMode := 66;
|
||||||
|
|
||||||
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(A) + '.dat');
|
Assign (ChatFile, Config.DataPath + 'chat' + strI2S(A) + '.dat');
|
||||||
FileMode := 66;
|
|
||||||
{$I-} Reset (ChatFile); {$I+}
|
{$I-} Reset (ChatFile); {$I+}
|
||||||
|
|
||||||
If IoResult = 0 Then Begin
|
If IoResult = 0 Then Begin
|
||||||
Read (ChatFile, Temp);
|
Read (ChatFile, Temp);
|
||||||
Close (ChatFile);
|
Close (ChatFile);
|
||||||
|
|
||||||
If (Not Temp.Active) and (ToNode > 0) Then Begin
|
If (Not Temp.Active) and (ToNode > 0) Then Begin
|
||||||
|
@ -166,9 +176,11 @@ Begin
|
||||||
|
|
||||||
If Temp.Active and (Temp.Available or Temp.InChat) Then Begin
|
If Temp.Active and (Temp.Available or Temp.InChat) Then Begin
|
||||||
If Data = '' Then Begin
|
If Data = '' Then Begin
|
||||||
Session.io.PromptInfo[1] := Temp.Name; { TEMP NODE NAME }
|
Session.io.PromptInfo[1] := Temp.Name;
|
||||||
Session.io.PromptInfo[2] := strI2S(A);
|
Session.io.PromptInfo[2] := strI2S(A);
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(148));
|
Session.io.OutFullLn (Session.GetPrompt(148));
|
||||||
|
|
||||||
NodeMsg.Message := Session.io.GetInput(79, 79, 11, '');
|
NodeMsg.Message := Session.io.GetInput(79, 79, 11, '');
|
||||||
End Else
|
End Else
|
||||||
NodeMsg.Message := Data;
|
NodeMsg.Message := Data;
|
||||||
|
@ -181,9 +193,12 @@ Begin
|
||||||
NodeMsg.Room := Room;
|
NodeMsg.Room := Room;
|
||||||
NodeMsg.FromWho := Session.User.ThisUser.Handle;
|
NodeMsg.FromWho := Session.User.ThisUser.Handle;
|
||||||
|
|
||||||
Assign (NodeMsgFile, Config.SystemPath + 'temp' + strI2S(A) + PathChar + 'chat.tmp');
|
|
||||||
FileMode := 66;
|
FileMode := 66;
|
||||||
|
|
||||||
|
Assign (NodeMsgFile, Config.SystemPath + 'temp' + strI2S(A) + PathChar + 'chat.tmp');
|
||||||
|
|
||||||
{$I-} Reset (NodeMsgFile); {$I+}
|
{$I-} Reset (NodeMsgFile); {$I+}
|
||||||
|
|
||||||
If IoResult <> 0 Then ReWrite(NodeMsgFile);
|
If IoResult <> 0 Then ReWrite(NodeMsgFile);
|
||||||
|
|
||||||
Seek (NodeMsgFile, FileSize(NodeMsgFile));
|
Seek (NodeMsgFile, FileSize(NodeMsgFile));
|
||||||
|
|
|
@ -1,18 +1,5 @@
|
||||||
Unit bbs_SysOpChat;
|
Unit bbs_SysOpChat;
|
||||||
|
|
||||||
(* some ideas for chat:
|
|
||||||
|
|
||||||
split chat additions:
|
|
||||||
|
|
||||||
- scroll half window instead of just the last line
|
|
||||||
- allow full arrow key movement in chat windows...
|
|
||||||
kinda like a full screen editor...
|
|
||||||
- ctrl-k brings up a command menu, which has:
|
|
||||||
OutFull file
|
|
||||||
display file
|
|
||||||
dos drop? add mini-dos internal to mystic?
|
|
||||||
|
|
||||||
*)
|
|
||||||
{$I M_OPS.PAS}
|
{$I M_OPS.PAS}
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
|
@ -215,16 +202,18 @@ End;
|
||||||
|
|
||||||
Procedure Line_Chat;
|
Procedure Line_Chat;
|
||||||
Var
|
Var
|
||||||
Ch : Char;
|
Ch : Char;
|
||||||
Str1,
|
Str1 : String[160];
|
||||||
Str2 : String;
|
Str2 : String[160];
|
||||||
Begin
|
Begin
|
||||||
Str1 := '';
|
Str1 := '';
|
||||||
Str2 := '';
|
Str2 := '';
|
||||||
|
|
||||||
Session.io.OutFullLn (Session.GetPrompt(26));
|
Session.io.OutFullLn (Session.GetPrompt(26));
|
||||||
|
|
||||||
Repeat
|
Repeat
|
||||||
Ch := Session.io.GetKey;
|
Ch := Session.io.GetKey;
|
||||||
|
|
||||||
Case Ch of
|
Case Ch of
|
||||||
#27 : If Session.io.LocalInput Then Break;
|
#27 : If Session.io.LocalInput Then Break;
|
||||||
#13 : Begin
|
#13 : Begin
|
||||||
|
@ -238,13 +227,17 @@ Begin
|
||||||
End;
|
End;
|
||||||
Else
|
Else
|
||||||
Str1 := Str1 + Ch;
|
Str1 := Str1 + Ch;
|
||||||
|
|
||||||
Session.io.BufAddChar(Ch);
|
Session.io.BufAddChar(Ch);
|
||||||
|
|
||||||
If Length(Str1) > 78 Then Begin
|
If Length(Str1) > 78 Then Begin
|
||||||
strWrap (Str1, Str2, 78);
|
strWrap (Str1, Str2, 78);
|
||||||
Session.io.OutBS(Length(Str2), True);
|
Session.io.OutBS(Length(Str2), True);
|
||||||
Session.io.OutRawLn ('');
|
Session.io.OutRawLn ('');
|
||||||
Session.io.OutRaw (Str2);
|
Session.io.OutRaw (Str2);
|
||||||
|
|
||||||
If Config.ChatLogging Then WriteLn (tFile, Str1);
|
If Config.ChatLogging Then WriteLn (tFile, Str1);
|
||||||
|
|
||||||
Str1 := Str2;
|
Str1 := Str2;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -253,7 +246,7 @@ Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(27));
|
Session.io.OutFull (Session.GetPrompt(27));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure OpenChat (Split : Boolean);
|
Procedure OpenChat (Split: Boolean);
|
||||||
Var
|
Var
|
||||||
Image : TConsoleImageRec;
|
Image : TConsoleImageRec;
|
||||||
Begin
|
Begin
|
||||||
|
@ -281,8 +274,8 @@ Begin
|
||||||
Close (tFile);
|
Close (tFile);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Session.User.InChat := False;
|
Session.User.InChat := False;
|
||||||
Session.TimeOut := TimerSeconds;
|
Session.TimeOut := TimerSeconds;
|
||||||
|
|
||||||
Session.io.RemoteRestore(Image);
|
Session.io.RemoteRestore(Image);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue