1
This commit is contained in:
parent
1675abc106
commit
b75f26ffce
@ -107,9 +107,7 @@ void Player::_CMUpdateTempCustomData(f8::MsgHdr& hdr, const cs::CMUpdateTempCust
|
|||||||
|
|
||||||
void Player::_CMFriendList(f8::MsgHdr& hdr, const cs::CMFriendList& msg)
|
void Player::_CMFriendList(f8::MsgHdr& hdr, const cs::CMFriendList& msg)
|
||||||
{
|
{
|
||||||
cs::SMFriendList respmsg;
|
PushFriendList();
|
||||||
FillFriendList(respmsg.mutable_friend_list());
|
|
||||||
SendMsg(respmsg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::_CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg)
|
void Player::_CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg)
|
||||||
@ -396,6 +394,11 @@ void Player::ReLogin(f8::MsgHdr& hdr, const cs::CMLogin& msg)
|
|||||||
|
|
||||||
void Player::FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list)
|
void Player::FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
auto p = friend_list->Add();
|
||||||
|
TypeConvert::Convert(data.base_data, *(p->mutable_base_data()));
|
||||||
|
TypeConvert::Convert(data.temp_custom_data, *(p->mutable_temp_custom_data()));
|
||||||
|
}
|
||||||
for (auto& pair : friend_hash_) {
|
for (auto& pair : friend_hash_) {
|
||||||
auto p = friend_list->Add();
|
auto p = friend_list->Add();
|
||||||
TypeConvert::Convert(pair.second.base_data, *(p->mutable_base_data()));
|
TypeConvert::Convert(pair.second.base_data, *(p->mutable_base_data()));
|
||||||
@ -629,3 +632,10 @@ void Player::NotifyUserInfoUpdate(Friend* friend_data)
|
|||||||
TypeConvert::Convert(friend_data->temp_custom_data, *p->mutable_temp_custom_data());
|
TypeConvert::Convert(friend_data->temp_custom_data, *p->mutable_temp_custom_data());
|
||||||
SendMsg(msg);
|
SendMsg(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::PushFriendList()
|
||||||
|
{
|
||||||
|
cs::SMFriendList respmsg;
|
||||||
|
FillFriendList(respmsg.mutable_friend_list());
|
||||||
|
SendMsg(respmsg);
|
||||||
|
}
|
||||||
|
@ -92,6 +92,7 @@ class Player
|
|||||||
void NotifyOnline();
|
void NotifyOnline();
|
||||||
void NotifyOffline();
|
void NotifyOffline();
|
||||||
void NotifyUserInfoUpdate(Friend* friend_data);
|
void NotifyUserInfoUpdate(Friend* friend_data);
|
||||||
|
void PushFriendList();
|
||||||
|
|
||||||
const std::string AccountId();
|
const std::string AccountId();
|
||||||
|
|
||||||
|
@ -371,6 +371,7 @@ void PlayerMgr::AsyncLoginOnOk(const std::string& account_id,
|
|||||||
respmsg.set_errcode(0);
|
respmsg.set_errcode(0);
|
||||||
respmsg.set_errmsg("ok");
|
respmsg.set_errmsg("ok");
|
||||||
hum->SendMsg(respmsg);
|
hum->SendMsg(respmsg);
|
||||||
|
hum->PushFriendList();
|
||||||
}
|
}
|
||||||
f8::MsgHdr::Destroy(hdr);
|
f8::MsgHdr::Destroy(hdr);
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@ class VirtualClient(object):
|
|||||||
def sendLogin(self, conn):
|
def sendLogin(self, conn):
|
||||||
msg = cs_proto_pb2.CMLogin()
|
msg = cs_proto_pb2.CMLogin()
|
||||||
msg.account_id = self.account
|
msg.account_id = self.account
|
||||||
|
msg.nickname = '萤火虫'
|
||||||
self.sendMsg(conn, msg)
|
self.sendMsg(conn, msg)
|
||||||
|
|
||||||
def parsePacket(self, conn, recv_buf):
|
def parsePacket(self, conn, recv_buf):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user