This commit is contained in:
aozhiwei 2020-09-27 14:54:29 +08:00
parent 3e8b7757ec
commit 1aaf093be2
4 changed files with 11 additions and 2 deletions

View File

@ -672,6 +672,7 @@ void Player::_CMGuildCreate(f8::MsgHdr& hdr, const cs::CMGuildCreate& msg)
Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(msg_context->socket_handle); Player* hum = PlayerMgr::Instance()->GetPlayerBySocket(msg_context->socket_handle);
if (hum && hum->AccountId() == msg_context->account_id) { if (hum && hum->AccountId() == msg_context->account_id) {
hum->UpdateGuildData(msg_context->guild_id, kGuildOwner);
cs::SMGuildCreate respmsg; cs::SMGuildCreate respmsg;
hum->SendMsg(respmsg); hum->SendMsg(respmsg);
} }
@ -1048,6 +1049,7 @@ void Player::_SS_IM_FriendApply(f8::MsgHdr& hdr, const ss::SS_IM_FriendApply& ms
void Player::ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg) void Player::ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg)
{ {
cs::SMLogin respmsg; cs::SMLogin respmsg;
FillSMLogin(respmsg);
WSListener::Instance()->SendToClient(hdr.socket_handle, 0, respmsg); WSListener::Instance()->SendToClient(hdr.socket_handle, 0, respmsg);
PlayerMgr::Instance()->ReBindSocket(hdr.socket_handle, this); PlayerMgr::Instance()->ReBindSocket(hdr.socket_handle, this);
} }
@ -1228,6 +1230,11 @@ void Player::UpdateGuildData(long long guild_id, int guild_job)
OnDataVersion1Change(); OnDataVersion1Change();
} }
void Player::FillSMLogin(cs::SMLogin& respmsg)
{
FillMFUserInfo(respmsg.mutable_account_info()->mutable_user_info());
}
void Player::FillApplyList(const cs::MFPaging& paging, cs::SMFriendApplyList& respmsg) void Player::FillApplyList(const cs::MFPaging& paging, cs::SMFriendApplyList& respmsg)
{ {
RemoveHandledApply(); RemoveHandledApply();

View File

@ -123,6 +123,7 @@ class Player
Friend* GetFriendById(const std::string& friend_id); Friend* GetFriendById(const std::string& friend_id);
Friend* GetBlackListById(const std::string& friend_id); Friend* GetBlackListById(const std::string& friend_id);
void UpdateGuildData(long long guild_id, int guild_job); void UpdateGuildData(long long guild_id, int guild_job);
void FillSMLogin(cs::SMLogin& respmsg);
const std::string AccountId(); const std::string AccountId();
const std::string SessionId(); const std::string SessionId();

View File

@ -553,6 +553,7 @@ void PlayerMgr::AsyncLoginOnOk(const std::string& account_id,
cs::SMLogin respmsg; cs::SMLogin respmsg;
respmsg.set_errcode(0); respmsg.set_errcode(0);
respmsg.set_errmsg("ok"); respmsg.set_errmsg("ok");
hum->FillSMLogin(respmsg);
hum->SendMsg(respmsg); hum->SendMsg(respmsg);
} }
long long login_tick = a8::XGetTickCount() - (long long)hdr->user_data; long long login_tick = a8::XGetTickCount() - (long long)hdr->user_data;

View File

@ -38,8 +38,8 @@ message MFBaseUserData
optional string avatar_url = 3; // optional string avatar_url = 3; //
optional int32 sex = 4; // 1 2 0 optional int32 sex = 4; // 1 2 0
optional int32 last_login_time = 5; // optional int32 last_login_time = 5; //
optional int64 guild_id = 6; //id optional int64 guild_id = 6; //id(0)
optional int32 guild_job = 7; // optional int32 guild_job = 7; // 1: 2: 3
optional int64 user_value1 = 50; //1 optional int64 user_value1 = 50; //1
optional int64 user_value2 = 51; //2 optional int64 user_value2 = 51; //2