ManaPlus
Functions
Gm Namespace Reference

Functions

void runCommand (const std::string &command, const std::string &params)
 
void runCommand (const std::string &command)
 
void runCharCommand (const std::string &command, const std::string &name, const std::string &params)
 
void runCharCommand (const std::string &command, const std::string &name)
 

Function Documentation

◆ runCharCommand() [1/2]

void Gm::runCharCommand ( const std::string &  command,
const std::string &  name 
)

Definition at line 94 of file gmfunctions.cpp.

96 {
97  if ((localPlayer != nullptr) && name == localPlayer->getName())
98  {
99  chatHandler->talk(std::string(
100  settings.gmCommandSymbol).append(
101  command));
102  }
103  else
104  {
105  chatHandler->talk(std::string(
107  command).append(
108  " \"").append(
109  name).append(
110  "\" "));
111  }
112 }
Net::ChatHandler * chatHandler
Definition: net.cpp:86
const std::string & getName() const
Definition: being.h:232
virtual void talk(const std::string &text) const =0
std::string gmCharCommandSymbol
Definition: settings.h:126
std::string gmCommandSymbol
Definition: settings.h:125
LocalPlayer * localPlayer
Settings settings
Definition: settings.cpp:32

References chatHandler, Being::getName(), Settings::gmCharCommandSymbol, Settings::gmCommandSymbol, localPlayer, settings, and Net::ChatHandler::talk().

◆ runCharCommand() [2/2]

void Gm::runCharCommand ( const std::string &  command,
const std::string &  name,
const std::string &  params 
)

◆ runCommand() [1/2]

void Gm::runCommand ( const std::string &  command)

Definition at line 54 of file gmfunctions.cpp.

55 {
56  chatHandler->talk(std::string(
57  settings.gmCommandSymbol).append(
58  command));
59 }

References chatHandler, Settings::gmCommandSymbol, settings, and Net::ChatHandler::talk().

◆ runCommand() [2/2]

void Gm::runCommand ( const std::string &  command,
const std::string &  params 
)

Definition at line 35 of file gmfunctions.cpp.

37 {
38  if (params.empty())
39  {
40  chatHandler->talk(std::string(
41  settings.gmCommandSymbol).append(
42  command));
43  }
44  else
45  {
46  chatHandler->talk(std::string(
47  settings.gmCommandSymbol).append(
48  command).append(
49  " ").append(
50  params));
51  }
52 }

References chatHandler, Settings::gmCommandSymbol, settings, and Net::ChatHandler::talk().

Referenced by TmwAthena::AdminHandler::alive(), Ea::AdminHandler::banName(), EAthena::AdminHandler::changePartyLeader(), TmwAthena::ChatHandler::channelMessage(), Ea::AdminHandler::createItems(), EAthena::AdminHandler::disguise(), TmwAthena::AdminHandler::gotoName(), EAthena::AdminHandler::gotoNpc(), EAthena::AdminHandler::guildRecall(), TmwAthena::AdminHandler::hide(), EAthena::AdminHandler::hideNpc(), Ea::AdminHandler::ipcheckName(), EAthena::AdminHandler::itemInfo(), EAthena::AdminHandler::jail(), Ea::AdminHandler::kickName(), EAthena::AdminHandler::locatePlayer(), EAthena::AdminHandler::mobSearch(), EAthena::AdminHandler::mobSpawnSearch(), EAthena::AdminHandler::monsterInfo(), EAthena::AdminHandler::npcMove(), EAthena::AdminHandler::nuke(), EAthena::AdminHandler::partyRecall(), TmwAthena::AdminHandler::recallName(), EAthena::AdminHandler::showAccountInfo(), EAthena::AdminHandler::showNpc(), EAthena::AdminHandler::slide(), Ea::AdminHandler::spawn(), EAthena::AdminHandler::spawnClone(), EAthena::AdminHandler::spawnEvilClone(), EAthena::AdminHandler::spawnSlave(), EAthena::AdminHandler::spawnSlaveClone(), Ea::AdminHandler::unbanName(), EAthena::AdminHandler::unjail(), TmwAthena::AdminHandler::warp(), and EAthena::AdminHandler::whoDrops().