This commit is contained in:
aozhiwei 2020-09-28 20:16:16 +08:00
parent 25b3d9f5c1
commit b97b960d27
5 changed files with 30 additions and 26 deletions

View File

@ -459,6 +459,9 @@ void App::ProcessIMConnMsg(f8::MsgHdr& hdr)
hdr.msgid);
if (handler) {
switch (handler->handlerid) {
case HID_GuildMgr:
ProcessNetMsg(handler, GuildMgr::Instance(), hdr);
break;
case HID_PlayerMgr:
ProcessNetMsg(handler, PlayerMgr::Instance(), hdr);
break;

View File

@ -767,6 +767,7 @@ Guild* Guild::CreateGuild(int gameid,
abort();
}
Guild* guild = new Guild;
guild->Init();
guild->gameid_ = gameid;
guild->guild_id_ = guild_id;
guild->guild_name_ = guild_name;

View File

@ -141,27 +141,27 @@ void GuildMgr::LoadGuild(long long guild_id)
(
a8::XValue(row[0]), //gameid
a8::XValue(row[1]), //guild_id
row[3], //guild_name
a8::XValue(row[4]), //guild_lv
a8::XValue(row[5]), //guild_exp
a8::XValue(row[6]), //guild_badge
a8::XValue(row[7]), //guild_apply_num
row[8], //guild_members
row[9], //guild_notice
row[10], //guild_declaration
row[11], //guild_log
row[12], //owner_id
row[13], //owner_name
row[14], //owner_avatar_url
row[15], //creator_id
row[16], //creator_name
row[17], //creator_avatar_url
row[18], //guild_data
a8::XValue(19), //guild_status
a8::XValue(20), //join_unlimited
a8::XValue(21), //join_cond1
a8::XValue(22), //join_cond2
a8::XValue(23) //createtime
row[2], //guild_name
a8::XValue(row[3]), //guild_lv
a8::XValue(row[4]), //guild_exp
a8::XValue(row[5]), //guild_badge
a8::XValue(row[6]), //guild_apply_num
row[7], //guild_members
row[8], //guild_notice
row[9], //guild_declaration
row[10], //guild_log
row[11], //owner_id
row[12], //owner_name
row[13], //owner_avatar_url
row[14], //creator_id
row[15], //creator_name
row[16], //creator_avatar_url
row[17], //guild_data
a8::XValue(row[18]), //guild_status
a8::XValue(row[19]), //join_unlimited
a8::XValue(row[20]), //join_cond1
a8::XValue(row[21]), //join_cond2
a8::XValue(row[22]) //createtime
);
GuildMgr::Instance()->id_hash_[guild->GuildId()] = guild;
break;
@ -204,7 +204,7 @@ void GuildMgr::LoadGuild(long long guild_id)
" owner_id, owner_name, owner_avatar_url, "
" creator_id, creator_name, creator_avatar_url, guild_data, guild_status, "
" join_unlimited, join_cond1, join_cond2, createtime "
"WHERE guild_id=%d;",
"FROM `guild` WHERE guild_id=%d;",
{
guild_id
},

View File

@ -46,6 +46,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&immsghandler, &SyncHelper::_SS_IM_GuildMemberUpdateResponse);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_IM_PushUserOnlineState);
RegisterNetMsgHandler(&immsghandler, &PlayerMgr::_SS_IM_RandomUsersResponse);
RegisterNetMsgHandler(&immsghandler, &GuildMgr::_SS_IM_ForwardGuildSMMsg);
RegisterNetMsgHandler(&mscmsghandler, &PlayerMgr::_SS_MS_PushUserList);
RegisterNetMsgHandler(&mscmsghandler, &GroupMgr::_SS_MS_LoadGroup);
@ -67,6 +68,8 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&imcmsghandler, &PlayerMgr::_SS_IM_GuildMemberQuitRequest);
RegisterNetMsgHandler(&imcmsghandler, &PlayerMgr::_SS_IM_GuildMemberUpdateRequest);
RegisterNetMsgHandler(&imcmsghandler, &GuildMgr::_SS_IM_ForwardGuildCMMsg);
RegisterNetMsgHandler(&wsmsghandler, &WSListener::_SS_Ping);
RegisterNetMsgHandler(&wsmsghandler, &PlayerMgr::_SS_WSP_SocketDisconnect);
@ -100,9 +103,6 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMTeamDismiss);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMTeamRename);
RegisterNetMsgHandler(&immsghandler, &GuildMgr::_SS_IM_ForwardGuildCMMsg);
RegisterNetMsgHandler(&immsghandler, &GuildMgr::_SS_IM_ForwardGuildSMMsg);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMGuildInfo);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMGuildCreate);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMGuildJoin);

View File

@ -55,7 +55,7 @@ void GuildMgr::__GuildCreate(f8::JsonHttpRequest* request)
conn,
"INSERT INTO `guild`(gameid, guild_id, guild_name, guild_lv, guild_exp, guild_badge, "
" guild_apply_num, guild_notice, guild_declaration, guild_log, owner_id, "
" owner_name, owner_avatar_url, creator_id, creator_name, creator_avatar_url, guild_member_num"
" owner_name, owner_avatar_url, creator_id, creator_name, creator_avatar_url, guild_member_num, "
" guild_data, guild_status, join_unlimited, join_cond1, join_cond2, createtime, modifytime)"
"VALUES(%d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', "
" '%s', '%s', '%s', '%s', '%s', 1, "