ManaPlus
gamerecv.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #include "net/ea/gamerecv.h"
24 
25 #include "client.h"
26 #include "notifymanager.h"
27 
29 
30 #include "gui/windows/okdialog.h"
31 
33 
34 #include "net/messagein.h"
35 
36 #include "utils/gettext.h"
37 
38 #include "debug.h"
39 
40 namespace Ea
41 {
42 
43 namespace GameRecv
44 {
45  std::string mMap;
47 } // namespace GameRecv
48 
50 {
52  msg.readInt32("users count"));
53 }
54 
56 {
57  if (msg.readUInt8("response") != 0U)
59 }
60 
62 {
63  if (msg.readInt16("response") != 0)
64  {
66  // TRANSLATORS: error header
67  _("Game"),
68  // TRANSLATORS: error message
69  _("Request to quit denied!"),
70  // TRANSLATORS: ok dialog button
71  _("OK"),
73  Modal_true,
75  nullptr,
76  260);
77  }
78 }
79 
80 } // namespace Ea
Net::MessageIn
Definition: messagein.h:40
BeingId
int BeingId
Definition: beingid.h:29
notifymanager.h
gamerecv.h
DialogType::ERROR
@ ERROR
Definition: dialogtype.h:33
Ea::GameRecv::processWhoAnswer
void processWhoAnswer(Net::MessageIn &msg)
Definition: gamerecv.cpp:49
Actions::msg
bool msg(InputEvent &event)
Definition: chat.cpp:38
OkDialog
Definition: okdialog.h:43
Ea::GameRecv::processMapQuitResponse
void processMapQuitResponse(Net::MessageIn &msg)
Definition: gamerecv.cpp:61
notifytypes.h
NotifyManager::notify
void notify(const unsigned int message)
Definition: notifymanager.cpp:81
Ea::GameRecv::mCharID
BeingId mCharID
Definition: gamerecv.cpp:46
Client::setState
void setState(const StateT state)
Definition: client.h:65
createwidget.h
gettext.h
ShowCenter_true
const bool ShowCenter_true
Definition: showcenter.h:29
Ea::GameRecv::processCharSwitchResponse
void processCharSwitchResponse(Net::MessageIn &msg)
Definition: gamerecv.cpp:55
Ea
Definition: adminhandler.cpp:30
client
Client * client
Definition: client.cpp:117
Modal_true
const bool Modal_true
Definition: modal.h:29
okdialog.h
Ea::GameRecv::mMap
std::string mMap
Definition: gamerecv.cpp:45
BeingId_zero
const BeingId BeingId_zero
Definition: beingid.h:29
_
#define _(s)
Definition: gettext.h:34
client.h
messagein.h
NotifyTypes::ONLINE_USERS
@ ONLINE_USERS
Definition: notifytypes.h:41
debug.h
State::SWITCH_CHARACTER
@ SWITCH_CHARACTER
Definition: state.h:63
CREATEWIDGET
#define CREATEWIDGET(type,...)
Definition: createwidget.h:28