diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:19:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:19:17 +0300 |
commit | 418d749f0d4889904d0b91e825a87e70a08d134c (patch) | |
tree | 5c244fcc48d343dd9ee8f6232b9f0fce92ca06c1 /src/net | |
parent | dc5766216ee50103909d3b5dcdc5747c149855e0 (diff) | |
download | mv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.gz mv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.bz2 mv-418d749f0d4889904d0b91e825a87e70a08d134c.tar.xz mv-418d749f0d4889904d0b91e825a87e70a08d134c.zip |
Remove getter for partyHandler.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/gui/partytab.cpp | 24 | ||||
-rw-r--r-- | src/net/net.cpp | 6 | ||||
-rw-r--r-- | src/net/net.h | 2 | ||||
-rw-r--r-- | src/net/partyhandler.h | 2 |
4 files changed, 15 insertions, 19 deletions
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index 96b52b5e1..937245fc9 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -66,7 +66,7 @@ PartyTab::~PartyTab() void PartyTab::handleInput(const std::string &msg) { - Net::getPartyHandler()->chat(ChatWindow::doReplace(msg)); + partyHandler->chat(ChatWindow::doReplace(msg)); } bool PartyTab::handleCommand(const std::string &restrict type, @@ -81,26 +81,26 @@ bool PartyTab::handleCommand(const std::string &restrict type, } else { - Net::getPartyHandler()->create(args); + partyHandler->create(args); } } else if (type == "invite") { - Net::getPartyHandler()->invite(args); + partyHandler->invite(args); } else if (type == "leave") { - Net::getPartyHandler()->leave(); + partyHandler->leave(); } else if (type == "kick") { - Net::getPartyHandler()->kick(args); + partyHandler->kick(args); } else if (type == "item") { if (args.empty()) { - switch (Net::getPartyHandler()->getShareItems()) + switch (partyHandler->getShareItems()) { case Net::PartyShare::YES: // TRANSLATORS: chat message @@ -132,11 +132,11 @@ bool PartyTab::handleCommand(const std::string &restrict type, switch (opt) { case 1: - Net::getPartyHandler()->setShareItems( + partyHandler->setShareItems( Net::PartyShare::YES); break; case 0: - Net::getPartyHandler()->setShareItems( + partyHandler->setShareItems( Net::PartyShare::NO); break; case -1: @@ -150,7 +150,7 @@ bool PartyTab::handleCommand(const std::string &restrict type, { if (args.empty()) { - switch (Net::getPartyHandler()->getShareExperience()) + switch (partyHandler->getShareExperience()) { case Net::PartyShare::YES: // TRANSLATORS: chat message @@ -182,11 +182,11 @@ bool PartyTab::handleCommand(const std::string &restrict type, switch (opt) { case 1: - Net::getPartyHandler()->setShareExperience( + partyHandler->setShareExperience( Net::PartyShare::YES); break; case 0: - Net::getPartyHandler()->setShareExperience( + partyHandler->setShareExperience( Net::PartyShare::NO); break; case -1: @@ -199,7 +199,7 @@ bool PartyTab::handleCommand(const std::string &restrict type, else if (type == "setleader" && Net::getServerFeatures()->haveChangePartyLeader()) { - Net::getPartyHandler()->changeLeader(args); + partyHandler->changeLeader(args); } else { diff --git a/src/net/net.cpp b/src/net/net.cpp index ee375cfc3..34e4eb345 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -54,6 +54,7 @@ namespace Net class LoginHandler; class MailHandler; class NpcHandler; + class PartyHandler; } Net::AdminHandler *adminHandler = nullptr; @@ -79,11 +80,6 @@ Net::CashShopHandler *cashShopHandler = nullptr; Net::FamilyHandler *familyHandler = nullptr; Net::BankHandler *bankHandler = nullptr; -Net::PartyHandler *Net::getPartyHandler() -{ - return partyHandler; -} - Net::PetHandler *Net::getPetHandler() { return petHandler; diff --git a/src/net/net.h b/src/net/net.h index e550cfc75..8dd94792b 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -36,14 +36,12 @@ namespace Net { -class PartyHandler; class PetHandler; class PlayerHandler; class SkillHandler; class TradeHandler; class ServerFeatures; -PartyHandler *getPartyHandler() A_WARN_UNUSED; PetHandler *getPetHandler() A_WARN_UNUSED; PlayerHandler *getPlayerHandler() A_WARN_UNUSED; SkillHandler *getSkillHandler() A_WARN_UNUSED; diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index ac42fe2cd..f9905c837 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -81,4 +81,6 @@ class PartyHandler notfinal } // namespace Net +extern Net::PartyHandler *partyHandler; + #endif // NET_PARTYHANDLER_H |