diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-01-05 23:25:29 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-01-16 19:53:59 +0100 |
commit | 79d6471f3950bf9ae062870f4fdcc292073d4b8d (patch) | |
tree | 10f9da723dcc932c9d526a26a7e7ef5504d523ac /src/net/manaserv | |
parent | 81306cf16bd4660b868f24a74b1e731c8a00af95 (diff) | |
download | mana-client-79d6471f3950bf9ae062870f4fdcc292073d4b8d.tar.gz mana-client-79d6471f3950bf9ae062870f4fdcc292073d4b8d.tar.bz2 mana-client-79d6471f3950bf9ae062870f4fdcc292073d4b8d.tar.xz mana-client-79d6471f3950bf9ae062870f4fdcc292073d4b8d.zip |
Fixed adminhandler being not initialized
This fixes a segfault when trying to do /announce on manaserv servers.
Reviewed-by: Bertram, bjorn.
Diffstat (limited to 'src/net/manaserv')
-rw-r--r-- | src/net/manaserv/adminhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/manaserv/adminhandler.h | 6 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.h | 1 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/net/manaserv/adminhandler.cpp b/src/net/manaserv/adminhandler.cpp index db6c22ed..280b0161 100644 --- a/src/net/manaserv/adminhandler.cpp +++ b/src/net/manaserv/adminhandler.cpp @@ -33,9 +33,19 @@ extern Connection *chatServerConnection; AdminHandler::AdminHandler() { + static const uint16_t _messages[] = + { + 0 + }; + handledMessages = _messages; adminHandler = this; } +void AdminHandler::handleMessage(Net::MessageIn &msg) +{ + +} + void AdminHandler::announce(const std::string &text) { MessageOut msg(PCMSG_ANNOUNCE); diff --git a/src/net/manaserv/adminhandler.h b/src/net/manaserv/adminhandler.h index 2d71f409..16c30e1c 100644 --- a/src/net/manaserv/adminhandler.h +++ b/src/net/manaserv/adminhandler.h @@ -24,13 +24,17 @@ #include "net/adminhandler.h" +#include "net/manaserv/messagehandler.h" + namespace ManaServ { -class AdminHandler : public Net::AdminHandler +class AdminHandler : public Net::AdminHandler, public MessageHandler { public: AdminHandler(); + void handleMessage(Net::MessageIn &msg); + void announce(const std::string &text); void localAnnounce(const std::string &text); diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp index a1ba746f..7d82ca39 100644 --- a/src/net/manaserv/generalhandler.cpp +++ b/src/net/manaserv/generalhandler.cpp @@ -30,6 +30,7 @@ #include "gui/skilldialog.h" #include "gui/specialswindow.h" +#include "net/manaserv/adminhandler.h" #include "net/manaserv/beinghandler.h" #include "net/manaserv/buysellhandler.h" #include "net/manaserv/charhandler.h" @@ -67,6 +68,7 @@ ServerInfo gameServer; ServerInfo chatServer; GeneralHandler::GeneralHandler(): + mAdminHandler(new AdminHandler), mBeingHandler(new BeingHandler), mBuySellHandler(new BuySellHandler), mCharHandler(new CharHandler), @@ -97,6 +99,7 @@ GeneralHandler::GeneralHandler(): void GeneralHandler::load() { + registerHandler(mAdminHandler.get()); registerHandler(mBeingHandler.get()); registerHandler(mBuySellHandler.get()); registerHandler(mCharHandler.get()); diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h index 45ded011..6eca4148 100644 --- a/src/net/manaserv/generalhandler.h +++ b/src/net/manaserv/generalhandler.h @@ -49,6 +49,7 @@ class GeneralHandler : public Net::GeneralHandler, public EventListener void event(Event::Channel channel, const Event &event); protected: + MessageHandlerPtr mAdminHandler; MessageHandlerPtr mBeingHandler; MessageHandlerPtr mBuySellHandler; MessageHandlerPtr mCharHandler; |