1
This commit is contained in:
parent
f9582530a1
commit
a6d31e571a
@ -145,7 +145,7 @@ void Player::_CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg)
|
|||||||
DBEngine::Instance()->ExecAsyncScript
|
DBEngine::Instance()->ExecAsyncScript
|
||||||
(
|
(
|
||||||
conn_info,
|
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, "
|
" sender_avatar_url, sender_sex, sender_group_id, sender_data_version1, "
|
||||||
" createtime)"
|
" createtime)"
|
||||||
"VALUES(%d, '%s', '%s', '%s', '%s', %d, %d, %d, %d);",
|
"VALUES(%d, '%s', '%s', '%s', '%s', %d, %d, %d, %d);",
|
||||||
|
@ -36,6 +36,8 @@ class VirtualClient(object):
|
|||||||
assert conn
|
assert conn
|
||||||
ioloop.IOLoop.current().spawn_callback(self.co_receiveMessage, conn)
|
ioloop.IOLoop.current().spawn_callback(self.co_receiveMessage, conn)
|
||||||
self.sendLogin(conn)
|
self.sendLogin(conn)
|
||||||
|
self.sendFriendApply(conn)
|
||||||
|
self.sendFriendApplyList(conn)
|
||||||
|
|
||||||
def sendMsg(self, conn, msg):
|
def sendMsg(self, conn, msg):
|
||||||
seqid = 1
|
seqid = 1
|
||||||
@ -69,6 +71,16 @@ class VirtualClient(object):
|
|||||||
msg.nickname = '萤火虫'
|
msg.nickname = '萤火虫'
|
||||||
self.sendMsg(conn, msg)
|
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):
|
def parsePacket(self, conn, recv_buf):
|
||||||
while len(recv_buf) >= 8:
|
while len(recv_buf) >= 8:
|
||||||
pktlen = recv_buf[0] + (recv_buf[1] << 8)
|
pktlen = recv_buf[0] + (recv_buf[1] << 8)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user