1
This commit is contained in:
parent
c2456dee43
commit
d674b16f2a
@ -15,6 +15,14 @@ enum GuildStatus_e
|
|||||||
kGuildDismissed = 2
|
kGuildDismissed = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum GuildJob_e
|
||||||
|
{
|
||||||
|
kGuildMember = 0,
|
||||||
|
kGuildOwner = 1,
|
||||||
|
kGuildAdmin = 2,
|
||||||
|
kGuildElite = 3
|
||||||
|
};
|
||||||
|
|
||||||
enum InnerMesssage_e
|
enum InnerMesssage_e
|
||||||
{
|
{
|
||||||
IM_WSProxyDisconnect = 100,
|
IM_WSProxyDisconnect = 100,
|
||||||
@ -53,6 +61,8 @@ const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
|||||||
const char* const EVENT_FRIEND_AGREE = "friend.agree";
|
const char* const EVENT_FRIEND_AGREE = "friend.agree";
|
||||||
const char* const EVENT_FRIEND_DELETE = "friend.delete";
|
const char* const EVENT_FRIEND_DELETE = "friend.delete";
|
||||||
|
|
||||||
|
const char* const EVENT_GUILD_DELETE = "guild.dismiss";
|
||||||
|
|
||||||
const int MAX_INSTANCE_ID = 1023;
|
const int MAX_INSTANCE_ID = 1023;
|
||||||
|
|
||||||
const int MAX_FRIEND_NUM = 30;
|
const int MAX_FRIEND_NUM = 30;
|
||||||
|
@ -43,6 +43,7 @@ void Guild::AddMember(GuildMember* member)
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
member_hash_[member->account_id] = member;
|
member_hash_[member->account_id] = member;
|
||||||
|
GenSortedMembers();
|
||||||
|
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
if (dirty_timer_) {
|
if (dirty_timer_) {
|
||||||
@ -55,6 +56,8 @@ void Guild::RemoveMember(const std::string& account_id)
|
|||||||
GuildMember* member = GetMember(account_id);
|
GuildMember* member = GetMember(account_id);
|
||||||
if (member) {
|
if (member) {
|
||||||
member_hash_.erase(account_id);
|
member_hash_.erase(account_id);
|
||||||
|
A8_SAFE_DELETE(member);
|
||||||
|
GenSortedMembers();
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
@ -114,22 +117,47 @@ void Guild::_CMGuildJoin(int socket_handle, const ss::MFIMMsgConext& context, co
|
|||||||
|
|
||||||
void Guild::_CMGuildAgree(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildAgree& msg)
|
void Guild::_CMGuildAgree(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildAgree& msg)
|
||||||
{
|
{
|
||||||
|
cs::SMGuildAgree respmsg;
|
||||||
|
GuildMgr::Instance()->ForwardGuildSMMsg(socket_handle, context, respmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::_CMGuildKick(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildKick& msg)
|
void Guild::_CMGuildKick(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildKick& msg)
|
||||||
{
|
{
|
||||||
|
cs::SMGuildKick respmsg;
|
||||||
|
GuildMember* member = GetMember(context.user_info().base_data().account_id());
|
||||||
|
if (!member) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GuildMgr::Instance()->ForwardGuildSMMsg(socket_handle, context, respmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::_CMGuildQuit(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildQuit& msg)
|
void Guild::_CMGuildQuit(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildQuit& msg)
|
||||||
{
|
{
|
||||||
|
cs::SMGuildQuit respmsg;
|
||||||
|
GuildMember* member = GetMember(context.user_info().base_data().account_id());
|
||||||
|
if (!member) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (member->guild_job == kGuildOwner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RemoveMember(member->account_id);
|
||||||
|
GuildMgr::Instance()->ForwardGuildSMMsg(socket_handle, context, respmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::_CMGuildDismiss(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildDismiss& msg)
|
void Guild::_CMGuildDismiss(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildDismiss& msg)
|
||||||
{
|
{
|
||||||
|
cs::SMGuildDismiss respmsg;
|
||||||
|
GuildMember* member = GetMember(context.user_info().base_data().account_id());
|
||||||
|
if (!member) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (member->guild_job != kGuildOwner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
guild_status = kGuildDismissed;
|
||||||
|
SaveToDB();
|
||||||
|
GuildMgr::Instance()->ForwardGuildSMMsg(socket_handle, context, respmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::_CMGuildRename(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildRename& msg)
|
void Guild::_CMGuildRename(int socket_handle, const ss::MFIMMsgConext& context, const cs::CMGuildRename& msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user