1
This commit is contained in:
commit
9f88d10a66
@ -35,7 +35,7 @@ struct AsyncTaskContext
|
|||||||
struct QueryUserStatusTask
|
struct QueryUserStatusTask
|
||||||
{
|
{
|
||||||
AsyncTaskContext context;
|
AsyncTaskContext context;
|
||||||
std::map<std::string, bool> users;
|
std::map<std::string, cs::MFUserStatus> users;
|
||||||
|
|
||||||
void Done()
|
void Done()
|
||||||
{
|
{
|
||||||
@ -43,8 +43,12 @@ struct QueryUserStatusTask
|
|||||||
cs::SMQueryUserStatus msg;
|
cs::SMQueryUserStatus msg;
|
||||||
for (auto& pair : users) {
|
for (auto& pair : users) {
|
||||||
cs::MFUserStatus* user = msg.add_status_list();
|
cs::MFUserStatus* user = msg.add_status_list();
|
||||||
|
#if 1
|
||||||
|
*user = pair.second;
|
||||||
|
#else
|
||||||
user->set_account_id(pair.first);
|
user->set_account_id(pair.first);
|
||||||
user->set__online(pair.second ? 1 : 0);
|
user->set__online(pair.second ? 1 : 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
context.hum->SendMsg(msg);
|
context.hum->SendMsg(msg);
|
||||||
}
|
}
|
||||||
@ -161,7 +165,10 @@ void AsyncTaskMgr::CreateQueryUserStatusTask(Player* hum, std::vector<std::strin
|
|||||||
hum->SendSSMsg(hum->myself, msg);
|
hum->SendSSMsg(hum->myself, msg);
|
||||||
|
|
||||||
for (auto& account_id : account_ids) {
|
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());
|
FillAsyncTaskContext(hum, &task->context, msg.context().seqid());
|
||||||
query_user_status_tasks_[task->context.seqid] = task;
|
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());
|
QueryUserStatusTask* task = GetQueryUserStatusTask(msg.context().seqid());
|
||||||
if (task) {
|
if (task) {
|
||||||
for (auto& user : msg.user_infos()) {
|
for (auto& user : msg.user_infos()) {
|
||||||
if (task->users.find(user.base_data().account_id()) !=
|
auto itr = task->users.find(user.base_data().account_id());
|
||||||
task->users.end()) {
|
if (itr != task->users.end()) {
|
||||||
task->users[user.base_data().account_id()] = true;
|
itr->second.set__online(1);
|
||||||
|
*itr->second.mutable_temp_custom_data() = user.temp_custom_data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,7 +575,9 @@ void Player::_CMSendChatMsg(f8::MsgHdr& hdr, const cs::CMSendChatMsg& msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cs::CMSendChatMsg* mutable_msg = (cs::CMSendChatMsg*)&msg;
|
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()) {
|
switch (msg.chat_channel()) {
|
||||||
case kCCWorld:
|
case kCCWorld:
|
||||||
ChatMgr::Instance()->ProcWorldChat(this, msg);
|
ChatMgr::Instance()->ProcWorldChat(this, msg);
|
||||||
|
@ -94,6 +94,7 @@ message MFUserStatus
|
|||||||
{
|
{
|
||||||
optional string account_id = 1; //账号id
|
optional string account_id = 1; //账号id
|
||||||
optional int32 _online = 2; //是否在线
|
optional int32 _online = 2; //是否在线
|
||||||
|
optional MFUserTempCustomData temp_custom_data = 3; //临时用户自定义数据
|
||||||
}
|
}
|
||||||
|
|
||||||
//好友申请
|
//好友申请
|
||||||
|
@ -21,7 +21,7 @@ def main():
|
|||||||
help = "account info")
|
help = "account info")
|
||||||
(options, args) = parser.parse_args()
|
(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'
|
# ws_url = args if args else 'ws://192.168.100.21:8911/friend/websocket'
|
||||||
accounts = options.accounts.split(',')
|
accounts = options.accounts.split(',')
|
||||||
accounts = []
|
accounts = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user