ManaPlus
Public Member Functions | Protected Attributes
TmwAthena::GeneralHandler Class Reference

#include <generalhandler.h>

Inheritance diagram for TmwAthena::GeneralHandler:
Net::GeneralHandler

Public Member Functions

 GeneralHandler ()
 
 ~GeneralHandler ()
 
void load () const
 
void reload () const
 
void unload () const
 
void flushNetwork () const
 
void flushSend () const
 
void clearHandlers () const
 
void reloadPartially () const
 
void gameStarted () const
 
void gameEnded () const
 
- Public Member Functions inherited from Net::GeneralHandler
 GeneralHandler ()
 

Protected Attributes

AdminHandlermAdminHandler
 
BeingHandlermBeingHandler
 
BuySellHandlermBuySellHandler
 
CharServerHandlermCharServerHandler
 
ChatHandlermChatHandler
 
ClanHandlermClanHandler
 
GameHandlermGameHandler
 
GuildHandlermGuildHandler
 
InventoryHandlermInventoryHandler
 
ItemHandlermItemHandler
 
LoginHandlermLoginHandler
 
NpcHandlermNpcHandler
 
PartyHandlermPartyHandler
 
PetHandlermPetHandler
 
PlayerHandlermPlayerHandler
 
SkillHandlermSkillHandler
 
TradeHandlermTradeHandler
 
QuestHandlermQuestHandler
 
ServerFeaturesmServerFeatures
 
AuctionHandlermAuctionHandler
 
AchievementHandlermAchievementHandler
 
AttendanceHandlermAttendanceHandler
 
BankHandlermBankHandler
 
BattleGroundHandlermBattleGroundHandler
 
BuyingStoreHandlermBuyingStoreHandler
 
CashShopHandlermCashShopHandler
 
ElementalHandlermElementalHandler
 
FamilyHandlermFamilyHandler
 
FriendsHandlermFriendsHandler
 
HomunculusHandlermHomunculusHandler
 
Mail2HandlermMail2Handler
 
MailHandlermMailHandler
 
MapHandlermMapHandler
 
MarketHandlermMarketHandler
 
BarterHandlermBarterHandler
 
MercenaryHandlermMercenaryHandler
 
RefineHandlermRefineHandler
 
RouletteHandlermRouletteHandler
 
SearchStoreHandlermSearchStoreHandler
 
VendingHandlermVendingHandler
 

Detailed Description

Definition at line 72 of file generalhandler.h.

Constructor & Destructor Documentation

◆ GeneralHandler()

TmwAthena::GeneralHandler::GeneralHandler ( )

Definition at line 84 of file generalhandler.cpp.

