This commit is contained in:
aozhiwei 2020-10-13 20:35:21 +08:00
parent dea0773c25
commit 73b9841dc6
2 changed files with 11 additions and 0 deletions

View File

@ -672,6 +672,13 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
SendMsg(respmsg);
return;
}
if (App::Instance()->nowtime - last_create_guild_time_ < 5) {
ShowErrorMsg("您的操作太过频繁,请稍后再试");
respmsg.set_errcode(1);
respmsg.set_errmsg("您的操作太过频繁,请稍后再试");
SendMsg(respmsg);
return;
}
if (role_data.today_create_guild_times >= MAX_DAILY_CREATE_GUILD_TIMES) {
ShowErrorMsg("今日创建战队次数已达上限");
respmsg.set_errcode(1);
@ -711,6 +718,7 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
params->SetVal("join_unlimited", msg.join_unlimited());
params->SetVal("join_cond1", msg.join_cond1());
params->SetVal("join_cond2", msg.join_cond2());
last_create_guild_time_ = App::Instance()->nowtime;
f8::HttpClientPool::Instance()->HttpGet
(
a8::XParams()
@ -728,6 +736,7 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
msg_context->guild_id,
param.param1);
} else {
hum->last_create_guild_time_ = 0;
hum->ShowErrorMsg(data.At("errmsg")->AsXValue().GetString());
}
}
@ -740,6 +749,7 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(msg_context->account_id);
if (hum) {
hum->last_create_guild_time_ = 0;
hum->ShowErrorMsg("服务器内部错误");
}

View File

@ -204,6 +204,7 @@ private:
int red_point_flags_ = 0;
std::set<std::string> exclude_account_ids_;
std::string user_sign_;
int last_create_guild_time_ = 0;
std::map<std::string, Friend*> friend_hash_;
std::map<std::string, Friend*> black_hash_;