From a39ca8e69e759daca60bd7f6cb2d5cb827d98893 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Mar 2015 01:28:21 +0300 Subject: eathena: add packet CMSG_LOGIN_PING 0x0200. --- src/net/eathena/loginhandler.cpp | 11 +++++++++++ src/net/eathena/loginhandler.h | 2 ++ src/net/eathena/protocol.h | 1 + src/net/loginhandler.h | 2 ++ src/net/tmwa/loginhandler.cpp | 4 ++++ src/net/tmwa/loginhandler.h | 2 ++ 6 files changed, 22 insertions(+) diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index fe10fc335..35797b21a 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -284,4 +284,15 @@ int LoginHandler::supportedOptionalActions() const : Net::RegistrationOptions::SetGenderOnRegister; } +void LoginHandler::ping() const +{ + createOutPacket(CMSG_LOGIN_PING); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); + outMsg.writeInt32(0, "unused"); +} + } // namespace EAthena diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h index 918d5c66d..c1543e627 100644 --- a/src/net/eathena/loginhandler.h +++ b/src/net/eathena/loginhandler.h @@ -61,6 +61,8 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler int supportedOptionalActions() const override final A_WARN_UNUSED; + void ping() const override final; + protected: static void processLoginError2(Net::MessageIn &msg); diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index b8667be22..a8317c988 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -479,6 +479,7 @@ #define CMSG_MAP_SERVER_CONNECT 0x089c #define CMSG_MAP_PING 0x035f /**< Send to server with tick */ +#define CMSG_LOGIN_PING 0x0200 #define CMSG_MAP_LOADED 0x007d #define CMSG_CLIENT_QUIT 0x018A diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index c7dee1fcc..410eb858b 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -95,6 +95,8 @@ class LoginHandler notfinal virtual void sendVersion() const = 0; + virtual void ping() const = 0; + virtual ~LoginHandler() { } diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 62ba4f188..0007f0ffb 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -290,4 +290,8 @@ void LoginHandler::processCharPasswordResponse(Net::MessageIn &msg) } } +void LoginHandler::ping() const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index fa27859c7..fba17a8ae 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -61,6 +61,8 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler void sendVersion() const override final; + void ping() const override final; + static void requestUpdateHosts(); private: -- cgit v1.2.3-60-g2f50