forked from SecretsOTheP/EQMacEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguild_mgr.h
82 lines (64 loc) · 2.26 KB
/
guild_mgr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef GUILD_MGR_H_
#define GUILD_MGR_H_
#include "../common/types.h"
#include "../common/guild_base.h"
#include <map>
#include <list>
#include "../zone/petitions.h"
extern PetitionList petition_list;
//extern GuildRanks_Struct guilds[512];
//extern ZoneDatabase database;
#define PBUFFER 50
#define MBUFFER 50
#define GUILD_BANK_MAIN_AREA_SIZE 200
#define GUILD_BANK_DEPOSIT_AREA_SIZE 20
class Client;
class ServerPacket;
class GuildApproval
{
public:
GuildApproval(const char* guildname,Client* owner,uint32 id);
~GuildApproval();
bool ProcessApproval();
bool AddMemberApproval(Client* addition);
uint32 GetID() { return refid; }
Client* GetOwner() { return owner; }
void GuildApproved();
void ApprovedMembers(Client* requestee);
private:
Timer* deletion_timer;
char guild[16];
Client* owner;
Client* members[6];
uint32 refid;
};
class ZoneGuildManager : public BaseGuildManager {
public:
~ZoneGuildManager(void);
void AddGuildApproval(const char* guildname, Client* owner);
void AddMemberApproval(uint32 refid,Client* name);
void ClearGuildsApproval();
GuildApproval* FindGuildByIDApproval(uint32 refid);
GuildApproval* FindGuildByOwnerApproval(Client* owner);
void ProcessApproval();
uint32 GetFreeID() { return id+1; }
//called by worldserver when it receives a message from world.
void ProcessWorldPacket(ServerPacket *pack);
void ListGuilds(Client *c) const;
void DescribeGuild(Client *c, uint32 guild_id) const;
uint8 *MakeGuildMembers(uint32 guild_id, const char *prefix_name, uint32 &length); //make a guild member list packet, returns ownership of the buffer.
void RecordInvite(uint32 char_id, uint32 guild_id, uint8 rank);
bool VerifyAndClearInvite(uint32 char_id, uint32 guild_id, uint8 rank);
void RequestOnlineGuildMembers(uint32 FromID, uint32 GuildID);
protected:
virtual void SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation);
virtual void SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid);
virtual void SendRankUpdate(uint32 CharID);
virtual void SendGuildDelete(uint32 guild_id);
std::map<uint32, std::pair<uint32, uint8> > m_inviteQueue; //map from char ID to guild,rank
private:
LinkedList<GuildApproval*> list;
uint32 id;
};
extern ZoneGuildManager guild_mgr;
#endif /*GUILD_MGR_H_*/