Skip to content

Commit c057842

Browse files
author
kbengine
committed
修正proxy在giveClientTo之后客户端上之前的那个entity未通知销毁。
1 parent 33a8c14 commit c057842

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎kbe/src/server/baseapp/proxy.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,16 @@ void Proxy::giveClientTo(Proxy* proxy)
300300
proxy->onGiveClientTo(lpChannel);
301301
setClientMailbox(NULL);
302302
addr(Mercury::Address::NONE);
303+
304+
if(proxy->getClientMailbox() != NULL)
305+
{
306+
// 通知client销毁当前entity
307+
Mercury::Bundle* pBundle = Mercury::Bundle::ObjPool().createObject();
308+
(*pBundle).newMessage(ClientInterface::onEntityDestroyed);
309+
(*pBundle) << this->getID();
310+
proxy->getClientMailbox()->postMail((*pBundle));
311+
Mercury::Bundle::ObjPool().reclaimObject(pBundle);
312+
}
303313
}
304314
}
305315

0 commit comments

Comments
 (0)