From 69ae7b1372fd02725197eba91a7e9f7b396dffe5 Mon Sep 17 00:00:00 2001 From: "Eric P. Nusbaum" Date: Mon, 10 Jun 2024 21:20:14 -0400 Subject: [PATCH 1/3] Log CATASTRO messages to logger - `CATASTRO` messages were being written to the console, not the Logger --- MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs b/MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs index 7a99b0b9..95980f9b 100644 --- a/MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs +++ b/MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs @@ -4059,10 +4059,7 @@ private void catastro() var formattedMessage = FormatPrintf(message, 2); - Console.ForegroundColor = ConsoleColor.Yellow; - Console.BackgroundColor = ConsoleColor.Red; - Console.WriteLine($"{Encoding.ASCII.GetString(formattedMessage)}"); - Console.ResetColor(); + _logger.Error($"({Module.ModuleIdentifier}) Catastro Failure: {Encoding.ASCII.GetString(formattedMessage)}"); Registers.Halt = true; } From 100c688401e10a68232605c0d7981f8cc69ff0da Mon Sep 17 00:00:00 2001 From: "Eric P. Nusbaum" Date: Mon, 10 Jun 2024 21:21:20 -0400 Subject: [PATCH 2/3] Handle Current Users not "IN" Module This routine would fail if a user wasn't "IN" a module, but "IN" a module. An example is running a login routine after login. Because the user wasn't _IN_ the module, this loop would throw an exception. --- MBBSEmu/HostProcess/MbbsHost.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MBBSEmu/HostProcess/MbbsHost.cs b/MBBSEmu/HostProcess/MbbsHost.cs index f044c7c6..80da1f66 100644 --- a/MBBSEmu/HostProcess/MbbsHost.cs +++ b/MBBSEmu/HostProcess/MbbsHost.cs @@ -1362,7 +1362,7 @@ private void DisableModule(string moduleId, bool isCrashed = false) } //Notify Users and Exit Modules - foreach (var c in _channelDictionary.Values.Where(x => x.CurrentModule.ModuleIdentifier == moduleId)) + foreach (var c in _channelDictionary.Values.Where(x => x.CurrentModule?.ModuleIdentifier == moduleId)) { if (isCrashed) { From a016d07b0eed602a8832a74b885cb900ae007508 Mon Sep 17 00:00:00 2001 From: "Eric P. Nusbaum" Date: Tue, 11 Jun 2024 16:24:55 -0400 Subject: [PATCH 3/3] Add CS to ToString() Output --- MBBSEmu/CPU/RegistersStructs.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MBBSEmu/CPU/RegistersStructs.cs b/MBBSEmu/CPU/RegistersStructs.cs index 243dad63..db77a63a 100644 --- a/MBBSEmu/CPU/RegistersStructs.cs +++ b/MBBSEmu/CPU/RegistersStructs.cs @@ -520,6 +520,7 @@ public override string ToString() output.Append($"BX={this.BX:X4} "); output.Append($"CX={this.CX:X4} "); output.Append($"DX={this.DX:X4} "); + output.Append($"CS={this.CS:X4} "); output.Append($"DS={this.DS:X4} "); output.AppendLine($"ES={this.ES:X4} "); output.Append($"SI={this.SI:X4} ");