@@ -63,11 +63,11 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function(
6363 self :DownloadCharacterList ()
6464 end )
6565 self .controls .accountNameGo .enabled = function ()
66- return self .controls .accountName .buf :match (" %S[#%-(%%23) ]%d%d%d%d$" )
66+ return self .controls .accountName .buf :match (" %S[#%-]%d%d%d%d$" )
6767 end
6868 self .controls .accountNameGo .tooltipFunc = function (tooltip )
6969 tooltip :Clear ()
70- if not self .controls .accountName .buf :match (" [#%-(%%23) ]%d%d%d%d$" ) then
70+ if not self .controls .accountName .buf :match (" [#%-]%d%d%d%d$" ) then
7171 tooltip :AddLine (16 , " ^7Missing discriminator e.g. " .. self .controls .accountName .buf .. " #1234" )
7272 end
7373 end
@@ -99,7 +99,7 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function(
9999
100100 self .controls .accountNameMissingDiscriminator = new (" LabelControl" , {" BOTTOMLEFT" ,self .controls .accountNameUnicode ," TOPLEFT" }, {0 , - 4 , 0 , 18 }, " ^1Missing discriminator e.g. #1234" )
101101 self .controls .accountNameMissingDiscriminator .shown = function ()
102- return not self .controls .accountName .buf :match (" [#%-(%%23) ]%d%d%d%d$" )
102+ return not self .controls .accountName .buf :match (" [#%-]%d%d%d%d$" )
103103 end
104104
105105
@@ -423,8 +423,8 @@ function ImportTabClass:DownloadCharacterList()
423423 else
424424 accountName = self .controls .accountName .buf :gsub (" ^[%s?]+" , " " ):gsub (" [%s?]+$" , " " ):gsub (" %s" , " +" )
425425 end
426+ accountName = accountName :gsub (" (.*)[#%-]" , " %1#" )
426427 local sessionID = # self .controls .sessionInput .buf == 32 and self .controls .sessionInput .buf or (main .gameAccounts [accountName ] and main .gameAccounts [accountName ].sessionID )
427- accountName = ReplaceDiscriminatorSafely (accountName )
428428 launch :DownloadPage (realm .hostName .. " character-window/get-characters?accountName=" .. accountName :gsub (" #" , " %%23" ).. " &realm=" .. realm .realmCode , function (response , errMsg )
429429 if errMsg == " Response code: 401" then
430430 self .charImportStatus = colorCodes .NEGATIVE .. " Sign-in is required."
@@ -469,7 +469,7 @@ function ImportTabClass:DownloadCharacterList()
469469 self .charImportMode = " GETSESSIONID"
470470 return
471471 end
472- realAccountName = ReplaceDiscriminatorSafely ( realAccountName )
472+ realAccountName = realAccountName : gsub ( " (.*)[#%-] " , " %1# " )
473473 accountName = realAccountName
474474 self .controls .accountName :SetText (realAccountName )
475475 self .charImportStatus = " Character list successfully retrieved."
@@ -1139,10 +1139,6 @@ function HexToChar(x)
11391139 return string.char (tonumber (x , 16 ))
11401140end
11411141
1142- function ReplaceDiscriminatorSafely (accountName )
1143- return accountName :gsub (" (.*)[#%-]" , " %1#" )
1144- end
1145-
11461142function UrlDecode (url )
11471143 if url == nil then
11481144 return
0 commit comments