1
This commit is contained in:
parent
14c68f6cd4
commit
3af8b04c82
@ -54,3 +54,5 @@ const int DAILY_JOIN_FRIEND_TIMES = 100;
|
||||
const int DAILY_APPLY_FRIEND_TIMES = 100;
|
||||
|
||||
const int SYS_RESET_TIME = 2*60; //每日两点重置
|
||||
|
||||
const int SERVER_INTERNAL_ERROR = 100;
|
||||
|
@ -78,8 +78,14 @@ void GuildMgr::_SS_IM_ForwardGuildCMMsg(f8::MsgHdr& hdr, const ss::SS_IM_Forward
|
||||
|
||||
void GuildMgr::_CMGuildCreate(const ss::MFIMMsgConext& context, const cs::CMGuildCreate& msg)
|
||||
{
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildCreate respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
Guild* guild = GetGuild(context.user_info().base_data().guild_id());
|
||||
if (guild) {
|
||||
cs::SMGuildCreate respmsg;
|
||||
respmsg.set_errcode(1);
|
||||
@ -87,11 +93,17 @@ void GuildMgr::_CMGuildCreate(const ss::MFIMMsgConext& context, const cs::CMGuil
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GuildMgr::_CMGuildJoin(const ss::MFIMMsgConext& context, const cs::CMGuildJoin& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildJoin respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(msg.guild_id());
|
||||
if (!guild) {
|
||||
@ -128,6 +140,13 @@ void GuildMgr::_CMGuildJoin(const ss::MFIMMsgConext& context, const cs::CMGuildJ
|
||||
|
||||
void GuildMgr::_CMGuildAgree(const ss::MFIMMsgConext& context, const cs::CMGuildAgree& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildAgree respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!guild) {
|
||||
@ -138,6 +157,13 @@ void GuildMgr::_CMGuildAgree(const ss::MFIMMsgConext& context, const cs::CMGuild
|
||||
|
||||
void GuildMgr::_CMGuildKick(const ss::MFIMMsgConext& context, const cs::CMGuildKick& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildKick respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!guild) {
|
||||
@ -161,6 +187,13 @@ void GuildMgr::_CMGuildKick(const ss::MFIMMsgConext& context, const cs::CMGuildK
|
||||
|
||||
void GuildMgr::_CMGuildQuit(const ss::MFIMMsgConext& context, const cs::CMGuildQuit& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildQuit respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!guild) {
|
||||
@ -183,6 +216,13 @@ void GuildMgr::_CMGuildQuit(const ss::MFIMMsgConext& context, const cs::CMGuildQ
|
||||
|
||||
void GuildMgr::_CMGuildDismiss(const ss::MFIMMsgConext& context, const cs::CMGuildDismiss& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildDismiss respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!guild) {
|
||||
@ -193,6 +233,13 @@ void GuildMgr::_CMGuildDismiss(const ss::MFIMMsgConext& context, const cs::CMGui
|
||||
|
||||
void GuildMgr::_CMGuildRename(const ss::MFIMMsgConext& context, const cs::CMGuildRename& msg)
|
||||
{
|
||||
if (!IsValidGuildId(context.user_info().base_data().guild_id())) {
|
||||
cs::SMGuildRename respmsg;
|
||||
respmsg.set_errcode(SERVER_INTERNAL_ERROR);
|
||||
respmsg.set_errmsg("服务器内部错误");
|
||||
ForwardGuildSMMsg(context, respmsg);
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
Guild* guild = GetGuild(context.guild_id());
|
||||
if (!guild) {
|
||||
@ -216,6 +263,11 @@ void GuildMgr::_CMGuildRename(const ss::MFIMMsgConext& context, const cs::CMGuil
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GuildMgr::IsValidGuildId(long long guild_id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Guild* GuildMgr::GetGuild(long long guild_id)
|
||||
{
|
||||
auto itr = id_hash_.find(guild_id);
|
||||
|
@ -50,6 +50,7 @@ class GuildMgr : public a8::Singleton<GuildMgr>
|
||||
void _CMGuildDismiss(const ss::MFIMMsgConext& context, const cs::CMGuildDismiss& msg);
|
||||
void _CMGuildRename(const ss::MFIMMsgConext& context, const cs::CMGuildRename& msg);
|
||||
|
||||
bool IsValidGuildId(long long guild_id);
|
||||
Guild* GetGuild(long long group_id);
|
||||
void ForwardGuildSMMsg(const ss::MFIMMsgConext& context,
|
||||
const ::google::protobuf::Message& smmsg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user