mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
The engine's handler for the three mirror-timer SMSGs (0x005E7990) only reads each packet and signals MIRROR_TIMER_START / _PAUSE / _STOP, so GetMirrorTimerInfo and GetMirrorTimerProgress read a table of our own. A MinHook on that handler fed it by reading the packet and putting the cursor back. The table now reads START (0x1D9) and STOP (0x1DB) as a Net::PacketDispatch subscriber, and the hook is gone. CGPlayer_C::Release (0x005E9AA0) runs StopMirrorTimers (0x005E9B90) for the active player: MIRROR_TIMER_STOP for all three types, with no packet. The table never saw it, so a breath timer stayed after a logout or a loading screen. Release then calls LeaveWorldUI (0x00490A80), which fires PLAYER_LEAVING_WORLD through the no-arg dispatcher. An Event::SignalHook subscriber clears the table on that event. What the functions return: - GetMirrorTimerInfo returns an empty slot as "UNKNOWN" with zeros, the name helper 0x005E7AE0 gives for no type, instead of nothing. Code that tests for "UNKNOWN" on PLAYER_ENTERING_WORLD called its setup with nil before. paused is a number, as the event's %d is, and spellID is a seventh value. - A PAUSE packet no longer changes the table. Tortoise never sends one: it resends START with the paused byte, which the table keeps. - GetMirrorTimerProgress is value + scale * elapsed with no clamp. A timer started paused holds its value. Names match through SStrCmpI, and a name that is not a timer type returns nil. - The time comes from Time::Clock. 0x0042B790 truncates the tick itself and returns it in EAX, so the GetTickCount workaround for an FPU return had no cause. Offsets.h drops the CDataStore readers, the handler and the PAUSE opcode, which nothing reads now, and its comment gives the verified signatures and packet layout. Both functions get API descriptors under the MirrorTimer system. API.md's section is rewritten to match.