Planeshift
GuildManager Class Reference

#include <guildmanager.h>

Public Member Functions

void AcceptWar (PendingGuildWarInvite *invite)
 
void CheckMinimumRequirements (psGuildInfo *guild, gemActor *notify)
 Ensure guild has at least the minimum members, and set timer to disband if not. More...
 
 GuildManager (ClientConnectionSet *pCCS, ChatManager *chat)
 
void HandleJoinGuild (PendingGuildInvite *invite)
 
void RequirementsDeadline (int guild_id)
 After the grace period is up, disband guild if requirements not met. More...
 
void ResendGuildData (int id)
 
virtual ~GuildManager ()
 
- Public Member Functions inherited from MessageManager< GuildManager >
void HandleMessage (MsgEntry *msg, Client *client)
 Transfers the message to the manager specific function. More...
 
void Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01)
 Subscribes this manager to a specific message type with a custom callback. More...
 
bool Unsubscribe (msgtype type)
 Unsubscribes this manager from a specific message type. More...
 
bool Unsubscribe (FunctionPointer handler, msgtype type)
 Unsubscribes a specific handler from a specific message type. More...
 
bool UnsubscribeAll ()
 Unsubscribes this manager from all message types. More...
 
virtual ~MessageManager ()
 Unsubscribes all messages then destroys this object. More...
 
- Public Member Functions inherited from MessageManagerBase
csArray< csString > DecodeCommandArea (Client *client, csString target)
 Decodes an area: expression. More...
 
gemObjectFindObjectByString (const csString &str, gemActor *me) const
 Find the object we are referring to in str. More...
 
ClientFindPlayerClient (const char *name)
 Finds Client* of character with given name. More...
 
virtual bool Verify (MsgEntry *pMsg, unsigned int flags, Client *&client)
 

Protected Member Functions

bool AddPlayerToGuild (int guild, const char *guildname, Client *client, int level)
 
void AllianceInvite (psGuildCmdMessage &msg, Client *client)
 
void AllianceLeader (psGuildCmdMessage &msg, Client *client)
 
void AllianceLeave (psGuildCmdMessage &msg, Client *client)
 
void AllianceRemove (psGuildCmdMessage &msg, Client *client)
 
void ChangeGuildName (psGuildCmdMessage &msg, Client *client)
 
bool CheckAllianceOperation (Client *client, bool checkLeaderGuild, psGuildInfo *&guild, psGuildAlliance *&alliance)
 
bool CheckClientRights (Client *client, GUILD_PRIVILEGE priv)
 Checks if client has right 'priv'. More...
 
bool CheckClientRights (Client *client, GUILD_PRIVILEGE priv, const char *denialMsg)
 Checks if client has right 'priv'. More...
 
void CreateGuild (psGuildCmdMessage &msg, Client *client)
 
void EndAlliance (psGuildCmdMessage &msg, Client *client)
 
void EndAlliance (psGuildAlliance *alliance, int clientNum)
 This is the function which actually end the alliance. More...
 
void EndGuild (psGuildInfo *guild, int clientnum)
 This function actually removes the guild. More...
 
void EndGuild (psGuildCmdMessage &msg, Client *client)
 This handles the command from the player to end the guild, validates and calls the other EndGuild. More...
 
bool FilterGuildName (const char *name)
 
GuildNotifySubscriptionFindNotifySubscr (Client *client)
 
int GetClientLevel (Client *client)
 
void GetMemberPermissions (psGuildCmdMessage &msg, Client *client)
 Handles the /getmemberpermissions command and returns the permissions of the member to the requesting client. More...
 
void GuildWar (psGuildCmdMessage &msg, Client *client)
 
void GuildYield (psGuildCmdMessage &msg, Client *client)
 
void HandleCmdMessage (MsgEntry *me, Client *client)
 
void HandleGUIMessage (MsgEntry *me, Client *client)
 
void HandleMOTDSet (MsgEntry *me, Client *client)
 
void HandleRemoveMember (Client *client, iDocumentNode *root)
 
