View Single Post
12/09/18, 09:04 PM   #12
Drakanwulf
 
Drakanwulf's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2017
Posts: 50
Well, I was pleasantly surprised, sirinsidiator, to find that ESO quietly discarded my first attempt to load a duplicate "LoadAddon" via an embedded folder. So I was wrong, again... darn it! But now I know why I was wrong which I did not know before.

The good news is that I also proved to my satisfaction that the "LoadAddon" stub does not interfere with anything ESO does and it can help trap and debug really dumb packaging mistakes. In other words; it doesn't hurt anything and it can help in specific circumstances.

This is the content of a the first LoadAddon folder. This is the folder I would use on the Live servers. LoadAddon loaded without error and successfully created its "LoadAddon" global table. LoadAddon was left running as a Stand-Alone add-on while the other tests were completed.

Code:
## Title: LoadAddon
## Description: A Stand-Alone Stub for loading and updating Stand-Alone Add-ons. 
## Version: 1.0.0
## AddOnVersion: 100
## APIVersion: 100025 100026
## DependsOn:
## SavedVariables:
## Contributors: Seerah, sirinsidiator, Votan, Baertram, and many more
## Author: Drakanwulf & Hawkeye1889

LoadAddon.lua

; This Add-on was not created by, affiliated with, or sponsored by, ZeniMax Media Inc. or its affiliates. 
; The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries.
; All rights reserved
;
; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
And this is the content of the first test of the TestEmbedding folder and manifest file. As you can see, all it does is try to load a "LoadAddon" folder a second time. ESO caught this mistake and quietly disposed of the duplicate load attempt. This is a really good thing. I did not fully comprehend the significance of this improvement until I saw it for myself.

Code:
## Title: LoadAddon
## Description: A Stand-Alone Stub for loading and updating Stand-Alone Add-ons. 
## Version: 1.0.0
## AddOnVersion: 100
## APIVersion: 100025 100026
## DependsOn:
## SavedVariables:
## Contributors: Seerah, sirinsidiator, Votan, Baertram, and many more
## Author: Drakanwulf & Hawkeye1889

LoadAddon

; LoadAddon.lua

; This Add-on was not created by, affiliated with, or sponsored by, ZeniMax Media Inc. or its affiliates. 
; The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries.
; All rights reserved
;
; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
And this is the content of the second test of the TestEmbedding folder and manifest file. As you can see, this test contains a really stupid mistake because the manifest tries to load the "LoadAddon" folder a second time which ESO caught, but ESO did not catch the third attempt to load the "LoadAddon.lua" file itself. ESO passed the third try through to the add-on code when it loaded the add-on by mistake.

Code:
## Title: LoadAddon
## Description: A Stand-Alone Stub for loading and updating Stand-Alone Add-ons. 
## Version: 1.0.0
## AddOnVersion: 100
## APIVersion: 100025 100026
## DependsOn:
## SavedVariables:
## Contributors: Seerah, sirinsidiator, Votan, Baertram, and many more
## Author: Drakanwulf & Hawkeye1889

LoadAddon

LoadAddon.lua

; This Add-on was not created by, affiliated with, or sponsored by, ZeniMax Media Inc. or its affiliates. 
; The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries.
; All rights reserved
;
; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
The attachment is a cropped screenshot of a ZBug window showing the assertion trap message for the really stupid, duplicate attempt. This was a bad thing, in my opinion, because the first load of LoadAddon (AddOnVersion 100) was still running when the "third" load was requested. A "/tbug LoadAddon" command showed that the global "LoadAddon" link was still there after all the tests and rejections had been completed.

I think you can verify what I did by using one of your own Stand-Alone add-ons to corroborate the hiccup in the duplicate load detection and prevention methodology. Anyway, I am a happy camper again. Thanks for all your help and assistance. We can continue this discussion in private on the Gitter channel if you would like to do so.
Attached Thumbnails
Click image for larger version

Name:	ZBug1920x1080.png
Views:	820
Size:	1.24 MB
ID:	1066