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 61 of file character.h.

Function Documentation

◆ connectToServer()

void Net::connectToServer ( const ServerInfo server)

Handles server detection and connection

Definition at line 130 of file net.cpp.

131 {
132  BLOCK_START("Net::connectToServer")
133  if (networkType == server.type &&
134  generalHandler != nullptr)
135  {
137  }
138  else
139  {
141  generalHandler != nullptr)
142  {
145  }
146 
147  switch (server.type)
148  {
149  case ServerType::EATHENA:
150  case ServerType::EVOL2:
152  break;
154  case ServerType::UNKNOWN:
155  default:
156 #ifdef TMWA_SUPPORT
158 #else // TMWA_SUPPORT
159 
161 #endif // TMWA_SUPPORT
162 
163  break;
164  }
165 
166  if (generalHandler != nullptr)
167  generalHandler->load();
168 
169  networkType = server.type;
170  }
171 
172  if (loginHandler != nullptr)
173  {
174  loginHandler->setServer(server);
176  }
177  BLOCK_END("Net::connectToServer")
178 }
virtual void reload() const =0
virtual void unload() const =0
virtual void load() const =0
void setServer(const ServerInfo &server)
Definition: loginhandler.h:43
virtual void connect() const =0
ServerTypeT type
Definition: serverinfo.h:42
#define delete2(var)
Definition: delete2.h:25
if(!vert) return
ServerTypeT networkType
Definition: net.cpp:127
Net::LoginHandler * loginHandler
Definition: net.cpp:90
Net::GeneralHandler * generalHandler
Definition: net.cpp:88
#define BLOCK_END(name)
Definition: perfomance.h:80
#define BLOCK_START(name)
Definition: perfomance.h:79

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 189 of file net.cpp.

190 {
191  return networkType;
192 }

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(), PopupMenu::isAllowCommand(), GroupDb::isAllowCommand(), PopupMenu::isAllowOtherCommand(), Being::isBuyShopEnabled(), Being::isSellShopEnabled(), ActorManager::itenplz(), DbManager::loadDb(), LocalPlayer::LocalPlayer(), LocalPlayer::magicAttack(), ItemContainer::mouseReleased(), ShopListBox::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 200 of file net.cpp.

201 {
202  return ignorePackets.find(id) != ignorePackets.end();
203 }
std::set< int > ignorePackets
Definition: net.cpp:128

References ignorePackets.

◆ loadIgnorePackets()

void Net::loadIgnorePackets ( )

Definition at line 194 of file net.cpp.

195 {
196  const std::string str = config.getStringValue("ignorelogpackets");
197  splitToIntSet(ignorePackets, str, ',');
198 }
std::string getStringValue(const std::string &key) const
Configuration config
void splitToIntSet(std::set< int > &tokens, const std::string &text, const char separator)

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

Referenced by Setup_Misc::apply().

◆ unload()

void Net::unload ( )

Variable Documentation

◆ ignorePackets

std::set<int> Net::ignorePackets

Definition at line 128 of file net.cpp.

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

◆ networkType

ServerTypeT Net::networkType = ServerType::UNKNOWN

Definition at line 127 of file net.cpp.

Referenced by connectToServer(), and getNetworkType().