The combat stats tracker was only started in LoginComplete — but
auto-updates go through InitializeForHotReload() which skipped it
entirely. After every hot reload, _combatStatsTracker was created but
never had SetCombatTracker/RestartSession/Start called.
Also adds vital sharing re-init for the same hot reload path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If the CombatStatsTracker constructor throws (e.g. TypeInitializationException
from static field initializers), we now catch and print the exact exception
type + message + inner exception to the DECAL chat window.
Also logs "tracker=OK" or "tracker=NULL" in LoginComplete so we can see
if the object was created at all.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The static constructor used reflection to read KillTracker.KillPatterns
which caused a TypeInitializationException — making _combatStatsTracker
null and silently disabling the entire combat tracking pipeline.
Replaced with a direct copy of the 35 kill regex patterns. No reflection,
no static constructor, no silent failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Temporary verbose logs:
- CombatStatsTracker.Start() logs when timer starts
- ProcessChatLine logs first 3 invocations (text preview)
- OnSendTick logs first 3 sends (kill/damage/monster counts)
Will remove once we confirm the pipeline is working.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DECAL's ChatBoxMessage delivers raw text with HTML tags and trailing
\r\n that break the ^...$ regex anchors in every combat pattern.
ProcessChatLine now strips tags and trims before matching, same as
ChatEventRouter.NormalizeChatLine does for the WebSocket chat stream.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a full combat event parser to the plugin that replicates every
stat Mag-Tools' Combat Tracker shows:
- CombatInfo.cs: DamageElement/AttackType enums, DamageStats class
(TotalAttacks, FailedAttacks, Crits, Normal/Crit damage + max),
MonsterCombatRecord with nested offense/defense dictionaries
(AttackType → DamageElement → DamageStats), CombatSessionState.
- CombatStatsTracker.cs: parses combat chat using the same regex
patterns as Mag-Tools' StandardTracker + AetheriaTracker +
CloakTracker. Detects melee/missile/magic hits (given+received),
evades, resists, kill messages, aetheria surges, cloak surges.
Element detection via verb keyword matching. Maintains session
(cleared on login) and lifetime (never cleared) state. Sends a
combat_stats snapshot to Overlord every 10 seconds.
- ChatEventRouter: wired to call ProcessChatLine on every chat event
- PluginCore: instantiates tracker, starts on login, disposes on shutdown
- WebSocket: added SendCombatStatsAsync + made SessionId internal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Settings tab button renamed from "Open Overlay" to "Toggle Overlay"
since the same button now closes the overlay if it's already open
(it already toggled, the old label was misleading).
- Overlay now draws a red X close button in the top-right corner while
Ctrl is held, matching UB's NetworkUI affordance. Ctrl+left-click on
the X hides the overlay. Same Ctrl-modifier gate as the drag
operation so the normal game UI is not affected.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two bugs fixed:
1. /mm vitalsharing on|off did not update the checkbox on the Settings
tab, leaving the UI out of sync with the actual state. Toggling via
PluginCore.SetVitalSharingEnabled now calls
Views.VVSTabbedMainView.RefreshSettingsFromConfig so the checkbox
reflects the new state regardless of whether the toggle came from
chat, the settings checkbox, or the settings overlay.
2. After a WebSocket reconnect, the plugin was silently dropping out of
the backend's vital sharing subscriber set. The receive loop's
disconnect cleanup removes the character from _vital_sharing_subscribers,
but the plugin only sent share_subscribe once at tracker.Start() — so
after any reconnect, no future share_* messages would be forwarded to
that client. Fix: when the WebSocket (re)connects and registers, if
PluginSettings.VitalSharingEnabled is true, re-send share_subscribe
immediately after the register envelope.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a Verbose Logging checkbox on the Settings tab (backed by the
existing PluginSettings.VerboseLogging flag) plus trace lines in
VitalSharingTracker so you can verify cross-PC coordination is actually
reaching VTank.
When enabled, chat logs will include:
[VitalShare] SEND share_cast_attempt ...
[VitalShare] SEND share_cast_success ...
[VitalShare→VTank] HelperPlayerUpdate <name> HP=.../... S=.../... M=.../...
[VitalShare→VTank] LogCastAttempt from <name>: spell=X target=0xY
[VitalShare→VTank] LogSpellCast from <name>: spell=X target=0xY duration=Zms
[VitalShare→VTank] SKIP ... (with reason when vTank.Instance is null
or the target isn't a valid local object)
No overhead when the toggle is off — VerboseLog() short-circuits before
formatting the message arguments, matching the existing log-gating
pattern in the codebase.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirrors UtilityBelt NetworkUI behaviour for the cross-PC vital sharing
overlay:
- Each non-self row now draws a small triangle pointing toward the peer
(relative to the local character's facing) and a range label in meters,
both tinted red as distance grows. Uses share_position_update data
that was already being streamed but previously ignored on receive.
- VitalSharingTracker caches peer positions from share_position_update
into the same PeerSnapshot used by the overlay.
- Hold Ctrl and left-drag the overlay to reposition it. A yellow border
highlights the drag bounds while Ctrl is held (matches UB).
Position is persisted to PluginSettings.VitalSharingOverlayX/Y.
- Input handled via CoreManager.WindowMessage, eating the events so the
game doesn't also react to the drag.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rewrite VitalSharingOverlayView as a DxHud drawn directly onto the
game surface with the same row layout UB NetworkUI uses: full-width
HP bar on top, Stamina + Mana bars side-by-side on the bottom, plus
per-row border and name/percentage text. Colours use the sidebar
palette (#ff4444 / #ffaa00 / #4488ff).
- Always include the local character as the first row so the overlay
shows something even before any peer traffic arrives. Previously
the window said "(no peers)" until another subscribed client
streamed vitals in.
- VitalSharingTracker.GetSelfSnapshot() reads current vitals via
CoreManager.Actions.Vital.
- Drop the old HudList-based XML view (no longer used).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Settings tab: new "Vital Sharing (cross-PC)" checkbox + "Open Overlay"
button, plus help text clarifying CharTag is used as the sharing group.
- Drop separate VitalSharingTags list — reuse PluginSettings.CharTag as
the single tag value sent with every share_* payload.
- New VitalSharingOverlayView (HudList of peers with coloured HP/STA/MANA
percentages) modeled after UB's NetworkUI. Colours match the web
sidebar palette (#ff4444 / #ffaa00 / #4488ff).
- VitalSharingTracker now caches a peer snapshot on every inbound
share_vital_update so the overlay can render without re-polling.
- PluginCore.SetVitalSharingEnabled static helper so the settings
checkbox can toggle without poking at private fields.
- /mm vitalsharing command simplified to on|off|status|overlay.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reimplements UtilityBelt VTankFellowHeals + Networking using Overlord's
WebSocket pipeline so debuff coordination and vital sharing work across
multiple PCs instead of only localhost.
- VitalSharingTracker: packet hook (0xF7B1/0x004A) for cast attempts,
chat regex for cast success (handles proc debuffs), 150ms vital timer,
300ms position timer, 5s item timer. Inbound share_* queued to main
thread via Core.RenderFrame and routed to UBHelper.vTank.Instance
(LogCastAttempt / LogSpellCast / HelperPlayerUpdate).
- WebSocket: new OnServerMessage event, share_* routing in receive loop,
SendVitalShareAsync helper.
- PluginSettings: VitalSharingEnabled (default off) + VitalSharingTags.
- PluginCore: /mm vitalsharing on|off|status|tag add/remove|tags.
- csproj: reference UtilityBelt.Helper.dll (sPlayerInfoUpdate actually
lives in utank2-i.dll under the uTank2 namespace).
Running UB local sharing and MM cross-PC sharing simultaneously is safe
since VTank's Log* methods are idempotent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60m was too narrow (~half a house). 240m matches the typical in-game
view distance for terrain features (1 AC coordinate unit = 240 game units).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously sent inventory immediately with potentially unidentified items.
Now uses the same scan-wait-send pattern as first-login:
1. Requests ID for all items needing identification
2. Waits for all identifications to complete (ChangeObject handler)
3. Only sends complete, fully-identified inventory when ready
Ensures clean inventory data for the backend, eliminates stale/partial items.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Log dungeon_map payload size and send success/failure
- Guard early COM calls (CharacterFilter, Actions.Heading) with
try/catch to prevent RPC_E_SERVERFAULT during state transitions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New DungeonMapReader reads dungeon cell geometry from game dat files
via DECAL FileService. NearbyObjectsTracker detects dungeon entry
via landblock change, reads cells once, and streams dungeon_map event.
nearby_objects payload now includes is_dungeon flag, landblock ID,
and raw physics coordinates for accurate dungeon positioning.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New NearbyObjectsTracker polls WorldFilter.GetLandscape() every 1s
when activated by start_radar/stop_radar commands from the browser.
Streams all visible objects (monsters, players, NPCs, portals, etc.)
with coordinates to the backend for real-time radar display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a Metas tab that lists remote .met/.nav files, checks update status, and downloads with .bak backups on overwrite. Add an Auto Install Updates setting (default on) and guard settings usage during early startup to avoid initialization errors.
RequestId() is called for armor, weapons, jewelry, and other items that need full ID data when picked up via OnCreateObject or OnChangeObject. Adds ObjectClassNeedsIdent helper matching MossyInventory's logic.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Replace hardcoded AssemblyVersion/AssemblyFileVersion with a CalVer
scheme (YYYY.M.D.HHmm) generated at build time via an MSBuild target
that writes a CalVer.cs file into obj/ before compilation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Unsubscribe all event handlers and stop/dispose timers at the start of
Startup() before re-creating objects. On first load the -= calls are
no-ops; on hot reload they remove stale handlers that would otherwise
compound with each reload. Also adds LoginComplete unsubscription to
Shutdown() for completeness.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
InitializeForHotReload was missing window position restore (settings
loaded after ViewInit, but position never re-applied) and character
stats streaming timer (10-min interval + initial send).
Added VVSTabbedMainView.RestorePosition() static wrapper and wired
it into the hot reload path after settings load. Added character
stats timer initialization as step 10.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
InitializeForHotReload() was called at the top of Startup() before
_killTracker, _chatEventRouter, and _inventoryMonitor were created,
causing NullReferenceException. Move the hot reload block to after
all core objects are initialized.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
InitializeForHotReload() never created a RareTracker — it only ran
if one already existed. When the new DLL is loaded on an already-
logged-in character, LoginComplete doesn't fire, so _rareTracker
stayed null and the null-check in ChatEventRouter.OnChatText silently
skipped all rare detection.
Now InitializeForHotReload creates and wires the RareTracker if it
hasn't been set yet, matching what LoginComplete does.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parse augmentation, rating, mastery, society, and general DWORD properties
from the 0x0013 login message. Capture the full titles list from 0x0029.
Both are included in the character_stats WebSocket payload for the new
TreeStats-style character window in the frontend.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove dead no-op commands (harmonyraw, debugtaper)
- Remove duplicate command (initgui, same as gui)
- Hide debug/test commands from help output (vtanktest, decalstatus,
decaldebug, testprismatic, testdeath, testtaper, debugupdate)
- Clean up descriptions for consistency
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add debug logging to all empty catch blocks in DecalHarmonyClean.cs setup methods
(prefix method catches intentionally stay silent to never break other plugins)
- Add error logging to VtankControl.VtSetSetting catch
- Add logging to DecalPatchMethods.ProcessInterceptedMessage catch
- Remove unused usings from PluginCore.cs (System.Diagnostics, System.Drawing,
System.Text, System.Text.RegularExpressions)
- Flatten redundant nested try/catch in PatchPluginHost
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create IPluginLogger interface, PluginCore implements it
- CharacterStats.cs and WebSocket.cs now use IPluginLogger instead of PluginCore.WriteToChat
- Extract KillTracker.cs: owns kill detection (all 36 regex patterns), death tracking,
rate calculation, and the 1-sec stats update timer
- Bridge properties on PluginCore maintain backward compat for WebSocket telemetry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- Move Init() and ServerDispatch hook from LoginComplete to Startup so
event 0x0013 (character properties) is caught during login sequence
- Add handler for message 0x02CF (PrivateUpdatePropertyInt64) to capture
runtime luminance changes when player earns/spends luminance in-game
- Uses RawData byte parsing for 0x02CF since Decal messages.xml may not
define this message type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>