ManaPlus
Public Member Functions | Static Protected Attributes
EAthena::AdminHandler Class Reference

#include <adminhandler.h>

Inheritance diagram for EAthena::AdminHandler:
Ea::AdminHandler Net::AdminHandler

Public Member Functions

 AdminHandler ()
 
 ~AdminHandler ()
 
void announce (const std::string &text) const
 
void localAnnounce (const std::string &text) const
 
void hide (const bool h) const
 
void kick (const BeingId playerId) const
 
void kickAll () const
 
void warp (const std::string &map, const int x, const int y) const
 
void resetStats () const
 
void resetSkills () const
 
void gotoName (const std::string &name) const
 
void recallName (const std::string &name) const
 
void mute (const Being *const being, const int type, const int limit) const
 
void muteName (const std::string &name) const
 
void requestLogin (const Being *const being) const
 
void setTileType (const int x, const int y, const int type) const
 
void unequipAll (const Being *const being) const
 
void requestStats (const std::string &name) const
 
void monsterInfo (const std::string &name) const
 
void itemInfo (const std::string &name) const
 
void whoDrops (const std::string &name) const
 
void mobSearch (const std::string &name) const
 
void mobSpawnSearch (const std::string &name) const
 
void playerGmCommands (const std::string &name) const
 
void playerCharGmCommands (const std::string &name) const
 
void showLevel (const std::string &name) const
 
void showStats (const std::string &name) const
 
void showStorageList (const std::string &name) const
 
void showCartList (const std::string &name) const
 
void showInventoryList (const std::string &name) const
 
void locatePlayer (const std::string &name) const
 
void showAccountInfo (const std::string &name) const
 
void spawnSlave (const std::string &name) const
 
void spawnClone (const std::string &name) const
 
void spawnSlaveClone (const std::string &name) const
 
void spawnEvilClone (const std::string &name) const
 
void savePosition (const std::string &name) const
 
void loadPosition (const std::string &name) const
 
void randomWarp (const std::string &name) const
 
void gotoNpc (const std::string &name) const
 
void killer (const std::string &name) const
 
void killable (const std::string &name) const
 
void heal (const std::string &name) const
 
void alive (const std::string &name) const
 
void disguise (const std::string &name) const
 
void immortal (const std::string &name) const
 
void hide (const std::string &name) const
 
void nuke (const std::string &name) const
 
void kill (const std::string &name) const
 
void jail (const std::string &name) const
 
void unjail (const std::string &name) const
 
void npcMove (const std::string &name, const int x, const int y) const
 
void hideNpc (const std::string &name) const
 
void showNpc (const std::string &name) const
 
void changePartyLeader (const std::string &name) const
 
void partyRecall (const std::string &name) const
 
void breakGuild (const std::string &name) const
 
void guildRecall (const std::string &name) const
 
void slide (const int x, const int y) const
 
void changeDress () const
 
void resetCooldowns () const
 
- Public Member Functions inherited from Ea::AdminHandler
 AdminHandler ()
 
void kickName (const std::string &name) const
 
void ban (const int playerId) const
 
void banName (const std::string &name) const
 
void unban (const int playerId) const
 
void unbanName (const std::string &name) const
 
void ipcheckName (const std::string &name) const
 
void createItems (const int id, const ItemColor color, const int amount) const
 
void spawn (const std::string &name) const
 
- Public Member Functions inherited from Net::AdminHandler
 AdminHandler ()
 

Static Protected Attributes

static std::string mStatsName
 

Detailed Description

Definition at line 32 of file adminhandler.h.

Constructor & Destructor Documentation

◆ AdminHandler()

EAthena::AdminHandler::AdminHandler ( )

Definition at line 44 of file adminhandler.cpp.

44  :
46 {
47  adminHandler = this;
48 }
Net::AdminHandler * adminHandler
Definition: net.cpp:84

References adminHandler.

◆ ~AdminHandler()

EAthena::AdminHandler::~AdminHandler ( )
virtual

Reimplemented from Ea::AdminHandler.

Definition at line 50 of file adminhandler.cpp.

51 {
52  adminHandler = nullptr;
53 }

References adminHandler.

Member Function Documentation

◆ alive()

void EAthena::AdminHandler::alive ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 296 of file adminhandler.cpp.

297 {
298  Gm::runCharCommand("alive", name);
299 }
void runCharCommand(const std::string &command, const std::string &name, const std::string &params)
Definition: gmfunctions.cpp:61

References Gm::runCharCommand().

◆ announce()

void EAthena::AdminHandler::announce ( const std::string &  text) const
virtual

Implements Net::AdminHandler.

Definition at line 55 of file adminhandler.cpp.

56 {
57  createOutPacket(CMSG_ADMIN_ANNOUNCE);
58  outMsg.writeInt16(CAST_S16(text.length() + 4), "len");
59  outMsg.writeString(text, CAST_S32(text.length()), "message");
60 }
#define CAST_S16
Definition: cast.h:28
#define CAST_S32
Definition: cast.h:30
#define createOutPacket(name)
Definition: messageout.h:37

References CAST_S16, CAST_S32, and createOutPacket.

◆ breakGuild()

void EAthena::AdminHandler::breakGuild ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 367 of file adminhandler.cpp.

368 {
369  Gm::runCharCommand("breakguild", name);
370 }

References Gm::runCharCommand().

◆ changeDress()

void EAthena::AdminHandler::changeDress ( ) const
virtual

Implements Net::AdminHandler.

Definition at line 383 of file adminhandler.cpp.

384 {
385  if (packetVersionZero < 20171214 &&
386  packetVersion < 20171220)
387  {
388  return;
389  }
390  createOutPacket(CMSG_CHANGE_DRESS);
391 }
int packetVersionZero
Definition: client.cpp:128
int packetVersion
Definition: client.cpp:125

References createOutPacket, packetVersion, and packetVersionZero.

◆ changePartyLeader()

void EAthena::AdminHandler::changePartyLeader ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 357 of file adminhandler.cpp.

358 {
359  Gm::runCommand("changeleader", name);
360 }
void runCommand(const std::string &command, const std::string &params)
Definition: gmfunctions.cpp:35

References Gm::runCommand().

◆ disguise()

void EAthena::AdminHandler::disguise ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 301 of file adminhandler.cpp.

302 {
303  Gm::runCommand("disguise", name);
304 }

References Gm::runCommand().

◆ gotoName()

void EAthena::AdminHandler::gotoName ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 106 of file adminhandler.cpp.

107 {
108  createOutPacket(CMSG_ADMIN_GOTO);
109  outMsg.writeString(name, 24, "name");
110 }

References createOutPacket.

◆ gotoNpc()

void EAthena::AdminHandler::gotoNpc ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 276 of file adminhandler.cpp.

277 {
278  Gm::runCommand("tonpc", name);
279 }

References Gm::runCommand().

◆ guildRecall()

void EAthena::AdminHandler::guildRecall ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 372 of file adminhandler.cpp.

373 {
374  Gm::runCommand("guildrecall", name);
375 }

References Gm::runCommand().

◆ heal()

void EAthena::AdminHandler::heal ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 291 of file adminhandler.cpp.

292 {
293  Gm::runCharCommand("heal", name);
294 }

References Gm::runCharCommand().

◆ hide() [1/2]

void EAthena::AdminHandler::hide ( const bool  h) const
virtual

Implements Net::AdminHandler.

Definition at line 69 of file adminhandler.cpp.

70 {
71  createOutPacket(CMSG_ADMIN_HIDE);
72  outMsg.writeInt32(0, "unused");
73 }

References createOutPacket.

◆ hide() [2/2]

void EAthena::AdminHandler::hide ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 311 of file adminhandler.cpp.

312 {
313  Gm::runCharCommand("hide", name);
314 }

References Gm::runCharCommand().

◆ hideNpc()

void EAthena::AdminHandler::hideNpc ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 347 of file adminhandler.cpp.

348 {
349  Gm::runCommand("hidenpc", name);
350 }

References Gm::runCommand().

◆ immortal()

void EAthena::AdminHandler::immortal ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 306 of file adminhandler.cpp.

307 {
308  Gm::runCharCommand("monsterignore", name);
309 }

References Gm::runCharCommand().

◆ itemInfo()

void EAthena::AdminHandler::itemInfo ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 176 of file adminhandler.cpp.

177 {
178  Gm::runCommand("iteminfo", name);
179 }

References Gm::runCommand().

◆ jail()

void EAthena::AdminHandler::jail ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 326 of file adminhandler.cpp.

327 {
328  Gm::runCommand("jail", name);
329 }

References Gm::runCommand().

◆ kick()

void EAthena::AdminHandler::kick ( const BeingId  playerId) const
virtual

Implements Net::AdminHandler.

Definition at line 75 of file adminhandler.cpp.

76 {
77  createOutPacket(CMSG_ADMIN_KICK);
78  outMsg.writeBeingId(playerId, "account id");
79 }

References createOutPacket.

◆ kickAll()

void EAthena::AdminHandler::kickAll ( ) const
virtual

Implements Net::AdminHandler.

Definition at line 81 of file adminhandler.cpp.

82 {
83  createOutPacket(CMSG_ADMIN_KICK_ALL);
84 }

References createOutPacket.

◆ kill()

void EAthena::AdminHandler::kill ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 321 of file adminhandler.cpp.

322 {
323  Gm::runCharCommand("kill", name);
324 }

References Gm::runCharCommand().

◆ killable()

void EAthena::AdminHandler::killable ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 286 of file adminhandler.cpp.

287 {
288  Gm::runCharCommand("killable", name);
289 }

References Gm::runCharCommand().

◆ killer()

void EAthena::AdminHandler::killer ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 281 of file adminhandler.cpp.

282 {
283  Gm::runCharCommand("killer", name);
284 }

References Gm::runCharCommand().

◆ loadPosition()

void EAthena::AdminHandler::loadPosition ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 266 of file adminhandler.cpp.

267 {
268  Gm::runCharCommand("load", name);
269 }

References Gm::runCharCommand().

◆ localAnnounce()

void EAthena::AdminHandler::localAnnounce ( const std::string &  text) const
virtual

Implements Net::AdminHandler.

Definition at line 62 of file adminhandler.cpp.

63 {
64  createOutPacket(CMSG_ADMIN_LOCAL_ANNOUNCE);
65  outMsg.writeInt16(CAST_S16(text.length() + 4), "len");
66  outMsg.writeString(text, CAST_S32(text.length()), "message");
67 }

References CAST_S16, CAST_S32, and createOutPacket.

◆ locatePlayer()

void EAthena::AdminHandler::locatePlayer ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 231 of file adminhandler.cpp.

232 {
233  Gm::runCommand("where", name);
234 }

References Gm::runCommand().

◆ mobSearch()

void EAthena::AdminHandler::mobSearch ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 186 of file adminhandler.cpp.

187 {
188  Gm::runCommand("mobsearch", name);
189 }

References Gm::runCommand().

◆ mobSpawnSearch()

void EAthena::AdminHandler::mobSpawnSearch ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 191 of file adminhandler.cpp.

192 {
193  Gm::runCommand("whereis", name);
194 }

References Gm::runCommand().

◆ monsterInfo()

void EAthena::AdminHandler::monsterInfo ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 171 of file adminhandler.cpp.

172 {
173  Gm::runCommand("monsterinfo", name);
174 }

References Gm::runCommand().

◆ mute()

void EAthena::AdminHandler::mute ( const Being *const  being,
const int  type,
const int  limit 
) const
virtual

Implements Net::AdminHandler.

Definition at line 118 of file adminhandler.cpp.

121 {
122  if (being == nullptr)
123  return;
124 
125  createOutPacket(CMSG_ADMIN_MUTE);
126  outMsg.writeBeingId(being->getId(), "account id");
127  outMsg.writeInt8(CAST_S8(type), "type");
128  outMsg.writeInt16(CAST_S16(limit), "value");
129 }
#define CAST_S8
Definition: cast.h:26
BeingId getId() const
Definition: actorsprite.h:64

References CAST_S16, CAST_S8, createOutPacket, and ActorSprite::getId().

◆ muteName()

void EAthena::AdminHandler::muteName ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 131 of file adminhandler.cpp.

132 {
133  createOutPacket(CMSG_ADMIN_MUTE_NAME);
134  outMsg.writeString(name, 24, "name");
135 }

References createOutPacket.

◆ npcMove()

void EAthena::AdminHandler::npcMove ( const std::string &  name,
const int  x,
const int  y 
) const
virtual

Implements Net::AdminHandler.

Definition at line 336 of file adminhandler.cpp.

339 {
340  Gm::runCommand("npcmove",
341  strprintf("%d %d %s",
342  x,
343  y,
344  name.c_str()));
345 }
std::string strprintf(const char *const format,...)

