ManaPlus
Data Structures | Typedefs | Functions | Variables
Net Namespace Reference

Data Structures

class  AchievementHandler
 
class  AdminHandler
 
class  AttendanceHandler
 
class  AuctionHandler
 
class  BankHandler
 
class  BarterHandler
 
class  BattleGroundHandler
 
class  BeingHandler
 
class  BuyingStoreHandler
 
class  BuySellHandler
 
class  CashShopHandler
 
struct  Character
 
class  CharServerHandler
 
class  ChatHandler
 
class  ClanHandler
 
class  Download
 
class  ElementalHandler
 
class  FamilyHandler
 
class  FriendsHandler
 
class  GameHandler
 
class  GeneralHandler
 
class  GuildHandler
 
class  HomunculusHandler
 
class  InventoryHandler
 
class  LoginHandler
 
class  Mail2Handler
 
class  MailHandler
 
class  MapHandler
 
class  MarketHandler
 
class  MercenaryHandler
 
class  MessageIn
 
class  MessageOut
 
class  NpcHandler
 
class  PartyHandler
 
class  PetHandler
 
class  PlayerHandler
 
class  QuestHandler
 
class  RefineHandler
 
class  RouletteHandler
 
class  SearchStoreHandler
 
class  ServerFeatures
 
class  SkillHandler
 
class  TradeHandler
 
class  VendingHandler
 

Typedefs

typedef std::list< Character * > Characters
 

Functions

void connectToServer (const ServerInfo &server)
 
void unload ()
 
ServerTypeT getNetworkType ()
 
void loadIgnorePackets ()
 
bool isIgnorePacket (const int id)
 

Variables

ServerTypeT networkType = ServerType::UNKNOWN
 
std::set< int > ignorePackets
 

Detailed Description

The network communication layer. It is composed of a host of interfaces that interact with different aspects of the game. They have different implementations depending on the type of server the client is connecting to.

Typedef Documentation

◆ Characters

typedef std::list< Character * > Net::Characters

Definition at line 60 of file character.h.

Function Documentation

◆ connectToServer()

void Net::connectToServer ( const ServerInfo server)

Handles server detection and connection

Definition at line 129 of file net.cpp.

130 {
131  BLOCK_START("Net::connectToServer")
132  if (networkType == server.type &&
133  generalHandler != nullptr)
134  {
136  }
137  else
138  {
140  generalHandler != nullptr)
141  {
144  }
145 
146  switch (server.type)
147  {
148  case ServerType::EATHENA:
149  case ServerType::EVOL2:
151  break;
153  case ServerType::UNKNOWN:
154  default:
155 #ifdef TMWA_SUPPORT
157 #else // TMWA_SUPPORT
158 
160 #endif // TMWA_SUPPORT
161 
162  break;
163  }
164 
165  if (generalHandler != nullptr)
166  generalHandler->load();
167 
168  networkType = server.type;
169  }
170 
171  if (loginHandler != nullptr)
172  {
173  loginHandler->setServer(server);
175  }
176  BLOCK_END("Net::connectToServer")
177 }

References BLOCK_END, BLOCK_START, Net::LoginHandler::connect(), delete2, ServerType::EATHENA, ServerType::EVOL2, generalHandler, Net::GeneralHandler::load(), loginHandler, networkType, Net::GeneralHandler::reload(), Net::LoginHandler::setServer(), ServerType::TMWATHENA, ServerInfo::type, ServerType::UNKNOWN, and Net::GeneralHandler::unload().

Referenced by Client::stateConnectServer1().

◆ getNetworkType()

ServerTypeT Net::getNetworkType ( )

Definition at line 188 of file net.cpp.

189 {
190  return networkType;
191 }

References networkType.

