Thread Tools Display Modes
01/25/23, 06:19 AM   #1
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
[Answered]About real time web connection between addon and api

Hi,

I am working on an addon and it will be usefull if i can request an api.

If nothing change since 6 year for security reason ZO disable web request right ?

If it's still disabled :
- an addon can read a file as a stream (and trigger an event when updated) ?
- an addon can read a file that was not already created when addon is loaded ?

Regards
  Reply With Quote
01/25/23, 10:14 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
No, simple answer and answered several times in the past years. Nothing changed.
Savedvariables are the only files that can be read and written to, and that's not in real time.
No web access or data exchange possible.

https://www.esoui.com/forums/showthread.php?t=10064
What addons can and cannot do.

Last edited by Baertram : 01/25/23 at 10:16 AM.
  Reply With Quote
01/25/23, 10:26 AM   #3
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
Well i have read this post about what can't do an addon but i have looked in Tamriel Trad Center addon and found this method calling an external url :

```lua
function TamrielTradeCentrePrice:SearchOnline(itemInfo)
local serverRegion = TamrielTradeCentre.GetCurrentServerRegion()
local url = "https://"
if (serverRegion == "NA") then
url = url .. "us."
else
url = url .. "eu."
end

url = url .. ""

url = url .. "ItemID=" .. itemInfo.ID
url = url .. "&ItemNamePattern=" .. itemInfo.Name

if (itemInfo.TraitID ~= nil) then
url = url .. "&ItemTraitID=" .. itemInfo.TraitID
end

if (itemInfo.QualityID ~= nil) then
url = url .. "&ItemQualityID=" .. itemInfo.QualityID
end

local level = itemInfo.Level
url = url .. "&LevelMin=" .. level .. "&LevelMax=" .. level

local langCode = TamrielTradeCentre:GetLangCode()

if (langCode ~= nil) then
url = url .. "&lang=" .. langCode
end

RequestOpenUnsafeURL(url)
end
```

That's why i was wondering if something change about that point

Last edited by quentinlamamy : 01/25/23 at 10:29 AM.
  Reply With Quote
01/25/23, 10:42 AM   #4
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 626
The above function is to search the Tamriel Trade Centre website for the item. It creates the URL that the website's author expects for his own website. That is all it does.
  Reply With Quote
01/25/23, 11:26 AM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Real-time communication with anything outside the game is something ZOS does not want or allow and their stance on these things has never changed since the game was released. Even if you were to find some way to get around all the limitations put in place, you can rest assure that your method will be removed as soon as possible. They are always watching.
This is also why every author should consider twice before trying to abuse an existing API in unintended ways.
We have seen too many functions removed or nerfed over the years because someone thought they can just do whatever they want.

Here's a wiki page with a list of things you should not do, which I update whenever something gets deemed unacceptable by ZOS. Please give it a read.
  Reply With Quote
01/25/23, 02:53 PM   #6
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
I think about using a software in background making the middleware between addon and my api , writing inside file (saved var ?) and read it in game (with a refresh button) it should work ? and be legit ?
  Reply With Quote
01/25/23, 04:21 PM   #7
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 626
The saved vars are stored in memory. So if you alter it and reload the UI any changes to the saved vars would be overwritten.

It doesn't matter how much you try to position yourself to do something innocent and with good intentions. It doesn't matter if you try your best to follow all policies to keep from affecting your mod or affecting other mods not related to your project.

The bottom line is you can't assume because you have honest intentions and the API is there that it has to be okay. You can't assume if you follow our guidance and advice that nothing will happen. You can't assume because TTC does something similar that it is okay.

There is a mod called God Send and the server team does not like it nor do they want people sending mass mail. Which has been communicated by zos, we aren't assuming. Just because people use it and it still exists doesn't mean it doesn't cause issues that aren't communicated to us.

I still hear from time to time of account bans from GMs using God Send, so it does happen. Each one feels they are targeted because they know other GMs that use it. Most say CS told them to stop using it and use the guild message of the day, which they feel is not sufficient. Most people are told somehow and complain once once something happens, but they knew they shouldn't do it.

Something more simple that happens is that people can also get a social ban for pressing E too fast to get guild history.

Once ZOS is aware of your mod after you release it and after they see the effect on the server or the game that is when decisions will be made. You will obviously say things like "oh I didn't know" or "I didn't mean to..." but it won't matter at that point.

There is no sharing or updating in real time. Forcing someone to reload their UI could even become a burden to the server. I don't reload my UI regularly for TTC so if your mod causes people to do that frequently zos will take notice. What they do at that point is anyone's guess.

What exists is tolerated at the moment even if zos dislikes it. Someone that comes along and pushes the envelope could cause them to push back and it will have a greater impact then you intended.

You can't really ask the community because we don't make the decisions. What you do is your choice and we really can't stop you but I can say it's probably best to just stop. There is no proving who is right or wrong. You are just asking and you are just getting a response.

