dont reset password on connection errors

This commit is contained in:
Eduardo Bart 2012-01-07 20:25:35 -02:00
parent 196a95f4c0
commit 4a179cd212
3 changed files with 10 additions and 6 deletions

View File

@ -18,10 +18,12 @@ local function clearAccountFields()
Settings.remove('password') Settings.remove('password')
end end
local function onError(protocol, error) local function onError(protocol, message, connectionError)
loadBox:destroy() loadBox:destroy()
if not connectionError then
clearAccountFields() clearAccountFields()
local errorBox = displayErrorBox('Login Error', error) end
local errorBox = displayErrorBox('Login Error', message)
errorBox.onOk = EnterGame.show errorBox.onOk = EnterGame.show
end end

View File

@ -2,8 +2,10 @@
-- you can place any custom user code here -- you can place any custom user code here
Hotkeys.bind('F1', function() Game.talk('exura gran') end) Hotkeys.bind('F1', function() Game.talk('exura gran') end)
Hotkeys.bind('F2', function() Game.talk('exori flam') end) Hotkeys.bind('F2', function() Game.talk('exori frigo') end)
Hotkeys.bind('F3', function() Game.talk('exevo flam hur') end) Hotkeys.bind('F3', function() Game.talk('exevo flam hur') end)
Hotkeys.bind('F4', function() Game.talk('exevo pan') end)
Hotkeys.bind('F5', function() Game.talk('exani tera') end)
Hotkeys.bind('Ctrl+R', function() runscript('otclientrc.lua') end) Hotkeys.bind('Ctrl+R', function() runscript('otclientrc.lua') end)
if rcloaded then if rcloaded then

View File

@ -82,7 +82,7 @@ void ProtocolLogin::onRecv(InputMessage& inputMessage)
void ProtocolLogin::onError(const boost::system::error_code& error) void ProtocolLogin::onError(const boost::system::error_code& error)
{ {
callLuaField("onError", error.message()); callLuaField("onError", error.message(), true);
} }
void ProtocolLogin::sendLoginPacket() void ProtocolLogin::sendLoginPacket()
@ -121,7 +121,7 @@ void ProtocolLogin::sendLoginPacket()
void ProtocolLogin::parseError(InputMessage& inputMessage) void ProtocolLogin::parseError(InputMessage& inputMessage)
{ {
std::string error = inputMessage.getString(); std::string error = inputMessage.getString();
callLuaField("onError", error); callLuaField("onError", error, false);
} }
void ProtocolLogin::parseMOTD(InputMessage& inputMessage) void ProtocolLogin::parseMOTD(InputMessage& inputMessage)