mirror of
https://github.com/edubart/otclient.git
synced 2025-12-22 16:27:10 +01:00
Started 1050 implementation and fix ups:
* Dat now loads (new animations aren't yet functional). * Fixed the way we reference client versions. TODO: Write new animation functionality & find out protocol changes.
This commit is contained in:
@@ -1475,9 +1475,27 @@ void Game::setProtocolVersion(int version)
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change protocol version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1041))
|
||||
if(version != 0 && (version < 740 || version > 1051))
|
||||
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
|
||||
|
||||
m_protocolVersion = version;
|
||||
|
||||
Proto::buildMessageModesMap(version);
|
||||
|
||||
g_lua.callGlobalField("g_game", "onProtocolVersionChange", version);
|
||||
}
|
||||
|
||||
void Game::setClientVersion(int version)
|
||||
{
|
||||
if(m_clientVersion == version)
|
||||
return;
|
||||
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1051))
|
||||
stdext::throw_exception(stdext::format("Client version %d not supported", version));
|
||||
|
||||
m_features.reset();
|
||||
enableFeature(Otc::GameFormatCreatureName);
|
||||
|
||||
@@ -1585,28 +1603,14 @@ void Game::setProtocolVersion(int version)
|
||||
enableFeature(Otc::GameCreatureIcons);
|
||||
enableFeature(Otc::GameHideNpcNames);
|
||||
}
|
||||
|
||||
|
||||
if(version >= 1038) {
|
||||
enableFeature(Otc::GamePremiumExpiration);
|
||||
}
|
||||
|
||||
m_protocolVersion = version;
|
||||
|
||||
Proto::buildMessageModesMap(version);
|
||||
|
||||
g_lua.callGlobalField("g_game", "onProtocolVersionChange", version);
|
||||
}
|
||||
|
||||
void Game::setClientVersion(int version)
|
||||
{
|
||||
if(m_clientVersion == version)
|
||||
return;
|
||||
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1041))
|
||||
stdext::throw_exception(stdext::format("Client version %d not supported", version));
|
||||
if(version >= 1050) {
|
||||
enableFeature(Otc::GameEnhancedAnimations);
|
||||
}
|
||||
|
||||
m_clientVersion = version;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user