Open tflo opened 1 year ago
I took a look at this, it appears to only be an issue with Azjol-Nerub specifically (or at least it's not a global thing). This random character was on my screen today when I logged in, and its URL uses a hyphen, so I'm not sure what the pattern is here.
I'll mess with it some more tonight to see if I can figure it out. If not, I can add a manual override for Azjol-Nerub specifically and go from there.
This random character was on my screen today when I logged in, and its URL uses a hyphen
Weird, yes. As said, I'm in the EU region, so maybe they have really different URI standards in the different regions. I think I remember, but am not 100% sure, that some years ago Azjol-Nerub
(with the hyphen) also worked here, i.e. for the en-GB Armory.
Azjol-Nerub in the US region also doesn't use a hyphen in the URL, whereas Moon Guard does, sorry, I forgot to clarify that I checked that. I have no idea what logic is being used behind the scenes, but I'll see if I can find a pattern later today.
Even weirder then ;)
It seems it depends on what the non-normalized form is: Azjol-Nerub
vs Moon Guard
. The first one has a hyphen in the non-normalized form, the latter has a space.
So maybe the pattern is that a hyphen gets removed, and a space gets replaced by a hyphen?
Just tried with a random name on another realm name with space:
https://worldofwarcraft.blizzard.com/en-gb/character/eu/Aerie-Peak/Rat
…works, whereas with AeriePeak
it doesn't. The non-normalized form is Aerie Peak
.
Replacing en-GB
with en-us
shows the same behavior.
Finally dug into this a bit tonight. The addon calls GameTooltip:GetUnit()
followed by UnitFullName(unit)
, but the latter function always returns the normalized realm name, there doesn't seem to be a way to get the non-normalized realm name from the tooltip. This is a problem because of what the Armory URLs require. Moon Guard
has a space so it needs to be Moon-Guard
, but Azjol-Nerub
needs to become AzjolNerub
. Their normalized realm names are MoonGuard
and AzjolNerub
, however, so I have no way of knowing whether the capital letter in the middle of the string is due to a removed space or hyphen.
I'll have to table this for now, but I'll see if I can come up with a workaround in the future.
I just looked up how LeatrixPlus is doing it – and they are also hardcoding the "special" names:
It seems Blizz's Armory is using the normalized realm name nowadays in their URIs (i.e. without "-", as returned by
GetNormalizedRealmName()
).The addon generates a link with a non-normalized realm name, which doesn't work, at least not in my region (EU):
:warning:
This works: