diff --git a/server/imserver/asynctaskmgr.cc b/server/imserver/asynctaskmgr.cc index 6da61c0..a6bd89d 100644 --- a/server/imserver/asynctaskmgr.cc +++ b/server/imserver/asynctaskmgr.cc @@ -35,7 +35,7 @@ struct AsyncTaskContext struct QueryUserStatusTask { AsyncTaskContext context; - std::map users; + std::map users; void Done() { @@ -43,8 +43,12 @@ struct QueryUserStatusTask cs::SMQueryUserStatus msg; for (auto& pair : users) { cs::MFUserStatus* user = msg.add_status_list(); + #if 1 + *user = pair.second; + #else user->set_account_id(pair.first); user->set__online(pair.second ? 1 : 0); + #endif } context.hum->SendMsg(msg); } @@ -161,7 +165,10 @@ void AsyncTaskMgr::CreateQueryUserStatusTask(Player* hum, std::vectorSendSSMsg(hum->myself, msg); for (auto& account_id : account_ids) { - task->users[account_id] = false; + cs::MFUserStatus status; + status.set_account_id(account_id); + status.set__online(0); + task->users[account_id] = status; } FillAsyncTaskContext(hum, &task->context, msg.context().seqid()); query_user_status_tasks_[task->context.seqid] = task; @@ -221,9 +228,10 @@ void AsyncTaskMgr::_SS_IM_PushUserOnlineState(f8::MsgHdr& hdr, const ss::SS_IM_P QueryUserStatusTask* task = GetQueryUserStatusTask(msg.context().seqid()); if (task) { for (auto& user : msg.user_infos()) { - if (task->users.find(user.base_data().account_id()) != - task->users.end()) { - task->users[user.base_data().account_id()] = true; + auto itr = task->users.find(user.base_data().account_id()); + if (itr != task->users.end()) { + itr->second.set__online(1); + *itr->second.mutable_temp_custom_data() = user.temp_custom_data(); } } } diff --git a/server/imserver/player.cc b/server/imserver/player.cc index 84c6f5c..30a992a 100644 --- a/server/imserver/player.cc +++ b/server/imserver/player.cc @@ -575,7 +575,9 @@ void Player::_CMSendChatMsg(f8::MsgHdr& hdr, const cs::CMSendChatMsg& msg) return; } cs::CMSendChatMsg* mutable_msg = (cs::CMSendChatMsg*)&msg; - mutable_msg->set_msg_body(MetaMgr::Instance()->ReplaceDirtyWord(msg.msg_body(), '*')); + if (msg.msg_type() == 2) { + mutable_msg->set_msg_body(MetaMgr::Instance()->ReplaceDirtyWord(msg.msg_body(), '*')); + } switch (msg.chat_channel()) { case kCCWorld: ChatMgr::Instance()->ProcWorldChat(this, msg); diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 492484b..f76135c 100644 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -94,6 +94,7 @@ message MFUserStatus { optional string account_id = 1; //账号id optional int32 _online = 2; //是否在线 + optional MFUserTempCustomData temp_custom_data = 3; //临时用户自定义数据 } //好友申请 diff --git a/server/tools/robot/virtualclient/new_robot.py b/server/tools/robot/virtualclient/new_robot.py index 256f30c..5060af0 100644 --- a/server/tools/robot/virtualclient/new_robot.py +++ b/server/tools/robot/virtualclient/new_robot.py @@ -21,7 +21,7 @@ def main(): help = "account info") (options, args) = parser.parse_args() - ws_url = args if args else 'wss://relation-dny.kingsome.cn/friend/websocket' + ws_url = args if args else 'wss://relation-test.kingsome.cn/friend/websocket' # ws_url = args if args else 'ws://192.168.100.21:8911/friend/websocket' accounts = options.accounts.split(',') accounts = []