summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-01-26 00:09:51 +0300
committerAndrei Karas <akaras@inbox.ru>2019-01-26 00:09:51 +0300
commitb6d97f404432d9cf6c84538c4d5f6f14e078ade3 (patch)
tree10339eb71797c794fa6ebd5e6371d1bb1494353a
parent4e2ceec09d767063ade469e6cb810a06d1e6249d (diff)
downloadmanaplus-b6d97f404432d9cf6c84538c4d5f6f14e078ade3.tar.gz
manaplus-b6d97f404432d9cf6c84538c4d5f6f14e078ade3.tar.bz2
manaplus-b6d97f404432d9cf6c84538c4d5f6f14e078ade3.tar.xz
manaplus-b6d97f404432d9cf6c84538c4d5f6f14e078ade3.zip
Add packet CMSG_CAMERA_INFO 0x0a77
-rw-r--r--src/net/eathena/maphandler.cpp16
-rw-r--r--src/net/eathena/maphandler.h5
-rw-r--r--src/net/eathena/packetsout.inc7
-rw-r--r--src/net/maphandler.h5
-rw-r--r--src/net/messageout.cpp11
-rw-r--r--src/net/messageout.h3
-rw-r--r--src/net/tmwa/maphandler.cpp7
-rw-r--r--src/net/tmwa/maphandler.h5
8 files changed, 59 insertions, 0 deletions
diff --git a/src/net/eathena/maphandler.cpp b/src/net/eathena/maphandler.cpp
index 433e95d36..7054949f2 100644
--- a/src/net/eathena/maphandler.cpp
+++ b/src/net/eathena/maphandler.cpp
@@ -25,6 +25,8 @@
#include "debug.h"
+extern int packetVersion;
+
namespace EAthena
{
@@ -50,4 +52,18 @@ void MapHandler::destroyInstance() const
outMsg.writeInt32(3, "command");
}
+void MapHandler::camera(int action,
+ float range,
+ float rotation,
+ float latitude) const
+{
+ if (packetVersion < 20160525)
+ return;
+ createOutPacket(CMSG_CAMERA_INFO);
+ outMsg.writeInt8(action, "action");
+ outMsg.writeFloat(range, "range");
+ outMsg.writeFloat(rotation, "rotation");
+ outMsg.writeFloat(latitude, "latitude");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/maphandler.h b/src/net/eathena/maphandler.h
index e8457115e..52f50add4 100644
--- a/src/net/eathena/maphandler.h
+++ b/src/net/eathena/maphandler.h
@@ -38,6 +38,11 @@ class MapHandler final : public Net::MapHandler
void blockPlayCancel() const override final;
void destroyInstance() const override final;
+
+ void camera(int action,
+ float range,
+ float rotation,
+ float latitude) const override final;
};
} // namespace EAthena
diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc
index ca3b0b2d4..7bb87d36d 100644
--- a/src/net/eathena/packetsout.inc
+++ b/src/net/eathena/packetsout.inc
@@ -352,6 +352,7 @@ packet(CMSG_INVENTORY_EXPAND_REJECT, 0x0000, 0, nullptr);
packet(CMSG_SKILL_USE_BEING_START, 0x0000, 0, nullptr);
packet(CMSG_SKILL_USE_BEING_STOP, 0x0000, 0, nullptr);
packet(CMSG_NPC_BARTER_CLOSE, 0x0000, 0, nullptr);
+packet(CMSG_CAMERA_INFO, 0x0000, 0, nullptr);
#else
// 20040713
if (packetVersion >= 20040713)
@@ -1377,6 +1378,12 @@ if (packetVersion >= 20160330)
packet(CMSG_MAIL2_SEND_MAIL, 0x0a6e, -1, clif->pRodexSendMail);
}
+// 20160525
+if (packetVersion >= 20160525)
+{
+ packet(CMSG_CAMERA_INFO, 0x0a77, 15, clif->pCameraInfo);
+}
+
// 20170419
if (packetVersion >= 20170419)
{
diff --git a/src/net/maphandler.h b/src/net/maphandler.h
index 51514b7af..55197f364 100644
--- a/src/net/maphandler.h
+++ b/src/net/maphandler.h
@@ -40,6 +40,11 @@ class MapHandler notfinal
virtual void blockPlayCancel() const = 0;
virtual void destroyInstance() const = 0;
+
+ virtual void camera(int action,
+ float range,
+ float rotation,
+ float latitude) const = 0;
};
} // namespace Net
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp
index 0e7709b8b..cfbc90554 100644
--- a/src/net/messageout.cpp
+++ b/src/net/messageout.cpp
@@ -130,6 +130,17 @@ void MessageOut::writeBeingId(const BeingId value, const char *const str)
writeInt32(toInt(value, int32_t), str);
}
+void MessageOut::writeFloat(const float value, const char *const str)
+{
+#ifdef ENABLEDEBUGLOG
+ std::string text = strprintf("writeFloat: %f", value);
+ DEBUGLOG2(text.c_str(), mPos, str);
+#endif
+ expand(4);
+ memcpy(mData + CAST_SIZE(mPos), &value, sizeof(float));
+ mPos += 4;
+}
+
#define LOBYTE(w) (CAST_U8(w))
#define HIBYTE(w) (CAST_U8((CAST_U16(w)) >> 8))
diff --git a/src/net/messageout.h b/src/net/messageout.h
index ef7371486..744d167e8 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -91,6 +91,9 @@ class MessageOut notfinal
int length,
const char *const str);
+ void writeFloat(const float value,
+ const char *const str);
+
/**
* Returns the content of the message.
*/
diff --git a/src/net/tmwa/maphandler.cpp b/src/net/tmwa/maphandler.cpp
index 655e4a676..81afd740c 100644
--- a/src/net/tmwa/maphandler.cpp
+++ b/src/net/tmwa/maphandler.cpp
@@ -44,4 +44,11 @@ void MapHandler::destroyInstance() const
{
}
+void MapHandler::camera(int action A_UNUSED,
+ float range A_UNUSED,
+ float rotation A_UNUSED,
+ float latitude A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/maphandler.h b/src/net/tmwa/maphandler.h
index dfc76e7c6..62aacc7a5 100644
--- a/src/net/tmwa/maphandler.h
+++ b/src/net/tmwa/maphandler.h
@@ -38,6 +38,11 @@ class MapHandler final : public Net::MapHandler
void blockPlayCancel() const override final;
void destroyInstance() const override final;
+
+ void camera(int action,
+ float range,
+ float rotation,
+ float latitude) const override final;
};
} // namespace TmwAthena