The current issues with SavedVars are related to Zenimax breaking the GetDisplayName function. We managed to cobble together a nice fix/addon for that. It will replaces the buggy version with one that is almost 100% reliable (see details).
http://www.esoui.com/downloads/info6...ayNameFix.html
The thing is: This about the single most dangerous piece of code I wrote in some time.
So I would rather have some more people look at it before adding it to a category minion considers and advertising it on the main forum.
Here is the code.
Manifest/DisplayNameFix.txt:
Code:
## Title: Display Name Fix
## APIVersion: 100007
## OptionalDependsOn: BugEater
DisplayNameFix_Constants.lua
DisplayNameFix.lua
Constants file. To be modified by the user:
Lua Code:
if (DisplayNameFixConstants == nil) then
DisplayNameFixConstants =
{
UserOverride = ""
}
end
And the main course, DisplayNameFix.lua:
Lua Code:
d("Before DNF: " .. GetDisplayName())
--step one: get a reference on the current GDN function
local oldGDN = GetDisplayName
--step two, prepare the sub functions to gather names from specific sources
local function gdnLogin()
--Try to get the login name from the login screen, if user selected "remmeber account name"
local result = GetCVar("AccountName")
if(result ~= nil and string.len(result) >= 1) then
result = DecorateDisplayName(result)
else
result = nil
end
return result
end
local function gdnGuild()
local result = nil
--try to get the name from the Guild member list
if GetNumGuilds() > 0 then
result = GetGuildMemberInfo(GetGuildId(1), GetPlayerGuildMemberIndex(GetGuildId(1)))
end
--check if what you got is at least remotely valid just in case; if not, ignore it
if not (result ~= nil and string.len(result) >= 2 and string.sub(result, 1, 1) == "@") then
result = nil
end
return result
end
local function gdnOverride()
local result = nil
--Extract the value of the override
if(DisplayNameFixConstants ~= nil) then
result = DisplayNameFixConstants.UserOverride
if not (result ~= nil and string.len(result) >= 2 and string.sub(result, 1, 1) == "@") then
result = nil
end
end
return result
end
--Step three, build your actuall function
local function newGDN()
local result = nil
--1. Try out the Login function. If you get a hit, out with it
result = gdnLogin()
if(result ~= nil) then return result end
--2. Try out the Guild function. If you get a hit, out with it
result = gdnGuild()
if(result ~= nil) then return result end
--3. Try the user override. It comes late as the value is shared between all people logging in on this Account.
result = gdnOverride()
if (result~= nil) then return result end
--4. If all failed, at least return the normal function result
return oldGDN ()
end
--Step four, check if the currently used function is buggy. If so, replace it:
local DName = GetDisplayName()
if (DName == nil or string.len(DName) <= 1 or string.sub(result, 1, 1) ~= "@") then
d("DNF is replacing GetDisplayName")
GetDisplayName = newGDN
d("Login Result: ", gdnLogin())
d("Guild Result: ", gdnGuild())
d("UserOverride Result: ", gdnOverride())
end
d("After DNF: " .. GetDisplayName())
Some tests with an extra use of "d" showed that the replaced functions seems to be only called twice after being out in place (one of them is for the saved var system).
If your addons needs the proper DisplayName before the onloaded event, you have to add this one as (optional) dependency. If you only need the name in the loaded event or later (like for accessing saved vars), you have to do nothing.
If nobody finds any mistake I propably put it live and advertise it on Sunday or Monday.