This commit is contained in:
aozhiwei 2020-06-17 17:02:26 +08:00
parent 99c8b5ca2d
commit 3193a788be
2 changed files with 7 additions and 3 deletions

View File

@ -221,7 +221,7 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
cs::MFPaging* paging_copy = new cs::MFPaging; cs::MFPaging* paging_copy = new cs::MFPaging;
*paging_copy = msg.paging(); *paging_copy = msg.paging();
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code); a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code);
DBEngine::Instance()->ExecAsyncScript DBEngine::Instance()->ExecAsyncQuery
( (
conn_info, conn_info,
"SELECT idx, applyid, target_id, sender_id, sender_nickname, " "SELECT idx, applyid, target_id, sender_id, sender_nickname, "
@ -527,7 +527,11 @@ void Player::FillApplyList(const cs::MFPaging& paging, cs::SMFriendApplyList& re
++i; ++i;
} }
*respmsg.mutable_paging() = paging; *respmsg.mutable_paging() = paging;
if (paging.page_size() > 0) {
respmsg.mutable_paging()->set_total_page(ceil(i / paging.page_size())); respmsg.mutable_paging()->set_total_page(ceil(i / paging.page_size()));
} else {
respmsg.mutable_paging()->set_total_page(1);
}
} }
void Player::SyncLocToMasterServer() void Player::SyncLocToMasterServer()

View File

@ -73,7 +73,7 @@ class VirtualClient(object):
def sendFriendApply(self, conn): def sendFriendApply(self, conn):
msg = cs_proto_pb2.CMFriendApply() msg = cs_proto_pb2.CMFriendApply()
msg.friend_id = '123' msg.friend_id = 'test0'
msg.msg = 'hello' msg.msg = 'hello'
self.sendMsg(conn, msg) self.sendMsg(conn, msg)