summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/enums/net/battlegroundtype.h35
-rw-r--r--src/net/battlegroundhandler.h5
-rw-r--r--src/net/eathena/battlegroundhandler.cpp9
-rw-r--r--src/net/eathena/battlegroundhandler.h3
-rw-r--r--src/net/eathena/protocol.h2
-rw-r--r--src/net/tmwa/battlegroundhandler.cpp6
-rw-r--r--src/net/tmwa/battlegroundhandler.h3
7 files changed, 63 insertions, 0 deletions
diff --git a/src/enums/net/battlegroundtype.h b/src/enums/net/battlegroundtype.h
new file mode 100644
index 000000000..43e23a128
--- /dev/null
+++ b/src/enums/net/battlegroundtype.h
@@ -0,0 +1,35 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2014-2015 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ENUMS_NET_BATTLEGROUNDTYPE_H
+#define ENUMS_NET_BATTLEGROUNDTYPE_H
+
+namespace BattleGroundType
+{
+ enum Type
+ {
+ Invalid = 0,
+ Individual = 1,
+ Party = 2,
+ Guild = 4
+ };
+} // namespace BattleGroundType
+
+#endif // ENUMS_NET_BATTLEGROUNDTYPE_H
diff --git a/src/net/battlegroundhandler.h b/src/net/battlegroundhandler.h
index c84b6c27e..11847a8ac 100644
--- a/src/net/battlegroundhandler.h
+++ b/src/net/battlegroundhandler.h
@@ -23,6 +23,8 @@
#ifdef EATHENA_SUPPORT
+#include "enums/net/battlegroundtype.h"
+
#include <string>
#include "localconsts.h"
@@ -35,6 +37,9 @@ class BattleGroundHandler notfinal
public:
virtual ~BattleGroundHandler()
{ }
+
+ virtual void registerBg(const BattleGroundType::Type &type,
+ const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/battlegroundhandler.cpp b/src/net/eathena/battlegroundhandler.cpp
index fa5bbf1aa..91078e141 100644
--- a/src/net/eathena/battlegroundhandler.cpp
+++ b/src/net/eathena/battlegroundhandler.cpp
@@ -22,6 +22,7 @@
#include "logger.h"
+#include "net/eathena/messageout.h"
#include "net/eathena/protocol.h"
#include "debug.h"
@@ -150,4 +151,12 @@ void BattleGroundHandler::processBattleJoined(Net::MessageIn &msg)
msg.readInt32("position");
}
+void BattleGroundHandler::registerBg(const BattleGroundType::Type &type,
+ const std::string &name) const
+{
+ createOutPacket(CMSG_BATTLE_REGISTER);
+ outMsg.writeInt16(static_cast<int16_t>(type), "type");
+ outMsg.writeString(name, 24, "bg name");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/battlegroundhandler.h b/src/net/eathena/battlegroundhandler.h
index 6e30edda1..e2be2a1e5 100644
--- a/src/net/eathena/battlegroundhandler.h
+++ b/src/net/eathena/battlegroundhandler.h
@@ -39,6 +39,9 @@ class BattleGroundHandler final : public MessageHandler,
void handleMessage(Net::MessageIn &msg) override final;
+ void registerBg(const BattleGroundType::Type &type,
+ const std::string &name) const override final;
+
protected:
void processBattleEmblem(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index cb4bcc401..504689647 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -492,6 +492,8 @@
#define CMSG_CHAT_PART_CHANNEL 0x0b09
#define CMSG_BATTLE_CHAT_MESSAGE 0x02db
+#define CMSG_BATTLE_REGISTER 0x08d7
+
#define CMSG_CREAYE_CHAT_ROOM 0x00d5
#define CMSG_LEAVE_CHAT_ROOM 0x00e3
#define CMSG_SET_CHAT_ROOM_OPTIONS 0x00de
diff --git a/src/net/tmwa/battlegroundhandler.cpp b/src/net/tmwa/battlegroundhandler.cpp
index 969628ec2..46c92d81b 100644
--- a/src/net/tmwa/battlegroundhandler.cpp
+++ b/src/net/tmwa/battlegroundhandler.cpp
@@ -42,4 +42,10 @@ void BattleGroundHandler::handleMessage(Net::MessageIn &msg A_UNUSED)
{
}
+void BattleGroundHandler::registerBg(const BattleGroundType::Type &type
+ A_UNUSED,
+ const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/battlegroundhandler.h b/src/net/tmwa/battlegroundhandler.h
index 796d02122..4be16d7a5 100644
--- a/src/net/tmwa/battlegroundhandler.h
+++ b/src/net/tmwa/battlegroundhandler.h
@@ -39,6 +39,9 @@ class BattleGroundHandler final : public MessageHandler,
A_DELETE_COPY(BattleGroundHandler)
void handleMessage(Net::MessageIn &msg) override final;
+
+ void registerBg(const BattleGroundType::Type &type,
+ const std::string &name) const override final;
};
} // namespace TmwAthena