mirror of
https://github.com/edubart/otclient.git
synced 2025-12-22 16:27:10 +01:00
Full protocol 10.74 support (session key), entergame style fixes
This commit is contained in:
@@ -534,7 +534,7 @@ void Game::processWalkCancel(Otc::Direction direction)
|
||||
m_localPlayer->cancelWalk(direction);
|
||||
}
|
||||
|
||||
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldName, const std::string& worldHost, int worldPort, const std::string& characterName, const std::string& authenticatorToken)
|
||||
void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldName, const std::string& worldHost, int worldPort, const std::string& characterName, const std::string& authenticatorToken, const std::string& sessionKey)
|
||||
{
|
||||
if(m_protocolGame || isOnline())
|
||||
stdext::throw_exception("Unable to login into a world while already online or logging.");
|
||||
@@ -549,7 +549,7 @@ void Game::loginWorld(const std::string& account, const std::string& password, c
|
||||
m_localPlayer->setName(characterName);
|
||||
|
||||
m_protocolGame = ProtocolGamePtr(new ProtocolGame);
|
||||
m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName, authenticatorToken);
|
||||
m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName, authenticatorToken, sessionKey);
|
||||
m_characterName = characterName;
|
||||
m_worldName = worldName;
|
||||
}
|
||||
@@ -1456,7 +1456,7 @@ void Game::setProtocolVersion(int version)
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change protocol version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1073))
|
||||
if(version != 0 && (version < 740 || version > 1074))
|
||||
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
|
||||
|
||||
m_protocolVersion = version;
|
||||
@@ -1474,7 +1474,7 @@ void Game::setClientVersion(int version)
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1073))
|
||||
if(version != 0 && (version < 740 || version > 1074))
|
||||
stdext::throw_exception(stdext::format("Client version %d not supported", version));
|
||||
|
||||
m_features.reset();
|
||||
@@ -1614,6 +1614,10 @@ void Game::setClientVersion(int version)
|
||||
enableFeature(Otc::GameAuthenticator);
|
||||
}
|
||||
|
||||
if(version >= 1074) {
|
||||
enableFeature(Otc::GameSessionKey);
|
||||
}
|
||||
|
||||
m_clientVersion = version;
|
||||
|
||||
g_lua.callGlobalField("g_game", "onClientVersionChange", version);
|
||||
|
||||
Reference in New Issue
Block a user