mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 2.5.3 - http://otclient.net/showthread.php?tid=275
This commit is contained in:
@@ -125,11 +125,13 @@ end
|
||||
|
||||
function onGameConnectionError(message, code)
|
||||
CharacterList.destroyLoadBox()
|
||||
local text = translateNetworkError(code, g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting(), message)
|
||||
errorBox = displayErrorBox(tr("Connection Error"), text)
|
||||
errorBox.onOk = function()
|
||||
errorBox = nil
|
||||
CharacterList.showAgain()
|
||||
if (not g_game.isOnline() or code ~= 2) and not errorBox then -- code 2 is normal disconnect, end of file
|
||||
local text = translateNetworkError(code, g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting(), message)
|
||||
errorBox = displayErrorBox(tr("Connection Error"), text)
|
||||
errorBox.onOk = function()
|
||||
errorBox = nil
|
||||
CharacterList.showAgain()
|
||||
end
|
||||
end
|
||||
scheduleAutoReconnect()
|
||||
end
|
||||
@@ -144,8 +146,8 @@ function onGameUpdateNeeded(signature)
|
||||
end
|
||||
|
||||
function onGameEnd()
|
||||
CharacterList.showAgain()
|
||||
scheduleAutoReconnect()
|
||||
CharacterList.showAgain()
|
||||
end
|
||||
|
||||
function onLogout()
|
||||
@@ -163,7 +165,7 @@ function scheduleAutoReconnect()
|
||||
end
|
||||
|
||||
function executeAutoReconnect()
|
||||
if not autoReconnectButton or not autoReconnectButton:isOn() then
|
||||
if not autoReconnectButton or not autoReconnectButton:isOn() or g_game.isOnline() then
|
||||
return
|
||||
end
|
||||
if errorBox then
|
||||
|
@@ -63,6 +63,12 @@ local function onUpdateNeeded(protocol, signature)
|
||||
return EnterGame.onError(tr('Your client needs updating, try redownloading it.'))
|
||||
end
|
||||
|
||||
local function onProxyList(protocol, proxies)
|
||||
for _, proxy in ipairs(proxies) do
|
||||
g_proxy.addProxy(proxy["host"], proxy["port"], proxy["priority"])
|
||||
end
|
||||
end
|
||||
|
||||
local function parseFeatures(features)
|
||||
for feature_id, value in pairs(features) do
|
||||
if value == "1" or value == "true" or value == true then
|
||||
@@ -468,6 +474,7 @@ function EnterGame.doLogin()
|
||||
protocolLogin.onSessionKey = onSessionKey
|
||||
protocolLogin.onCharacterList = onCharacterList
|
||||
protocolLogin.onUpdateNeeded = onUpdateNeeded
|
||||
protocolLogin.onProxyList = onProxyList
|
||||
|
||||
EnterGame.hide()
|
||||
loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...'))
|
||||
|
Reference in New Issue
Block a user