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

#include <generalhandler.h>

Inheritance diagram for EAthena::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
 
Mail2HandlermMail2Handler
 
MailHandlermMailHandler
 
AuctionHandlermAuctionHandler
 
AchievementHandlermAchievementHandler
 
AttendanceHandlermAttendanceHandler
 
CashShopHandlermCashShopHandler
 
FamilyHandlermFamilyHandler
 
BankHandlermBankHandler
 
BattleGroundHandlermBattleGroundHandler
 
MercenaryHandlermMercenaryHandler
 
BuyingStoreHandlermBuyingStoreHandler
 
HomunculusHandlermHomunculusHandler
 
FriendsHandlermFriendsHandler
 
ElementalHandlermElementalHandler
 
MapHandlermMapHandler
 
MarketHandlermMarketHandler
 
BarterHandlermBarterHandler
 
VendingHandlermVendingHandler
 
RefineHandlermRefineHandler
 
RouletteHandlermRouletteHandler
 
SearchStoreHandlermSearchStoreHandler
 

Detailed Description

Definition at line 73 of file generalhandler.h.

Constructor & Destructor Documentation

◆ GeneralHandler()

EAthena::GeneralHandler::GeneralHandler ( )

Definition at line 85 of file generalhandler.cpp.

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

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

◆ ~GeneralHandler()

EAthena::GeneralHandler::~GeneralHandler ( )
virtual

Reimplemented from Net::GeneralHandler.

Definition at line 131 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, EAthena::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 EAthena::GeneralHandler::clearHandlers ( ) const
virtual

Implements Net::GeneralHandler.

Definition at line 238 of file generalhandler.cpp.

239 {
240  if (Network::mInstance != nullptr)
242 }
void clearHandlers()
Definition: network.cpp:183

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

Referenced by unload().

◆ flushNetwork()

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

Implements Net::GeneralHandler.

Definition at line 214 of file generalhandler.cpp.

215 {
216  if (Network::mInstance == nullptr)
217  return;
218 
221 
222  if (Network::mInstance->getState() == Network::NET_ERROR)
223  {
225  {
227  }
228  else
229  {
230  // TRANSLATORS: error message
231  errorMessage = _("Got disconnected from server!");
232  }
233 
235  }
236 }
void setState(const StateT state)
Definition: client.h:66
void dispatchMessages()
Definition: network.cpp:194
void flush()
Definition: network.cpp:157
const std::string & getError() const
Definition: network.h:58
@ NET_ERROR
Definition: network.h:83
Client * client
Definition: client.cpp:118
std::string errorMessage
Definition: client.cpp:116
#define _(s)
Definition: gettext.h:35
@ ERROR
Definition: state.h:35
const char * getError()
Definition: sdltcpnet.cpp:99
std::string empty
Definition: podict.cpp:26

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

◆ flushSend()

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

Implements Net::GeneralHandler.

Definition at line 206 of file generalhandler.cpp.

207 {
208  if (Network::mInstance == nullptr)
209  return;
210 
212 }

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

◆ gameEnded()

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

Implements Net::GeneralHandler.

Definition at line 250 of file generalhandler.cpp.

251 {
252  if (socialWindow != nullptr)
253  {
256  }
257 
261 }
ClanTab * clanTab
Definition: clantab.cpp:36
bool removeTab(Guild *const guild)
GuildTab * guildTab
Guild * taGuild
Definition: guildhandler.h:99
Party * taParty
Definition: partyrecv.cpp:48
PartyTab * partyTab
Definition: partytab.cpp:45
SocialWindow * socialWindow

References clanTab, delete2, guildTab, partyTab, SocialWindow::removeTab(), socialWindow, EAthena::taGuild, and Ea::taParty.

◆ gameStarted()

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

Implements Net::GeneralHandler.

Definition at line 244 of file generalhandler.cpp.

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

References SkillDialog::loadSkills(), and skillDialog.

◆ load()

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

Implements Net::GeneralHandler.

Definition at line 177 of file generalhandler.cpp.

178 {
179  new Network;
181 }
void registerHandlers()
Definition: network.cpp:125

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

◆ reload()

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

Implements Net::GeneralHandler.

Definition at line 183 of file generalhandler.cpp.

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

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

◆ reloadPartially()

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

Implements Net::GeneralHandler.

Definition at line 196 of file generalhandler.cpp.

197 {
199 }

References Ea::PartyHandler::reload().

◆ unload()

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

Implements Net::GeneralHandler.

Definition at line 201 of file generalhandler.cpp.

202 {
203  clearHandlers();
204 }

References clearHandlers().

Field Documentation

◆ mAchievementHandler

AchievementHandler* EAthena::GeneralHandler::mAchievementHandler
protected

Definition at line 123 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAdminHandler

AdminHandler* EAthena::GeneralHandler::mAdminHandler
protected

Definition at line 101 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAttendanceHandler

AttendanceHandler* EAthena::GeneralHandler::mAttendanceHandler
protected

Definition at line 124 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mAuctionHandler

AuctionHandler* EAthena::GeneralHandler::mAuctionHandler
protected

Definition at line 122 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBankHandler

BankHandler* EAthena::GeneralHandler::mBankHandler
protected

Definition at line 127 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBarterHandler

BarterHandler* EAthena::GeneralHandler::mBarterHandler
protected

Definition at line 136 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBattleGroundHandler

BattleGroundHandler* EAthena::GeneralHandler::mBattleGroundHandler
protected

Definition at line 128 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBeingHandler

BeingHandler* EAthena::GeneralHandler::mBeingHandler
protected

Definition at line 102 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBuyingStoreHandler

BuyingStoreHandler* EAthena::GeneralHandler::mBuyingStoreHandler
protected

Definition at line 130 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mBuySellHandler

BuySellHandler* EAthena::GeneralHandler::mBuySellHandler
protected

Definition at line 103 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mCashShopHandler

CashShopHandler* EAthena::GeneralHandler::mCashShopHandler
protected

Definition at line 125 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mCharServerHandler

CharServerHandler* EAthena::GeneralHandler::mCharServerHandler
protected

Definition at line 104 of file generalhandler.h.

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

◆ mChatHandler

ChatHandler* EAthena::GeneralHandler::mChatHandler
protected

Definition at line 105 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mClanHandler

ClanHandler* EAthena::GeneralHandler::mClanHandler
protected

Definition at line 106 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mElementalHandler

ElementalHandler* EAthena::GeneralHandler::mElementalHandler
protected

Definition at line 133 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mFamilyHandler

FamilyHandler* EAthena::GeneralHandler::mFamilyHandler
protected

Definition at line 126 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mFriendsHandler

FriendsHandler* EAthena::GeneralHandler::mFriendsHandler
protected

Definition at line 132 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mGameHandler

GameHandler* EAthena::GeneralHandler::mGameHandler
protected

Definition at line 107 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mGuildHandler

GuildHandler* EAthena::GeneralHandler::mGuildHandler
protected

Definition at line 108 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mHomunculusHandler

HomunculusHandler* EAthena::GeneralHandler::mHomunculusHandler
protected

Definition at line 131 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mInventoryHandler

InventoryHandler* EAthena::GeneralHandler::mInventoryHandler
protected

Definition at line 109 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mItemHandler

ItemHandler* EAthena::GeneralHandler::mItemHandler
protected

Definition at line 110 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mLoginHandler

LoginHandler* EAthena::GeneralHandler::mLoginHandler
protected

Definition at line 111 of file generalhandler.h.

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

◆ mMail2Handler

Mail2Handler* EAthena::GeneralHandler::mMail2Handler
protected

Definition at line 120 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMailHandler

MailHandler* EAthena::GeneralHandler::mMailHandler
protected

Definition at line 121 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMapHandler

MapHandler* EAthena::GeneralHandler::mMapHandler
protected

Definition at line 134 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMarketHandler

MarketHandler* EAthena::GeneralHandler::mMarketHandler
protected

Definition at line 135 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mMercenaryHandler

MercenaryHandler* EAthena::GeneralHandler::mMercenaryHandler
protected

Definition at line 129 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mNpcHandler

NpcHandler* EAthena::GeneralHandler::mNpcHandler
protected

Definition at line 112 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPartyHandler

PartyHandler* EAthena::GeneralHandler::mPartyHandler
protected

Definition at line 113 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPetHandler

PetHandler* EAthena::GeneralHandler::mPetHandler
protected

Definition at line 114 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mPlayerHandler

PlayerHandler* EAthena::GeneralHandler::mPlayerHandler
protected

Definition at line 115 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mQuestHandler

QuestHandler* EAthena::GeneralHandler::mQuestHandler
protected

Definition at line 118 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mRefineHandler

RefineHandler* EAthena::GeneralHandler::mRefineHandler
protected

Definition at line 138 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mRouletteHandler

RouletteHandler* EAthena::GeneralHandler::mRouletteHandler
protected

Definition at line 139 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mSearchStoreHandler

SearchStoreHandler* EAthena::GeneralHandler::mSearchStoreHandler
protected

Definition at line 140 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mServerFeatures

ServerFeatures* EAthena::GeneralHandler::mServerFeatures
protected

Definition at line 119 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mSkillHandler

SkillHandler* EAthena::GeneralHandler::mSkillHandler
protected

Definition at line 116 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mTradeHandler

TradeHandler* EAthena::GeneralHandler::mTradeHandler
protected

Definition at line 117 of file generalhandler.h.

Referenced by ~GeneralHandler().

◆ mVendingHandler

VendingHandler* EAthena::GeneralHandler::mVendingHandler
protected

Definition at line 137 of file generalhandler.h.

Referenced by ~GeneralHandler().


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