ManaPlus
Namespaces | Data Structures | Functions | Variables
EAthena Namespace Reference

Namespaces

 AchievementRecv
 
 AdminRecv
 
 AttendanceRecv
 
 AuctionRecv
 
 BankRecv
 
 BarterRecv
 
 BattleGroundRecv
 
 BeingRecv
 
 BuyingStoreRecv
 
 BuySellRecv
 
 CashShopRecv
 
 CharServerRecv
 
 ChatRecv
 
 ClanRecv
 
 ElementalRecv
 
 FamilyRecv
 
 FriendsRecv
 
 GameRecv
 
 GeneralRecv
 
 GuildRecv
 
 HomunculusRecv
 
 InventoryRecv
 
 ItemRecv
 
 LoginRecv
 
 Mail2Recv
 
 MailRecv
 
 MapRecv
 
 MarketRecv
 
 MercenaryRecv
 
 NpcRecv
 
 PartyRecv
 
 PetRecv
 
 PlayerRecv
 
 QuestRecv
 
 RefineRecv
 
 RouletteRecv
 
 SearchStoreRecv
 
 SkillRecv
 
 TradeRecv
 
 VendingRecv
 

Data Structures

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

Functions

static void setBasicFields (Being *const dstBeing, const uint8_t gender, const int hairStyle, const ItemColor hairColor, const uint32_t weapon, const uint16_t headBottom, const uint16_t headMid, const uint16_t headTop, const uint16_t shoes, const uint16_t gloves, const bool notMove)
 
union EAthena::ItemFlags __attribute__ ((packed))
 
void updateProtocol ()
 
void updateProtocolMain ()
 
void updateProtocolRe ()
 
void updateProtocolZero ()
 

Variables

GuildtaGuild = 0
 
ServerInfo charServer
 
ServerInfo mapServer
 
MenuTypeT menu = MenuType::Unknown
 
static const unsigned int packet_lengths_size = 0xFFFFU
 
static const unsigned int messagesSize = 0xFFFFU
 

Function Documentation

◆ __attribute__()

union EAthena::MapTypeProperty2 EAthena::__attribute__ ( (packed)  )

◆ setBasicFields()

static void EAthena::setBasicFields ( Being *const  dstBeing,
const uint8_t  gender,
const int  hairStyle,
const ItemColor  hairColor,
const uint32_t  weapon,
const uint16_t  headBottom,
const uint16_t  headMid,
const uint16_t  headTop,
const uint16_t  shoes,
const uint16_t  gloves,
const bool  notMove 
)
static

Definition at line 96 of file beingrecv.cpp.

107 {
108  const ActorTypeT actorType = dstBeing->getType();
109  switch (actorType)
110  {
111  case ActorType::Player:
112  dstBeing->setGender(Being::intToGender(gender));
113  dstBeing->setHairColor(hairColor);
114  // Set these after the gender, as the sprites may be gender-specific
115  if (hairStyle == 0)
116  {
118  0,
119  std::string());
120  }
121  else
122  {
124  hairStyle * -1,
125  ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
126  }
127  if (updateSlots)
128  {
129  dstBeing->updateSprite(SPRITE_WEAPON,
130  headBottom,
131  std::string());
133  headMid,
134  std::string());
136  headTop,
137  std::string());
138  dstBeing->updateSprite(SPRITE_HAIR,
139  shoes,
140  std::string());
141  dstBeing->updateSprite(SPRITE_SHOES,
142  gloves,
143  std::string());
144  dstBeing->updateSprite(SPRITE_BODY,
145  weapon,
146  std::string());
147  dstBeing->setWeaponId(weapon);
148  }
149  break;
150  case ActorType::Npc:
152  {
153  dstBeing->setGender(Being::intToGender(gender));
154  }
155  if (dstBeing->getAllowNpcEquipment())
156  {
157  dstBeing->setHairColor(hairColor);
158  dstBeing->setHairStyle(SPRITE_HAIR_COLOR, -hairStyle);
159  // for npc not checking updateSlots flag,
160  // probably because npc missing visible packet if moving
161  dstBeing->updateSprite(SPRITE_WEAPON,
162  headBottom,
163  std::string());
165  headMid,
166  std::string());
168  headTop,
169  std::string());
170  dstBeing->updateSprite(SPRITE_HAIR,
171  shoes,
172  std::string());
173  dstBeing->updateSprite(SPRITE_SHOES,
174  gloves,
175  std::string());
176  dstBeing->updateSprite(SPRITE_BODY,
177  weapon,
178  std::string());
179  dstBeing->setWeaponId(weapon);
180  }
181  break;
182  default:
183  case ActorType::Monster:
184  case ActorType::Portal:
185  case ActorType::Pet:
190  break;
192  case ActorType::Avatar:
193  case ActorType::Unknown:
194  reportAlways("Wrong being type detected: %d",
195  CAST_S32(actorType))
196  break;
197  }
198 }
ActorType ::T ActorTypeT
Definition: actortype.h:43
#define CAST_S32
Definition: cast.h:30
#define reportAlways(...)
Definition: checkutils.h:253
void setHairStyle(const unsigned int slot, const int id)
Definition: being.cpp:3372
void setWeaponId(const int id)
Definition: being.cpp:3135
bool getAllowNpcEquipment() const
Definition: being.h:1102
static GenderT intToGender(const uint8_t sex) A_CONST
Definition: being.h:941
void updateSprite(const unsigned int slot, const int id, const std::string &color)
Definition: being.cpp:2771
void setHairColor(const unsigned int slot, const ItemColor color)
Definition: being.cpp:3389
virtual void setGender(const GenderT gender)
Definition: being.cpp:3581
ActorTypeT getType() const
Definition: being.h:116
virtual bool haveNpcGender() const =0
@ Mercenary
Definition: actortype.h:38
@ Homunculus
Definition: actortype.h:39
@ SkillUnit
Definition: actortype.h:40
@ Elemental
Definition: actortype.h:41
@ FloorItem
Definition: actortype.h:34
const ItemInfo & get(const int id)
Definition: itemdb.cpp:792
@ SPRITE_HAIR_COLOR
Definition: sprite.h:35
@ SPRITE_WEAPON
Definition: sprite.h:31
@ SPRITE_SHOES
Definition: sprite.h:38
@ SPRITE_BODY
Definition: sprite.h:39
@ SPRITE_CLOTHES_COLOR
Definition: sprite.h:36
@ SPRITE_HEAD_BOTTOM
Definition: sprite.h:32
Net::ServerFeatures * serverFeatures
Definition: net.cpp:101

