ManaPlus
Functions | Variables
Ea::PartyRecv Namespace Reference

Functions

void processPartyCreate (Net::MessageIn &msg)
 
void processPartyLeave (Net::MessageIn &msg)
 
void processPartyUpdateCoords (Net::MessageIn &msg)
 
void processPartyExpSettingsContinue (Net::MessageIn &msg, const PartyShareT exp)
 
void processPartyItemSettingsContinue (Net::MessageIn &msg, const PartyShareT item)
 
void createTab ()
 

Variables

PartyShareT mShareExp = PartyShare::UNKNOWN
 
PartyShareT mShareItems = PartyShare::UNKNOWN
 

Function Documentation

◆ createTab()

void Ea::PartyRecv::createTab ( )

Definition at line 226 of file partyrecv.cpp.

227 {
229  if (config.getBoolValue("showChatHistory"))
230  partyTab->loadFromLogFile("#Party");
231 }
ChatWindow * chatWindow
Definition: chatwindow.cpp:94
void loadFromLogFile(const std::string &name)
Definition: chattab.cpp:510
bool getBoolValue(const std::string &key) const
Configuration config
PartyTab * partyTab
Definition: partytab.cpp:45

References chatWindow, config, Configuration::getBoolValue(), ChatTab::loadFromLogFile(), and partyTab.

Referenced by EAthena::ClanRecv::processClanInfo(), EAthena::PartyRecv::processPartyInfo(), EAthena::PartyRecv::processPartySettings(), and TmwAthena::PartyRecv::processPartySettings().

◆ processPartyCreate()

void Ea::PartyRecv::processPartyCreate ( Net::MessageIn msg)

Definition at line 56 of file partyrecv.cpp.

57 {
58  if (msg.readUInt8("flag") != 0U)
60  else
62 }
bool msg(InputEvent &event)
Definition: chat.cpp:39
void notify(const unsigned int message)
@ PARTY_CREATE_FAILED
Definition: notifytypes.h:60

References Actions::msg(), NotifyManager::notify(), NotifyTypes::PARTY_CREATE_FAILED, and NotifyTypes::PARTY_CREATED.

◆ processPartyExpSettingsContinue()

void Ea::PartyRecv::processPartyExpSettingsContinue ( Net::MessageIn msg,
const PartyShareT  exp 
)

Definition at line 64 of file partyrecv.cpp.

66 {
67  switch (exp)
68  {
69  case PartyShare::YES:
71  break;
74  break;
75  case PartyShare::NO:
77  break;
80  break;
83  break;
86  break;
87  default:
90  break;
91  }
92 }
#define CAST_S32
Definition: cast.h:30
#define UNIMPLEMENTEDPACKETFIELD(field)
Definition: logger.h:59
PartyShareT mShareExp
Definition: partyrecv.cpp:52
@ PARTY_EXP_SHARE_ON
Definition: notifytypes.h:72
@ PARTY_EXP_SHARE_OFF
Definition: notifytypes.h:73
@ PARTY_EXP_SHARE_ERROR
Definition: notifytypes.h:74
@ NOT_POSSIBLE
Definition: partyshare.h:34

References CAST_S32, mShareExp, PartyShare::NO, PartyShare::NOT_POSSIBLE, NotifyManager::notify(), NotifyTypes::PARTY_EXP_SHARE_ERROR, NotifyTypes::PARTY_EXP_SHARE_OFF, NotifyTypes::PARTY_EXP_SHARE_ON, UNIMPLEMENTEDPACKETFIELD, PartyShare::UNKNOWN, and PartyShare::YES.

Referenced by EAthena::PartyRecv::processPartySettings(), and TmwAthena::PartyRecv::processPartySettings().

◆ processPartyItemSettingsContinue()

void Ea::PartyRecv::processPartyItemSettingsContinue ( Net::MessageIn msg,
const PartyShareT  item 
)

Definition at line 94 of file partyrecv.cpp.

96 {
97  switch (item)
98  {
99  case PartyShare::YES:
101  break;
104  break;
105  case PartyShare::NO:
107  break;
110  break;
113  break;
116  break;
117  default:
118  case PartyShare::UNKNOWN:
120  break;
121  }
122 }
PartyShareT mShareItems
Definition: partyrecv.cpp:53
@ PARTY_ITEM_SHARE_ON
Definition: notifytypes.h:75
@ PARTY_ITEM_SHARE_ERROR
Definition: notifytypes.h:77
@ PARTY_ITEM_SHARE_OFF
Definition: notifytypes.h:76

References CAST_S32, mShareItems, PartyShare::NO, PartyShare::NOT_POSSIBLE, NotifyManager::notify(), NotifyTypes::PARTY_ITEM_SHARE_ERROR, NotifyTypes::PARTY_ITEM_SHARE_OFF, NotifyTypes::PARTY_ITEM_SHARE_ON, UNIMPLEMENTEDPACKETFIELD, PartyShare::UNKNOWN, and PartyShare::YES.

