Fixed not being able to relog after reloading gamelib

This commit is contained in:
TheSumm 2015-01-25 14:17:16 +01:00
parent da2762dac3
commit 4e2ded571e
1 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,5 @@
local currentRsa
function g_game.getRsa() function g_game.getRsa()
return currentRsa return G.currentRsa
end end
function g_game.findPlayerItem(itemId, subType) function g_game.findPlayerItem(itemId, subType)
@ -19,7 +17,7 @@ function g_game.findPlayerItem(itemId, subType)
end end
function g_game.chooseRsa(host) function g_game.chooseRsa(host)
if currentRsa ~= CIPSOFT_RSA and currentRsa ~= OTSERV_RSA then return end if G.currentRsa ~= CIPSOFT_RSA and G.currentRsa ~= OTSERV_RSA then return end
if host:ends('.tibia.com') or host:ends('.cipsoft.com') then if host:ends('.tibia.com') or host:ends('.cipsoft.com') then
g_game.setRsa(CIPSOFT_RSA) g_game.setRsa(CIPSOFT_RSA)
@ -29,7 +27,7 @@ function g_game.chooseRsa(host)
g_game.setCustomOs(OsTypes.Linux) g_game.setCustomOs(OsTypes.Linux)
end end
else else
if currentRsa == CIPSOFT_RSA then if G.currentRsa == CIPSOFT_RSA then
g_game.setCustomOs(-1) g_game.setCustomOs(-1)
end end
g_game.setRsa(OTSERV_RSA) g_game.setRsa(OTSERV_RSA)
@ -44,11 +42,11 @@ end
function g_game.setRsa(rsa, e) function g_game.setRsa(rsa, e)
e = e or '65537' e = e or '65537'
g_crypt.rsaSetPublicKey(rsa, e) g_crypt.rsaSetPublicKey(rsa, e)
currentRsa = rsa G.currentRsa = rsa
end end
function g_game.isOfficialTibia() function g_game.isOfficialTibia()
return currentRsa == CIPSOFT_RSA return G.currentRsa == CIPSOFT_RSA
end end
function g_game.getSupportedClients() function g_game.getSupportedClients()
@ -112,4 +110,6 @@ function g_game.getClientProtocolVersion(client)
return clients[client] or client return clients[client] or client
end end
g_game.setRsa(OTSERV_RSA) if not G.currentRsa then
g_game.setRsa(OTSERV_RSA)
end