84  :
85  mAdminHandler(new AdminHandler),
86  mBeingHandler(new BeingHandler),
87  mBuySellHandler(new BuySellHandler),
88  mCharServerHandler(new CharServerHandler),
89  mChatHandler(new ChatHandler),
90  mClanHandler(new ClanHandler),
91  mGameHandler(new GameHandler),
92  mGuildHandler(new GuildHandler),
93  mInventoryHandler(new InventoryHandler),
94  mItemHandler(new ItemHandler),
95  mLoginHandler(new LoginHandler),
96  mNpcHandler(new NpcHandler),
97  mPartyHandler(new PartyHandler),
98  mPetHandler(new PetHandler),
99  mPlayerHandler(new PlayerHandler),
100  mSkillHandler(new SkillHandler),
101  mTradeHandler(new TradeHandler),
102  mQuestHandler(new QuestHandler),
103  mServerFeatures(new ServerFeatures),
104  mAuctionHandler(new AuctionHandler),
105  mAchievementHandler(new AchievementHandler),
106  mAttendanceHandler(new AttendanceHandler),
107  mBankHandler(new BankHandler),
108  mBattleGroundHandler(new BattleGroundHandler),
109  mBuyingStoreHandler(new BuyingStoreHandler),
110  mCashShopHandler(new CashShopHandler),
111  mElementalHandler(new ElementalHandler),
112  mFamilyHandler(new FamilyHandler),
113  mFriendsHandler(new FriendsHandler),
114  mHomunculusHandler(new HomunculusHandler),
115  mMail2Handler(new Mail2Handler),
116  mMailHandler(new MailHandler),
117  mMapHandler(new MapHandler),
118  mMarketHandler(new MarketHandler),
119  mBarterHandler(new BarterHandler),
120  mMercenaryHandler(new MercenaryHandler),
121  mRefineHandler(new RefineHandler),
122  mRouletteHandler(new RouletteHandler),
123  mSearchStoreHandler(new SearchStoreHandler),
124  mVendingHandler(new VendingHandler)
125 {
126  generalHandler = this;
127  logger->log("Creating tmwa handler");
128 }
void log(const char *const log_text,...)
Definition: logger.cpp:269
BuyingStoreHandler * mBuyingStoreHandler
AdminHandler * mAdminHandler
RouletteHandler * mRouletteHandler
LoginHandler * mLoginHandler
InventoryHandler * mInventoryHandler
ElementalHandler * mElementalHandler
RefineHandler * mRefineHandler
PartyHandler * mPartyHandler
GuildHandler * mGuildHandler
AttendanceHandler * mAttendanceHandler
FamilyHandler * mFamilyHandler
PlayerHandler * mPlayerHandler
HomunculusHandler * mHomunculusHandler
TradeHandler * mTradeHandler
MarketHandler * mMarketHandler
BattleGroundHandler * mBattleGroundHandler
VendingHandler * mVendingHandler
AchievementHandler * mAchievementHandler
QuestHandler * mQuestHandler
SkillHandler * mSkillHandler
FriendsHandler * mFriendsHandler
CashShopHandler * mCashShopHandler
BeingHandler * mBeingHandler
ServerFeatures * mServerFeatures
BarterHandler * mBarterHandler
BuySellHandler * mBuySellHandler
CharServerHandler * mCharServerHandler
MercenaryHandler * mMercenaryHandler
AuctionHandler * mAuctionHandler
Mail2Handler * mMail2Handler
SearchStoreHandler * mSearchStoreHandler
Net::GeneralHandler * generalHandler
Definition: net.cpp:88
Logger * logger
Definition: logger.cpp:89

References generalHandler, Logger::log(), and logger.

◆ ~GeneralHandler()

TmwAthena::GeneralHandler::~GeneralHandler ( )
virtual

Reimplemented from Net::GeneralHandler.

Definition at line 130 of file generalhandler.cpp.

References delete2, mAchievementHandler, mAdminHandler, mAttendanceHandler, mAuctionHandler, mBankHandler, mBarterHandler, mBattleGroundHandler, mBeingHandler, mBuyingStoreHandler, mBuySellHandler, mCashShopHandler, mCharServerHandler, mChatHandler, mClanHandler, mElementalHandler, mFamilyHandler, mFriendsHandler, mGameHandler, mGuildHandler, mHomunculusHandler, TmwAthena::Network::mInstance, mInventoryHandler, mItemHandler, mLoginHandler, mMail2Handler, mMailHandler, mMapHandler, mMarketHandler, mMercenaryHandler, mNpcHandler, mPartyHandler, mPetHandler, mPlayerHandler, mQuestHandler, mRefineHandler, mRouletteHandler, mSearchStoreHandler, mServerFeatures, mSkillHandler, mTradeHandler, and mVendingHandler.

Member Function Documentation

◆ clearHandlers()

void TmwAthena::GeneralHandler::clearHandlers ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 241 of file generalhandler.cpp.

242 {
243  if (Network::mInstance != nullptr)
245 }
void clearHandlers()
Definition: network.cpp:93

References TmwAthena::Network::clearHandlers(), and TmwAthena::Network::mInstance.

Referenced by unload().

◆ flushNetwork()

void TmwAthena::GeneralHandler::flushNetwork ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 213 of file generalhandler.cpp.

214 {
215  if (Network::mInstance == nullptr)
216  return;
217 
218  BLOCK_START("GeneralHandler::flushNetwork 1")
219  Network::mInstance->flush();
221  Network::mInstance->dispatchMessages();
222 
224  if (Network::mInstance->getState() == Network::NET_ERROR)
225  {
227  {
229  }
230  else
231  {
232  // TRANSLATORS: error message
233  errorMessage = _("Got disconnected from server!");
234  }
235 
237  }
238  BLOCK_END("GeneralHandler::flushNetwork 3")
239 }
void setState(const StateT state)
Definition: client.h:66
const std::string & getError() const
Definition: network.h:58
Client * client
Definition: client.cpp:118
std::string errorMessage
Definition: client.cpp:116
#define _(s)
Definition: gettext.h:35
if(!vert) return
@ ERROR
Definition: state.h:35
const char * getError()
Definition: sdltcpnet.cpp:99
#define BLOCK_END(name)
Definition: perfomance.h:80
#define BLOCK_START(name)
Definition: perfomance.h:79
std::string empty
Definition: podict.cpp:26

References _, BLOCK_END, BLOCK_START, client, TmwAthena::Network::dispatchMessages(), empty, State::ERROR, errorMessage, Ea::Network::flush(), TcpNet::getError(), Ea::Network::getError(), TmwAthena::Network::mInstance, Ea::Network::NET_ERROR, and Client::setState().

◆ flushSend()

void TmwAthena::GeneralHandler::flushSend ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 205 of file generalhandler.cpp.

206 {
207  if (Network::mInstance == nullptr)
208  return;
209 
211 }
void flush()
Definition: network.cpp:157

References Ea::Network::flush(), and TmwAthena::Network::mInstance.

◆ gameEnded()

void TmwAthena::GeneralHandler::gameEnded ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 253 of file generalhandler.cpp.

254 {
255  if (socialWindow != nullptr)
257 
259 }
bool removeTab(Guild *const guild)
Party * taParty
Definition: partyrecv.cpp:48
PartyTab * partyTab
Definition: partytab.cpp:45
SocialWindow * socialWindow

References delete2, partyTab, SocialWindow::removeTab(), socialWindow, and Ea::taParty.

◆ gameStarted()

void TmwAthena::GeneralHandler::gameStarted ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 247 of file generalhandler.cpp.

248 {
249  if (skillDialog != nullptr)
251 }
void loadSkills()
SkillDialog * skillDialog
Definition: skilldialog.cpp:66

References SkillDialog::loadSkills(), and skillDialog.

◆ load()

void TmwAthena::GeneralHandler::load ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 176 of file generalhandler.cpp.

177 {
178  new Network;
180 }
void registerHandlers()
Definition: network.cpp:87

References TmwAthena::Network::mInstance, and TmwAthena::Network::registerHandlers().

◆ reload()

void TmwAthena::GeneralHandler::reload ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 182 of file generalhandler.cpp.

183 {
184  if (Network::mInstance != nullptr)
186 
187  static_cast<LoginHandler*>(mLoginHandler)->clearWorlds();
188  const CharServerHandler *const charHandler =
189  static_cast<CharServerHandler*>(mCharServerHandler);
190  charHandler->setCharCreateDialog(nullptr);
191  charHandler->setCharSelectDialog(nullptr);
193 }
void disconnect()
Definition: network.cpp:139
static void reload()

References Ea::Network::disconnect(), mCharServerHandler, TmwAthena::Network::mInstance, mLoginHandler, Ea::PartyHandler::reload(), TmwAthena::CharServerHandler::setCharCreateDialog(), and Ea::CharServerHandler::setCharSelectDialog().

◆ reloadPartially()

void TmwAthena::GeneralHandler::reloadPartially ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 195 of file generalhandler.cpp.

196 {
198 }

References Ea::PartyHandler::reload().

◆ unload()

void TmwAthena::GeneralHandler::unload ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 200 of file generalhandler.cpp.

201 {
202  clearHandlers();
203 }

References clearHandlers().

Field Documentation

◆ mAchievementHandler

AchievementHandler* TmwAthena::GeneralHandler::mAchievementHandler
protected

Definition at line 120 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAdminHandler

AdminHandler* TmwAthena::GeneralHandler::mAdminHandler
protected

Definition at line 100 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAttendanceHandler

AttendanceHandler* TmwAthena::GeneralHandler::mAttendanceHandler
protected

Definition at line 121 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAuctionHandler

AuctionHandler* TmwAthena::GeneralHandler::mAuctionHandler
protected

Definition at line 119 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBankHandler

BankHandler* TmwAthena::GeneralHandler::mBankHandler
protected

Definition at line 122 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBarterHandler

BarterHandler* TmwAthena::GeneralHandler::mBarterHandler
protected

Definition at line 134 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBattleGroundHandler

BattleGroundHandler* TmwAthena::GeneralHandler::mBattleGroundHandler
protected

Definition at line 123 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBeingHandler

BeingHandler* TmwAthena::GeneralHandler::mBeingHandler
protected

Definition at line 101 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBuyingStoreHandler

BuyingStoreHandler* TmwAthena::GeneralHandler::mBuyingStoreHandler
protected

Definition at line 124 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBuySellHandler

BuySellHandler* TmwAthena::GeneralHandler::mBuySellHandler
protected

Definition at line 102 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mCashShopHandler

CashShopHandler* TmwAthena::GeneralHandler::mCashShopHandler
protected

Definition at line 125 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mCharServerHandler

CharServerHandler* TmwAthena::GeneralHandler::mCharServerHandler
protected

Definition at line 103 of file generalhandler.h.

Referenced by reload(), and ~GeneralHandler().

◆ mChatHandler

ChatHandler* TmwAthena::GeneralHandler::mChatHandler
protected

Definition at line 104 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mClanHandler

ClanHandler* TmwAthena::GeneralHandler::mClanHandler
protected

Definition at line 105 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mElementalHandler

ElementalHandler* TmwAthena::GeneralHandler::mElementalHandler
protected

Definition at line 126 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mFamilyHandler

FamilyHandler* TmwAthena::GeneralHandler::mFamilyHandler
protected

Definition at line 127 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mFriendsHandler

FriendsHandler* TmwAthena::GeneralHandler::mFriendsHandler
protected

Definition at line 128 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mGameHandler

GameHandler* TmwAthena::GeneralHandler::mGameHandler
protected

Definition at line 106 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mGuildHandler

GuildHandler* TmwAthena::GeneralHandler::mGuildHandler
protected

Definition at line 107 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mHomunculusHandler

HomunculusHandler* TmwAthena::GeneralHandler::mHomunculusHandler
protected

Definition at line 129 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mInventoryHandler

InventoryHandler* TmwAthena::GeneralHandler::mInventoryHandler
protected

Definition at line 108 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mItemHandler

ItemHandler* TmwAthena::GeneralHandler::mItemHandler
protected

Definition at line 109 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mLoginHandler

LoginHandler* TmwAthena::GeneralHandler::mLoginHandler
protected

Definition at line 110 of file generalhandler.h.

Referenced by reload(), and ~GeneralHandler().

◆ mMail2Handler

Mail2Handler* TmwAthena::GeneralHandler::mMail2Handler
protected

Definition at line 130 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMailHandler

MailHandler* TmwAthena::GeneralHandler::mMailHandler
protected

Definition at line 131 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMapHandler

MapHandler* TmwAthena::GeneralHandler::mMapHandler
protected

Definition at line 132 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMarketHandler

MarketHandler* TmwAthena::GeneralHandler::mMarketHandler
protected

Definition at line 133 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMercenaryHandler

MercenaryHandler* TmwAthena::GeneralHandler::mMercenaryHandler
protected

Definition at line 135 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mNpcHandler

NpcHandler* TmwAthena::GeneralHandler::mNpcHandler
protected

Definition at line 111 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPartyHandler

PartyHandler* TmwAthena::GeneralHandler::mPartyHandler
protected

Definition at line 112 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPetHandler

PetHandler* TmwAthena::GeneralHandler::mPetHandler
protected

Definition at line 113 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPlayerHandler

PlayerHandler* TmwAthena::GeneralHandler::mPlayerHandler
protected

Definition at line 114 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mQuestHandler

QuestHandler* TmwAthena::GeneralHandler::mQuestHandler
protected

Definition at line 117 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mRefineHandler

RefineHandler* TmwAthena::GeneralHandler::mRefineHandler
protected

Definition at line 136 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mRouletteHandler

RouletteHandler* TmwAthena::GeneralHandler::mRouletteHandler
protected

Definition at line 137 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mSearchStoreHandler

SearchStoreHandler* TmwAthena::GeneralHandler::mSearchStoreHandler
protected

Definition at line 138 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mServerFeatures

ServerFeatures* TmwAthena::GeneralHandler::mServerFeatures
protected

Definition at line 118 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mSkillHandler

SkillHandler* TmwAthena::GeneralHandler::mSkillHandler
protected

Definition at line 115 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mTradeHandler

TradeHandler* TmwAthena::GeneralHandler::mTradeHandler
protected

Definition at line 116 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mVendingHandler

VendingHandler* TmwAthena::GeneralHandler::mVendingHandler
protected

Definition at line 139 of file generalhandler.h.

Referenced by ~GeneralHandler().


The documentation for this class was generated from the following files: