From 130ad803401e9d582a2118d9bc92b984222b00f1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 20 Feb 2015 15:35:36 +0300 Subject: eathena: add support for online list packets. --- src/net/eathena/packets.h | 2 +- src/net/eathena/playerhandler.cpp | 6 ++++++ src/net/eathena/protocol.h | 7 +++++-- src/net/eathena/serverfeatures.cpp | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index af745449c..d096fd2c8 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -282,7 +282,7 @@ int16_t packet_lengths[] = //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // #0x0B00 16, -1, 10, -1, -1, -1, -1, 0, 27, 0, -1, -1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // #0x0B40 diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 03dbb2cf5..b5bc87dcf 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -62,6 +62,7 @@ PlayerHandler::PlayerHandler() : SMSG_PLAYER_SKILL_MESSAGE, SMSG_MAP_MASK, SMSG_MAP_MUSIC, + SMSG_ONLINE_LIST, 0 }; handledMessages = _messages; @@ -141,6 +142,10 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) processMapMusic(msg); break; + case SMSG_ONLINE_LIST: + processOnlineList(msg); + break; + default: break; } @@ -249,6 +254,7 @@ void PlayerHandler::respawn() const void PlayerHandler::requestOnlineList() const { + createOutPacket(CMSG_ONLINE_LIST); } void PlayerHandler::updateStatus(const uint8_t status) const diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 73357f562..a9ab76092 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -291,8 +291,7 @@ #define SMSG_MAP_TYPE_PROPERTY2 0x099b #define SMSG_MAP_TYPE 0x01d6 #define SMSG_IGNORE_ALL_RESPONSE 0x00d2 -// unused for now -#define SMSG_ONLINE_LIST 0x0211 + #define SMSG_NPC_COMMAND 0x0B00 #define SMSG_MAP_ACCOUNT_ID 0x0283 @@ -348,6 +347,8 @@ #define SMSG_SEARCHSTORE_OPEN 0x083a #define SMSG_SEARCHSTORE_CLICK_ACK 0x083d +#define SMSG_ONLINE_LIST 0x0b10 + /********************************** * Packets from client to server * **********************************/ @@ -575,4 +576,6 @@ #define CMSG_SET_STATUS 0x0b0e +#define CMSG_ONLINE_LIST 0x0b0f + #endif // NET_EATHENA_PROTOCOL_H diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 182c97186..beb042279 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -37,7 +37,7 @@ ServerFeatures::ServerFeatures() bool ServerFeatures::haveServerOnlineList() const { - return false; + return serverVersion >= 5; } bool ServerFeatures::haveOnlineList() const -- cgit v1.2.3-70-g09d2