Last edited by Sharlikran : 01/25/23 at 04:47 PM.
  Reply With Quote
01/26/23, 04:59 AM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
As sirinsidiator and Sharlikran (in detail) and me already told you you should NOT go on trying as there is no way
(SV are stored in the game memory. Altering it outside the game won't change the memory. Only reloadui does and it will overwrite from ingame memory first, so you're idea won't work and was answered already in several other threads too -> I'll add that to the "what addons cannot do" so one finde it more easily.),
and if any way works out it's not intended to work!


ZOs will shut it down, most likely affecting other API which might (did in the past) break other addons. So please do not start this and make all the other community members here suffer from it in the end just because you think it could be doable and would be legit.

If your really want to know if it's legit ask ZOs!
If they allow it to you, I'd say they should not revert later on. But you should clearly describe them what your idea is, technically.

Thank you for your understanding that not all nice ideas will be doable, or at least not for long, and having downsides for all others in the end.


Edit:

About TTC:
That's why addons like TTC write data to new lua files (no SV!) before the game client starts as afterwards it's not possible anymore. The client of TTC downloads the data and updates a price*lua file in the addon folder (no sv file) for offline usage. It's just loading this file, which needs to exist before the game client starts!

The client, while running next to the game and if enabeld in the ingame addon settings to collect guid listings and upload them to the TTC website, does the following: The addon ingame collects guild listings and writes it to the internal memory. On reloadui it writes data to the SV file.
The client checks for a timestamp change of the SV file, or similar, and uploads the listings to the TTC website.
So this is never a realtime exchange of data. And it is, like Sharlikran wrote above, a gray area and ZOs never allowed (nor totally disallowed) it!

Last edited by Baertram : 01/26/23 at 05:35 AM.
  Reply With Quote
01/26/23, 06:20 AM   #9
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
THks for the answer, even if some of them seems disproportionate, i was just asking a technical question about how sv file are readed, not if i can hack eso ^^

Thks @Baertram, your explaination about ttc file system communication help me to understand how data load works.

Conclusion my addon will just write file, nothing else don't worry
  Reply With Quote
01/26/23, 07:38 AM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Originally Posted by quentinlamamy View Post
THks for the answer, even if some of them seems disproportionate, i was just asking a technical question about how sv file are readed, not if i can hack eso ^^
You are welcome.

As you had asked about Webservices and connections to other websites, afterwards switched to manipulating SV files, and we did not know what your actual goal/idea is:
We just informed you what is not possible and what should not be done/tried.

We better warn too often than having to deal with results afterwards where it might be too late
Next time maybe tell us more about what your desired goal is, in advance, and we could pin-point to that solution/possibilities.
  Reply With Quote
01/26/23, 08:04 AM   #11
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
We better warn too often than having to deal with results afterwards where it might be too late
Sure, to give you more context i want to create an integration of players skill craft inside discord.

With all the information this thread gave to me i seems that it will be

1) An eso addon extract characters craft skills and write it in saved var
2) A local agent who manage discord auth etc, read this file and send it to a discord bot
3) on the discord with specific command you get information about players skills, give groups, display recap table (like trait buddy for ex)
  Reply With Quote
01/26/23, 09:30 AM   #12
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Yep, sounds totally doable if it's only about "Reading the SavedVariables" and "Carfting skills" (which do not change within seconds)
  Reply With Quote
01/26/23, 11:00 AM   #13
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
There is already an addon that works with discord in this exact fashion: https://www.esoui.com/downloads/info...ordStatus.html
Maybe you can improve on that?
  Reply With Quote
01/26/23, 06:52 PM   #14
quentinlamamy
 
quentinlamamy's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2016
Posts: 24
This addon work to make yout own discord profil more beautifull. It's for the player own discord account

My addon goal is to give content to the guild discord and share their member skills it's another feature and another way to work. Seems to be a cool feature, will check that

Now i have some work to understand how to access skills etc (i'm sure there is some lib for that but i want to understand how it work before using a lib )
  Reply With Quote
01/27/23, 12:29 PM   #15
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Search for the object SKILLS_DATA_MANAGER in the esoui sources.

It's created here from class ZO_SkillsDataManager
https://github.com/esoui/esoui/blob/...nager.lua#L274

And provides functions to get the skills info like
GetCraftingSkillLineData(craftingSkillType)
https://github.com/esoui/esoui/blob/...nager.lua#L245

The skillLine should have an index then which can be used with other functions to get the name, rank, morph etc.
e.g.
IsSkillAbilityPurchased(skillType, skillLineIndex, skillIndex)
IsSkillAbilityPassive(skillType, skillLineIndex, skillIndex)



Hope this helps.

Last edited by Baertram : 01/27/23 at 12:34 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » [Answered]About real time web connection between addon and api

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