09/06/22, 10:21 PM | #1 | |
Join Date: Sep 2022
Posts: 2
|
Working around creating insecure dialogs
Hey all! Got an issue:
https://forums.elderscrollsonline.co...n-gamepad-mode Just like in this thread on the forums, where if your addon is the first one to make a gamepad dialog then all further dialogs, like the one activity finder makes when your queue pops, are deemed insecure and gives you errors because of it. Code:
/EsoUI/Ingame/PlayerToPlayer/PlayerToPlayer.lua:1464: Attempt to access a private function 'CancelTaskbarWindowFlash' from insecure code. The callstack became untrusted 3 stack frame(s) from the top. stack traceback: /EsoUI/Ingame/PlayerToPlayer/PlayerToPlayer.lua:1464: in function 'ZO_PlayerToPlayer:RemoveEntryFromIncomingQueueTable' <Locals> self = [table:1]{lastFailedPromptTime = 4047797, hasResurrectPending = F, hasRequiredSoulGem = F, showingResponsePrompt = F, msToDelayToShowPrompt = 500, shouldShowNotificationKeybindLayer = F, isBeingResurrected = F, failedRaidRevives = F, resurrectable = F}, index = 1, incomingEntry = [table:2]{messageFormat = 7700, acceptText = "Ready", seen = T, expiresAtS = 4273.5825195312, pendingResponse = T, dialogTitle = "Activity Finder", incomingType = 13} </Locals> /EsoUI/Ingame/PlayerToPlayer/PlayerToPlayer.lua:1406: in function 'ZO_PlayerToPlayer:Decline' <Locals> self = [table:1], incomingEntry = [table:2], index = 1 </Locals> /EsoUI/Ingame/Globals/InGameDialogs.lua:3590: in function 'buttonCallback' <Locals> dialog = ud </Locals> /EsoUI/Libraries/ZO_Dialog/Gamepad/ZO_GenericDialog_Gamepad.lua:25: in function 'callback' <Locals> pressState = F </Locals> /EsoUI/Libraries/ZO_KeybindStrip/ZO_KeybindStrip.lua:680: in function 'ZO_KeybindStrip:TryHandlingKeybindDown' <Locals> self = [table:3]{batchUpdating = F, insertionId = 500, allowDefaultExit = T}, keybind = "DIALOG_NEGATIVE", buttonOrEtherealDescriptor = ud, keybindButtonDescriptor = [table:4]{onShowCooldown = 2000, sound = "Dialog_Decline", keybind = "DIALOG_NEGATIVE", alignment = 1}, enabled = T </Locals> (tail call): ? /EsoUI/Libraries/ZO_Dialog/ZO_Dialog.lua:1268: in function 'ZO_Dialogs_ButtonKeybindPressed' <Locals> keybind = "DIALOG_NEGATIVE", dialog = ud, handledButton = F </Locals> :1: in function '(main chunk)' <Locals> keybind = "DIALOG_NEGATIVE" </Locals> |
|
09/07/22, 01:53 AM | #2 |
Most gamepad stuff gets initialized deferred means it is not loaded until shown first time. So if you add or hook there it will throw nil errors or get insecure code due to addons adding code before all was loaded properly (inventory at keyboard e.g. often was causing this if you tried to change it before it was initialized properly). ZOs added hook functions like SecurePostHook to circumvent this at keyboard stuff, hopefully at gamepad code too.
code gets tainted if you hook or add into it before it was loaded properly. try to use SecurePostHook at dialog functions to make your hooks secure, or add a ZO_PostHookHandler on the OnShow or OnEffectivelyShown (dialogs control) then hide the dialog directly and show your own dialog. Maybe it will make the original load, make all secure and then your dialogs can work afterwards. Could maybe make it flicker once but after that you maybe are able to replace the complete dialogs without getting insecure errors. |
|
09/07/22, 03:08 AM | #3 | ||
Join Date: Sep 2022
Posts: 2
|
Code:
SecurePostHook(ZO_Armory_Gamepad, "RefreshBuildList", BetterArmory.RefreshBuildList) Code:
SecurePostHook(ZO_ARMORY_MANAGER, "ShowBuildOperationConfirmationDialog", BetterArmory.ShowBuildOperationConfirmationDialog) Your idea to hook and hide the original dialog myself before continuing with my own code sounds like it would work tho! Gotta change and figure out a bunch of stuff to make it work, but I'll leave that for tomorrow methinks. When it's not 4am lol Last edited by Moohemoth : 09/07/22 at 03:12 AM. |
||
ESOUI » Developer Discussions » Lua/XML Help » Working around creating insecure dialogs |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|