summaryrefslogtreecommitdiff
path: root/src/net/eathena/battlegroundhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-11-04 20:19:53 +0300
committerAndrei Karas <akaras@inbox.ru>2016-11-04 21:16:31 +0300
commitc5a5274c86201b74325a8b84ab4543c73959c5d5 (patch)
treedfc3e7a8e584a2f42e1dcd70a8ce9837ac448549 /src/net/eathena/battlegroundhandler.cpp
parentcb6572ebd60ecc525c5a236a26eefc673841f056 (diff)
downloadmanaverse-c5a5274c86201b74325a8b84ab4543c73959c5d5.tar.gz
manaverse-c5a5274c86201b74325a8b84ab4543c73959c5d5.tar.bz2
manaverse-c5a5274c86201b74325a8b84ab4543c73959c5d5.tar.xz
manaverse-c5a5274c86201b74325a8b84ab4543c73959c5d5.zip
Dont send some packets with unsupported server versions.
Diffstat (limited to 'src/net/eathena/battlegroundhandler.cpp')
-rw-r--r--src/net/eathena/battlegroundhandler.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net/eathena/battlegroundhandler.cpp b/src/net/eathena/battlegroundhandler.cpp
index 723ab3bfe..0f92afe84 100644
--- a/src/net/eathena/battlegroundhandler.cpp
+++ b/src/net/eathena/battlegroundhandler.cpp
@@ -26,6 +26,7 @@
#include "debug.h"
extern Net::BattleGroundHandler *battleGroundHandler;
+extern int packetVersion;
namespace EAthena
{
@@ -38,6 +39,8 @@ BattleGroundHandler::BattleGroundHandler()
void BattleGroundHandler::registerBg(const BattleGroundTypeT &type,
const std::string &name) const
{
+ if (packetVersion < 20111005)
+ return;
createOutPacket(CMSG_BATTLE_REGISTER);
outMsg.writeInt16(CAST_S16(type), "type");
outMsg.writeString(name, 24, "bg name");
@@ -45,6 +48,8 @@ void BattleGroundHandler::registerBg(const BattleGroundTypeT &type,
void BattleGroundHandler::rekoveRequest(const std::string &name) const
{
+ if (packetVersion < 20111005)
+ return;
createOutPacket(CMSG_BATTLE_REVOKE);
outMsg.writeString(name, 24, "bg name");
}
@@ -53,6 +58,8 @@ void BattleGroundHandler::beginAck(const bool result,
const std::string &bgName,
const std::string &gameName) const
{
+ if (packetVersion < 20111005)
+ return;
createOutPacket(CMSG_BATTLE_BEGIN_ACK);
outMsg.writeInt8(CAST_S8(result ? 1 : 0), "result");
outMsg.writeString(bgName, 24, "bg name");
@@ -61,6 +68,8 @@ void BattleGroundHandler::beginAck(const bool result,
void BattleGroundHandler::checkState(const std::string &name) const
{
+ if (packetVersion < 20111005)
+ return;
createOutPacket(CMSG_BATTLE_CHECK_STATE);
outMsg.writeString(name, 24, "bg name");
}