This commit is contained in:
aozhiwei 2020-06-17 16:37:03 +08:00
parent f9582530a1
commit a6d31e571a
2 changed files with 13 additions and 1 deletions

View File

@ -145,7 +145,7 @@ void Player::_CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg)
DBEngine::Instance()->ExecAsyncScript
(
conn_info,
"INSERT INTO `friend_apply`(applyid, target_id, sender_id, sender_nickmake, "
"INSERT INTO `friend_apply`(applyid, target_id, sender_id, sender_nickname, "
" sender_avatar_url, sender_sex, sender_group_id, sender_data_version1, "
" createtime)"
"VALUES(%d, '%s', '%s', '%s', '%s', %d, %d, %d, %d);",

View File

@ -36,6 +36,8 @@ class VirtualClient(object):
assert conn
ioloop.IOLoop.current().spawn_callback(self.co_receiveMessage, conn)
self.sendLogin(conn)
self.sendFriendApply(conn)
self.sendFriendApplyList(conn)
def sendMsg(self, conn, msg):
seqid = 1
@ -69,6 +71,16 @@ class VirtualClient(object):
msg.nickname = '萤火虫'
self.sendMsg(conn, msg)
def sendFriendApply(self, conn):
msg = cs_proto_pb2.CMFriendApply()
msg.friend_id = '123'
msg.msg = 'hello'
self.sendMsg(conn, msg)
def sendFriendApplyList(self, conn):
msg = cs_proto_pb2.CMFriendApplyList()
self.sendMsg(conn, msg)
def parsePacket(self, conn, recv_buf):
while len(recv_buf) >= 8:
pktlen = recv_buf[0] + (recv_buf[1] << 8)