Planeshift
Classes | Public Member Functions

GMEventManager Class Reference

GameMaster Events manager class. More...

#include <gmeventmanager.h>

List of all members.

Classes

struct  GMEvent
struct  PlayerData

Public Member Functions

bool AddNewGMEvent (Client *client, csString eventName, csString eventDescription)
 GM attempts to add new event.
bool AssumeControlOfGMEvent (Client *client, csString eventName)
 GM attempts to assume control of an event, after originator has absconded.
bool CompleteGMEvent (Client *client, csString eventName)
 A player completes an event.
bool CompleteGMEvent (Client *client, PID gmID, bool byTheControllerGM=true)
 A player completes an event.
bool EraseGMEvent (Client *client, csString eventName)
 GM discards an event of theirs by name; participants are removed, and it is wiped from the DB.
int GetAllGMEventsForPlayer (PID playerID, csArray< int > &completedEvents, int &runningEventAsGM, csArray< int > &completedEventsAsGM)
 Returns all events for a player.
GMEventStatus GetGMEventDetailsByID (int id, csString &name, csString &description)
 Returns event details for a particular event.
 GMEventManager ()
virtual void HandleGMEventCommand (MsgEntry *me, Client *client)
 handle message from client
bool Initialise (void)
bool ListGMEvents (Client *client)
 Sends a list of all events to client.
bool RegisterPlayerInGMEvent (Client *client, Client *target)
 GM registers player into his/her event.
bool RegisterPlayersInRangeInGMEvent (Client *client, float range)
 GM registers all players in range.
bool RemovePlayerFromGMEvent (Client *client, Client *target)
 A player is removed from a running event.
bool RemovePlayerFromGMEvents (PID playerID)
 Removes a player from any GM event they maybe involved with (eg player being deleted)
bool RewardPlayersInGMEvent (Client *client, RangeSpecifier rewardRecipient, float range, Client *target, psRewardData *reward)
 Reward players who complete an event.
 ~GMEventManager ()

Detailed Description

GameMaster Events manager class.

Definition at line 72 of file gmeventmanager.h.


Constructor & Destructor Documentation

GMEventManager::GMEventManager ( )
GMEventManager::~GMEventManager ( )

Member Function Documentation

bool GMEventManager::AddNewGMEvent ( Client client,
csString  eventName,
csString  eventDescription 
)

GM attempts to add new event.

Parameters:
clientclient pointer.
eventNameevent name.
eventDescriptionevent description.
Returns:
true = success, false = failed.
bool GMEventManager::AssumeControlOfGMEvent ( Client client,
csString  eventName 
)

GM attempts to assume control of an event, after originator has absconded.

Parameters:
clientclient pointer.
eventNameevent name.
Returns:
true = success, false = failed.
bool GMEventManager::CompleteGMEvent ( Client client,
PID  gmID,
bool  byTheControllerGM = true 
)

A player completes an event.

Parameters:
clientclient pointer.
gmIDGame Master player ID.
byTheControllerGMtrue if it is the controlling GM
Returns:
true = success, false = failed.
bool GMEventManager::CompleteGMEvent ( Client client,
csString  eventName 
)

A player completes an event.

Parameters:
clientclient pointer.
eventNameName of the event.
Returns:
true = success, false = failed.
bool GMEventManager::EraseGMEvent ( Client client,
csString  eventName 
)

GM discards an event of theirs by name; participants are removed, and it is wiped from the DB.

Parameters:
clientclient pointer.
eventNameevent name.
Returns:
true = success, false = failed.
int GMEventManager::GetAllGMEventsForPlayer ( PID  playerID,
csArray< int > &  completedEvents,
int runningEventAsGM,
csArray< int > &  completedEventsAsGM 
)

Returns all events for a player.

Parameters:
playerIDthe player identity.
completedEventsarray of event ids of completed events player.
runningEventAsGMrunning event id as GM.
completedEventsAsGMarray of ids of completed events as GM.
Returns:
int running event id.
GMEventStatus GMEventManager::GetGMEventDetailsByID ( int  id,
csString &  name,
csString &  description 
)

Returns event details for a particular event.

Parameters:
idevent id.
namename of event.
descriptiondescription of event.
Returns:
GMEventStatus status of event.
virtual void GMEventManager::HandleGMEventCommand ( MsgEntry me,
Client client 
) [virtual]

handle message from client

bool GMEventManager::Initialise ( void  )
bool GMEventManager::ListGMEvents ( Client client)

Sends a list of all events to client.

Parameters:
clientclient pointer.
Returns:
true = success, false = failed.
bool GMEventManager::RegisterPlayerInGMEvent ( Client client,
Client target 
)

GM registers player into his/her event.

Parameters:
clientclient pointer.
targetregisteree player client.
Returns:
true = success, false = failed.
bool GMEventManager::RegisterPlayersInRangeInGMEvent ( Client client,
float  range 
)

GM registers all players in range.

Parameters:
clientclient pointer.
rangerequired range.
Returns:
true = success, false = failed.
bool GMEventManager::RemovePlayerFromGMEvent ( Client client,
Client target 
)

A player is removed from a running event.

A player can be excused from finishing an event.

Parameters:
clientclient pointer.
targetregisteree player client to be removed.
Returns:
true = success, false = failed.
bool GMEventManager::RemovePlayerFromGMEvents ( PID  playerID)

Removes a player from any GM event they maybe involved with (eg player being deleted)

Parameters:
playerIDid of player being removed
Returns:
true = success
bool GMEventManager::RewardPlayersInGMEvent ( Client client,
RangeSpecifier  rewardRecipient,
float  range,
Client target,
psRewardData reward 
)

Reward players who complete an event.

Event *must* be live at the time of reward).

Parameters:
clientclient pointer.
rewardRecipientwho will receive the reward.
rangerequired range of winners (NO_RANGE = all participants).
targetspecific individual winner.
rewardThe reward.
Returns:
true = success, false = failed.

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