From 26c682c0dcacd99b03c60170ecb19230bf0ea5a7 Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Tue, 7 Aug 2012 17:55:05 -0300 Subject: [PATCH] Some changes to charlist --- modules/client_entergame/characterlist.lua | 12 +++++++----- modules/gamelib/protocollogin.lua | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/client_entergame/characterlist.lua b/modules/client_entergame/characterlist.lua index af7e5ed5..99674898 100644 --- a/modules/client_entergame/characterlist.lua +++ b/modules/client_entergame/characterlist.lua @@ -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 diff --git a/modules/gamelib/protocollogin.lua b/modules/gamelib/protocollogin.lua index 7a2cd6ba..d459d90e 100644 --- a/modules/gamelib/protocollogin.lua +++ b/modules/gamelib/protocollogin.lua @@ -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()