Skip to content

Update Interaction.lua#145

Open
Thrumbar wants to merge 1 commit intoebonyfaye:masterfrom
Thrumbar:master
Open

Update Interaction.lua#145
Thrumbar wants to merge 1 commit intoebonyfaye:masterfrom
Thrumbar:master

Conversation

@Thrumbar
Copy link
Copy Markdown

================================================================================ Interaction Module Refactor & Taxi Sync Fix

Version: Refactor + Taxi Sync Stabilization
Author: EMA Refactor Pass
Scope: Taxi / Mount / Loot Systems

-------------------------------------------------------------------------------- [FIX] Prevent follower auto-flying before master selection --------------------------------------------------------------------------------

  • Added pending taxi request timestamp (pendingCreatedAt)
  • Implemented freshness window (IsPendingFresh, ~2s)
  • Taxi requests now expire if not used immediately
  • Prevents stale taxi commands from triggering on next taxi open

-------------------------------------------------------------------------------- [FIX] Restrict taxi sync to master only

  • Added master validation in TaxiPrivate:TakeFromTeam if not EMAApi.IsCharacterTheMaster(sender) then return end
  • Prevents non-master or stale commands from triggering taxi actions

-------------------------------------------------------------------------------- [FIX] Clear stale taxi state reliably

  • Added TaxiPrivate:ResetState()

  • Added TaxiPrivate:ClearPending()

  • State cleared on:

    • TAXIMAP_CLOSED
    • PLAYER_ENTERING_WORLD
    • PLAYER_CONTROL_GAINED (post-flight landing)
  • Eliminates lingering pending taxi state between interactions

-------------------------------------------------------------------------------- [FIX] Remove delayed taxi execution (timer-based)

  • Removed ScheduleTimer("TakeTimedTaxi")

  • Removed TakeTimedTaxi()

  • Taxi now executes immediately when valid

  • Prevents:

    • secure state conflicts
    • delayed execution bugs
    • invalid taxi frame timing issues

-------------------------------------------------------------------------------- [FIX] Prevent taxi frame close race conditions

  • Added suppressCloseBroadcast flag

  • Added TaxiPrivate:ShouldSuppressClose()

  • Prevents premature closing of taxi UI during:

    • active taxi sync
    • recent taxi take
    • pending sync state

-------------------------------------------------------------------------------- [REFACTOR] Introduce structured taxi state tracking --------------------------------------------------------------------------------

  • Added EMA.taxiState:

    • pendingTake
    • pendingSender
    • pendingNodeName
    • pendingNodeIndex
    • pendingCreatedAt
    • suppressCloseBroadcast
    • lastTakeAt
  • Centralizes all taxi-related state

-------------------------------------------------------------------------------- [REFACTOR] Split module into private subsystems

  • Introduced:

    • TaxiPrivate
    • MountPrivate
    • LootPrivate
  • Improves:

    • readability
    • maintainability
    • debugging isolation

-------------------------------------------------------------------------------- [REFACTOR] Add compatibility abstraction layer

  • Introduced Compat helpers:

    • IsClassic / IsRetail
    • GetTaxiFrame
    • HasMountJournal
    • CanUseTaxiNodes
    • CloseTaxiMap
  • Removes scattered API/version checks

  • Improves Retail/Classic compatibility

-------------------------------------------------------------------------------- [FIX] Mount synchronization stability

  • Added casting mount tracking:

    • EMA.castingMount
    • EMA.castingMountName
  • Fixed mount success detection

  • Prevented duplicate or invalid mount triggers

-------------------------------------------------------------------------------- [FIX] Defensive API guards

  • Added checks for:

    • LibAuras availability
    • MountJournal functions
    • Taxi node APIs
    • UI frame existence
    • Enum.UIMapSystem
  • Prevents runtime errors and nil access

-------------------------------------------------------------------------------- [REFACTOR] Naming cleanup and consistency

  • changeTexiTime → changeTaxiTime
  • LeavsTaxi → LeavesTaxi
  • checkBoxrequestStop → checkBoxRequestStop

-------------------------------------------------------------------------------- [FEATURE] Saved variable migration

  • Added EMA:MigrateSettings()
  • Automatically migrates legacy typo keys: changeTexiTime → changeTaxiTime

-------------------------------------------------------------------------------- [RESULT]

  • Followers no longer auto-fly unexpectedly
  • Taxi sync is deterministic and master-controlled
  • No stale taxi requests persist between interactions
  • Improved stability across Retail and Classic
  • Codebase significantly more maintainable ================================================================================

================================================================================
Interaction Module Refactor & Taxi Sync Fix
================================================================================