Referenced by ChangeDisplay::action(), PopupMenu::addBuySell(), PopupMenu::addCatchPetCommands(), ChatWindow::addChatTab(), PopupMenu::addMailCommands(), PopupMenu::addSocialMenu(), Being::addToCache(), LocalPlayer::attack(), LocalPlayer::attack2(), LocalPlayer::attributeChanged(), CharSelectDialog::CharSelectDialog(), ChatTab::chatLog(), TradeWindow::checkItem(), ActorManager::createBeing(), createGuiWindows(), LocalPlayer::fixPos(), PartyTab::getAutoCompleteCommands(), FloorItem::getName(), Item::getName(), Being::handleAttack(), PartyTab::handleCommand(), Being::handleSkill(), EAthena::ServerFeatures::haveServerVersion(), ActorManager::heal(), GroupDb::isAllowCommand(), PopupMenu::isAllowCommand(), PopupMenu::isAllowOtherCommand(), Being::isBuyShopEnabled(), Being::isSellShopEnabled(), ActorManager::itenplz(), DbManager::loadDb(), LocalPlayer::LocalPlayer(), LocalPlayer::magicAttack(), ShopListBox::mouseReleased(), ItemContainer::mouseReleased(), LocalPlayer::moveToTarget(), LocalPlayer::optionChanged(), Actions::outString(), outStringNormal(), parseDirectionName(), LocalPlayer::pickedUp(), ChatWindow::resortChatLog(), EAthena::LoginHandler::sendLoginRegister(), ItemPopup::setItem(), Being::setState(), PopupMenu::showAdoptCommands(), PopupMenu::showChatPopup(), PopupMenu::showEmoteType(), PopupMenu::showFloorItemGMCommands(), PopupMenu::showItemGMCommands(), PopupMenu::showMonsterGMCommands(), PopupMenu::showMuteCommands(), PopupMenu::showNpcGMCommands(), PopupMenu::showPlayerGMCommands(), PopupMenu::showPopup(), DbManager::unloadDb(), Item::updateColor(), ShopItem::updateDisplayName(), Being::updateFromCache(), and LocalPlayer::updateStatus().

◆ isIgnorePacket()

bool Net::isIgnorePacket ( const int  id)

Definition at line 199 of file net.cpp.

200 {
201  return ignorePackets.find(id) != ignorePackets.end();
202 }

References ignorePackets.

◆ loadIgnorePackets()

void Net::loadIgnorePackets ( )

Definition at line 193 of file net.cpp.

194 {
195  const std::string str = config.getStringValue("ignorelogpackets");
196  splitToIntSet(ignorePackets, str, ',');
197 }

References config, Configuration::getStringValue(), ignorePackets, and splitToIntSet().

Referenced by Setup_Misc::apply().

◆ unload()

void Net::unload ( )

Clear the chars data

Definition at line 179 of file net.cpp.

180 {
181  const GeneralHandler *const handler = generalHandler;
182  if (handler != nullptr)
183  handler->unload();
184  ignorePackets.clear();
186 }

