summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-12 22:02:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-12 22:02:58 +0300
commitd559a259e27a6011ab1d608a45443c8c9d310c4f (patch)
treeeb04c61ee70fad2eeb47e45ce606705b9e339257 /src/net/eathena
parent09b39a5ea31dedbaff19ba1030f08809f4d61617 (diff)
downloadplus-d559a259e27a6011ab1d608a45443c8c9d310c4f.tar.gz
plus-d559a259e27a6011ab1d608a45443c8c9d310c4f.tar.bz2
plus-d559a259e27a6011ab1d608a45443c8c9d310c4f.tar.xz
plus-d559a259e27a6011ab1d608a45443c8c9d310c4f.zip
eathena: add partial support for packet SMSG_INSTANCE_START 0x02cb.
Also add empty maphandler.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/maphandler.cpp68
-rw-r--r--src/net/eathena/maphandler.h47
-rw-r--r--src/net/eathena/packets.h2
-rw-r--r--src/net/eathena/protocol.h2
4 files changed, 118 insertions, 1 deletions
diff --git a/src/net/eathena/maphandler.cpp b/src/net/eathena/maphandler.cpp
new file mode 100644
index 000000000..6ac2e8392
--- /dev/null
+++ b/src/net/eathena/maphandler.cpp
@@ -0,0 +1,68 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2011-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/>.
+ */
+
+#include "net/eathena/maphandler.h"
+
+#include "logger.h"
+
+#include "net/ea/eaprotocol.h"
+
+#include "net/eathena/messageout.h"
+#include "net/eathena/protocol.h"
+
+#include "debug.h"
+
+extern Net::MapHandler *mapHandler;
+
+namespace EAthena
+{
+
+MapHandler::MapHandler() :
+ MessageHandler()
+{
+ static const uint16_t _messages[] =
+ {
+ SMSG_INSTANCE_START,
+ 0
+ };
+ handledMessages = _messages;
+ mailHandler = this;
+}
+
+void MapHandler::handleMessage(Net::MessageIn &msg)
+{
+ switch (msg.getId())
+ {
+ case SMSG_INSTANCE_START:
+ processInstanceStart(msg);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void MapHandler::processInstanceStart(Net::MessageIn &msg)
+{
+ msg.readString(61, "instance name");
+ msg.readInt16("flag");
+}
+
+} // namespace EAthena
diff --git a/src/net/eathena/maphandler.h b/src/net/eathena/maphandler.h
new file mode 100644
index 000000000..5d8985db5
--- /dev/null
+++ b/src/net/eathena/maphandler.h
@@ -0,0 +1,47 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2011-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 NET_EATHENA_MAPHANDLER_H
+#define NET_EATHENA_MAPHANDLER_H
+
+#include "net/maphandler.h"
+
+#include "net/eathena/messagehandler.h"
+
+namespace EAthena
+{
+class MessageOut;
+
+class MapHandler final : public MessageHandler, public Net::MapHandler
+{
+ public:
+ MapHandler();
+
+ A_DELETE_COPY(MapHandler)
+
+ void handleMessage(Net::MessageIn &msg) override final;
+
+ protected:
+ void processInstanceStart(Net::MessageIn &msg);
+};
+
+} // namespace EAthena
+
+#endif // NET_EATHENA_MAPHANDLER_H
diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h
index 01dbbbb5f..343867ce4 100644
--- a/src/net/eathena/packets.h
+++ b/src/net/eathena/packets.h
@@ -98,7 +98,7 @@ int16_t packet_lengths[] =
0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -1, -1, 107, 6, -1, 0, 7, 22, 191, 0, 8, 0, 0, 0, 0,
// #0x02C0
- 0, -1, 0, 0, 0, 30, 30, 0, 0, 3, 0, 0, 0, 0, 0, 0,
+ 0, -1, 0, 0, 0, 30, 30, 0, 0, 3, 0, 65, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index a14e46421..3180d45e2 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -414,6 +414,8 @@
#define SMSG_CLASS_CHANGE 0x01b0
+#define SMSG_INSTANCE_START 0x02cb
+
/**********************************
* Packets from client to server *
**********************************/