ManaPlus
adminhandler.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2018 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/tmwa/adminhandler.h"
24 
25 #include "game.h"
26 
27 #include "net/tmwa/messageout.h"
28 #include "net/tmwa/protocolout.h"
29 
30 #include "utils/gmfunctions.h"
31 #include "utils/stringutils.h"
32 
33 #include "debug.h"
34 
35 namespace TmwAthena
36 {
37 
39  Ea::AdminHandler()
40 {
41  adminHandler = this;
42 }
43 
45 {
46  adminHandler = nullptr;
47 }
48 
49 void AdminHandler::announce(const std::string &text) const
50 {
52  outMsg.writeInt16(CAST_S16(text.length() + 4), "len");
53  outMsg.writeString(text, CAST_S32(text.length()), "message");
54 }
55 
56 void AdminHandler::localAnnounce(const std::string &text) const
57 {
59  outMsg.writeInt16(CAST_S16(text.length() + 4), "len");
60  outMsg.writeString(text, CAST_S32(text.length()), "message");
61 }
62 
63 void AdminHandler::hide(const bool h A_UNUSED) const
64 {
66  outMsg.writeInt32(0, "unused");
67 }
68 
69 void AdminHandler::kick(const BeingId playerId) const
70 {
72  outMsg.writeBeingId(playerId, "account id");
73 }
74 
76 {
77 }
78 
79 void AdminHandler::warp(const std::string &map, const int x, const int y) const
80 {
81  Gm::runCommand("warp",
82  strprintf("%s %d %d", map.c_str(), x, y));
83 }
84 
86 {
87 }
88 
90 {
91 }
92 
93 void AdminHandler::gotoName(const std::string &name) const
94 {
95  Gm::runCommand("goto", name);
96 }
97 
98 void AdminHandler::recallName(const std::string &name) const
99 {
100  Gm::runCommand("recall", name);
101 }
102 
103 void AdminHandler::mute(const Being *const being A_UNUSED,
104  const int type A_UNUSED,
105  const int limit A_UNUSED) const
106 {
107 }
108 
109 void AdminHandler::muteName(const std::string &name A_UNUSED) const
110 {
111 }
112 
113 void AdminHandler::requestLogin(const Being *const being A_UNUSED) const
114 {
115 }
116 
117 void AdminHandler::setTileType(const int x A_UNUSED, const int y A_UNUSED,
118  const int type A_UNUSED) const
119 {
120 }
121 
122 void AdminHandler::unequipAll(const Being *const being A_UNUSED) const
123 {
124 }
125 
126 void AdminHandler::requestStats(const std::string &name A_UNUSED) const
127 {
128 }
129 
130 void AdminHandler::monsterInfo(const std::string &name A_UNUSED) const
131 {
132 }
133 
134 void AdminHandler::itemInfo(const std::string &name A_UNUSED) const
135 {
136 }
137 
138 void AdminHandler::whoDrops(const std::string &name A_UNUSED) const
139 {
140 }
141 
142 void AdminHandler::mobSearch(const std::string &name A_UNUSED) const
143 {
144 }
145 
146 void AdminHandler::mobSpawnSearch(const std::string &name A_UNUSED) const
147 {
148 }
149 
150 void AdminHandler::playerGmCommands(const std::string &name A_UNUSED) const
151 {
152 }
153 
154 void AdminHandler::playerCharGmCommands(const std::string &name A_UNUSED) const
155 {
156 }
157 
158 void AdminHandler::showLevel(const std::string &name A_UNUSED) const
159 {
160 }
161 
162 void AdminHandler::showStats(const std::string &name A_UNUSED) const
163 {
164 }
165 
166 void AdminHandler::showStorageList(const std::string &name A_UNUSED) const
167 {
168 }
169 
170 void AdminHandler::showCartList(const std::string &name A_UNUSED) const
171 {
172 }
173 
174 void AdminHandler::showInventoryList(const std::string &name A_UNUSED) const
175 {
176 }
177 
178 void AdminHandler::locatePlayer(const std::string &name A_UNUSED) const
179 {
180 }
181 
182 void AdminHandler::showAccountInfo(const std::string &name A_UNUSED) const
183 {
184 }
185 
186 void AdminHandler::spawnSlave(const std::string &name A_UNUSED) const
187 {
188 }
189 
190 void AdminHandler::spawnClone(const std::string &name A_UNUSED) const
191 {
192 }
193 
194 void AdminHandler::spawnSlaveClone(const std::string &name A_UNUSED) const
195 {
196 }
197 
198 void AdminHandler::spawnEvilClone(const std::string &name A_UNUSED) const
199 {
200 }
201 
202 void AdminHandler::savePosition(const std::string &name A_UNUSED) const
203 {
204 }
205 
206 void AdminHandler::loadPosition(const std::string &name A_UNUSED) const
207 {
208 }
209 
210 void AdminHandler::randomWarp(const std::string &name A_UNUSED) const
211 {
212 }
213 
214 void AdminHandler::gotoNpc(const std::string &name A_UNUSED) const
215 {
216 }
217 
218 void AdminHandler::killer(const std::string &name A_UNUSED) const
219 {
220 }
221 
222 void AdminHandler::killable(const std::string &name A_UNUSED) const
223 {
224 }
225 
226 void AdminHandler::heal(const std::string &name A_UNUSED) const
227 {
228 }
229 
230 void AdminHandler::alive(const std::string &name) const
231 {
232  Gm::runCommand("revive", name);
233 }
234 
235 void AdminHandler::disguise(const std::string &name A_UNUSED) const
236 {
237 }
238 
239 void AdminHandler::immortal(const std::string &name A_UNUSED) const
240 {
241 }
242 
243 void AdminHandler::hide(const std::string &name A_UNUSED) const
244 {
245  Gm::runCommand("hide");
246 }
247 
248 void AdminHandler::nuke(const std::string &name A_UNUSED) const
249 {
250 }
251 
252 void AdminHandler::kill(const std::string &name A_UNUSED) const
253 {
254 }
255 
256 void AdminHandler::jail(const std::string &name A_UNUSED) const
257 {
258 }
259 
260 void AdminHandler::unjail(const std::string &name A_UNUSED) const
261 {
262 }
263 
264 void AdminHandler::npcMove(const std::string &name A_UNUSED,
265  const int x A_UNUSED,
266  const int y A_UNUSED) const
267 {
268 }
269 
270 void AdminHandler::hideNpc(const std::string &name A_UNUSED) const
271 {
272 }
273 
274 void AdminHandler::showNpc(const std::string &name A_UNUSED) const
275 {
276 }
277 
278 void AdminHandler::changePartyLeader(const std::string &name A_UNUSED) const
279 {
280 }
281 
282 void AdminHandler::partyRecall(const std::string &name A_UNUSED) const
283 {
284 }
285 
286 void AdminHandler::breakGuild(const std::string &name A_UNUSED) const
287 {
288 }
289 
290 void AdminHandler::guildRecall(const std::string &name A_UNUSED) const
291 {
292 }
293 
294 void AdminHandler::slide(const int x, const int y) const
295 {
296  warp(Game::instance()->getCurrentMapName(), x, y);
297 }
298 
299 } // namespace TmwAthena
void mute(const Being *const being, const int type, const int limit) const
void unjail(const std::string &name) const
void itemInfo(const std::string &name) const
int CMSG_ADMIN_ANNOUNCE
Definition: protocolout.cpp:97
void gotoName(const std::string &name) const
void jail(const std::string &name) const
void setTileType(const int x, const int y, const int type) const
void breakGuild(const std::string &name) const
void loadPosition(const std::string &name) const
void nuke(const std::string &name) const
void heal(const std::string &name) const
void disguise(const std::string &name) const
void showAccountInfo(const std::string &name) const
int BeingId
Definition: beingid.h:29
void spawnSlaveClone(const std::string &name) const
void spawnEvilClone(const std::string &name) const
void playerCharGmCommands(const std::string &name) const
void alive(const std::string &name) const
void gotoNpc(const std::string &name) const
void showCartList(const std::string &name) const
void kill(const std::string &name) const
void hide(const bool h) const
void killable(const std::string &name) const
void showStats(const std::string &name) const
void runCommand(const std::string &command, const std::string &params)
Definition: gmfunctions.cpp:36
#define CAST_S32
Definition: cast.h:29
void spawnSlave(const std::string &name) const
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
void muteName(const std::string &name) const
void unequipAll(const Being *const being) const
void changePartyLeader(const std::string &name) const
int CMSG_ADMIN_HIDE
Definition: protocolout.cpp:99
void showLevel(const std::string &name) const
void monsterInfo(const std::string &name) const
void partyRecall(const std::string &name) const
void randomWarp(const std::string &name) const
#define createOutPacket(name)
Definition: messageout.h:36
void locatePlayer(const std::string &name) const
void npcMove(const std::string &name, const int x, const int y) const
void playerGmCommands(const std::string &name) const
Net::AdminHandler * adminHandler
Definition: net.cpp:78
void localAnnounce(const std::string &text) const
void announce(const std::string &text) const
void slide(const int x, const int y) const
void hideNpc(const std::string &name) const
void showInventoryList(const std::string &name) const
#define A_UNUSED
Definition: localconsts.h:171
void killer(const std::string &name) const
void guildRecall(const std::string &name) const
void requestStats(const std::string &name) const
void warp(const std::string &map, const int x, const int y) const
void whoDrops(const std::string &name) const
static Game * instance()
Definition: game.h:81
void spawnClone(const std::string &name) const
int CMSG_ADMIN_LOCAL_ANNOUNCE
Definition: protocolout.cpp:98
void showNpc(const std::string &name) const
#define CAST_S16
Definition: cast.h:27
void mobSearch(const std::string &name) const
int CMSG_ADMIN_KICK
void mobSpawnSearch(const std::string &name) const
Definition: being.h:93
void immortal(const std::string &name) const
void kick(const BeingId playerId) const
void showStorageList(const std::string &name) const
void savePosition(const std::string &name) const
void requestLogin(const Being *const being) const
void recallName(const std::string &name) const