|
@@ -1,7 +1,5 @@
|
1
|
|
-local currentRsa
|
2
|
|
-
|
3
|
1
|
function g_game.getRsa()
|
4
|
|
- return currentRsa
|
|
2
|
+ return G.currentRsa
|
5
|
3
|
end
|
6
|
4
|
|
7
|
5
|
function g_game.findPlayerItem(itemId, subType)
|
|
@@ -19,7 +17,7 @@ function g_game.findPlayerItem(itemId, subType)
|
19
|
17
|
end
|
20
|
18
|
|
21
|
19
|
function g_game.chooseRsa(host)
|
22
|
|
- if currentRsa ~= CIPSOFT_RSA and currentRsa ~= OTSERV_RSA then return end
|
|
20
|
+ if G.currentRsa ~= CIPSOFT_RSA and G.currentRsa ~= OTSERV_RSA then return end
|
23
|
21
|
if host:ends('.tibia.com') or host:ends('.cipsoft.com') then
|
24
|
22
|
g_game.setRsa(CIPSOFT_RSA)
|
25
|
23
|
|
|
@@ -29,7 +27,7 @@ function g_game.chooseRsa(host)
|
29
|
27
|
g_game.setCustomOs(OsTypes.Linux)
|
30
|
28
|
end
|
31
|
29
|
else
|
32
|
|
- if currentRsa == CIPSOFT_RSA then
|
|
30
|
+ if G.currentRsa == CIPSOFT_RSA then
|
33
|
31
|
g_game.setCustomOs(-1)
|
34
|
32
|
end
|
35
|
33
|
g_game.setRsa(OTSERV_RSA)
|
|
@@ -44,11 +42,11 @@ end
|
44
|
42
|
function g_game.setRsa(rsa, e)
|
45
|
43
|
e = e or '65537'
|
46
|
44
|
g_crypt.rsaSetPublicKey(rsa, e)
|
47
|
|
- currentRsa = rsa
|
|
45
|
+ G.currentRsa = rsa
|
48
|
46
|
end
|
49
|
47
|
|
50
|
48
|
function g_game.isOfficialTibia()
|
51
|
|
- return currentRsa == CIPSOFT_RSA
|
|
49
|
+ return G.currentRsa == CIPSOFT_RSA
|
52
|
50
|
end
|
53
|
51
|
|
54
|
52
|
function g_game.getSupportedClients()
|
|
@@ -112,4 +110,6 @@ function g_game.getClientProtocolVersion(client)
|
112
|
110
|
return clients[client] or client
|
113
|
111
|
end
|
114
|
112
|
|
115
|
|
-g_game.setRsa(OTSERV_RSA)
|
|
113
|
+if not G.currentRsa then
|
|
114
|
+ g_game.setRsa(OTSERV_RSA)
|
|
115
|
+end
|