From 60a1b6445a42966ede7e2068ae8187cc2a44108e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 11 May 2020 13:50:46 +0800 Subject: [PATCH] 1 --- server/imserver/IMConnMgr.cc | 8 ++------ server/imserver/IMConnMgr.h | 4 +--- server/imserver/types.h | 5 ++++- server/tools/protobuild/cs_proto.proto | 8 ++++++++ third_party/framework | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/server/imserver/IMConnMgr.cc b/server/imserver/IMConnMgr.cc index ef8308d..1ab3743 100644 --- a/server/imserver/IMConnMgr.cc +++ b/server/imserver/IMConnMgr.cc @@ -23,16 +23,11 @@ IMConn* IMConnMgr::GetConnByKey(const std::string& key) return itr != key_hash_.end() ? itr->second : nullptr; } -IMConn* IMConnMgr::GetConnById(int instance_id) -{ - auto itr = id_hash_.find(instance_id); - return itr != id_hash_.end() ? itr->second : nullptr; -} - IMConn* IMConnMgr::RecreateIMConn(const std::string& host, int port) { std::string key = host + ":" + a8::XValue(port).GetString(); IMConn* conn = GetConnByKey(key); + #if 0 if (conn) { return conn; } @@ -45,6 +40,7 @@ IMConn* IMConnMgr::RecreateIMConn(const std::string& host, int port) conn->Init(instance_id, remote_ip, remote_port); id_hash_[conn->instance_id] = conn; key_hash_[key] = conn; + #endif conn->Open(); return conn; } diff --git a/server/imserver/IMConnMgr.h b/server/imserver/IMConnMgr.h index bde0d2b..2b61b8e 100644 --- a/server/imserver/IMConnMgr.h +++ b/server/imserver/IMConnMgr.h @@ -13,11 +13,9 @@ class IMConnMgr : public a8::Singleton void UnInit(); IMConn* GetConnByKey(const std::string& key); - IMConn* GetConnById(int instance_id); IMConn* RecreateIMConn(const std::string& host, int port); private: - unsigned short curr_id_ = 1000; std::map key_hash_; - std::map id_hash_; + std::map id_hash_; }; diff --git a/server/imserver/types.h b/server/imserver/types.h index 57f6d92..bcbaf00 100644 --- a/server/imserver/types.h +++ b/server/imserver/types.h @@ -12,7 +12,6 @@ struct PerfMonitor long long read_count = 0; }; - struct Friend { std::string account_id; @@ -21,6 +20,10 @@ struct Friend int sex = 0; int online = 0; + std::string server_host; + int server_port; + long long server_ident = 0; + int data_version1 = 0; unsigned int crc32_code = 0; }; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 44a258b..6e0b5d4 100644 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -153,6 +153,13 @@ message SMGroupRename optional string error_msg = 2; } +message CMSendChatMsg +{ + optional int32 chat_channel = 1; + optional string target = 2; + optional string msg = 3; +} + message SMUserStatusNotify { repeated string online_users = 1; @@ -163,6 +170,7 @@ message SMChatMsgNotify { optional string sender = 1; optional int32 chat_channel = 2; + optional string msg = 3; } message SMUserInfoUpdate diff --git a/third_party/framework b/third_party/framework index 9ba2696..4e1a347 160000 --- a/third_party/framework +++ b/third_party/framework @@ -1 +1 @@ -Subproject commit 9ba2696e52664c9f5b7a1e09a4a5516359d330b0 +Subproject commit 4e1a34704dc08d0279e78c275989f10f85fd6cc2