Planeshift
AdminCmdData Class Reference

Base class for all the data classes for admin commands. More...

#include <adminmanager.h>

Public Member Functions

 AdminCmdData (csString commandName)
 creates data object for the specified command. More...
 
 AdminCmdData (csString commandName, WordArray &words)
 Parses the given message and stores its data. More...
 
virtual AdminCmdDataCreateCmdData (AdminManager *msgManager, MsgEntry *me, psAdminCmdMessage &msg, Client *client, WordArray &words)
 Creates a command data object of the current class containing the parsed data. More...
 
virtual csString GetHelpMessage ()
 Retrieve help message for the command that fits to the data. More...
 
virtual bool IsQuietInvalid ()
 Used for overriding. More...
 
virtual bool LogGMCommand (Client *gmClient, const char *cmd)
 Logs the game master command. More...
 
void ParseError (MsgEntry *me, const char *errmsg)
 Sends the error message to the gm and invalidates the object. More...
 
virtual ~AdminCmdData ()
 

Public Attributes

csString command
 command name this obj contains data for More...
 
bool help
 flag for displaying help (true for displaying help) More...
 
bool valid
 flag for setting content valid/invalid More...
 

Protected Member Functions

bool IsHelp (const csString &word)
 Test for help word and store help state when found. More...
 
bool LogGMCommand (Client *gmClient, PID playerID, const char *cmd)
 logs the game master command and target to the database. More...
 

Detailed Description

Base class for all the data classes for admin commands.

Contains Data and parsing facilities for admin commands.

Definition at line 270 of file adminmanager.h.

Constructor & Destructor Documentation

AdminCmdData::AdminCmdData ( csString  commandName)
inline

creates data object for the specified command.

Parameters
commandNamename of the command (e.g. /ban)

Definition at line 280 of file adminmanager.h.

AdminCmdData::AdminCmdData ( csString  commandName,
WordArray words 
)

Parses the given message and stores its data.

Parameters
commandNamename of the command (e.g. /ban)
wordscommand message to parse
virtual AdminCmdData::~AdminCmdData ( )
inlinevirtual

Definition at line 290 of file adminmanager.h.

Member Function Documentation

virtual AdminCmdData* AdminCmdData::CreateCmdData ( AdminManager msgManager,
MsgEntry me,
psAdminCmdMessage msg,
Client client,
WordArray words 
)
virtual

Creates a command data object of the current class containing the parsed data.

Parameters
msgManagermessage manager that handles this command
meMessage sent by the client
msgpsAdminCmdMessage containing the message
clientclient of the network communication
wordscommand message to parse
Returns
AdminCmdData* pointer to object containing parsed data. When parsing failed the valid flag is set to false.

Reimplemented in AdminCmdDataTime, AdminCmdDataList, AdminCmdDataRndMsgTest, AdminCmdDataSimple, AdminCmdDataNPCClientQuit, AdminCmdDataServerQuit, AdminCmdDataAssignFaction, AdminCmdDataSetKillExp, AdminCmdDataDisableQuest, AdminCmdDataListWarnings, AdminCmdDataReload, AdminCmdDataSetItem, AdminCmdDataSetTrait, AdminCmdDataSetQuality, AdminCmdDataQuest, AdminCmdDataBadText, AdminCmdDataHire, AdminCmdDataGameMasterEvent, AdminCmdDataPath, AdminCmdDataLocation, AdminCmdDataAction, AdminCmdDataSetLabelColor, AdminCmdDataSet, AdminCmdDataSetSkill, AdminCmdDataScale, AdminCmdDataMorph, AdminCmdDataModify, AdminCmdDataFog, AdminCmdDataWeatherEffect, AdminCmdDataWeather, AdminCmdDataSectorTarget, AdminCmdDataCheckItem, AdminCmdDataItemTarget, AdminCmdDataAward, AdminCmdDataDeputize, AdminCmdDataImpersonate, AdminCmdDataPetition, AdminCmdDataChangeGuildLeader, AdminCmdDataChangeGuildName, AdminCmdDataChangeName, AdminCmdDataSlide, AdminCmdDataTeleport, AdminCmdDataCrystal, AdminCmdDataRunScript, AdminCmdDataKey, AdminCmdDataItem, AdminCmdDataInfo, AdminCmdDataLoadQuest, AdminCmdDataSetStackable, AdminCmdDataDebugTribe, AdminCmdDataDebugNPC, AdminCmdDataChangeNPCType, AdminCmdDataPercept, AdminCmdDataKillNPC, AdminCmdDataBan, AdminCmdDataUpdateRespawn, AdminCmdDataDeleteChar, AdminCmdDataDeath, AdminCmdDataTargetReason, and AdminCmdDataTarget.

virtual csString AdminCmdData::GetHelpMessage ( )
virtual
bool AdminCmdData::IsHelp ( const csString &  word)
inlineprotected

Test for help word and store help state when found.

Parameters
wordto test
Returns
bool if help word was found, otherwise false

Definition at line 348 of file adminmanager.h.

virtual bool AdminCmdData::IsQuietInvalid ( )
inlinevirtual

Used for overriding.

If it's true the command will have no visual effects and will be discarded.

Returns
bool if true we will ignore this command and not execute it.

Reimplemented in AdminCmdDataTarget.

Definition at line 328 of file adminmanager.h.

virtual bool AdminCmdData::LogGMCommand ( Client gmClient,
const char *  cmd 
)
virtual

Logs the game master command.

Parameters
gmClientissuing the command
cmdcommand message issued
Returns
bool: false when database logging fails

Reimplemented in AdminCmdDataTarget.

bool AdminCmdData::LogGMCommand ( Client gmClient,
PID  playerID,
const char *  cmd 
)
protected

logs the game master command and target to the database.

/slide command cannot be logged with this function.

Parameters
gmClientissuing the command
playerIDtargeted player (if applicable)
cmdcommand message issued
void AdminCmdData::ParseError ( MsgEntry me,
const char *  errmsg 
)

Sends the error message to the gm and invalidates the object.

errormessage is sent to the gm client and valid is set to false.

Parameters
meThe incoming message from the GM
errmsgerror message

Member Data Documentation

csString AdminCmdData::command

command name this obj contains data for

Definition at line 273 of file adminmanager.h.

bool AdminCmdData::help

flag for displaying help (true for displaying help)

Definition at line 274 of file adminmanager.h.

bool AdminCmdData::valid

flag for setting content valid/invalid

Definition at line 275 of file adminmanager.h.


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