This commit is contained in:
aozhiwei 2020-06-18 20:18:43 +08:00
parent 0913f39bd4
commit 69e366b9b0
4 changed files with 11 additions and 15 deletions

View File

@ -641,3 +641,8 @@ long long App::NewUUID()
{ {
return uuid.Generate(); return uuid.Generate();
} }
long long App::NewSeqId()
{
return ++seq_id_;
}

View File

@ -33,6 +33,7 @@ class App : public a8::Singleton<App>
a8::XParams* GetContext(long long context_id); a8::XParams* GetContext(long long context_id);
bool HasFlag(int flag); bool HasFlag(int flag);
long long NewUUID(); long long NewUUID();
long long NewSeqId();
private: private:
void QuickExecute(); void QuickExecute();
@ -69,6 +70,7 @@ public:
bool servicing = true; bool servicing = true;
private: private:
long long seq_id_ = 1000;
std::mutex *loop_mutex_ = nullptr; std::mutex *loop_mutex_ = nullptr;
std::condition_variable *loop_cond_ = nullptr; std::condition_variable *loop_cond_ = nullptr;

View File

@ -450,21 +450,10 @@ void Player::FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserIn
} }
} }
void Player::FillIMMsgConext(f8::MsgHdr& hdr, ss::MFIMMsgConext* conext) void Player::FillIMMsgConext(f8::MsgHdr& hdr, ss::MFIMMsgConext* context)
{ {
#if 0 FillMFUserInfo(context->mutable_user_info());
conext->set_socket_handle(hdr.socket_handle); context->set_seqid(App::Instance()->NewSeqId());
conext->set_account_id(myself.base_data.account_id);
conext->set_nickname(myself.base_data.nickname);
conext->set_avatar_url(myself.base_data.avatar_url);
conext->set_sex(myself.base_data.sex);
#if 1
conext->set_online(true);
#else
conext->set_online(online);
#endif
conext->set_msgid(hdr.msgid);
#endif
} }
void Player::ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code) void Player::ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code)

View File

@ -98,7 +98,7 @@ class Player
private: private:
void FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list); void FillFriendList(::google::protobuf::RepeatedPtrField< ::cs::MFUserInfo >* friend_list);
void FillIMMsgConext(f8::MsgHdr& hdr, ss::MFIMMsgConext* conext); void FillIMMsgConext(f8::MsgHdr& hdr, ss::MFIMMsgConext* context);
void FillMFUserInfo(cs::MFUserInfo* user_info); void FillMFUserInfo(cs::MFUserInfo* user_info);
void ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code); void ForwardGroupCMMsg(f8::MsgHdr& hdr, long long hash_code);
void SaveToDB(); void SaveToDB();