1
This commit is contained in:
parent
f31a32e56b
commit
eb08467bdf
@ -181,7 +181,7 @@ void DBHelper::ConfirmGuild(Player* hum, long long guild_id)
|
||||
DBEngine::Instance()->ExecAsyncScript
|
||||
(
|
||||
conn_info,
|
||||
"UPDATE `guild` SET status=%d, guild_data='%s', modifytime=%d WHERE guild_id=%d;",
|
||||
"UPDATE `guild` SET guild_status=%d, guild_data='%s', modifytime=%d WHERE guild_id=%d;",
|
||||
{
|
||||
kGuildCreated,
|
||||
guild_data,
|
||||
|
@ -675,7 +675,7 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
|
||||
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(msg_context->socket_handle);
|
||||
if (hum && hum->AccountId() == msg_context->account_id) {
|
||||
if (data.At("errcode") == 0) {
|
||||
if (data.At("errcode")->AsXValue().GetInt() == 0) {
|
||||
DBHelper::Instance()->ConfirmGuild(hum, msg_context->guild_id);
|
||||
} else {
|
||||
hum->ShowErrorMsg(data.At("errmsg")->AsXValue().GetString());
|
||||
|
@ -100,7 +100,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
curl
|
||||
hiredis
|
||||
tinyxml2
|
||||
tcmalloc
|
||||
behaviac_gcc_debug
|
||||
)
|
||||
else()
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "dbengine.h"
|
||||
#include "app.h"
|
||||
#include "jsondatamgr.h"
|
||||
#include "IMListener.h"
|
||||
|
||||
const size_t MAX_RANK_HUMAN_NUM = 50;
|
||||
|
||||
@ -93,6 +94,13 @@ void GuildMgr::__GuildCreate(f8::JsonHttpRequest* request)
|
||||
cs::MFGuildBasic* guild = (cs::MFGuildBasic*)param.param1.GetUserData();
|
||||
|
||||
GuildMgr::Instance()->AddGuild(guild);
|
||||
|
||||
{
|
||||
std::string response;
|
||||
request->resp_xobj->ToJsonStr(response);
|
||||
IMListener::Instance()->SendText(request->socket_handle, a8::HttpResponse(response));
|
||||
}
|
||||
|
||||
delete request;
|
||||
},
|
||||
[] (a8::XParams& param, int error_code, const std::string& error_msg)
|
||||
@ -409,12 +417,19 @@ void GuildMgr::GenGuildRank()
|
||||
|
||||
void GuildMgr::ResortRank(std::vector<cs::MFGuildBasic*>& rank_list)
|
||||
{
|
||||
if (rank_list.size() == 41) {
|
||||
for (int i = 0; i < rank_list.size(); ++i) {
|
||||
printf("%d guild_id:%lld\n", i, rank_list[i]->guild_id());
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
std::sort(rank_list.begin(),
|
||||
rank_list.end(),
|
||||
[] (cs::MFGuildBasic* a, cs::MFGuildBasic* b) -> bool
|
||||
{
|
||||
return GuildMgr::Instance()->CmpGuild(a, b);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void GuildMgr::UpdateRank(std::vector<cs::MFGuildBasic*>& rank_list, cs::MFGuildBasic* guild)
|
||||
|
Loading…
x
Reference in New Issue
Block a user