1
This commit is contained in:
parent
e480b86564
commit
13b48a5a91
@ -71,6 +71,52 @@ void DBHelper::SetFriendApplyStatus(
|
||||
);
|
||||
}
|
||||
|
||||
void DBHelper::SetGuildApplyStatus(
|
||||
const std::string& sender_id,
|
||||
long long guild_id,
|
||||
int status)
|
||||
{
|
||||
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(guild_id);
|
||||
DBEngine::Instance()->ExecAsyncScript
|
||||
(
|
||||
conn_info,
|
||||
"UPDATE `guild_apply` SET status=%d WHERE guild_id=%d AND sender_id='%s';",
|
||||
{
|
||||
status,
|
||||
guild_id,
|
||||
sender_id
|
||||
},
|
||||
a8::XParams(),
|
||||
nullptr,
|
||||
nullptr,
|
||||
guild_id
|
||||
);
|
||||
}
|
||||
|
||||
void DBHelper::SetGuildApplyStatus(
|
||||
long long idx,
|
||||
const std::string& sender_id,
|
||||
long long guild_id,
|
||||
int status)
|
||||
{
|
||||
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(guild_id);
|
||||
DBEngine::Instance()->ExecAsyncScript
|
||||
(
|
||||
conn_info,
|
||||
"UPDATE `guild_apply` SET status=%d WHERE idx=%d AND guild_id=%d AND sender_id='%s';",
|
||||
{
|
||||
status,
|
||||
idx,
|
||||
guild_id,
|
||||
sender_id
|
||||
},
|
||||
a8::XParams(),
|
||||
nullptr,
|
||||
nullptr,
|
||||
guild_id
|
||||
);
|
||||
}
|
||||
|
||||
void DBHelper::AddFriendApply(Player* hum, const std::string& target_id)
|
||||
{
|
||||
auto on_ok =
|
||||
|
@ -28,6 +28,15 @@ class DBHelper : public a8::Singleton<DBHelper>
|
||||
const std::string& sender_id,
|
||||
const std::string& target_id,
|
||||
int status);
|
||||
void SetGuildApplyStatus(
|
||||
const std::string& sender_id,
|
||||
long long guild_id,
|
||||
int status);
|
||||
void SetGuildApplyStatus(
|
||||
long long idx,
|
||||
const std::string& sender_id,
|
||||
long long guild_id,
|
||||
int status);
|
||||
void AddFriendApply(Player* hum, const std::string& target_id);
|
||||
void AddGuildApply(Guild* guild, const cs::MFUserInfo& user_info);
|
||||
void AddEvent(const std::string& sender_id,
|
||||
|
@ -152,6 +152,14 @@ void Guild::_CMGuildAgree(f8::MsgHdr& hdr, const cs::CMGuildAgree& msg)
|
||||
respmsg);
|
||||
return;
|
||||
}
|
||||
if (!(sender->guild_job == kGuildOwner || sender->guild_job == kGuildAdmin)) {
|
||||
respmsg.set_errcode(3);
|
||||
respmsg.set_errmsg("权限不够");
|
||||
GuildMgr::Instance()->ForwardGuildSMMsg(hdr.socket_handle,
|
||||
forward_msg->context(),
|
||||
respmsg);
|
||||
return;
|
||||
}
|
||||
GuildMgr::Instance()->ForwardGuildSMMsg(hdr.socket_handle,
|
||||
forward_msg->context(),
|
||||
respmsg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user