void HandleSetAllianceNotifications (Client *client, iDocumentNode *root)
 Sets the status of alliance notifications when an alliance member logins/logsout. More...
 
void HandleSetGuildNotifications (Client *client, iDocumentNode *root)
 Sets the status of guild notifications when a guild member logins/logsout. More...
 
void HandleSetLevelRight (Client *client, iDocumentNode *root)
 Sets the permission of specific level and priviledge (example: Initiate, View Chat, yes) More...
 
void HandleSetMaxMemberPoints (Client *client, iDocumentNode *root)
 Handles the message from the client asking for a change in max member points. More...
 
void HandleSetMemberLevel (Client *client, iDocumentNode *root)
 
void HandleSetMemberNotes (Client *client, iDocumentNode *root, bool isPublic)
 
void HandleSetMemberPoints (Client *client, iDocumentNode *root)
 
void HandleSetOnline (Client *client, iDocumentNode *root)
 
void HandleSubscribeGuildData (Client *client, iDocumentNode *root)
 
void Invite (psGuildCmdMessage &msg, Client *client)
 
bool IsLeader (Client *client)
 
void ListMembers (psGuildCmdMessage &msg, Client *client)
 
csString MakeAllianceMemberXML (psGuildInfo *member, bool allianceLeader)
 
void MOTD (psGuildCmdMessage &msg, Client *client)
 
void NewAlliance (psGuildCmdMessage &msg, Client *client)
 
bool ParseRightString (csString privilege, GUILD_PRIVILEGE &right)
 Parses a right string in order to be used by the right assignment functions. More...
 
void Promote (psGuildCmdMessage &msg, Client *client)
 
void Remove (psGuildCmdMessage &msg, Client *client)
 
void RemoveMemberFromAlliance (Client *client, psGuildInfo *guild, psGuildAlliance *alliance, psGuildInfo *removedGuild)
 
void Rename (psGuildCmdMessage &msg, Client *client)
 
bool RetrieveAllianceNotifications (iDocumentNode *root)
 Parses the xml to check if the client wants to be notified of alliance member logging in/off. More...
 
bool RetrieveGuildNotifications (iDocumentNode *root)
 Parses the xml to check if the client wants to be notified of guild member logging in/off. More...
 
bool RetrieveOnlineOnly (iDocumentNode *root)
 Parses the xml to check if the client wants only a list of online members. More...
 
void Secret (psGuildCmdMessage &msg, Client *client)
 
void SendAllianceData (Client *client)
 
void SendAllianceNotifications (psGuildAlliance *alliance)
 Calls SendNotifications() with type psGUIGuildMessage::ALLIANCE_DATA for all alliance members. More...
 
void SendGuildData (Client *client)
 
void SendGuildPoints (psGuildCmdMessage &msg, Client *client)
 
void SendLevelData (Client *client)
 
void SendMemberData (Client *client, bool onlineOnly)
 
void SendNoAllianceNotifications (psGuildAlliance *alliance)
 Sends psGUIGuildMessage::ALLIANCE_DATA messages saying "you are not in any alliance" to all notification subscribers from given alliance. More...
 
void SendNoAllianceNotifications (psGuildInfo *guild)
 
void SendNotifications (int guild, int msg)
 Sends changed guild data to notification subscribers. More...
 
void SetMemberPermissions (psGuildCmdMessage &msg, Client *client)
 Handles the /setmemberpermissions command and allows to change the permissions of a particular member of a guild (addition/removal from the guild level permissions). More...
 
void UnsubscribeGuildData (Client *client)
 
void UnsubscribeWholeGuild (psGuildInfo *guild)
 
void Web (psGuildCmdMessage &msg, Client *client)
 

Protected Attributes

ChatManagerchatserver
 
ClientConnectionSetclients
 
csArray< GuildNotifySubscription * > notifySubscr
 
csRef< iDocumentSystem > xml
 

Additional Inherited Members

