1
This commit is contained in:
parent
3abbe22431
commit
a929a622f4
@ -197,11 +197,11 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
|
||||
apply.idx = a8::XValue(row[0]);
|
||||
apply.applyid = a8::XValue(row[1]);
|
||||
apply.target_id = row[2];
|
||||
apply.sender_id = row[3];
|
||||
apply.sender_nickname = row[4];
|
||||
apply.sender_avatar_url = row[5];
|
||||
apply.sender_sex = a8::XValue(row[6]);
|
||||
apply.sender_data_version1 = a8::XValue(row[7]);
|
||||
apply.base_data.account_id = row[3];
|
||||
apply.base_data.nickname = row[4];
|
||||
apply.base_data.avatar_url = row[5];
|
||||
apply.base_data.sex = a8::XValue(row[6]);
|
||||
apply.base_data.base_data_version = a8::XValue(row[7]);
|
||||
hum->apply_list_.push_back(apply);
|
||||
if (apply.idx > hum->last_apply_idx_) {
|
||||
hum->last_apply_idx_ = apply.idx;
|
||||
@ -256,18 +256,30 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
|
||||
void Player::_CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg)
|
||||
{
|
||||
cs::SMFriendAgree respmsg;
|
||||
if (GetFriendById(msg.apply().account_id())) {
|
||||
if (GetFriendById(msg.apply().base_data().account_id())) {
|
||||
respmsg.set_errcode(0);
|
||||
respmsg.set_errmsg("");
|
||||
SendMsg(respmsg);
|
||||
return;
|
||||
}
|
||||
if (msg.apply().account_id() == AccountId()) {
|
||||
if (msg.apply().base_data().account_id() == AccountId()) {
|
||||
respmsg.set_errcode(2);
|
||||
respmsg.set_errmsg("不能添加自己");
|
||||
SendMsg(respmsg);
|
||||
return;
|
||||
}
|
||||
Friend* friendobj = new Friend;
|
||||
#if 0
|
||||
TypeConvert::Convert(msg.apply().base_data(), friendobj->base_data);
|
||||
#endif
|
||||
friendobj->crc32_code = a8::openssl::Crc32
|
||||
(
|
||||
(unsigned char*)friendobj->base_data.account_id.data(),
|
||||
friendobj->base_data.account_id.size()
|
||||
);
|
||||
friendobj->hum = this;
|
||||
friend_hash_[friendobj->base_data.account_id] = friendobj;
|
||||
PlayerMgr::Instance()->WatchPlayer(friendobj);
|
||||
SendMsg(respmsg);
|
||||
}
|
||||
|
||||
|
@ -8,20 +8,14 @@ void TypeConvert::Convert(const cs::MFFriendApply& apply_pb, FriendApply& apply)
|
||||
{
|
||||
apply.idx = apply_pb.idx();
|
||||
apply.applyid = apply_pb.applyid();
|
||||
apply.sender_id = apply_pb.account_id();
|
||||
apply.sender_nickname = apply_pb.nickname();
|
||||
apply.sender_avatar_url = apply_pb.avatar_url();
|
||||
apply.sender_sex = apply_pb.sex();
|
||||
apply.target_id = apply_pb.target_id();
|
||||
}
|
||||
|
||||
void TypeConvert::Convert(const FriendApply& apply, cs::MFFriendApply& apply_pb)
|
||||
{
|
||||
apply_pb.set_idx(apply.idx);
|
||||
apply_pb.set_applyid(apply.applyid);
|
||||
apply_pb.set_account_id(apply.sender_id);
|
||||
apply_pb.set_nickname(apply.sender_nickname);
|
||||
apply_pb.set_avatar_url(apply.sender_avatar_url);
|
||||
apply_pb.set_sex(apply.sender_sex);
|
||||
apply_pb.set_target_id(apply.target_id);
|
||||
}
|
||||
|
||||
void TypeConvert::Convert(const BaseUserData& base_data, ss::MFBaseUserDataDB& base_data_pb)
|
||||
|
@ -48,9 +48,5 @@ struct FriendApply
|
||||
long long idx = 0;
|
||||
long long applyid = 0;
|
||||
std::string target_id;
|
||||
std::string sender_id;
|
||||
std::string sender_nickname;
|
||||
std::string sender_avatar_url;
|
||||
int sender_sex = 0;
|
||||
int sender_data_version1 = 0;
|
||||
BaseUserData base_data;
|
||||
};
|
||||
|
@ -59,11 +59,9 @@ message MFUserInfo
|
||||
message MFFriendApply
|
||||
{
|
||||
optional int64 idx = 1; //唯一索引id
|
||||
optional int64 applyid = 2; //唯一id
|
||||
optional string account_id = 3; //账号id
|
||||
optional string nickname = 4; //昵称
|
||||
optional string avatar_url = 5; //头像
|
||||
optional int32 sex = 6; //性别
|
||||
optional int64 applyid = 2; //applyid
|
||||
optional string target_id = 3; //target_id
|
||||
optional MFBaseUserData base_data = 4; //基础数据
|
||||
}
|
||||
|
||||
//登录好友服
|
||||
|
Loading…
x
Reference in New Issue
Block a user