Referenced by EAthena::PartyRecv::processPartySettings(), and TmwAthena::PartyRecv::processPartySettings().

◆ processPartyLeave()

void Ea::PartyRecv::processPartyLeave ( Net::MessageIn msg)

Definition at line 124 of file partyrecv.cpp.

125 {
126  const BeingId id = msg.readBeingId("account id");
127  const std::string nick = msg.readString(24, "nick");
128  const int reason = msg.readUInt8("flag");
129  if (localPlayer == nullptr)
130  return;
131 
132  if (id == localPlayer->getId())
133  {
134  switch (reason)
135  {
136  case 0:
137  default:
139  break;
140 
141  case 1:
143  break;
144 
145  case 2:
147  break;
148 
149  case 3:
151  break;
152  }
153 
154  if (reason >= 2)
155  return;
156 
157  if (Ea::taParty != nullptr)
158  {
161  }
162 
164 
165  if ((socialWindow != nullptr) && (Ea::taParty != nullptr))
168  }
169  else
170  {
171  switch (reason)
172  {
173  case 0:
174  default:
176  break;
177 
178  case 1:
180  break;
181 
182  case 2:
184  break;
185 
186  case 3:
188  break;
189  }
190 
191  if (reason >= 2)
192  return;
193 
194  if (actorManager != nullptr)
195  {
196  Being *const b = actorManager->findBeing(id);
197  if ((b != nullptr) && b->getType() == ActorType::Player)
198  {
199  b->setParty(nullptr);
200  b->setPartyName("");
201  }
202  }
203  if (Ea::taParty != nullptr)
205  }
206 }
ActorManager * actorManager
int BeingId
Definition: beingid.h:30
Being * findBeing(const BeingId id) const
BeingId getId() const
Definition: actorsprite.h:64
Definition: being.h:96
void setParty(Party *const party)
Definition: being.cpp:1307
void setPartyName(const std::string &name)
Definition: being.cpp:5246
ActorTypeT getType() const
Definition: being.h:116
void removeFromMembers()
Definition: party.cpp:201
void removeMember(const PartyMember *const member)
Definition: party.cpp:128
void clearMembers()
Definition: party.h:122
bool removeTab(Guild *const guild)
#define delete2(var)
Definition: delete2.h:25
LocalPlayer * localPlayer
Party * taParty
Definition: partyrecv.cpp:48
@ PARTY_USER_KICKED
Definition: notifytypes.h:80
@ PARTY_USER_LEFT_DENY
Definition: notifytypes.h:79
@ PARTY_USER_KICK_DENY
Definition: notifytypes.h:81
SocialWindow * socialWindow

References actorManager, Party::clearMembers(), delete2, ActorManager::findBeing(), ActorSprite::getId(), Being::getType(), localPlayer, Actions::msg(), NotifyManager::notify(), NotifyTypes::PARTY_KICK_DENY, NotifyTypes::PARTY_KICKED, NotifyTypes::PARTY_LEFT, NotifyTypes::PARTY_LEFT_DENY, NotifyTypes::PARTY_USER_KICK_DENY, NotifyTypes::PARTY_USER_KICKED, NotifyTypes::PARTY_USER_LEFT, NotifyTypes::PARTY_USER_LEFT_DENY, partyTab, ActorType::Player, Party::removeFromMembers(), Party::removeMember(), SocialWindow::removeTab(), Being::setParty(), Being::setPartyName(), socialWindow, and Ea::taParty.

◆ processPartyUpdateCoords()

void Ea::PartyRecv::processPartyUpdateCoords ( Net::MessageIn msg)

Definition at line 208 of file partyrecv.cpp.

209 {
210  const BeingId id = msg.readBeingId("account id");
211  PartyMember *m = nullptr;
212  if (Ea::taParty != nullptr)
213  m = Ea::taParty->getMember(id);
214  if (m != nullptr)
215  {
216  m->setX(msg.readInt16("x"));
217  m->setY(msg.readInt16("y"));
218  }
219  else
220  {
221  msg.readInt16("x");
222  msg.readInt16("y");
223  }
224 }
void setY(const int y)
Definition: avatar.h:135
void setX(const int x)
Definition: avatar.h:129
PartyMember * getMember(const BeingId id) const
Definition: party.cpp:99

References Party::getMember(), Actions::msg(), Avatar::setX(), Avatar::setY(), and Ea::taParty.

Variable Documentation

◆ mShareExp

PartyShareT Ea::PartyRecv::mShareExp = PartyShare::UNKNOWN

◆ mShareItems

PartyShareT Ea::PartyRecv::mShareItems = PartyShare::UNKNOWN