Some changes to charlist

This commit is contained in:
Henrique Santiago 2012-08-07 17:55:05 -03:00
parent 4919bdf1bc
commit 26c682c0dc
2 changed files with 11 additions and 9 deletions

View File

@ -191,17 +191,17 @@ function CharacterList.create(characters, premDays)
local focusLabel
for i,characterInfo in ipairs(characters) do
local characterName = characterInfo[1]
local worldName = characterInfo[2]
local worldHost = characterInfo[3]
local worldIp = characterInfo[4]
local characterName = characterInfo.name
local worldName = characterInfo.worldName
local worldHost = characterInfo.worldIp
local worldPort = characterInfo.worldPort
local label = g_ui.createWidget('CharacterListLabel', characterList)
label:setText(characterName .. ' (' .. worldName .. ')')
label:setPhantom(false)
label.characterName = characterName
label.worldHost = worldHost
label.worldPort = worldIp
label.worldPort = worldPort
connect(label, { onDoubleClick = function () CharacterList.doLogin() return true end } )
@ -214,6 +214,8 @@ function CharacterList.create(characters, premDays)
if premDays > 0 then
accountStatusLabel:setText(tr("Account Status:\nPremium Account (%s) days left", premDays))
else
accountStatusLabel:setText(tr('Account Status:\nFree Account'))
end
end

View File

@ -109,10 +109,10 @@ function ProtocolLogin:parseCharacterList(msg)
local charactersCount = msg:getU8()
for i=1,charactersCount do
local character = {}
character[1] = msg:getString()
character[2] = msg:getString()
character[3] = iptostring(msg:getU32())
character[4] = msg:getU16()
character.name = msg:getString()
character.worldName = msg:getString()
character.worldIp = iptostring(msg:getU32())
character.worldPort = msg:getU16()
characters[i] = character
end
local premDays = msg:getU16()