Version: Refactor + Taxi Sync Stabilization
Author: EMA Refactor Pass
Scope: Taxi / Mount / Loot Systems

--------------------------------------------------------------------------------
[FIX] Prevent follower auto-flying before master selection
--------------------------------------------------------------------------------
- Added pending taxi request timestamp (pendingCreatedAt)
- Implemented freshness window (IsPendingFresh, ~2s)
- Taxi requests now expire if not used immediately
- Prevents stale taxi commands from triggering on next taxi open

--------------------------------------------------------------------------------
[FIX] Restrict taxi sync to master only
--------------------------------------------------------------------------------
- Added master validation in TaxiPrivate:TakeFromTeam
  if not EMAApi.IsCharacterTheMaster(sender) then return end
- Prevents non-master or stale commands from triggering taxi actions

--------------------------------------------------------------------------------
[FIX] Clear stale taxi state reliably
--------------------------------------------------------------------------------
- Added TaxiPrivate:ResetState()
- Added TaxiPrivate:ClearPending()

- State cleared on:
  * TAXIMAP_CLOSED
  * PLAYER_ENTERING_WORLD
  * PLAYER_CONTROL_GAINED (post-flight landing)

- Eliminates lingering pending taxi state between interactions

--------------------------------------------------------------------------------
[FIX] Remove delayed taxi execution (timer-based)
--------------------------------------------------------------------------------
- Removed ScheduleTimer("TakeTimedTaxi")
- Removed TakeTimedTaxi()
- Taxi now executes immediately when valid

- Prevents:
  * secure state conflicts
  * delayed execution bugs
  * invalid taxi frame timing issues

--------------------------------------------------------------------------------
[FIX] Prevent taxi frame close race conditions
--------------------------------------------------------------------------------
- Added suppressCloseBroadcast flag
- Added TaxiPrivate:ShouldSuppressClose()

- Prevents premature closing of taxi UI during:
  * active taxi sync
  * recent taxi take
  * pending sync state

--------------------------------------------------------------------------------
[REFACTOR] Introduce structured taxi state tracking
--------------------------------------------------------------------------------
- Added EMA.taxiState:
  * pendingTake
  * pendingSender
  * pendingNodeName
  * pendingNodeIndex
  * pendingCreatedAt
  * suppressCloseBroadcast
  * lastTakeAt

- Centralizes all taxi-related state

--------------------------------------------------------------------------------
[REFACTOR] Split module into private subsystems
--------------------------------------------------------------------------------
- Introduced:
  * TaxiPrivate
  * MountPrivate
  * LootPrivate

- Improves:
  * readability
  * maintainability
  * debugging isolation

--------------------------------------------------------------------------------
[REFACTOR] Add compatibility abstraction layer
--------------------------------------------------------------------------------
- Introduced Compat helpers:
  * IsClassic / IsRetail
  * GetTaxiFrame
  * HasMountJournal
  * CanUseTaxiNodes
  * CloseTaxiMap

- Removes scattered API/version checks
- Improves Retail/Classic compatibility

--------------------------------------------------------------------------------
[FIX] Mount synchronization stability
--------------------------------------------------------------------------------
- Added casting mount tracking:
  * EMA.castingMount
  * EMA.castingMountName

- Fixed mount success detection
- Prevented duplicate or invalid mount triggers

--------------------------------------------------------------------------------
[FIX] Defensive API guards
--------------------------------------------------------------------------------
- Added checks for:
  * LibAuras availability
  * MountJournal functions
  * Taxi node APIs
  * UI frame existence
  * Enum.UIMapSystem

- Prevents runtime errors and nil access

--------------------------------------------------------------------------------
[REFACTOR] Naming cleanup and consistency
--------------------------------------------------------------------------------
- changeTexiTime → changeTaxiTime
- LeavsTaxi → LeavesTaxi
- checkBoxrequestStop → checkBoxRequestStop

--------------------------------------------------------------------------------
[FEATURE] Saved variable migration
--------------------------------------------------------------------------------
- Added EMA:MigrateSettings()
- Automatically migrates legacy typo keys:
  changeTexiTime → changeTaxiTime

--------------------------------------------------------------------------------
[RESULT]
--------------------------------------------------------------------------------
- Followers no longer auto-fly unexpectedly
- Taxi sync is deterministic and master-controlled
- No stale taxi requests persist between interactions
- Improved stability across Retail and Classic
- Codebase significantly more maintainable
================================================================================
@Thrumbar
Copy link
Copy Markdown
Author

This started when group members would not take the flight with leader. Cause was window was closing before they could..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant