Harden group sync: SF dedup, roster debounce, area ID filter

- SF first-responder lock: after sending SR/LSR, only accept SF
  messages from the first player to respond, ignore duplicates
  from other members to prevent entity flicker.
- Roster change debounce: retriggerable 5s timer with up to 5
  one-second extensions (10s max). Only fires on group size
  increase. Party events skipped when in raid.
- Area ID check in DLL respawn: markers only spawn when the
  player is in the same zone (area_id match against 0xB4E314).
- New GetCurrentAreaId() Lua function for addon zone awareness.
This commit is contained in:
MarcelineVQ
2026-03-02 11:26:10 -08:00
parent 93e4354d7b
commit bf718b66db
3 changed files with 120 additions and 19 deletions
+10
View File
@@ -535,9 +535,11 @@ fn tickAnimations() void {
if (player != 0) {
const player_pos = getUnitPosition(player);
if (player_pos.x != 0 or player_pos.y != 0 or player_pos.z != 0) {
const current_area = hook.readMem(u32, o.ZONE_AREA_ID);
for (0..NUM_MARKERS) |i| {
if (!marker_defs[i].active) continue;
if (marker_entities[i] != null) continue; // entity alive, skip
if (marker_defs[i].area_id != current_area) continue; // wrong zone
const dx = player_pos.x - marker_defs[i].pos.x;
const dy = player_pos.y - marker_defs[i].pos.y;
@@ -660,6 +662,14 @@ pub fn luaGetMarkerDef(L: u32) callconv(.c) u32 {
return 4;
}
/// Lua: local areaId = GetCurrentAreaId()
/// Returns the current zone area ID from the game global.
pub fn luaGetCurrentAreaId(L: u32) callconv(.c) u32 {
const area_id = hook.readMem(u32, o.ZONE_AREA_ID);
lapi.pushnumber(L, @floatCast(@as(f64, @floatFromInt(area_id))));
return 1;
}
// =============================================================================
// World teardown hook
// =============================================================================