|
|
@ -240,7 +240,20 @@ function ProtocolLogin:parseCharacterList(msg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local account = {}
|
|
|
|
local account = {}
|
|
|
|
account.premDays = msg:getU16()
|
|
|
|
if g_game.getProtocolVersion() > 1077 then
|
|
|
|
|
|
|
|
account.status = msg:getU8()
|
|
|
|
|
|
|
|
account.subStatus = msg:getU8()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
account.premDays = msg:getU32()
|
|
|
|
|
|
|
|
if account.premDays ~= 0 and account.premDays ~= 65535 then
|
|
|
|
|
|
|
|
account.premDays = math.floor((account.premDays - os.time()) / 86400)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
account.status = AccountStatus.Ok
|
|
|
|
|
|
|
|
account.premDays = msg:getU16()
|
|
|
|
|
|
|
|
account.subStatus = account.premDays > 0 and SubscriptionStatus.Premium or SubscriptionStatus.Free
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
signalcall(self.onCharacterList, self, characters, account)
|
|
|
|
signalcall(self.onCharacterList, self, characters, account)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -258,4 +271,4 @@ end
|
|
|
|
function ProtocolLogin:onError(msg, code)
|
|
|
|
function ProtocolLogin:onError(msg, code)
|
|
|
|
local text = translateNetworkError(code, self:isConnecting(), msg)
|
|
|
|
local text = translateNetworkError(code, self:isConnecting(), msg)
|
|
|
|
signalcall(self.onLoginError, self, text)
|
|
|
|
signalcall(self.onLoginError, self, text)
|
|
|
|
end
|
|
|
|
end
|
|
|
|