References NpcDialogMenuInfo::buttons, PlayerInfo::clear(), delete2, delete_all(), HorseInfo::downSprites, anonymous_namespace{statuseffectdb.cpp}::fakeId, FOR_EACH, generalHandler, ignorePackets, NpcDialogMenuInfo::images, Logger::log1(), logger, anonymous_namespace{itemfielddb.cpp}::mAddInfos, anonymous_namespace{questdb.cpp}::mAllEffects, anonymous_namespace{avatardb.cpp}::mAvatarInfos, anonymous_namespace{statdb.cpp}::mBasicStats, anonymous_namespace{weaponsdb.cpp}::mBows, anonymous_namespace{badgesdb.cpp}::mClans, anonymous_namespace{clandb.cpp}::mClansInfos, anonymous_namespace{colordb.cpp}::mColorLists, anonymous_namespace{palettedb.cpp}::mColors, anonymous_namespace{commandsdb.cpp}::mCommands, anonymous_namespace{unitsdb.cpp}::mCurrencies, anonymous_namespace{npcdialogdb.cpp}::mDialogs, anonymous_namespace{elementaldb.cpp}::mElementalInfos, anonymous_namespace{emotedb.cpp}::mEmoteInfos, NpcDialogInfo::menu, anonymous_namespace{groupdb.cpp}::mGroups, anonymous_namespace{badgesdb.cpp}::mGuilds, anonymous_namespace{homunculusdb.cpp}::mHomunculusInfos, anonymous_namespace{horsedb.cpp}::mHorseInfos, anonymous_namespace{languagedb.cpp}::mIcons, anonymous_namespace{networkdb.cpp}::mInPackets, anonymous_namespace{itemdb.cpp}::mItemInfos, anonymous_namespace{chardb.cpp}::mLoaded, anonymous_namespace{mapdb.cpp}::mLoaded, anonymous_namespace{deaddb.cpp}::mLoaded, anonymous_namespace{networkdb.cpp}::mLoaded, anonymous_namespace{npcdialogdb.cpp}::mLoaded, anonymous_namespace{weaponsdb.cpp}::mLoaded, anonymous_namespace{colordb.cpp}::mLoaded, anonymous_namespace{commandsdb.cpp}::mLoaded, anonymous_namespace{statdb.cpp}::mLoaded, anonymous_namespace{statuseffectdb.cpp}::mLoaded, anonymous_namespace{itemoptiondb.cpp}::mLoaded, anonymous_namespace{itemfielddb.cpp}::mLoaded, anonymous_namespace{elementaldb.cpp}::mLoaded, anonymous_namespace{moddb.cpp}::mLoaded, anonymous_namespace{homunculusdb.cpp}::mLoaded, anonymous_namespace{mercenarydb.cpp}::mLoaded, anonymous_namespace{badgesdb.cpp}::mLoaded, anonymous_namespace{horsedb.cpp}::mLoaded, anonymous_namespace{petdb.cpp}::mLoaded, anonymous_namespace{skillunitdb.cpp}::mLoaded, anonymous_namespace{groupdb.cpp}::mLoaded, anonymous_namespace{clandb.cpp}::mLoaded, anonymous_namespace{avatardb.cpp}::mLoaded, anonymous_namespace{monsterdb.cpp}::mLoaded, anonymous_namespace{emotedb.cpp}::mLoaded, anonymous_namespace{npcdb.cpp}::mLoaded, anonymous_namespace{itemdb.cpp}::mLoaded, anonymous_namespace{mapdb.cpp}::mMaps, anonymous_namespace{mercenarydb.cpp}::mMercenaryInfos, anonymous_namespace{deaddb.cpp}::mMessages, anonymous_namespace{moddb.cpp}::mModInfos, anonymous_namespace{monsterdb.cpp}::mMonsterInfos, anonymous_namespace{itemdb.cpp}::mNamedItemInfos, anonymous_namespace{badgesdb.cpp}::mNames, anonymous_namespace{npcdb.cpp}::mNPCInfos, anonymous_namespace{itemoptiondb.cpp}::mOptions, anonymous_namespace{statdb.cpp}::mPages, anonymous_namespace{badgesdb.cpp}::mParties, anonymous_namespace{petdb.cpp}::mPETInfos, anonymous_namespace{languagedb.cpp}::mPo, anonymous_namespace{questdb.cpp}::mQuests, anonymous_namespace{networkdb.cpp}::mRemovePackets, anonymous_namespace{itemfielddb.cpp}::mRequiredInfos, anonymous_namespace{weaponsdb.cpp}::mShields, anonymous_namespace{skillunitdb.cpp}::mSkillUnitInfos, anonymous_namespace{sounddb.cpp}::mSounds, anonymous_namespace{statdb.cpp}::mStats, anonymous_namespace{weaponsdb.cpp}::mSwords, anonymous_namespace{itemdb.cpp}::mTagNames, anonymous_namespace{itemdb.cpp}::mTags, anonymous_namespace{textdb.cpp}::mTexts, anonymous_namespace{horsedb.cpp}::mUnknown, anonymous_namespace{emotedb.cpp}::mUnknown, anonymous_namespace{itemdb.cpp}::mUnknown, anonymous_namespace{statuseffectdb.cpp}::opt1ToIdMap, anonymous_namespace{statuseffectdb.cpp}::opt2ToIdMap, anonymous_namespace{statuseffectdb.cpp}::opt3ToIdMap, anonymous_namespace{statuseffectdb.cpp}::optionToIdMap, EmoteInfo::sprites, anonymous_namespace{statuseffectdb.cpp}::statusEffects, NpcDialogMenuInfo::texts, NotifyTypes::TYPE_END, Net::GeneralHandler::unload(), unloadMap(), and HorseInfo::upSprites.

