Support for client version 7.6

Tell me if there are parts which I should change.

- Not everything is tested yet, feel free to report bugs in 7.6
- the data send in between login opcode and account data might not be
correct, but I could not find any documents showing the right protocol
yet
- Hotkeys working
This commit is contained in:
Sam
2013-10-04 04:09:54 +02:00
parent 7cf645e715
commit 5843b78e87
14 changed files with 240 additions and 111 deletions

View File

@@ -34,11 +34,11 @@ end
function g_game.getSupportedClients()
return {
810, 811, 840, 842, 850, 853, 854,
860, 861, 862, 870, 910, 940, 944,
953, 954, 960, 961, 963, 970, 980,
981, 982, 983, 984, 985, 986, 1001,
1002, 1010
760, 810, 811, 840, 842, 850, 853,
854, 860, 861, 862, 870, 910, 940,
944, 953, 954, 960, 961, 963, 970,
980, 981, 982, 983, 984, 985, 986,
1001, 1002, 1010
}
end

View File

@@ -188,5 +188,9 @@ ClientOpcodes = {
ClientMarketCreate = 246, -- 944
ClientMarketCancel = 247, -- 944
ClientMarketAccept = 248, -- 944
ClientAnswerModalDialog = 249 -- 960
ClientAnswerModalDialog = 249, -- 960
-- 760
ClientEnterAccount760 = 513,
ClientEnterGame760 = 522
}

View File

@@ -27,9 +27,13 @@ end
function ProtocolLogin:sendLoginPacket()
local msg = OutputMessage.create()
msg:addU8(ClientOpcodes.ClientEnterAccount)
msg:addU16(g_game.getOs())
if g_game.getProtocolVersion() == 760 then
msg:addU16(ClientOpcodes.ClientEnterAccount760)
else
msg:addU8(ClientOpcodes.ClientEnterAccount)
msg:addU16(g_game.getOs())
end
msg:addU16(g_game.getProtocolVersion())
if g_game.getProtocolVersion() >= 971 then
@@ -49,14 +53,16 @@ function ProtocolLogin:sendLoginPacket()
-- first RSA byte must be 0
msg:addU8(0)
-- xtea key
self:generateXteaKey()
local xteaKey = self:getXteaKey()
msg:addU32(xteaKey[1])
msg:addU32(xteaKey[2])
msg:addU32(xteaKey[3])
msg:addU32(xteaKey[4])
if g_game.getProtocolVersion() >= 800 then
-- xtea key
self:generateXteaKey()
local xteaKey = self:getXteaKey()
msg:addU32(xteaKey[1])
msg:addU32(xteaKey[2])
msg:addU32(xteaKey[3])
msg:addU32(xteaKey[4])
end
if g_game.getFeature(GameAccountNames) then
msg:addString(self.accountName)
else
@@ -73,14 +79,18 @@ function ProtocolLogin:sendLoginPacket()
local paddingBytes = g_crypt.rsaGetSize() - (msg:getMessageSize() - offset)
assert(paddingBytes >= 0)
msg:addPaddingBytes(paddingBytes, 0)
msg:encryptRsa()
if g_game.getProtocolVersion() >= 800 then
msg:encryptRsa()
end
if g_game.getFeature(GameProtocolChecksum) then
self:enableChecksum()
end
self:send(msg)
self:enableXteaEncryption()
if g_game.getProtocolVersion() >= 800 then
self:enableXteaEncryption()
end
self:recv()
end