Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

GuildManager Class Reference

#include <guildmanager.h>

List of all members.

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.
 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.
void ResendGuildData (int id)
virtual ~GuildManager ()

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, const char *denialMsg)
 Checks if client has right 'priv'.
bool CheckClientRights (Client *client, GUILD_PRIVILEGE priv)
 Checks if client has right 'priv'.
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.
void EndGuild (psGuildInfo *guild, int clientnum)
 This function actually removes the guild.
void EndGuild (psGuildCmdMessage &msg, Client *client)
 This handles the command from the player to end the guild, validates and calls the other EndGuild.
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.
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.
void HandleSetGuildNotifications (Client *client, iDocumentNode *root)
 Sets the status of guild notifications when a guild member logins/logsout.
void HandleSetLevelRight (Client *client, iDocumentNode *root)
void HandleSetMaxMemberPoints (Client *client, iDocumentNode *root)
 Handles the message from the client asking for a change in max member points.
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.
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.
bool RetrieveGuildNotifications (iDocumentNode *root)
 Parses the xml to check if the client wants to be notified of guild member logging in/off.
bool RetrieveOnlineOnly (iDocumentNode *root)
 Parses the xml to check if the client wants only a list of online members.
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.
void SendGuildData (Client *client)
void SendGuildPoints (psGuildCmdMessage &msg, Client *client)
void SendLevelData (Client *client)
void SendMemberData (Client *client, bool onlineOnly)
void SendNoAllianceNotifications (psGuildInfo *guild)
void SendNoAllianceNotifications (psGuildAlliance *alliance)
 Sends psGUIGuildMessage::ALLIANCE_DATA messages saying "you are not in any alliance" to all notification subscribers from given alliance.
void SendNotifications (int guild, int msg)
 Sends changed guild data to notification subscribers.
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).
void UnsubscribeGuildData (Client *client)
void UnsubscribeWholeGuild (psGuildInfo *guild)
void Web (psGuildCmdMessage &msg, Client *client)

Protected Attributes

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

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]
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 ( psGuildInfo guild) [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::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

Definition at line 268 of file guildmanager.h.

Definition at line 269 of file guildmanager.h.

Definition at line 270 of file guildmanager.h.

csRef<iDocumentSystem> GuildManager::xml [protected]

Definition at line 272 of file guildmanager.h.


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