References Gm::runCommand(), strprintf(), x, and y.

◆ nuke()

void EAthena::AdminHandler::nuke ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 316 of file adminhandler.cpp.

317 {
318  Gm::runCommand("nuke", name);
319 }

References Gm::runCommand().

◆ partyRecall()

void EAthena::AdminHandler::partyRecall ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 362 of file adminhandler.cpp.

363 {
364  Gm::runCommand("partyrecall", name);
365 }

References Gm::runCommand().

◆ playerCharGmCommands()

void EAthena::AdminHandler::playerCharGmCommands ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 201 of file adminhandler.cpp.

202 {
203  Gm::runCharCommand("charcommands", name);
204 }

References Gm::runCharCommand().

◆ playerGmCommands()

void EAthena::AdminHandler::playerGmCommands ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 196 of file adminhandler.cpp.

197 {
198  Gm::runCharCommand("commands", name);
199 }

References Gm::runCharCommand().

◆ randomWarp()

void EAthena::AdminHandler::randomWarp ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 271 of file adminhandler.cpp.

272 {
273  Gm::runCharCommand("jump", name);
274 }

References Gm::runCharCommand().

◆ recallName()

void EAthena::AdminHandler::recallName ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 112 of file adminhandler.cpp.

113 {
114  createOutPacket(CMSG_ADMIN_RECALL);
115  outMsg.writeString(name, 24, "name");
116 }

References createOutPacket.

◆ requestLogin()

void EAthena::AdminHandler::requestLogin ( const Being *const  being) const
virtual

Implements Net::AdminHandler.

Definition at line 137 of file adminhandler.cpp.

138 {
139  if (being == nullptr)
140  return;
141 
142  createOutPacket(CMSG_ADMIN_ID_TO_LOGIN);
143  outMsg.writeBeingId(being->getId(), "account id");
144 }

References createOutPacket, and ActorSprite::getId().

◆ requestStats()

void EAthena::AdminHandler::requestStats ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 164 of file adminhandler.cpp.

165 {
166  mStatsName = name;
167  createOutPacket(CMSG_ADMIN_REQUEST_STATS);
168  outMsg.writeString(name, 24, "name");
169 }
static std::string mStatsName
Definition: adminhandler.h:167

References createOutPacket, and mStatsName.

◆ resetCooldowns()

void EAthena::AdminHandler::resetCooldowns ( ) const
virtual

Implements Net::AdminHandler.

Definition at line 393 of file adminhandler.cpp.

394 {
395  if (packetVersion < 20160622)
396  return;
397  createOutPacket(CMSG_ADMIN_RESET_COOLDOWNS);
398 }

References createOutPacket, and packetVersion.

◆ resetSkills()

void EAthena::AdminHandler::resetSkills ( ) const
virtual

Implements Net::AdminHandler.

Definition at line 100 of file adminhandler.cpp.

101 {
102  createOutPacket(CMSG_ADMIN_RESET_PLAYER);
103  outMsg.writeInt16(1, "flag");
104 }

References createOutPacket.

◆ resetStats()

void EAthena::AdminHandler::resetStats ( ) const
virtual

Implements Net::AdminHandler.

Definition at line 94 of file adminhandler.cpp.

95 {
96  createOutPacket(CMSG_ADMIN_RESET_PLAYER);
97  outMsg.writeInt16(0, "flag");
98 }

References createOutPacket.

◆ savePosition()

void EAthena::AdminHandler::savePosition ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 261 of file adminhandler.cpp.

262 {
263  Gm::runCharCommand("save", name);
264 }

References Gm::runCharCommand().

◆ setTileType()

void EAthena::AdminHandler::setTileType ( const int  x,
const int  y,
const int  type 
) const
virtual

Implements Net::AdminHandler.

Definition at line 146 of file adminhandler.cpp.

148 {
149  createOutPacket(CMSG_ADMIN_SET_TILE_TYPE);
150  outMsg.writeInt16(CAST_S16(x), "x");
151  outMsg.writeInt16(CAST_S16(y), "y");
152  outMsg.writeInt16(CAST_S16(type), "type");
153 }

References CAST_S16, createOutPacket, x, and y.

◆ showAccountInfo()

void EAthena::AdminHandler::showAccountInfo ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 236 of file adminhandler.cpp.

