Thread Tools Display Modes
10-31-15, 09:44 PM   #1
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Differ between logout and reload

I need to know wether I'm logout or just /reload the UI
  • The Event "PLAYER_LOGOUT" triggers for both scenarios which don't help.
  • Also tried to find API that could tell me something about the session time which also ended up in a dead end.
Is it even possible to differ between a "real" logout or a UI-reload?!
__________________

Last edited by syncrow : 10-31-15 at 09:46 PM. Reason: false title
  Reply With Quote
10-31-15, 10:21 PM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by syncrow View Post
I need to know wether I'm logout or just /reload the UI
  • The Event "PLAYER_LOGOUT" triggers for both scenarios which don't help.
  • Also tried to find API that could tell me something about the session time which also ended up in a dead end.
Is it even possible to differ between a "real" logout or a UI-reload?!
If there's no other way, you could hook the functions used when logging out and reloading.
Lua Code:
  1. local _Quit = Quit
  2. local _Logout = Logout
  3. local _ReloadUI = ReloadUI
  4. local _ConsoleExec = ConsoleExec
  5. function Quit()
  6.     -- do something
  7.     return _Quit()
  8. end
  9. function Logout()
  10.     -- do something
  11.     return _Logout()
  12. end
  13. function ReloadUI()
  14.     -- do something
  15.     return _ReloadUI()
  16. end
  17. function ConsoleExec(msg)
  18.     if strlower(msg) == "reloadui" then
  19.         -- do something
  20.     end
  21.     return _ConsoleExec(msg)
  22. end
__________________
  Reply With Quote
10-31-15, 11:24 PM   #3
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Originally Posted by MunkDev View Post
If there's no other way, you could hook the functions used when logging out and reloading.
ReloadUI seems to be not hookable or "PLAYER_LOGOUT" triggers right before the hook.

Nevertheless hooking: Quit(), Logout() and CancelLogout() with "PLAYER_LOGOUT" seems to work flawless!

This helps alot for my music player project!
__________________

Last edited by syncrow : 10-31-15 at 11:29 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Differ between logout and reload

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off