- Public Types inherited from MessageManager< GuildManager >
typedef void(GuildManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

Definition at line 67 of file guildmanager.h.

Constructor & Destructor Documentation

GuildManager::GuildManager ( ClientConnectionSet pCCS,
ChatManager chat 
)
virtual GuildManager::~GuildManager ( )
virtual

Member Function Documentation

void GuildManager::AcceptWar ( PendingGuildWarInvite *  invite)
bool GuildManager::AddPlayerToGuild ( int  guild,
const char *  guildname,
Client client,
int  level 
)
protected
void GuildManager::AllianceInvite ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::AllianceLeader ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::AllianceLeave ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::AllianceRemove ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::ChangeGuildName ( psGuildCmdMessage msg,
Client client 
)
protected
bool GuildManager::CheckAllianceOperation ( Client client,
bool  checkLeaderGuild,
psGuildInfo *&  guild,
psGuildAlliance *&  alliance 
)
protected
bool GuildManager::CheckClientRights ( Client client,
GUILD_PRIVILEGE  priv 
)
protected

Checks if client has right 'priv'.

bool GuildManager::CheckClientRights ( Client client,
GUILD_PRIVILEGE  priv,
const char *  denialMsg 
)
protected

Checks if client has right 'priv'.

If not, it sends him psSystemMessage with text 'denialMsg'

void GuildManager::CheckMinimumRequirements ( psGuildInfo guild,
gemActor notify 
)

Ensure guild has at least the minimum members, and set timer to disband if not.

void GuildManager::CreateGuild ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::EndAlliance ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::EndAlliance ( psGuildAlliance alliance,
int  clientNum 
)
protected

This is the function which actually end the alliance.

This is needed as the alliance could be removed also for the lack of the prerequisites automatically on guild removal, which itself can happen automatically.

Parameters
allianceA pointer to the alliance being removed.
clientNumThe number of the client who issued the command, if any.
void GuildManager::EndGuild ( psGuildInfo guild,
int  clientnum 
)
protected

This function actually removes the guild.

void GuildManager::EndGuild ( psGuildCmdMessage msg,
Client client 
)
protected

This handles the command from the player to end the guild, validates and calls the other EndGuild.

bool GuildManager::FilterGuildName ( const char *  name)
protected
GuildNotifySubscription* GuildManager::FindNotifySubscr ( Client client)
protected
int GuildManager::GetClientLevel ( Client client)
protected
void GuildManager::GetMemberPermissions ( psGuildCmdMessage msg,
Client client 
)
protected

Handles the /getmemberpermissions command and returns the permissions of the member to the requesting client.

The client can only check permissions of members he can change permissions too.

Parameters
msgthe message coming from the client
clientthe client sending the request
void GuildManager::GuildWar ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::GuildYield ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::HandleCmdMessage ( MsgEntry me,
Client client 
)
protected
void GuildManager::HandleGUIMessage ( MsgEntry me,
Client client 
)
protected
void GuildManager::HandleJoinGuild ( PendingGuildInvite *  invite)
void GuildManager::HandleMOTDSet ( MsgEntry me,
Client client 
)
protected
void GuildManager::HandleRemoveMember ( Client client,
iDocumentNode *  root 
)
protected
void GuildManager::HandleSetAllianceNotifications ( Client client,
iDocumentNode *  root 
)
protected

Sets the status of alliance notifications when an alliance member logins/logsout.

void GuildManager::HandleSetGuildNotifications ( Client client,
iDocumentNode *  root 
)
protected

Sets the status of guild notifications when a guild member logins/logsout.

void GuildManager::HandleSetLevelRight ( Client client,
iDocumentNode *  root 
)
protected

Sets the permission of specific level and priviledge (example: Initiate, View Chat, yes)

void GuildManager::HandleSetMaxMemberPoints ( Client client,
iDocumentNode *  root 
)
protected

Handles the message from the client asking for a change in max member points.

Parameters
clientthe client asking the operation
rootthe document node which starts the data for this command
void GuildManager::HandleSetMemberLevel ( Client client,
iDocumentNode *  root 
)
protected
void GuildManager::HandleSetMemberNotes ( Client client,
iDocumentNode *  root,
bool  isPublic 
)
protected
void GuildManager::HandleSetMemberPoints ( Client client,
iDocumentNode *  root 
)
protected
void GuildManager::HandleSetOnline ( Client client,
iDocumentNode *  root 
)
protected
void GuildManager::HandleSubscribeGuildData ( Client client,
iDocumentNode *  root 
)
protected
void GuildManager::Invite ( psGuildCmdMessage msg,
Client client 
)
protected
bool GuildManager::IsLeader ( Client client)
protected
void GuildManager::ListMembers ( psGuildCmdMessage msg,
Client client 
)
protected
csString GuildManager::MakeAllianceMemberXML ( psGuildInfo member,
bool  allianceLeader 
)
protected
void GuildManager::MOTD ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::NewAlliance ( psGuildCmdMessage msg,
Client client 
)
protected
bool GuildManager::ParseRightString ( csString  privilege,
GUILD_PRIVILEGE right 
)
protected

Parses a right string in order to be used by the right assignment functions.

Parameters
privilegeA string with the privilege name
rightWhere the result is stored
Returns
true if the right was found
void GuildManager::Promote ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::Remove ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::RemoveMemberFromAlliance ( Client client,
psGuildInfo guild,
psGuildAlliance alliance,
psGuildInfo removedGuild 
)
protected
void GuildManager::Rename ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::RequirementsDeadline ( int  guild_id)

After the grace period is up, disband guild if requirements not met.

void GuildManager::ResendGuildData ( int  id)
bool GuildManager::RetrieveAllianceNotifications ( iDocumentNode *  root)
protected

Parses the xml to check if the client wants to be notified of alliance member logging in/off.

bool GuildManager::RetrieveGuildNotifications ( iDocumentNode *  root)
protected

Parses the xml to check if the client wants to be notified of guild member logging in/off.

bool GuildManager::RetrieveOnlineOnly ( iDocumentNode *  root)
protected

Parses the xml to check if the client wants only a list of online members.

void GuildManager::Secret ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::SendAllianceData ( Client client)
protected
void GuildManager::SendAllianceNotifications ( psGuildAlliance alliance)
protected

Calls SendNotifications() with type psGUIGuildMessage::ALLIANCE_DATA for all alliance members.

void GuildManager::SendGuildData ( Client client)
protected
void GuildManager::SendGuildPoints ( psGuildCmdMessage msg,
Client client 
)
protected
void GuildManager::SendLevelData ( Client client)
protected
void GuildManager::SendMemberData ( Client client,
bool  onlineOnly 
)
protected
void GuildManager::SendNoAllianceNotifications ( psGuildAlliance alliance)
protected

Sends psGUIGuildMessage::ALLIANCE_DATA messages saying "you are not in any alliance" to all notification subscribers from given alliance.

This is used when an alliance is being disbanded or when one of its members is removed.

void GuildManager::SendNoAllianceNotifications ( psGuildInfo guild)
protected
void GuildManager::SendNotifications ( int  guild,
int  msg 
)
protected

Sends changed guild data to notification subscribers.

Value of 'msg' says which kind of data and it can be:

void GuildManager::SetMemberPermissions ( psGuildCmdMessage msg,
Client client 
)
protected

Handles the /setmemberpermissions command and allows to change the permissions of a particular member of a guild (addition/removal from the guild level permissions).

Parameters
msgthe message coming from the client
clientthe client sending the request
void GuildManager::UnsubscribeGuildData ( Client client)
protected
void GuildManager::UnsubscribeWholeGuild ( psGuildInfo guild)
protected
void GuildManager::Web ( psGuildCmdMessage msg,
Client client 
)
protected

Member Data Documentation

ChatManager* GuildManager::chatserver
protected

Definition at line 269 of file guildmanager.h.

ClientConnectionSet* GuildManager::clients
protected

Definition at line 270 of file guildmanager.h.

csArray<GuildNotifySubscription*> GuildManager::notifySubscr
protected

Definition at line 271 of file guildmanager.h.

csRef<iDocumentSystem> GuildManager::xml
protected

Definition at line 273 of file guildmanager.h.


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