Planeshift
Public Member Functions | Public Attributes | Protected Member Functions

AdminCmdData Class Reference

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

#include <adminmanager.h>

List of all members.

Public Member Functions

 AdminCmdData (csString commandName)
 creates data object for the specified command.
 AdminCmdData (csString commandName, WordArray &words)
 Parses the given message and stores its data.
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.
virtual csString GetHelpMessage ()
 Retrieve help message for the command that fits to the data.
virtual bool IsQuietInvalid ()
 Used for overriding.
virtual bool LogGMCommand (Client *gmClient, const char *cmd)
 Logs the game master command.
void ParseError (MsgEntry *me, const char *errmsg)
 Sends the error message to the gm and invalidates the object.
virtual ~AdminCmdData ()

Public Attributes

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

Protected Member Functions

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

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 ( ) [inline, virtual]

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

virtual csString AdminCmdData::GetHelpMessage ( ) [virtual]
bool AdminCmdData::IsHelp ( const csString &  word) [inline, protected]

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 ( ) [inline, virtual]

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

command name this obj contains data for

Definition at line 273 of file adminmanager.h.

flag for displaying help (true for displaying help)

Definition at line 274 of file adminmanager.h.

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: