diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-05 20:15:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 01:18:57 +0300 |
commit | 8dcda5453e7fec40b1f55a66bf5f60f1b8dbd833 (patch) | |
tree | 512768b20e67c351daca72aad113f2b50dc94a2d /src | |
parent | 223641a3057a5abf0113440601e3b6330287d68b (diff) | |
download | manaverse-8dcda5453e7fec40b1f55a66bf5f60f1b8dbd833.tar.gz manaverse-8dcda5453e7fec40b1f55a66bf5f60f1b8dbd833.tar.bz2 manaverse-8dcda5453e7fec40b1f55a66bf5f60f1b8dbd833.tar.xz manaverse-8dcda5453e7fec40b1f55a66bf5f60f1b8dbd833.zip |
Fix server features initialisation.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.cpp | 7 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 3 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.cpp | 8 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.h | 4 |
8 files changed, 35 insertions, 2 deletions
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 5a18b15f9..0a838c248 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -54,6 +54,7 @@ #include "net/eathena/partyhandler.h" #include "net/eathena/playerhandler.h" #include "net/eathena/protocol.h" +#include "net/eathena/serverfeatures.h" #include "net/eathena/tradehandler.h" #include "net/eathena/skillhandler.h" #include "net/eathena/questhandler.h" @@ -90,7 +91,8 @@ GeneralHandler::GeneralHandler() : mPlayerHandler(new PlayerHandler), mSkillHandler(new SkillHandler), mTradeHandler(new TradeHandler), - mQuestHandler(new QuestHandler) + mQuestHandler(new QuestHandler), + mServerFeatures(new ServerFeatures) { static const uint16_t _messages[] = { diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index c509ef6da..edce8330e 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -30,6 +30,8 @@ namespace EAthena { +class ServerFeatures; + class GeneralHandler final : public MessageHandler, public Net::GeneralHandler { @@ -75,6 +77,7 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mSkillHandler; MessageHandlerPtr mTradeHandler; MessageHandlerPtr mQuestHandler; + ServerFeatures *mServerFeatures; }; } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 3b11842e6..cb0b730e4 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -22,9 +22,16 @@ #include "debug.h" +extern Net::ServerFeatures *serverFeatures; + namespace EAthena { +ServerFeatures::ServerFeatures() +{ + serverFeatures = this; +} + bool ServerFeatures::haveOnlineList() const { return false; diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 79febd773..c15bbb705 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -30,6 +30,10 @@ namespace EAthena class ServerFeatures final : public Net::ServerFeatures { public: + ServerFeatures(); + + A_DELETE_COPY(ServerFeatures) + bool haveOnlineList() const override final; }; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index a31f6d1dc..be33614a2 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -55,6 +55,7 @@ #include "net/tmwa/pethandler.h" #include "net/tmwa/playerhandler.h" #include "net/tmwa/protocol.h" +#include "net/tmwa/serverfeatures.h" #include "net/tmwa/tradehandler.h" #include "net/tmwa/skillhandler.h" #include "net/tmwa/questhandler.h" @@ -92,7 +93,8 @@ GeneralHandler::GeneralHandler() : mPlayerHandler(new PlayerHandler), mSkillHandler(new SkillHandler), mTradeHandler(new TradeHandler), - mQuestHandler(new QuestHandler) + mQuestHandler(new QuestHandler), + mServerFeatures(new ServerFeatures) { static const uint16_t _messages[] = { diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 083483b11..cf2d848f0 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -30,6 +30,8 @@ namespace TmwAthena { +class ServerFeatures; + class GeneralHandler final : public MessageHandler, public Net::GeneralHandler { @@ -76,6 +78,7 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mSkillHandler; MessageHandlerPtr mTradeHandler; MessageHandlerPtr mQuestHandler; + ServerFeatures *mServerFeatures; }; } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index d2aba176b..416183e3f 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -20,13 +20,21 @@ #include "net/tmwa/serverfeatures.h" +#include "net/net.h" + #include "debug.h" extern int serverVersion; +extern Net::ServerFeatures *serverFeatures; namespace TmwAthena { +ServerFeatures::ServerFeatures() +{ + serverFeatures = this; +} + bool ServerFeatures::haveOnlineList() const { return serverVersion >= 3; diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index f6daa2eb7..6b85b887c 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -30,6 +30,10 @@ namespace TmwAthena class ServerFeatures final : public Net::ServerFeatures { public: + ServerFeatures(); + + A_DELETE_COPY(ServerFeatures) + bool haveOnlineList() const override final; }; |