ManaPlus
Functions | Variables
EAthena::FamilyRecv Namespace Reference

Functions

void processAskForChild (Net::MessageIn &msg)
 
void processCallPartner (Net::MessageIn &msg)
 
void processDivorced (Net::MessageIn &msg)
 
void processAskForChildReply (Net::MessageIn &msg)
 

Variables

ConfirmDialogconfirmDlg = 0
 
RequestAdoptChildListener listener
 
BeingId mParent1 = BeingId_zero
 
BeingId mParent2 = BeingId_zero
 

Function Documentation

◆ processAskForChild()

void EAthena::FamilyRecv::processAskForChild ( Net::MessageIn msg)

Definition at line 55 of file familyrecv.cpp.

56 {
57  if (localPlayer == nullptr)
58  {
59  mParent1 = msg.readBeingId("account id who ask");
60  mParent2 = msg.readBeingId("acoount id for other parent");
61  msg.readString(24, "name who ask");
62  return;
63  }
64  mParent1 = msg.readBeingId("account id who ask");
65  mParent2 = msg.readBeingId("acoount id for other parent");
66  const std::string name1 = msg.readString(24, "name who ask");
67  const Party *const party = localPlayer->getParty();
68  if (party != nullptr)
69  {
70  const PartyMember *const member = party->getMember(mParent2);
71  if (member != nullptr)
72  {
73  const std::string name2 = member->getName();
75  // TRANSLATORS: adopt child message
76  _("Request parents"),
77  // TRANSLATORS: adopt child message
78  strprintf(_("Do you accept %s and %s as parents?"),
79  name1.c_str(), name2.c_str()),
81  false,
83  nullptr);
85  }
86  }
87 }
std::string getName() const
Definition: avatar.h:53
Party * getParty() const
Definition: being.h:330
Definition: party.h:63
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:252
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:25
#define _(s)
Definition: gettext.h:35
LocalPlayer * localPlayer
uint32_t party
const bool Modal_false
Definition: modal.h:30
bool msg(InputEvent &event)
Definition: chat.cpp:39
ConfirmDialog * confirmDlg
Definition: familyrecv.cpp:49
RequestAdoptChildListener listener
Definition: familyrecv.cpp:50
static const std::string SOUND_REQUEST
Definition: sound.h:29
std::string strprintf(const char *const format,...)

References _, Widget::addActionListener(), confirmDlg, CREATEWIDGETV, Avatar::getName(), Being::getParty(), listener, localPlayer, Modal_false, mParent1, mParent2, Actions::msg(), party, SOUND_REQUEST, and strprintf().

◆ processAskForChildReply()

void EAthena::FamilyRecv::processAskForChildReply ( Net::MessageIn msg)

Definition at line 108 of file familyrecv.cpp.

109 {
110  const int type = msg.readInt32("type");
111  switch (type)
112  {
113  case 0:
115  break;
116  case 1:
118  break;
119  case 2:
121  break;
122  default:
124  break;
125  }
126 }
#define UNIMPLEMENTEDPACKETFIELD(field)
Definition: logger.h:59
void notify(const unsigned int message)
@ ADOPT_CHILD_ERROR_LEVEL
Definition: notifytypes.h:228
@ ADOPT_CHILD_ERROR_HAVE_BABY
Definition: notifytypes.h:227
@ ADOPT_CHILD_ERROR_BABY_MARRIED
Definition: notifytypes.h:229

References NotifyTypes::ADOPT_CHILD_ERROR_BABY_MARRIED, NotifyTypes::ADOPT_CHILD_ERROR_HAVE_BABY, NotifyTypes::ADOPT_CHILD_ERROR_LEVEL, Actions::msg(), NotifyManager::notify(), and UNIMPLEMENTEDPACKETFIELD.

◆ processCallPartner()

void EAthena::FamilyRecv::processCallPartner ( Net::MessageIn msg)

Definition at line 89 of file familyrecv.cpp.

90 {
91  const std::string name = msg.readString(24, "name");
92  if ((localPlayer != nullptr) && name == localPlayer->getName())
93  {
95  }
96  else
97  {
99  }
100 }
const std::string & getName() const
Definition: being.h:232

References NotifyTypes::CALLED_PARTNER, NotifyTypes::CALLING_PARTNER, Being::getName(), localPlayer, Actions::msg(), and NotifyManager::notify().

◆ processDivorced()

void EAthena::FamilyRecv::processDivorced ( Net::MessageIn msg)

Definition at line 102 of file familyrecv.cpp.

103 {
104  const std::string name = msg.readString(24, "name");
106 }

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

Variable Documentation

◆ confirmDlg

ConfirmDialog* EAthena::FamilyRecv::confirmDlg = 0

Definition at line 49 of file familyrecv.cpp.

Referenced by processAskForChild().

◆ listener

RequestAdoptChildListener EAthena::FamilyRecv::listener

Definition at line 50 of file familyrecv.cpp.

Referenced by processAskForChild().

◆ mParent1

BeingId EAthena::FamilyRecv::mParent1 = BeingId_zero

◆ mParent2

BeingId EAthena::FamilyRecv::mParent2 = BeingId_zero