Protocol updates up to 10.82

This commit is contained in:
TheSumm
2015-10-24 17:46:53 +02:00
parent d9e8bfff4c
commit 0d8791e1a7
12 changed files with 371 additions and 11 deletions

View File

@@ -1395,6 +1395,48 @@ void Game::seekInContainer(int cid, int index)
m_protocolGame->sendSeekInContainer(cid, index);
}
void Game::buyStoreOffer(int offerId, int productType, const std::string& name)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendBuyStoreOffer(offerId, productType, name);
}
void Game::requestTransactionHistory(int page, int entriesPerPage)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendRequestTransactionHistory(page, entriesPerPage);
}
void Game::requestStoreOffers(const std::string& categoryName)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendRequestStoreOffers(categoryName);
}
void Game::openStore()
{
if(!canPerformGameAction())
return;
m_protocolGame->sendOpenStore();
}
void Game::transferCoins(const std::string& recipient, int amount)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendTransferCoins(recipient, amount);
}
void Game::openTransactionHistory(int entriesPerPage)
{
if(!canPerformGameAction())
return;
m_protocolGame->sendOpenTransactionHistory(entriesPerPage);
}
void Game::ping()
{
if(!m_protocolGame || !m_protocolGame->isConnected())
@@ -1450,7 +1492,7 @@ void Game::setProtocolVersion(int version)
if(isOnline())
stdext::throw_exception("Unable to change protocol version while online");
if(version != 0 && (version < 740 || version > 1076))
if(version != 0 && (version < 740 || version > 1082))
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
m_protocolVersion = version;
@@ -1468,7 +1510,7 @@ void Game::setClientVersion(int version)
if(isOnline())
stdext::throw_exception("Unable to change client version while online");
if(version != 0 && (version < 740 || version > 1076))
if(version != 0 && (version < 740 || version > 1082))
stdext::throw_exception(stdext::format("Client version %d not supported", version));
m_features.reset();
@@ -1620,6 +1662,10 @@ void Game::setClientVersion(int version)
enableFeature(Otc::GameSessionKey);
}
if(version >= 1080) {
enableFeature(Otc::GameIngameStore);
}
m_clientVersion = version;
g_lua.callGlobalField("g_game", "onClientVersionChange", version);