Question about CallSecureProtected
I was looking at the API page and I noticed it says this:
Quote:
|
I remember asking ZOS that same question a long time ago and they where as surprised to see this code as you are.
The only reason we could think of is that whoever originally wrote it was using one of the game launchers that allowed to circumvent the security system of the api (which is obviously against the TOS) to call protected and private functions just as normal functions from addon code and everyone else just copied it without understanding it. Guess nobody bothered updating the wiki afterwards. :D |
I remember (several years ago though) that calling a secure function directly, without using CallSecureProtected(funcName, ...), was raising lua errors?
|
Quote:
|
If you call a function with CallSecureProtected and the function is not a protected function, then it will fail. You don't specifically have to check if it's protected if you already know from the documentation that it's protected, although if you just assume it is and we change it later to no longer be protected your code will suddenly break if you're not checking first. So, you know, caveat emptor. CallSecureProtected returns a bool telling you if it worked, and if it didn't, it returns a string explaining what what wrong.
Also just as a reminder, protected just means you can't call it during combat. Private means you can't call it at all. |
Quote:
|
Thanks for the explanation Dan, updated the Wiki too.
|
All times are GMT -6. The time now is 08:16 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI