Thread Tools Display Modes
10-25-17, 01:11 PM   #1
ceylina
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Are quit() and logout() now protected?

As of 7.3.2, the functions logout() and quit() are somehow considered protected now. I am trying to look to see if anything has changed that no longer allows you to programmatically call logout or quit() or if there is a new function call that replaces it with the latest patch.

http://wowprogramming.com/docs/api/Quit

This is what happens when trying to call it.
[ADDON_ACTION_FORBIDDEN] AddOn 'quickQuit' tried to call the protected function 'Quit()'.

I mean I can hit escape and use the built in exit buttons so that isn't being tainted or anything.
  Reply With Quote
10-25-17, 01:21 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
It appears so. You can still /logout and /quit
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-25-17, 01:25 PM   #3
ceylina
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Sadness. I hate using macros in code. Hopefully someone will figure out the change
  Reply With Quote
10-25-17, 01:59 PM   #4
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
It might not be fully protected, might just require a hardware event. E.g. you can call ReloadUI in a click script on an unprotected button, but you can't call ReloadUI from an event handler or an update script.
__________________
  Reply With Quote
10-25-17, 02:08 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
The error say they are only available to the Blizzard UI. You can /run ReloadUI() but not /run Logout() or /run Quit()
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-25-17, 05:07 PM   #6
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 68
Has anyone else noticed an error when you /camp if you have an addon with a SlashCmdList loaded?
__________________
Thomas aka Urnn
  Reply With Quote
10-25-17, 05:36 PM   #7
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by thomasjohnshannon View Post
Has anyone else noticed an error when you /camp if you have an addon with a SlashCmdList loaded?
Yes. They forgot to add the slash handlers for logout and quit to the secure command hash table. The table is populated with all the existing SecureCmdList functions, but logout and quit are declared afterwards with the rest of the unprotected functions.
Lua Code:
  1. -- starting at line 1584
  2. -- Pre-populate the secure command hash table
  3. for index, value in pairs(SecureCmdList) do
  4.     local i = 1;
  5.     local cmdString = _G["SLASH_"..index..i];
  6.     while ( cmdString ) do
  7.         cmdString = strupper(cmdString);
  8.         hash_SecureCmdList[cmdString] = value;  -- add to hash
  9.         i = i + 1;
  10.         cmdString = _G["SLASH_"..index..i];
  11.     end
  12. end

Lua Code:
  1. -- starting at line 1700
  2. SlashCmdList["LOGOUT"] = function(msg)
  3.     Logout();
  4. end
  5.  
  6. SlashCmdList["QUIT"] = function(msg)
  7.     if (IsKioskModeEnabled()) then
  8.         return;
  9.     end
  10.     Quit();
  11. end

This should be reported as a bug.
__________________

Last edited by MunkDev : 10-26-17 at 05:59 PM.
  Reply With Quote
10-26-17, 10:42 AM   #8
thomasjohnshannon
A Theradrim Guardian
 
thomasjohnshannon's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 68
Originally Posted by MunkDev View Post
It might not be fully protected, might just require a hardware event. E.g. you can call ReloadUI in a click script on an unprotected button, but you can't call ReloadUI from an event handler or an update script.
I did a quick test with a static popup and it seems to be totally protected.
__________________
Thomas aka Urnn
  Reply With Quote
11-12-17, 12:08 PM   #9
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
In other words, LDB Exit_Buton is completely useless and can't be repaired ATM?
  Reply With Quote
11-13-17, 08:27 PM   #10
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,237
Originally Posted by AnrDaemon View Post
In other words, LDB Exit_Buton is completely useless and can't be repaired ATM?
Correct. +10 characters.
  Reply With Quote
11-13-17, 09:59 PM   #11
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Lua Code:
  1. local button = CreateFrame('Button', 'ExitButton', nil, 'InsecureActionButtonTemplate')
  2. button:SetAttribute('type', 'macro')
  3. button:SetAttribute('macrotext', '/exit')

...should work.
__________________
  Reply With Quote
11-17-17, 05:45 PM   #12
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Originally Posted by MunkDev View Post
Lua Code:
  1. local button = CreateFrame('Button', 'ExitButton', nil, 'InsecureActionButtonTemplate')
  2. button:SetAttribute('type', 'macro')
  3. button:SetAttribute('macrotext', '/exit')

...should work.
It does work.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Are quit() and logout() now protected?

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