mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 21:13:26 +02:00
Dont use boost locale anymore
This commit is contained in:
@@ -111,7 +111,12 @@ end
|
||||
|
||||
function onGameConnectionError(message, code)
|
||||
CharacterList.destroyLoadBox()
|
||||
local text = tr('Your connection has been lost. (err: %d)', code)
|
||||
local text
|
||||
if g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting() then
|
||||
text = tr('Unable to establish a connection. (err: %d)%s', code)
|
||||
else
|
||||
text = tr('Your connection has been lost. (err: %d)', code)
|
||||
end
|
||||
errorBox = displayErrorBox(tr("Connection Error"), text)
|
||||
errorBox.onOk = function()
|
||||
errorBox = nil
|
||||
|
@@ -211,7 +211,7 @@ function EnterGame.doLogin()
|
||||
g_settings.set('port', G.port)
|
||||
|
||||
protocolLogin = ProtocolLogin.create()
|
||||
protocolLogin.onError = onError
|
||||
protocolLogin.onLoginError = onError
|
||||
protocolLogin.onMotd = onMotd
|
||||
protocolLogin.onCharacterList = onCharacterList
|
||||
protocolLogin.onUpdateNeeded = onUpdateNeeded
|
||||
|
@@ -85,6 +85,7 @@ function ProtocolLogin:sendLoginPacket()
|
||||
end
|
||||
|
||||
function ProtocolLogin:onConnect()
|
||||
self.gotConnection = true
|
||||
self:sendLoginPacket()
|
||||
end
|
||||
|
||||
@@ -155,6 +156,11 @@ function ProtocolLogin:parseOpcode(opcode, msg)
|
||||
end
|
||||
|
||||
function ProtocolLogin:onError(msg, code)
|
||||
local text = tr('Your connection has been lost. (err: %d)', code)
|
||||
signalcall(self.onLoginError, self, opcode, text)
|
||||
local text
|
||||
if self:isConnecting() then
|
||||
text = tr('Unable to establish a connection. (err: %d)', code)
|
||||
else
|
||||
text = tr('Your connection has been lost. (err: %d)', code)
|
||||
end
|
||||
signalcall(self.onLoginError, self, text)
|
||||
end
|
Reference in New Issue
Block a user