feat: fire PLAYER_LOGOUT event when logout begins

Fire PLAYER_LOGOUT from SMSG_LOGOUT_RESPONSE when the server confirms
logout. Addons use this to save state and perform cleanup before the
player leaves the world.
This commit is contained in:
Kelsi 2026-03-21 11:22:57 -07:00
parent 1fd220de29
commit 1f6865afce

View file

@ -24645,6 +24645,7 @@ void GameHandler::handleLogoutResponse(network::Packet& packet) {
logoutCountdown_ = 20.0f; logoutCountdown_ = 20.0f;
} }
LOG_INFO("Logout response: success, instant=", (int)data.instant); LOG_INFO("Logout response: success, instant=", (int)data.instant);
if (addonEventCallback_) addonEventCallback_("PLAYER_LOGOUT", {});
} else { } else {
// Failure // Failure
addSystemChatMessage("Cannot logout right now."); addSystemChatMessage("Cannot logout right now.");