Referenced by SpellManager::fillSpells(), ItemFieldDb::load(), LanguageDb::load(), TextDb::load(), PaletteDB::load(), SoundDB::load(), WeaponsDB::load(), BadgesDB::load(), StatDb::load(), ModDB::load(), DeadDB::load(), ItemOptionDb::load(), AvatarDB::load(), GroupDb::load(), PETDB::load(), SkillUnitDb::load(), QuestDb::load(), CharDB::load(), ClanDb::load(), CommandsDB::load(), HomunculusDB::load(), MercenaryDB::load(), ElementalDb::load(), MonsterDB::load(), NPCDB::load(), ItemDB::load(), HorseDB::load(), MapDB::load(), ColorDB::load(), NpcDialogDB::load(), NetworkDb::load(), EmoteDB::load(), StatusEffectDB::load(), Theme::loadRect(), DbManager::unloadDb(), TouchManager::unloadTouchItem(), and QuestsWindow::~QuestsWindow().

Variable Documentation

◆ ignorePackets

std::set<int> Net::ignorePackets

Definition at line 127 of file net.cpp.

Referenced by isIgnorePacket(), loadIgnorePackets(), and unload().

◆ networkType

ServerTypeT Net::networkType = ServerType::UNKNOWN

Definition at line 126 of file net.cpp.

Referenced by connectToServer(), and getNetworkType().

EAthena::GeneralHandler
Definition: generalhandler.h:72
loginHandler
Net::LoginHandler * loginHandler
Definition: net.cpp:89
Net::GeneralHandler::load
virtual void load() const =0
Net::LoginHandler::connect
virtual void connect() const =0
Net::LoginHandler::setServer
void setServer(const ServerInfo &server)
Definition: loginhandler.h:42
generalHandler
Net::GeneralHandler * generalHandler
Definition: net.cpp:87
TmwAthena::GeneralHandler
Definition: generalhandler.h:71
delete2
#define delete2(var)
Definition: delete2.h:24
if
if(!vert) return
ServerInfo::type
ServerTypeT type
Definition: serverinfo.h:41
Net::GeneralHandler::unload
virtual void unload() const =0
Net::GeneralHandler::reload
virtual void reload() const =0
ServerType::EATHENA
@ EATHENA
Definition: servertype.h:32
Net::networkType
ServerTypeT networkType
Definition: net.cpp:126
ServerType::EVOL2
@ EVOL2
Definition: servertype.h:33
Configuration::getStringValue
std::string getStringValue(const std::string &key) const
Definition: configuration.cpp:487
ServerType::UNKNOWN
@ UNKNOWN
Definition: servertype.h:30
config
Configuration config
Definition: configuration.cpp:51
ServerType::TMWATHENA
@ TMWATHENA
Definition: servertype.h:31
BLOCK_START
#define BLOCK_START(name)
Definition: perfomance.h:78
BLOCK_END
#define BLOCK_END(name)
Definition: perfomance.h:79
Net::ignorePackets
std::set< int > ignorePackets
Definition: net.cpp:127
splitToIntSet
void splitToIntSet(std::set< int > &tokens, const std::string &text, const char separator)
Definition: stringutils.cpp:450