From c1ba61eb566a0a1a2532690ba3bf7e6498bee06b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 13:47:36 +0300 Subject: Remove auto pointers from network code. --- src/net/eathena/generalhandler.cpp | 52 +++++++++++++++++++------------------- src/net/eathena/messagehandler.h | 2 +- src/net/tmwa/generalhandler.cpp | 52 +++++++++++++++++++------------------- src/net/tmwa/messagehandler.h | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index b5206afcc..9ea481f2c 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -185,28 +185,28 @@ void GeneralHandler::load() if (!mNetwork) return; - mNetwork->registerHandler(mAdminHandler.get()); - mNetwork->registerHandler(mBeingHandler.get()); - mNetwork->registerHandler(mBuySellHandler.get()); - mNetwork->registerHandler(mChatHandler.get()); - mNetwork->registerHandler(mCharServerHandler.get()); - mNetwork->registerHandler(mGameHandler.get()); - mNetwork->registerHandler(mGuildHandler.get()); - mNetwork->registerHandler(mInventoryHandler.get()); - mNetwork->registerHandler(mItemHandler.get()); - mNetwork->registerHandler(mLoginHandler.get()); - mNetwork->registerHandler(mNpcHandler.get()); - mNetwork->registerHandler(mPlayerHandler.get()); - mNetwork->registerHandler(mSkillHandler.get()); - mNetwork->registerHandler(mTradeHandler.get()); - mNetwork->registerHandler(mPartyHandler.get()); - mNetwork->registerHandler(mPetHandler.get()); - mNetwork->registerHandler(mQuestHandler.get()); - mNetwork->registerHandler(mMailHandler.get()); - mNetwork->registerHandler(mAuctionHandler.get()); - mNetwork->registerHandler(mCashShopHandler.get()); - mNetwork->registerHandler(mFamilyHandler.get()); - mNetwork->registerHandler(mBankHandler.get()); + mNetwork->registerHandler(mAdminHandler); + mNetwork->registerHandler(mBeingHandler); + mNetwork->registerHandler(mBuySellHandler); + mNetwork->registerHandler(mChatHandler); + mNetwork->registerHandler(mCharServerHandler); + mNetwork->registerHandler(mGameHandler); + mNetwork->registerHandler(mGuildHandler); + mNetwork->registerHandler(mInventoryHandler); + mNetwork->registerHandler(mItemHandler); + mNetwork->registerHandler(mLoginHandler); + mNetwork->registerHandler(mNpcHandler); + mNetwork->registerHandler(mPlayerHandler); + mNetwork->registerHandler(mSkillHandler); + mNetwork->registerHandler(mTradeHandler); + mNetwork->registerHandler(mPartyHandler); + mNetwork->registerHandler(mPetHandler); + mNetwork->registerHandler(mQuestHandler); + mNetwork->registerHandler(mMailHandler); + mNetwork->registerHandler(mAuctionHandler); + mNetwork->registerHandler(mCashShopHandler); + mNetwork->registerHandler(mFamilyHandler); + mNetwork->registerHandler(mBankHandler); } void GeneralHandler::reload() @@ -214,17 +214,17 @@ void GeneralHandler::reload() if (mNetwork) mNetwork->disconnect(); - static_cast(mLoginHandler.get())->clearWorlds(); + static_cast(mLoginHandler)->clearWorlds(); CharServerHandler *const charHandler = static_cast( - mCharServerHandler.get()); + mCharServerHandler); charHandler->setCharCreateDialog(nullptr); charHandler->setCharSelectDialog(nullptr); - static_cast(mPartyHandler.get())->reload(); + static_cast(mPartyHandler)->reload(); } void GeneralHandler::reloadPartially() const { - static_cast(mPartyHandler.get())->reload(); + static_cast(mPartyHandler)->reload(); } void GeneralHandler::unload() diff --git a/src/net/eathena/messagehandler.h b/src/net/eathena/messagehandler.h index 5cbf7e1d9..841c10db9 100644 --- a/src/net/eathena/messagehandler.h +++ b/src/net/eathena/messagehandler.h @@ -50,7 +50,7 @@ class MessageHandler notfinal : public Net::MessageHandler Network *mNetwork; }; -typedef const std::auto_ptr MessageHandlerPtr; +typedef MessageHandler* MessageHandlerPtr; } // namespace EAthena diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index fbf7ec863..90fd3ad79 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -201,28 +201,28 @@ void GeneralHandler::load() if (!mNetwork) return; - mNetwork->registerHandler(mAdminHandler.get()); - mNetwork->registerHandler(mBeingHandler.get()); - mNetwork->registerHandler(mBuySellHandler.get()); - mNetwork->registerHandler(mChatHandler.get()); - mNetwork->registerHandler(mCharServerHandler.get()); - mNetwork->registerHandler(mGameHandler.get()); - mNetwork->registerHandler(mGuildHandler.get()); - mNetwork->registerHandler(mInventoryHandler.get()); - mNetwork->registerHandler(mItemHandler.get()); - mNetwork->registerHandler(mLoginHandler.get()); - mNetwork->registerHandler(mNpcHandler.get()); - mNetwork->registerHandler(mPlayerHandler.get()); - mNetwork->registerHandler(mSkillHandler.get()); - mNetwork->registerHandler(mTradeHandler.get()); - mNetwork->registerHandler(mPartyHandler.get()); - mNetwork->registerHandler(mPetHandler.get()); - mNetwork->registerHandler(mQuestHandler.get()); - mNetwork->registerHandler(mMailHandler.get()); - mNetwork->registerHandler(mAuctionHandler.get()); - mNetwork->registerHandler(mCashShopHandler.get()); - mNetwork->registerHandler(mFamilyHandler.get()); - mNetwork->registerHandler(mBankHandler.get()); + mNetwork->registerHandler(mAdminHandler); + mNetwork->registerHandler(mBeingHandler); + mNetwork->registerHandler(mBuySellHandler); + mNetwork->registerHandler(mChatHandler); + mNetwork->registerHandler(mCharServerHandler); + mNetwork->registerHandler(mGameHandler); + mNetwork->registerHandler(mGuildHandler); + mNetwork->registerHandler(mInventoryHandler); + mNetwork->registerHandler(mItemHandler); + mNetwork->registerHandler(mLoginHandler); + mNetwork->registerHandler(mNpcHandler); + mNetwork->registerHandler(mPlayerHandler); + mNetwork->registerHandler(mSkillHandler); + mNetwork->registerHandler(mTradeHandler); + mNetwork->registerHandler(mPartyHandler); + mNetwork->registerHandler(mPetHandler); + mNetwork->registerHandler(mQuestHandler); + mNetwork->registerHandler(mMailHandler); + mNetwork->registerHandler(mAuctionHandler); + mNetwork->registerHandler(mCashShopHandler); + mNetwork->registerHandler(mFamilyHandler); + mNetwork->registerHandler(mBankHandler); } void GeneralHandler::reload() @@ -230,17 +230,17 @@ void GeneralHandler::reload() if (mNetwork) mNetwork->disconnect(); - static_cast(mLoginHandler.get())->clearWorlds(); + static_cast(mLoginHandler)->clearWorlds(); CharServerHandler *const charHandler = static_cast( - mCharServerHandler.get()); + mCharServerHandler); charHandler->setCharCreateDialog(nullptr); charHandler->setCharSelectDialog(nullptr); - static_cast(mPartyHandler.get())->reload(); + static_cast(mPartyHandler)->reload(); } void GeneralHandler::reloadPartially() const { - static_cast(mPartyHandler.get())->reload(); + static_cast(mPartyHandler)->reload(); } void GeneralHandler::unload() diff --git a/src/net/tmwa/messagehandler.h b/src/net/tmwa/messagehandler.h index 9f87fd6b6..f276ad08b 100644 --- a/src/net/tmwa/messagehandler.h +++ b/src/net/tmwa/messagehandler.h @@ -50,7 +50,7 @@ class MessageHandler notfinal : public Net::MessageHandler Network *mNetwork; }; -typedef const std::auto_ptr MessageHandlerPtr; +typedef MessageHandler* MessageHandlerPtr; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2