237 {
238  Gm::runCommand("accinfo", name);
239 }

References Gm::runCommand().

◆ showCartList()

void EAthena::AdminHandler::showCartList ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 221 of file adminhandler.cpp.

222 {
223  Gm::runCharCommand("cartlist", name);
224 }

References Gm::runCharCommand().

◆ showInventoryList()

void EAthena::AdminHandler::showInventoryList ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 226 of file adminhandler.cpp.

227 {
228  Gm::runCharCommand("itemlist", name);
229 }

References Gm::runCharCommand().

◆ showLevel()

void EAthena::AdminHandler::showLevel ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 206 of file adminhandler.cpp.

207 {
208  Gm::runCharCommand("exp", name);
209 }

References Gm::runCharCommand().

◆ showNpc()

void EAthena::AdminHandler::showNpc ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 352 of file adminhandler.cpp.

353 {
354  Gm::runCommand("shownpc", name);
355 }

References Gm::runCommand().

◆ showStats()

void EAthena::AdminHandler::showStats ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 211 of file adminhandler.cpp.

212 {
213  Gm::runCharCommand("stats", name);
214 }

References Gm::runCharCommand().

◆ showStorageList()

void EAthena::AdminHandler::showStorageList ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 216 of file adminhandler.cpp.

217 {
218  Gm::runCharCommand("storagelist", name);
219 }

References Gm::runCharCommand().

◆ slide()

void EAthena::AdminHandler::slide ( const int  x,
const int  y 
) const
virtual

Implements Net::AdminHandler.

Definition at line 377 of file adminhandler.cpp.

378 {
379  Gm::runCommand("slide",
380  strprintf("%d %d", x, y));
381 }

References Gm::runCommand(), strprintf(), x, and y.

◆ spawnClone()

void EAthena::AdminHandler::spawnClone ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 246 of file adminhandler.cpp.

247 {
248  Gm::runCommand("clone", name);
249 }

References Gm::runCommand().

◆ spawnEvilClone()

void EAthena::AdminHandler::spawnEvilClone ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 256 of file adminhandler.cpp.

257 {
258  Gm::runCommand("evilclone", name);
259 }

References Gm::runCommand().

◆ spawnSlave()

void EAthena::AdminHandler::spawnSlave ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 241 of file adminhandler.cpp.

242 {
243  Gm::runCommand("summon", name);
244 }

References Gm::runCommand().

◆ spawnSlaveClone()

void EAthena::AdminHandler::spawnSlaveClone ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 251 of file adminhandler.cpp.

252 {
253  Gm::runCommand("slaveclone", name);
254 }

References Gm::runCommand().

◆ unequipAll()

void EAthena::AdminHandler::unequipAll ( const Being *const  being) const
virtual

Implements Net::AdminHandler.

Definition at line 155 of file adminhandler.cpp.

156 {
157  if (being == nullptr)
158  return;
159 
160  createOutPacket(CMSG_ADMIN_UNEQUIP_ALL);
161  outMsg.writeBeingId(being->getId(), "account id");
162 }

References createOutPacket, and ActorSprite::getId().

◆ unjail()

void EAthena::AdminHandler::unjail ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 331 of file adminhandler.cpp.

332 {
333  Gm::runCommand("unjail", name);
334 }

References Gm::runCommand().

◆ warp()

void EAthena::AdminHandler::warp ( const std::string &  map,
const int  x,
const int  y 
) const
virtual

Implements Net::AdminHandler.

Definition at line 86 of file adminhandler.cpp.

87 {
88  createOutPacket(CMSG_PLAYER_MAPMOVE);
89  outMsg.writeString(map, 16, "map");
90  outMsg.writeInt16(CAST_S16(x), "x");
91  outMsg.writeInt16(CAST_S16(y), "y");
92 }

References CAST_S16, createOutPacket, x, and y.

◆ whoDrops()

void EAthena::AdminHandler::whoDrops ( const std::string &  name) const
virtual

Implements Net::AdminHandler.

Definition at line 181 of file adminhandler.cpp.

182 {
183  Gm::runCommand("whodrops", name);
184 }

References Gm::runCommand().

Field Documentation

◆ mStatsName

std::string EAthena::AdminHandler::mStatsName
staticprotected

Definition at line 167 of file adminhandler.h.

Referenced by requestStats().


The documentation for this class was generated from the following files: