Commit Graph

23 Commits

Author SHA1 Message Date
MarcelineVQ b0b70a744e dpslog: queued log writer, raid roster fix, shutdown hook, minimap icon fixes
Log file writer queues events and flushes after 3s delay, re-resolving
GUIDs at write time so names from later packets can fill in. Flush
triggers on each new event (for old entries) and on DestroyObjectManager
hook before the object manager is torn down.

- Fix raid roster access: 0xB712A8 is a flat array, not pointer-to-array
- Fix SPELL_GO hit targets: full u64 GUIDs, not packed
- Fix GetLocalizedText calling convention: __fastcall not __cdecl
- Fix isUnknownName filtering at dpslog use sites (not in shared wow.zig)
- Fix dropdown icon tCoords persisting across reload
- Add pfQuest-style quest available icon (gold exclamation mark BLP)
- Hook DestroyObjectManager for log flush instead of World_HandleLogoutCleanup
- Null GUID handling: nil name, 0x80000000 flags in both Lua and file paths
- Document combat log file writer in DLL_README
2026-03-20 15:03:04 -07:00
MarcelineVQ d84f723539 dpslog: handler table swaps, CombatLogGetCurrentEventInfo, unit flags, boolean fix
Major architectural changes:

- Migrate 12 packet handlers from JMP-patching Detours to NetClient opcode
  handler table pointer swaps. No code bytes modified — only heap pointers.
  Invisible to Warden memory scans. Hook InitializeGameEngine (0x401570,
  __thiscall) to install swaps after all handlers are registered.

- Implement CombatLogGetCurrentEventInfo() — WotLK-style lazy arg retrieval.
  Event fires with no args; addons call the function to get all fields from
  a C-side buffer. No arg count limit (bypasses ExecuteLuaCallback 19-arg cap).
  Includes unit flags, raid flags, and all suffix fields.

- Compute COMBATLOG_OBJECT_* unit flags: affiliation (MINE/PARTY/RAID/OUTSIDER),
  reaction (FRIENDLY/NEUTRAL/HOSTILE via UnitReaction), control (PLAYER/NPC),
  type (PLAYER/NPC/PET/GUARDIAN/OBJECT via SUMMONEDBY check), special (TARGET),
  and raid target markers.

- Fix boolean fields (critical/glancing/crushing): changed from %d (Lua number 0,
  which is TRUTHY) to nil/"1" via boolToLua(). Details addon was counting every
  hit as critical because it uses truthiness checks.

- SPELL_INSTAKILL now fires from SPELLLOGEXECUTE (has caster GUID).
  Standalone SMSG_SPELLINSTAKILLLOG handler is pass-through only.

- SPELL_EXTRA_ATTACKS now uses target GUID from packet (was discarded).

- SPELL_CAST_START/SUCCESS now parse spell target from packet.

- SPELL_DRAIN subevent added for instant power drain effects.

- Rename event from COMBAT_LOG_EVENT to COMBAT_LOG_EVENT_UNFILTERED.

- Update DPSMate and WSBT CLEU adapters to use CombatLogGetCurrentEventInfo().

- Remove unnecessary `or 0` guards on numeric fields (always non-nil from C).
2026-03-18 16:55:27 -07:00
MarcelineVQ fc762ac200 dpslog: CLEU rename, DPSMate absorb pipeline, WSBT adapter, module version API
- Rename COMBAT_LOG_EVENT -> COMBAT_LOG_EVENT_UNFILTERED across Zig/Lua
- DPSMate CLEU adapter: absorb pipeline (SetUnregisterVariables, Absorb,
  ConfirmAbsorbApplication, UnregisterAbsorb), BuildFail type 2/3,
  "(Periodic)" suffix, removed dead handler
- WSBT (Weird Scrolling Battle Text): CLEU adapter fork of MSBT with
  dispatch table, A/B combat profiling, selective event unregistration
- Module version API: GetWeirdUtilsVersion(name?) Lua function + WeirdUtils
  global table, additive across independent DLLs. Build system passes
  per-module version strings via build_options.
- Hook Glue_LoadScriptFunctions (0x46ABB0) for login screen availability
- Rename lsf_hook -> register_commands_hook (real name: Player_LoadScriptFunctions)
- lua.zig: add setglobal/getglobal via LUA_GLOBALSINDEX (-10001)
2026-03-18 14:20:16 -07:00
MarcelineVQ d52d4bc661 docs: add DPSLog to DLL_README and release notes
- DLL_README.md: full feature description, GetSpellInfo API, module name in dev API list
- RELEASE_NOTES.md: updated DPSLog entry with WotLK parity details, removed from gaps list
- README.md: updated module table
2026-03-18 00:16:57 -07:00
MarcelineVQ 944e398e41 minimapicons: add quest available tracking to minimap
Reads quest giver status from unit+0xCB8 (populated by client's
SMSG_QUESTGIVER_STATUS packet handler) to show yellow ! icons on the
minimap for NPCs with available quests. Uses the vanilla gossip frame
AvailableQuestIcon texture. Enabled by default, togglable from the
tracking dropdown like other NPC categories.
2026-03-14 23:18:17 -07:00
MarcelineVQ 236cf95bdd Add file cache and timer fix to release notes and DLL_README 2026-03-14 15:03:31 -07:00
MarcelineVQ 0f14213b0b Add logging module with auto-prefix, route all output through Logger
Replace console.zig with logging.zig: per-module Logger with auto
[name] prefix, optional file output, and destination routing. Convert
all modules from manual [name] prefixes and global con.print to Logger
instances. Remove redundant "Module loaded" lines. Replace
OutputDebugStringA in outline/tracker with Logger. Add dpslog module
with structured combat log events (SPELL_DMG, PERIODIC, HEAL, MELEE).
Add clickthrough module and bigcursor D3D9 cursor scaling.
2026-03-10 13:26:45 -07:00
MarcelineVQ d4e9c0417a Remove debug logging, update DLL_README with clickthrough 2026-03-09 22:42:57 -07:00
MarcelineVQ 541b9c97f0 Rename pngscreenshot to pngscreenshots 2026-03-08 22:09:38 -07:00
MarcelineVQ 2c4132ead7 Rename screenshot module to pngscreenshot
Less generic DLL name for distribution.
2026-03-08 15:48:16 -07:00
MarcelineVQ eb7b7a94e4 Clean up minimap icons: remove WMO filtering, cache active tracking, namespace Lua API
Remove unused indoor/outdoor WMO filtering and gray blip tinting.
Cache active tracking state in a bool refreshed on config change
instead of scanning all entries per-object per-frame. Move
SetObjectTypeBlip into WeirdUtils table to keep it out of the
global namespace. Add minimap tracking section to DLL_README.
2026-03-08 13:37:44 -07:00
MarcelineVQ d2f91fe8c2 Replace screenshot addon with screenshotQuality CVar
Remove the embedded Screenshot addon (TOC + Lua) and WeirdUtilsScreenshot()
Lua function. Compression quality is now controlled entirely via a CVar
(saved to config.wtf), read fresh on each screenshot. CVar 0 disables PNG
and falls through to original TGA.
2026-03-08 12:24:19 -07:00
MarcelineVQ f836850768 Separate UI feedback from public Lua API
Public functions (WorldMarker, ClearWorldMarker) no longer show chat
messages — return values indicate status. New WorldMarkers.UI_WorldMarker
and UI_ClearWorldMarker wrappers provide user-facing feedback for
slash commands and keybindings. Update README with new API signatures.
2026-03-07 14:23:52 -08:00
MarcelineVQ 97844cce8c Update M2 marker assets and DLL_README documentation
Update Raid_UI_FX M2 models. Add bigcursor Lua API docs
(SetCursorScale/GetCursorScale), clean up module control API wording.
2026-03-07 10:28:25 -08:00
MarcelineVQ 2aaa089c76 Add module control API, bigcursor with fractional scaling, shared mutex
Module control API:
- Three cdecl exports: WeirdUtils_IsModuleActive, WeirdUtils_DisableModule, WeirdUtils_DisableAll
- C header include/weirdutils_api.h for runtime DLL discovery
- All modules gain pub module_name, isActive(), shared mutex via src/mutex.zig
- build.zig refactored to module_list array of ModuleDesc

Bigcursor:
- D3D9 vtable hooks on SetCursorProperties/ShowCursor
- Scale2x/Scale3x pixel-art upscalers in pure Zig (replaces 12K-line hqx C)
- Bilinear resampler for fractional scales (1.0-4.0, default 1.2)
- Win32 cursor via CreateIconIndirect bypasses D3D9 32x32 limit
- FNV-1a hash cache for ~16 cursor bitmaps
- Lua API: SetCursorScale(n) / GetCursorScale()
- CVar cursorScale for Config.wtf persistence (tenths)

Other:
- Add dpslog module stub
- Docs and README updates
2026-03-06 13:27:35 -08:00
MarcelineVQ 00749d5745 Add bigcursor module stub, rename combatlog to logsessions, bump session timer to 60min
- New bigcursor module skeleton with build integration and mutex
- Rename combatlog module to logsessions (directory, files, build options,
  imports, console prefixes, mutex name, DLL variant, docs)
- Increase log session continuation threshold from 30 to 60 minutes
- Update DLL_README log sessions section
2026-03-04 15:14:04 -08:00
MarcelineVQ 1bbf334958 Add GetCombatLogPath/GetChatLogPath Lua functions, update log path globals
Register Lua functions to expose current log paths. At PLAYER_LOGIN,
overwrite COMBATLOGENABLED/CHATLOGENABLED globals with actual redirected
paths (English locale only). Update DLL_README with Lua API and logging
enable instructions.
2026-03-04 14:39:58 -08:00
MarcelineVQ 0c76c99734 Update DLL_README for per-character log dirs, drop PID from filenames 2026-03-04 14:06:08 -08:00
MarcelineVQ 4af033d01d Rename dataassets→customassets, Markers→WorldMarkers, prefix all mutexes
- dataassets module renamed to customassets everywhere (build flag,
  source, DLL variant name, docs)
- Markers addon renamed to WorldMarkers (addon path, .toc, .lua,
  Bindings.xml header, Lua globals, debug log prefix, mutex name)
- All 9 module mutexes now use WeirdUtils_ prefix to avoid
  collisions with other DLLs in the same process
2026-03-03 10:26:17 -08:00
MarcelineVQ c00ea75d59 Rename looseassets module to dataassets 2026-03-02 23:55:26 -08:00
MarcelineVQ c04680788d Fix release-mode crashes: inline asm register clobbers and fastcall ABI
Root cause: hook.fastcall used "r" constraints + explicit MOV to set
ECX/EDX. LLVM can allocate "r" inputs to clobbered registers, causing
cross-assignment (ecx_in→EDX, edx_in→ECX) or function address stomping
when func lands in ECX/EDX. Debug works by luck (trivial regalloc);
Release optimizes aggressively and hits the conflicts.

Fix: explicit "{ecx}", "{edx}", "{eax}" register constraints in zhook
fastcall — compiler places values directly, no MOV needed, no ambiguity.

Also fix 9 inline asm blocks across main.zig, interact.zig,
screenshot.zig, markers.zig missing ECX/EDX clobbers after CALL
instructions. Without clobbers the optimizer assumes registers retain
input values after the call — stale reuse in release builds.

Other changes in this commit:
- Rename markers→worldmarkers (build flag, DLL, Lua table)
- Rename assetfix→looseassets
- lua.zig: add .never_tail to pushcclosure, pcall, openlib, pushnumber
- Move internal marker functions into WorldMarkers Lua table via openlib
- Remove unused GetCurrentAreaId function
- Fix cleanup_file_handle_hook.original() → .callOriginal()
2026-03-02 23:38:04 -08:00
MarcelineVQ db1243d136 Add marker persistence, respawn, group sync, and fix pushnumber ABI
Marker definitions (position + area ID) now persist across zone
transitions. Entities are destroyed on map change but respawned
automatically when the player approaches within 200y. Definitions
are cleared on logout/exit via onShutdown hook.

Group sync via addon messages (WMark prefix, colon-delimited protocol)
with permission checks (raid leader/assist, party leader). Includes
sync request/response for late joiners and roster change broadcasting.

Fix lua_pushnumber calling convention: function is __thiscall (ECX=L,
f64 on stack, ret 8), not __fastcall. The patched inreg fastcall was
placing the f64's low dword in EDX, corrupting values.

Other fixes:
- Remove Bindings.xml from .toc files (explicit binding loader needed)
- Remove remove_on_shutdown for markers (was killing hooks on logout)
- Remove diagnostic entity check code (culling behavior understood)
- New Lua APIs: SetMarkerDef, ClearMarkerDef, GetMarkerDef
- Rename binding labels to marker colors
2026-03-02 11:45:26 -08:00
MarcelineVQ 4b6e4ceaa9 Add end-user DLL README documenting features and install guide 2026-03-02 07:51:07 -08:00