References ActorType::Avatar, CAST_S32, ActorType::Elemental, ActorType::FloorItem, ItemDB::get(), Net::ServerFeatures::haveNpcGender(), ActorType::Homunculus, Being::intToGender(), ActorType::Mercenary, ActorType::Monster, ActorType::Npc, ActorType::Pet, ActorType::Player, ActorType::Portal, reportAlways, serverFeatures, ActorType::SkillUnit, SPRITE_BODY, SPRITE_CLOTHES_COLOR, ItemDbType::SPRITE_HAIR, SPRITE_HAIR_COLOR, SPRITE_HEAD_BOTTOM, SPRITE_SHOES, SPRITE_WEAPON, and ActorType::Unknown.

Referenced by EAthena::BeingRecv::processBeingMove(), EAthena::BeingRecv::processBeingSpawn(), and EAthena::BeingRecv::processBeingVisible().

◆ updateProtocol()

void EAthena::updateProtocol ( )

Definition at line 47 of file updateprotocol.cpp.

48 {
49  itemIdLen = 2;
50  logger->log("packet version: %d", packetVersion);
51  if (packets_main == true)
52  {
53  logger->log("packets version type: main");
55  packetVersionRe = 0;
57  }
58  else if (packets_re == true)
59  {
60  logger->log("packets version type: re");
64  }
65  else if (packets_zero == true)
66  {
67  logger->log("packets version type: zero");
70  packetVersionRe = 0;
71  }
72  if (packetVersionMain >= 20181121 ||
73  packetVersionRe >= 20180704 ||
74  packetVersionZero >= 20181114)
75  {
76  itemIdLen = 4;
77  }
78 #define PACKETS_UPDATE
79 #include "net/protocoloutupdate.h"
80 #include "net/eathena/packetsout.inc"
81 #undef packet
85  Network *const network = Network::mInstance;
86  if (network != nullptr)
87  {
88  network->clearHandlers();
89  network->registerHandlers();
90  network->registerFakeHandlers();
91  }
92 }
void log(const char *const log_text,...)
Definition: logger.cpp:269
bool packets_zero
Definition: client.cpp:133
bool packets_re
Definition: client.cpp:132
int itemIdLen
Definition: client.cpp:130
int packetVersionRe
Definition: client.cpp:127
bool packets_main
Definition: client.cpp:131
int packetVersionMain
Definition: client.cpp:126
int packetVersionZero
Definition: client.cpp:128
int packetVersion
Definition: client.cpp:125
Logger * logger
Definition: logger.cpp:89
void updateProtocolRe()
void updateProtocolMain()
void updateProtocolZero()

References EAthena::Network::clearHandlers(), itemIdLen, Logger::log(), logger, EAthena::Network::mInstance, packets_main, packets_re, packets_zero, packetVersion, packetVersionMain, packetVersionRe, packetVersionZero, EAthena::Network::registerFakeHandlers(), EAthena::Network::registerHandlers(), updateProtocolMain(), updateProtocolRe(), and updateProtocolZero().

Referenced by EAthena::LoginRecv::processServerVersion(), and EAthena::LoginHandler::updatePacketVersion().

◆ updateProtocolMain()

void EAthena::updateProtocolMain ( )

Definition at line 34 of file updateprotocol_main.cpp.

35 {
36 #include "net/protocoloutupdate.h"
37 #include "net/eathena/packetsout_shuffle_main.inc"
38 #undef packet
39 }

Referenced by updateProtocol().

◆ updateProtocolRe()

void EAthena::updateProtocolRe ( )

Definition at line 34 of file updateprotocol_re.cpp.

35 {
36 #include "net/protocoloutupdate.h"
37 #include "net/eathena/packetsout_shuffle_re.inc"
38 #undef packet
39 }

Referenced by updateProtocol().

◆ updateProtocolZero()

void EAthena::updateProtocolZero ( )

Definition at line 34 of file updateprotocol_zero.cpp.

35 {
36 #include "net/protocoloutupdate.h"
37 #include "net/eathena/packetsout_shuffle_zero.inc"
38 #undef packet
39 }

Referenced by updateProtocol().

Variable Documentation

◆ charServer

ServerInfo EAthena::charServer

◆ mapServer

ServerInfo EAthena::mapServer

◆ menu

MenuTypeT EAthena::menu = MenuType::Unknown

◆ messagesSize

const unsigned int EAthena::messagesSize = 0xFFFFU
static

Definition at line 109 of file network.cpp.

Referenced by EAthena::Network::dispatchMessages(), and EAthena::Network::Network().

◆ packet_lengths_size

const unsigned int EAthena::packet_lengths_size = 0xFFFFU
static

◆ taGuild

Guild * EAthena::taGuild = 0