This commit is contained in:
aozhiwei 2020-06-18 14:12:33 +08:00
parent 3fce6420fb
commit c7bea11299
2 changed files with 29 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "IMConnMgr.h"
#include "MSConn.h"
#include "MSConnMgr.h"
#include "handlermgr.h"
void Player::Init()
{
@ -735,7 +736,30 @@ void Player::InternalSendSSMsg(const Friend& friend_data,
{
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(friend_data.base_data.account_id);
if (hum) {
f8::NetMsgHandler* handler = f8::GetNetMsgHandler(&HandlerMgr::Instance()->imcmsghandler,
msgid);
if (!handler || handler->handlerid != HID_PlayerMgr) {
return;
}
f8::MsgHdr hdr;
hdr.msgid = msgid;
hdr.seqid = 0;
hdr.socket_handle = 0;
int packlen = msg.ByteSize();
char* buff = nullptr;
if (packlen) {
buff = (char*)malloc(packlen);
msg.SerializeToArray(buff, packlen);
}
hdr.buf = buff;
hdr.buflen = packlen;
hdr.offset = 0;
hdr.ip_saddr = 0;
ProcessNetMsg(handler, PlayerMgr::Instance(), hdr);
if (buff) {
free(buff);
}
}
}
#endif

View File

@ -37,6 +37,7 @@ class VirtualClient(object):
assert conn
ioloop.IOLoop.current().spawn_callback(self.co_receiveMessage, conn)
self.sendLogin(conn)
self.sendFriendList(conn)
self.sendFriendApply(conn)
self.sendFriendApplyList(conn)
@ -72,6 +73,10 @@ class VirtualClient(object):
msg.nickname = '萤火虫'
self.sendMsg(conn, msg)
def sendFriendList(self, conn):
msg = cs_proto_pb2.CMFriendList()
self.sendMsg(conn, msg)
def sendFriendApply(self, conn):
msg = cs_proto_pb2.CMFriendApply()
msg.friend_id = 'test01'