diff --git a/mystic/HISTORY.txt b/mystic/HISTORY.txt index d7cd5fb..b2c52f4 100644 --- a/mystic/HISTORY.txt +++ b/mystic/HISTORY.txt @@ -4806,3 +4806,33 @@ ! Fixed a bug that could corrupt a message and/or crash when editing a message with a lot of lines. + + + New option: "Ask Theme" in the General Settings. If this is set to true + Mystic will prompt the user to select a theme after the graphics are + detected upon each connection. + + + Added new MPL function: Real2Str this takes a string and decimal place + value. Example: + + Var + R : Real; + Begin + R := 1234.1234; + WriteLn (Real2Str(R, 2)); // Will print 1234.12 + End + + + The GE menu command (edit user settings) option 14 (select theme) can now + have a section option which specifies the base filename of a theme. For + example, if the theme filename is "english" you can do: + + Menu command: GE + Data: 14 english + + This will cause the theme to be selected automatically, without prompting + the user for anything. If a second parameter is not supplied, the user + will be prompted to select a theme. + + + Copy/Paste is now added/fixed for menu commands and menu execution lists + in the new menu editor. + + + NodeSpy in Windows now uses OS named pipes instead of Disk I/O. diff --git a/mystic/bbs_cfg_menuedit.pas b/mystic/bbs_cfg_menuedit.pas index 44ceea6..7e2b09c 100644 --- a/mystic/bbs_cfg_menuedit.pas +++ b/mystic/bbs_cfg_menuedit.pas @@ -310,10 +310,12 @@ Const Status2 = ' (TAB) Switch (/) Commands '; Grid = '(Grid) Item # to jump to on keypress '; Var - Box : TAnsiMenuBox; - List : TAnsiMenuList; - Form : TAnsiMenuForm; - Topic : String; + Box : TAnsiMenuBox; + List : TAnsiMenuList; + Form : TAnsiMenuForm; + Topic : String; + CopyCmd : RecMenuCmd; + HasCopy : Boolean = False; Procedure MakeList; Var @@ -400,7 +402,18 @@ Begin List.Open (2, 15, 79, 21); Case List.ExitCode of - '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|') of + '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of + 'C' : If List.Picked <> List.ListMax Then Begin + CopyCmd := Menu.Item[Num]^.CmdData[List.Picked]^; + HasCopy := True; + End; + 'P' : If HasCopy Then Begin + Menu.InsertCommand(Num, List.Picked); + + Menu.Item[Num]^.CmdData[List.Picked]^ := CopyCmd; + + Changed := True; + End; 'I' : Begin Menu.InsertCommand(Num, List.Picked); Changed := True; diff --git a/mystic/bbs_cfg_syscfg.pas b/mystic/bbs_cfg_syscfg.pas index 05ccc26..b8ee6f8 100644 --- a/mystic/bbs_cfg_syscfg.pas +++ b/mystic/bbs_cfg_syscfg.pas @@ -77,9 +77,9 @@ Begin Box := TAnsiMenuBox.Create; Form := TAnsiMenuForm.Create; - Box.Open (5, 5, 75, 17); + Box.Open (5, 5, 75, 18); - VerticalLine (24, 7, 15); + VerticalLine (24, 7, 16); VerticalLine (67, 7, 12); Form.AddStr ('B', ' BBS Name', 14, 7, 26, 7, 10, 25, 30, @Config.BBSName, Topic); @@ -90,7 +90,8 @@ Begin Form.AddStr ('F', ' Feedback To', 11, 12, 26, 12, 13, 25, 30, @Config.FeedbackTo, Topic); Form.AddStr ('A', ' Start Menu', 12, 13, 26, 13, 12, 20, 20, @Config.DefStartMenu, Topic); Form.AddStr ('H', ' Theme', 17, 14, 26, 14, 7, 20, 20, @Config.DefThemeFile, Topic); - Form.AddTog ('E', ' Terminal', 14, 15, 26, 15, 10, 10, 0, 3, 'Ask Detect Detect/Ask ANSI', @Config.DefTermMode, Topic); + Form.AddBol ('K', ' Ask Theme', 13, 15, 26, 15, 11, 3, @Config.ThemeOnStart, Topic + 'Ask theme each connection'); + Form.AddTog ('E', ' Terminal', 14, 16, 26, 16, 10, 10, 0, 3, 'Ask Detect Detect/Ask ANSI', @Config.DefTermMode, Topic); Form.AddBol ('L', ' Chat Logging', 53, 7, 69, 7, 14, 3, @Config.ChatLogging, Topic); Form.AddByte ('R', ' Hours Start', 54, 8, 69, 8, 13, 2, 0, 24, @Config.ChatStart, Topic); diff --git a/mystic/bbs_core.pas b/mystic/bbs_core.pas index cd20ab4..4856299 100644 --- a/mystic/bbs_core.pas +++ b/mystic/bbs_core.pas @@ -356,26 +356,28 @@ Begin End; Function TBBSCore.LoadThemeData (Str: String) : Boolean; +Var + TempTheme : RecTheme; Begin Result := False; Reset (ThemeFile); While Not Eof(ThemeFile) Do Begin - Read (ThemeFile, Theme); + Read (ThemeFile, TempTheme); {$IFDEF FS_SENSITIVE} - If Theme.FileName = Str Then Begin + If TempTheme.FileName = Str Then Begin {$ELSE} - If strUpper(Theme.FileName) = strUpper(Str) Then Begin + If strUpper(TempTheme.FileName) = strUpper(Str) Then Begin {$ENDIF} - If Not FileExist(Config.DataPath + Theme.FileName + '.thm') Then Break; + If Not FileExist(Config.DataPath + TempTheme.FileName + '.thm') Then Break; {$I-} Close (PromptFile); {$I+} If IoResult <> 0 Then; - Assign (PromptFile, Config.DataPath + Theme.FileName + '.thm'); + Assign (PromptFile, Config.DataPath + TempTheme.FileName + '.thm'); Result := ioReset(PromptFile, SizeOf(RecPrompt), fmRWDN); @@ -384,6 +386,8 @@ Begin End; Close (ThemeFile); + + If Result Then Theme := TempTheme; End; End. diff --git a/mystic/bbs_io.pas b/mystic/bbs_io.pas index 449852d..68706a7 100644 --- a/mystic/bbs_io.pas +++ b/mystic/bbs_io.pas @@ -1926,7 +1926,7 @@ Begin While Input.KeyPressed Do Input.ReadKey; {$ENDIF} {$IFDEF WINDOWS} - If Not TBBSCore(Core).LocalMode Then TBBSCore(Core).Client.PurgeInputData; + If Not TBBSCore(Core).LocalMode Then TBBSCore(Core).Client.PurgeInputData(True); {$ENDIF} End; diff --git a/mystic/bbs_menus.pas b/mystic/bbs_menus.pas index e108cad..4f7ea27 100644 --- a/mystic/bbs_menus.pas +++ b/mystic/bbs_menus.pas @@ -190,7 +190,7 @@ Begin '1' : ShowBBSHistory(strS2I(CmdData)); 'A' : View_Directory(CmdData, 0); 'D' : Session.io.OutFile (CmdData, True, 0); - 'E' : Session.User.Edit_User_Settings(strS2I(CmdData)); + 'E' : Session.User.EditUserSettings(CmdData); 'H', 'I' : Begin If Cmd[2] = 'H' Then Begin @@ -304,7 +304,7 @@ Begin Session.io.OutFile('newuser', True, 0); If Session.io.GetYN(Session.GetPrompt(269), True) Then Begin Session.User.CreateNewUser(''); - Session.User.User_Logon2; + Session.User.UserLogon2; MenuName := Config.MatrixMenu; Result := True; diff --git a/mystic/bbs_msgbase.pas b/mystic/bbs_msgbase.pas index 984641f..91ba85c 100644 --- a/mystic/bbs_msgbase.pas +++ b/mystic/bbs_msgbase.pas @@ -980,11 +980,11 @@ Begin TempStr := WrapData + ' ' + TempStr; End; - strWrap (TempStr, WrapData, 74); + strWrap (TempStr, WrapData, 75); - WriteLn (QuoteFile, Initials + Copy(TempStr, 1, 74)); + WriteLn (QuoteFile, Initials + Copy(TempStr, 1, 75)); End Else - WriteLn (QuoteFile, Initials + Copy(TempStr, 1, 74)); + WriteLn (QuoteFile, Initials + Copy(TempStr, 1, 75)); End; Close (QuoteFile); diff --git a/mystic/bbs_user.pas b/mystic/bbs_user.pas index 20700cf..97854d0 100644 --- a/mystic/bbs_user.pas +++ b/mystic/bbs_user.pas @@ -61,12 +61,12 @@ Type Procedure GetOption1 (Edit: Boolean); Procedure GetOption2 (Edit: Boolean); Procedure GetOption3 (Edit: Boolean); - Procedure GetLanguage; - Procedure User_Logon (Var UN, PW, MPE : String); - Procedure User_Logon2; - Procedure User_Logon3; + Procedure GetTheme; + Procedure UserLogon1 (Var UN, PW, MPE : String); + Procedure UserLogon2; + Procedure UserLogon3; Procedure CreateNewUser (DefName: String); - Procedure Edit_User_Settings (What: Byte); + Procedure EditUserSettings (Data: String); Function Check_Trash (Name: String) : Boolean; End; @@ -428,7 +428,7 @@ Begin If Session.LocalMode Then Session.io.Graphics := 1 Else Begin - Session.Client.PurgeInputData; + Session.Client.PurgeInputData(True); Session.io.OutRaw (#27 + '[6n'); Session.io.BufFlush; @@ -440,7 +440,7 @@ Begin End; End; - Session.Client.PurgeInputData; + Session.Client.PurgeInputData(True); End; Session.io.OutFullLn (Session.GetPrompt(259)); @@ -801,7 +801,7 @@ Begin End; End; -Procedure TBBSUser.GetLanguage; +Procedure TBBSUser.GetTheme; Var Old : RecTheme; T : Byte; @@ -883,7 +883,7 @@ Begin If strUpper(DefName) = 'NEW' Then DefName := ''; With Config Do Begin - If AskTheme Then GetLanguage Else ThisUser.Theme := DefThemeFile; + If AskTheme Then GetTheme Else ThisUser.Theme := DefThemeFile; If AskAlias Then GetAlias(False, DefName); If AskRealName Then GetRealName(False); If AskStreet Then GetAddress(False); @@ -991,7 +991,7 @@ Begin Session.Msgs.PostTextFile('sysletter.txt;0;' + Config.SysopName + ';' + Config.SysopName + ';New account created', True); End; -Procedure TBBSUser.User_Logon3; +Procedure TBBSUser.UserLogon3; Var Count : Byte; Ch : Char; @@ -1069,7 +1069,7 @@ Begin { END forced voting check } End; -Procedure TBBSUser.User_Logon2; +Procedure TBBSUser.UserLogon2; Begin {$IFDEF LOGGING} Session.SystemLog('Logon2'); {$ENDIF} @@ -1170,7 +1170,7 @@ Begin {$ENDIF} End; -Procedure TBBSUser.User_Logon (Var UN, PW, MPE : String); +Procedure TBBSUser.UserLogon1 (Var UN, PW, MPE : String); Var A : Integer; Count : Byte; @@ -1193,7 +1193,11 @@ Begin Halt(0); End; - Session.io.OutFullLn ('|CL' + mysSoftwareID + ' BBS v' + mysVersion + ' (' + OSID + ') Node |ND'); +// Session.io.AnsiClear; +// Session.io.OutFullLn('|CR' + strPadC(mysSoftwareID + ' BBS v' + mysVersion + ' [' + OSID + '] : Node |ND', 79, ' ')); +// Session.io.OutFullLn(strPadC(CopyID, 79, ' ')); + + Session.io.OutFullLn ('|CL' + mysSoftwareID + ' BBS v' + mysVersion + ' [' + OSID + '] : Node |ND'); Session.io.OutFullLn (CopyID); If Config.DefTermMode = 0 Then @@ -1206,6 +1210,8 @@ Begin If (Session.io.Graphics = 0) and (Config.DefTermMode = 2) Then GetGraphics; End; + If Config.ThemeOnStart Then GetTheme; + If FileExist(Config.ScriptPath + 'startup.mpx') Then ExecuteMPL(NIL, 'startup'); @@ -1256,8 +1262,8 @@ Begin If Session.io.GetYN(Session.GetPrompt(1), False) Then Begin CreateNewUser(ThisUser.Handle); - User_Logon2; - User_Logon3; + UserLogon2; + UserLogon3; Exit; End; @@ -1291,17 +1297,26 @@ Begin ThisUser.Theme := Config.DefThemeFile; End; - User_Logon2; + UserLogon2; If MPE <> '' Then Begin ExecuteMPL(NIL, MPE); Halt; End Else - User_Logon3; + UserLogon3; End; -Procedure TBBSUser.Edit_User_Settings (What: Byte); +Procedure TBBSUser.EditUserSettings (Data: String); +Var + What : Byte; Begin + What := strS2I(strWordGet(1, Data, ' ')); + + If strWordCount(Data, ' ') > 1 Then + Data := strStripB(Copy(Data, strWordPos(2, Data, ' '), 255), ' ') + Else + Data := ''; + Case What of 1 : GetAddress(True); 2 : GetCityState(True); @@ -1322,7 +1337,10 @@ Begin 11 : GetPassword(True); 12 : GetRealName(True); 13 : GetAlias(True, ''); - 14 : GetLanguage; + 14 : If Data = '' Then + GetTheme + Else + Session.LoadThemeData(Data); 15 : GetEditor(True); 16 : If Access(Config.AcsInvisLogin) Then Begin Chat.Invisible := Not Chat.Invisible; diff --git a/mystic/default.txt b/mystic/default.txt index f3a7d72..5c9f763 100644 --- a/mystic/default.txt +++ b/mystic/default.txt @@ -328,17 +328,17 @@ 180 |CR|PA ; nodechat text: &1 = user name 181 |07<|15|&1|07> |07 -; Language select header -182 |CR|14Available languages:|CR -; Language select format: -; &1 = language number &2 = language description -183 |15|$R03|&1|14|&2 -; Language select footer -184 |CR|09Select language: |XX -; Language file does not exist -185 |CR|12Language file does not exist. -; Displayed if user's language does not exist. -186 |CR|12Selected language not available. Using default language.|CR|PA +; Theme select header +182 |CR|14Available themes:|CR +; Theme select format: +; &1 = Theme number &2 = Theme description +183 |10|&1 |08..... |07|&2 +; Theme select footer +184 |CR|09Select your theme |01[|10Enter|01/|10Default|01]: |09 +; Theme file does not exist +185 |CR|12Theme file does not exist. +; Displayed if user's theme does not exist. +186 |CR|12Selected theme not available. Using default theme.|CR|PA ; new user: use full screen node chat? 187 |CR|12Use full screen node chat? |11 ; One Liner header diff --git a/mystic/mpl_common.pas b/mystic/mpl_common.pas index 1497105..1cc98e1 100644 --- a/mystic/mpl_common.pas +++ b/mystic/mpl_common.pas @@ -245,6 +245,7 @@ Begin AddProc ({$IFDEF MPLPARSER} 'fillchar', {$ENDIF} '*lc', iNone); // 90 AddProc ({$IFDEF MPLPARSER} 'fwriterec', {$ENDIF} 'Fx', iNone); // 91 AddProc ({$IFDEF MPLPARSER} 'freadrec', {$ENDIF} 'Fx', iNone); // 92 + AddProc ({$IFDEF MPLPARSER} 'real2str', {$ENDIF} 'rb', iString); // 93; IW := 500; // BEGIN BBS-SPECIFIC STUFF diff --git a/mystic/mpl_execute.pas b/mystic/mpl_execute.pas index 08a37b1..f36a388 100644 --- a/mystic/mpl_execute.pas +++ b/mystic/mpl_execute.pas @@ -1767,6 +1767,10 @@ Begin BlockRead (File(Pointer(Param[1].vData)^), VarData[Param[2].vID]^.Data^, VarData[Param[2].vID]^.DataSize); IoError := IoResult; End; + 93 : Begin + TempStr := strR2S(Param[1].R, Param[2].B); + Store (TempStr, 256); + End; 500 : Begin TempStr := Session.io.GetInput(Param[1].B, Param[2].B, Param[3].B, Param[4].S); Store (TempStr, 256); diff --git a/mystic/mpl_types.pas b/mystic/mpl_types.pas index 25585e3..e099c86 100644 --- a/mystic/mpl_types.pas +++ b/mystic/mpl_types.pas @@ -77,7 +77,7 @@ Type ); Const - mplVer = '11C'; + mplVer = '11D'; mplVersion = '[MPX ' + mplVer +']' + #26; mplVerLength = 10; mplExtSource = '.mps'; diff --git a/mystic/mystic.pas b/mystic/mystic.pas index 88dcdaf..1694e8e 100644 --- a/mystic/mystic.pas +++ b/mystic/mystic.pas @@ -465,7 +465,7 @@ Begin Set_Node_Action (Session.GetPrompt(345)); - Session.User.User_Logon (UserName, Password, Script); + Session.User.UserLogon1 (UserName, Password, Script); If Session.TimeOffset > 0 Then Session.TimeSaved := Session.User.ThisUser.TimeLeft; diff --git a/mystic/nodespy.pas b/mystic/nodespy.pas index c8dc25b..2462315 100644 --- a/mystic/nodespy.pas +++ b/mystic/nodespy.pas @@ -496,7 +496,7 @@ Procedure SnoopNode (Node: Byte); Var Pipe : TPipe; Buffer : Array[1..4 * 1024] of Char; - BufRead : LongInt; + BufRead : LongWord; Update : LongInt; Procedure DrawStatus; @@ -534,7 +534,7 @@ Begin Pipe := TPipe.Create(Config.DataPath, True, Node); - If Not Pipe.ConnectPipe(1500) Then Begin + If Not Pipe.ConnectPipe(800) Then Begin ShowMsgBox (0, 'Unable to establish a session. Try again'); Pipe.Free; Exit; @@ -546,17 +546,18 @@ Begin DrawStatus; + Screen.TextAttr := 7; + Screen.ClearScreen; + Update := TimerSet(UpdateNode); While Pipe.Connected Do Begin Pipe.ReadFromPipe(Buffer, SizeOf(Buffer), BufRead); - Case BufRead of - -1 : Break; - 0 : WaitMS(200); + If BufRead = 0 Then + WaitMS(200) Else Term.ProcessBuf(Buffer, BufRead); - End; If Keyboard.KeyPressed Then Case Keyboard.ReadKey of @@ -609,7 +610,8 @@ Begin Screen.TextAttr := 7; Screen.ClearScreen; - Screen.WriteStr ('Connecting to 127.0.0.1... '); + + Screen.WriteStr ('Telnet to 127.0.0.1... '); Client := TIOSocket.Create; @@ -865,7 +867,7 @@ Begin Repeat If Keyboard.KeyWait(1000) Then - Case Keyboard.ReadKey of + Case UpCase(Keyboard.ReadKey) of #00 : Case Keyboard.ReadKey of #71 : Begin TopPage := 1; @@ -925,6 +927,14 @@ Begin FullReDraw; End; #27 : Break; + 'G' : If ShowMsgBox(1, 'Kill Ghost on Node ' + strI2S(NodeInfo[CurNode]^.Node)) Then Begin + FileErase(Config.DataPath + 'chat' + strI2S(NodeInfo[CurNode]^.Node) + '.dat'); + + UpdateOnlineStatus; + DrawNodes; + + NodeTimer := TimerSet(UpdateNode); + End; End; If TimerUp(NodeTimer) Then Begin diff --git a/mystic/records.pas b/mystic/records.pas index d1225bf..4c4f132 100644 --- a/mystic/records.pas +++ b/mystic/records.pas @@ -23,7 +23,7 @@ Const mysSoftwareID = 'Mystic'; // no idea mysCopyYear = '1997-2012'; // its been a long time! - mysVersion = '1.10 A19'; // current version + mysVersion = '1.10 A20'; // current version mysDataChanged = '1.10 A11'; // version of last records change {$IFDEF WIN32} @@ -271,7 +271,8 @@ Type inetNNTPTimeOut : Word; // UNSORTED inetTNHidden : Boolean; - Reserved : Array[1..845] of Char; + ThemeOnStart : Boolean; + Reserved : Array[1..844] of Char; End; Const diff --git a/mystic/todo.pas b/mystic/todo.pas index 6851438..6b920de 100644 --- a/mystic/todo.pas +++ b/mystic/todo.pas @@ -15,15 +15,12 @@ BUGS AND POSSIBLE ISSUES functions. ! RAR internal viewer does not work with files that have embedded comments ! Test midnight rollovers for time (flag for user to be immune to timecheck) -! Validate that "groupX.ans" and "fgroupX.ans" actually work. -! Test NNTP with Thunderbird specifically FUBAR dates on messages. FUTURE / IDEAS / WORK IN PROGRESS / NOTES ========================================= -- Auto wrapping of quotes before the FS editor gets to it. - Finish Threaded message reader -- Add "high roller Smack talk" into BlackJack +- Add "high roller/smack talk" into BlackJack - Add better MIS logging per server (connect, refuse, blocked, etc) - BBS email autoforwarded to Internet email - Ability to send internet email to people from within the BBS. @@ -36,7 +33,6 @@ FUTURE / IDEAS / WORK IN PROGRESS / NOTES - MCI code to show how many files are in current filebase - Online ANSI file viewer (integrate with art gallery) - Online text editor / ansi editor? -- Better theme selection (menu command option to select theme) - Externalize remaining prompt data (msg flags, etc) - File comments and rating system - Integrate eventual online ANSI help system into configuration utilities