Planeshift
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

psUserCommands Class Reference

Manages different commands that are player based in nature. More...

#include <cmdusers.h>

List of all members.

Classes

struct  EMOTE
 Struct to hold our emote data. More...

Public Member Functions

virtual const char * HandleCommand (const char *cmd)
 Interprets a received message and executes the command.
virtual void HandleMessage (MsgEntry *msg)
bool LoadEmotes ()
 psUserCommands (ClientMsgHandler *mh, CmdHandler *ch, iObjectRegistry *obj)
virtual ~psUserCommands ()

Static Public Member Functions

static void HandleSlay (bool answeredYes, void *data)

Protected Types

enum  EntityTypes {
  PSENTITYTYPE_PLAYER_CHARACTER, PSENTITYTYPE_NON_PLAYER_CHARACTER, PSENTITYTYPE_ALIVE_CHARACTER, PSENTITYTYPE_DEAD_CHARACTER,
  PSENTITYTYPE_ITEM, PSENTITYTYPE_NAME, PSENTITYTYPE_NO_TARGET
}
enum  SearchDirection { SEARCH_FORWARD, SEARCH_BACK, SEARCH_NONE }

Protected Member Functions

void AskToSlayBeforeSending (psMessageCracker *msg)
GEMClientObjectFindEntityWithName (const char *name)
csString FormatTarget (const csString &target="target")
 Returns a target string formatted to be sent in a message.
void UpdateTarget (SearchDirection searchDirection, EntityTypes entityType, const char *name)

Protected Attributes

csArray< EMOTEemoteList

Detailed Description

Manages different commands that are player based in nature.

Definition at line 45 of file cmdusers.h.


Member Enumeration Documentation

enum psUserCommands::EntityTypes [protected]
Enumerator:
PSENTITYTYPE_PLAYER_CHARACTER 
PSENTITYTYPE_NON_PLAYER_CHARACTER 
PSENTITYTYPE_ALIVE_CHARACTER 
PSENTITYTYPE_DEAD_CHARACTER 
PSENTITYTYPE_ITEM 
PSENTITYTYPE_NAME 
PSENTITYTYPE_NO_TARGET 

Definition at line 73 of file cmdusers.h.

Enumerator:
SEARCH_FORWARD 
SEARCH_BACK 
SEARCH_NONE 

Definition at line 66 of file cmdusers.h.


Constructor & Destructor Documentation

psUserCommands::psUserCommands ( ClientMsgHandler mh,
CmdHandler ch,
iObjectRegistry *  obj 
)
virtual psUserCommands::~psUserCommands ( ) [virtual]

Member Function Documentation

void psUserCommands::AskToSlayBeforeSending ( psMessageCracker msg) [protected]
GEMClientObject* psUserCommands::FindEntityWithName ( const char *  name) [protected]
csString psUserCommands::FormatTarget ( const csString &  target = "target") [protected]

Returns a target string formatted to be sent in a message.

This function would be called on a target input by the player, and will return a string indicating the same target, formatted to be sent in a net message to the server. If this can't be done, it will send back an empty string (error)

Parameters:
targetThe target to be formatted
Returns:
Returns the formatted target, or an empty string
virtual const char* psUserCommands::HandleCommand ( const char *  cmd) [virtual]

Interprets a received message and executes the command.

char * returned can be an error message to display.

Implements psCmdBase.

virtual void psUserCommands::HandleMessage ( MsgEntry msg) [virtual]

Implements psCmdBase.

static void psUserCommands::HandleSlay ( bool  answeredYes,
void *  data 
) [static]
bool psUserCommands::LoadEmotes ( )
void psUserCommands::UpdateTarget ( SearchDirection  searchDirection,
EntityTypes  entityType,
const char *  name 
) [protected]

Member Data Documentation

Definition at line 114 of file cmdusers.h.


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