diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-13 11:50:48 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-02-13 20:55:48 +0100 |
commit | abeebcba08ff2abc2993657b9043543223dce3d1 (patch) | |
tree | 4850e54c0690df454f9e3e2dcad39f7ea971f8bc /src/net | |
parent | 46ba64726b4261a4c25b579187682508d99b9e32 (diff) | |
download | mana-abeebcba08ff2abc2993657b9043543223dce3d1.tar.gz mana-abeebcba08ff2abc2993657b9043543223dce3d1.tar.bz2 mana-abeebcba08ff2abc2993657b9043543223dce3d1.tar.xz mana-abeebcba08ff2abc2993657b9043543223dce3d1.zip |
Removed no longer supported admin messages
* Removed /announce command
* Changed "Kick player" in player pop-up to kick by name
Other messages, like CMSG_ADMIN_HIDE, CMSG_ADMIN_MUTE and
CMSG_ADMIN_LOCAL_ANNOUNCE were already not used by the client. Also,
none of this was implemented for Manaserv.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/adminhandler.h | 20 | ||||
-rw-r--r-- | src/net/manaserv/adminhandler.cpp | 35 | ||||
-rw-r--r-- | src/net/manaserv/adminhandler.h | 14 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.cpp | 49 | ||||
-rw-r--r-- | src/net/tmwa/adminhandler.h | 14 |
5 files changed, 2 insertions, 130 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index ea436710..492918a7 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -22,36 +22,20 @@ #ifndef ADMINHANDLER_H #define ADMINHANDLER_H -#include <iosfwd> +#include <string> namespace Net { class AdminHandler { public: - virtual ~AdminHandler() {} - - virtual void announce(const std::string &text) = 0; - - virtual void localAnnounce(const std::string &text) = 0; - - virtual void hide(bool hide) = 0; - - virtual void kick(int playerId) = 0; + virtual ~AdminHandler() = default; virtual void kick(const std::string &name) = 0; - virtual void ban(int playerId) = 0; - virtual void ban(const std::string &name) = 0; - virtual void unban(int playerId) = 0; - virtual void unban(const std::string &name) = 0; - - virtual void mute(int playerId, int type, int limit) = 0; - - // TODO }; } // namespace Net diff --git a/src/net/manaserv/adminhandler.cpp b/src/net/manaserv/adminhandler.cpp index 8928a33d..8ba7c47d 100644 --- a/src/net/manaserv/adminhandler.cpp +++ b/src/net/manaserv/adminhandler.cpp @@ -46,54 +46,19 @@ void AdminHandler::handleMessage(MessageIn &msg) } -void AdminHandler::announce(const std::string &text) -{ - // TODO send warning about using @announce instead -} - -void AdminHandler::localAnnounce(const std::string &text) -{ - // TODO add @command for this -} - -void AdminHandler::hide(bool hide) -{ - // TODO -} - -void AdminHandler::kick(int playerId) -{ - // TODO -} - void AdminHandler::kick(const std::string &name) { // TODO } -void AdminHandler::ban(int playerId) -{ - // TODO -} - void AdminHandler::ban(const std::string &name) { // TODO } -void AdminHandler::unban(int playerId) -{ - // TODO -} - void AdminHandler::unban(const std::string &name) { // TODO } -void AdminHandler::mute(int playerId, int type, int limit) -{ - // TODO -} - } // namespace ManaServ diff --git a/src/net/manaserv/adminhandler.h b/src/net/manaserv/adminhandler.h index 1edcf6b6..e3bd02e0 100644 --- a/src/net/manaserv/adminhandler.h +++ b/src/net/manaserv/adminhandler.h @@ -35,25 +35,11 @@ class AdminHandler : public Net::AdminHandler, public MessageHandler void handleMessage(MessageIn &msg) override; - void announce(const std::string &text) override; - - void localAnnounce(const std::string &text) override; - - void hide(bool hide) override; - - void kick(int playerId) override; - void kick(const std::string &name) override; - void ban(int playerId) override; - void ban(const std::string &name) override; - void unban(int playerId) override; - void unban(const std::string &name) override; - - void mute(int playerId, int type, int limit) override; }; } // namespace ManaServ diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 29202eb7..ce2a8264 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -24,18 +24,15 @@ #include "actorspritemanager.h" #include "being.h" #include "event.h" -#include "game.h" #include "playerrelations.h" #include "net/chathandler.h" #include "net/net.h" #include "net/tmwa/messagein.h" -#include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" #include "utils/gettext.h" -#include "utils/stringutils.h" #include <string> @@ -79,65 +76,19 @@ void AdminHandler::handleMessage(MessageIn &msg) } } -void AdminHandler::announce(const std::string &text) -{ - MessageOut outMsg(CMSG_ADMIN_ANNOUNCE); - outMsg.writeInt16(text.length() + 4); - outMsg.writeString(text, text.length()); -} - -void AdminHandler::localAnnounce(const std::string &text) -{ - MessageOut outMsg(CMSG_ADMIN_LOCAL_ANNOUNCE); - outMsg.writeInt16(text.length() + 4); - outMsg.writeString(text, text.length()); -} - -void AdminHandler::hide(bool hide) -{ - MessageOut outMsg(CMSG_ADMIN_HIDE); - outMsg.writeInt32(0); //unused -} - -void AdminHandler::kick(int playerId) -{ - MessageOut outMsg(CMSG_ADMIN_KICK); - outMsg.writeInt32(playerId); -} - void AdminHandler::kick(const std::string &name) { Net::getChatHandler()->talk("@kick " + name); } -void AdminHandler::ban(int playerId) -{ - // Not supported -} - void AdminHandler::ban(const std::string &name) { Net::getChatHandler()->talk("@ban " + name); } -void AdminHandler::unban(int playerId) -{ - // Not supported -} - void AdminHandler::unban(const std::string &name) { Net::getChatHandler()->talk("@unban " + name); } -void AdminHandler::mute(int playerId, int type, int limit) -{ - return; // Still looking into this - - MessageOut outMsg(CMSG_ADMIN_MUTE); - outMsg.writeInt32(playerId); - outMsg.writeInt8(type); - outMsg.writeInt16(limit); -} - } // namespace TmwAthena diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index f91a093d..ce74fd8d 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -36,25 +36,11 @@ class AdminHandler : public MessageHandler, public Net::AdminHandler void handleMessage(MessageIn &msg) override; - void announce(const std::string &text) override; - - void localAnnounce(const std::string &text) override; - - void hide(bool hide) override; - - void kick(int playerId) override; - void kick(const std::string &name) override; - void ban(int playerId) override; - void ban(const std::string &name) override; - void unban(int playerId) override; - void unban(const std::string &name) override; - - void mute(int playerId, int type, int limit) override; }; } // namespace TmwAthena |