mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Multi-protocol
Lots of chagnes to add multi protocol flexibility, not really completed yet, still have to rework text messages opcodes and other stuff, so this still a working in progress feature * Rework dat reader, the dat reader can now * dinamically detect dat version * Split game into gamelib and game_interface * Lots of other minor changes
This commit is contained in:
47
modules/gamelib/game.lua
Normal file
47
modules/gamelib/game.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
local currentRsa = OTSERV_RSA
|
||||
|
||||
function g_game.getRsa()
|
||||
return currentRsa
|
||||
end
|
||||
|
||||
function g_game.chooseRsa(host)
|
||||
if host:match('.*\.tibia\.com') or host:match('.*\.cipsoft\.com') then
|
||||
currentRsa = CIPSOFT_RSA
|
||||
else
|
||||
currentRsa = OTSERV_RSA
|
||||
end
|
||||
end
|
||||
|
||||
function g_game.setRsa(rsa)
|
||||
currentRsa = rsa
|
||||
end
|
||||
|
||||
function g_game.isOfficialTibia()
|
||||
return currentRsa == CIPSOFT_RSA
|
||||
end
|
||||
|
||||
function g_game.getOsType()
|
||||
if g_game.isOfficialTibia() then
|
||||
if g_app.getOs() == 'windows' then
|
||||
return OsTypes.Windows
|
||||
else
|
||||
return OsTypes.Linux
|
||||
end
|
||||
else
|
||||
if g_app.getOs() == 'windows' then
|
||||
return OsTypes.OtclientWindows
|
||||
elseif g_app.getOs() == 'mac' then
|
||||
return OsTypes.OtclientMac
|
||||
else
|
||||
return OsTypes.OtclientLinux
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function g_game.getSupportedProtocols()
|
||||
return {
|
||||
810, 853, 854, 860, 861, 862, 870, 940,
|
||||
953, 954, 960
|
||||
}
|
||||
end
|
||||
|
Reference in New Issue
Block a user