Phase 1: Extract Constants.cs and CommandRouter.cs

- Extract magic numbers (timer intervals, message type IDs, property keys) into Constants.cs
- Replace ~600-line HandleMmCommand switch with dictionary-based CommandRouter
- All /mm commands preserved with same behavior, now registered via lambdas
- PluginCore.cs and CharacterStats.cs updated to use named constants

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erik 2026-02-27 07:24:43 +00:00
parent 9e9a94f159
commit 4845a67c1f
5 changed files with 585 additions and 516 deletions

View file

@ -134,9 +134,9 @@ namespace MosswartMassacre
long key = tmpStruct.Value<Int64>("key");
long value = tmpStruct.Value<Int64>("value");
if (key == 6) // AvailableLuminance
if (key == Constants.AvailableLuminanceKey)
luminanceEarned = value;
else if (key == 7) // MaximumLuminance
else if (key == Constants.MaximumLuminanceKey)
luminanceTotal = value;
}
}
@ -162,9 +162,9 @@ namespace MosswartMassacre
int key = BitConverter.ToInt32(raw, 5);
long value = BitConverter.ToInt64(raw, 9);
if (key == 6) // AvailableLuminance
if (key == Constants.AvailableLuminanceKey)
luminanceEarned = value;
else if (key == 7) // MaximumLuminance
else if (key == Constants.MaximumLuminanceKey)
luminanceTotal = value;
}
catch (Exception ex)