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:
BenDol
2014-08-03 10:02:28 +12:00
parent fe585d27d8
commit d7429c201c
31 changed files with 316 additions and 121 deletions

View File

@@ -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;