Thread Tools Display Modes
01/16/21, 08:05 AM   #1
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Option to shorten the display URL of RequestOpenUnsafeURL

Hello everybody,

I'm currently building an add-on that exports the character's skills and action bars and generates a link for the ESO-Skillfactory.

I use the LUA function RequestOpenUnsafeURL() for the generated URL.
In principle, everything works as planned, but the URL can become very long under certain circumstances (with many skills).

In the game it looks like this:


As you can see the base64 part including the active skills of the character using the whole screen size
Do any of you know a way to abbreviate the displayed URL so that the player still sees the entire confirm dialog? Maybe this is also a topic that ZOS_DanBatson can take a look at

Keldor

Last edited by Keldor : 01/16/21 at 08:07 AM.
  Reply With Quote
01/16/21, 08:49 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,567
Don't think that's what ZOS had in mind when they added this function.
Shortening the URL is unlikely to happen, since they want the user to be able to inspect what is being opened. Maybe they can change the dialog to add a scrollbar though.

You could also look into making your format more efficient so the links become shorter. Is Base64 encoding really needed for example? It will make your url longer than it needs to be when you don't use binary data.
  Reply With Quote
01/16/21, 09:02 AM   #3
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
You are absolutely right, but even without Base64 the URL is only slightly shorter

  Reply With Quote
01/16/21, 09:04 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,567
you could take a look at the base62 encoding I use in LibHistoire for integer values. makes long integer values much shorter.
  Reply With Quote
01/16/21, 09:42 AM   #5
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
I think the best option would be for ZOS to include a textarea for the URL in the dialog

So you don't have to worry about a much longer URL when new skills are added to the game
  Reply With Quote
01/16/21, 09:57 AM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,567
That certainly wouldn't be a bad solution, but you'd still have to be worried, since webservers are limited in how long a url can be and you cannot send post requests from ingame.
  Reply With Quote
01/16/21, 10:38 AM   #7
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
I agree, the URL should not be longer than 2000 characters, luckily I'm still a bit away from that I have published a first version for testing (https://www.esoui.com/downloads/info...ildExport.html).

I will collect ideas how to get the URL shorter. It would be great if someone from ZOS sees the problem with the dialog.
  Reply With Quote
01/16/21, 10:52 AM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,567
One idea that comes to mind would be the use of a lookup table for skills instead of the original ids. The skills that players can unlock are only a very small subset of the available skills in game and that way you get much smaller numbers like 1, 2, 3. If you group together consecutive numbers as e.g. "1-5" you can save even more. You could then also optimize and assign common combinations so they will get a long sequence in your lookup table. In case of new skills that are not supported yet, you can just send the original id.
  Reply With Quote
01/16/21, 11:30 AM   #9
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
That is also a good idea. I have my internal Auto Increment IDs in the database, which start at 1 for the skills.
  Reply With Quote
01/16/21, 03:05 PM   #10
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Thanks for the idea with the internal Ids, sirinsidiator The URL is now quite short. Not perfect but shorter than before

  Reply With Quote
01/16/21, 04:36 PM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Another idea, if this will work:
Use an URL shortener to shorten your starting url
https://www.eso-skillfactory.com/de/...-import/?data=
to something like https://short.url/12345

Depending on the shortened url it might be saving a bit space as well.
But the downside would be that users couldn't see the direct url that opens. But to be true I guess most wouldn't care
  Reply With Quote
01/16/21, 04:52 PM   #12
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
I already had the idea I have now saved a few characters in the URL path by replacing /build-planer/addon-import/ with /import/
  Reply With Quote
01/17/21, 02:55 AM   #13
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,567
Depending on how your webserver is configured, you may also just drop the www and shorten it to https://eso-skillfactory.com/import/. And if it's worth the ~65€ to you, registering an new domain like esoskf.io just for the imports could shave off another few characters.
  Reply With Quote
01/17/21, 07:08 AM   #14
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
That's actually another idea, though I'm quite happy with the current status of the URL

Thanks for your many suggestions here in the thread
  Reply With Quote
01/18/21, 02:31 AM   #15
andy.s
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 40
Use hexadecimal numbers, so e.g. 119 becomes 77
  Reply With Quote
01/19/21, 06:44 AM   #16
Keldor
 
Keldor's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 101
Thanks for the idea with the hexadecimal numbers. But I think that I don't need the conversion currently, because the numbers are already quite small, since I use my own database ids.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Option to shorten the display URL of RequestOpenUnsafeURL

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