本文整理汇总了C++中network::Bundle::appendBlob方法的典型用法代码示例。如果您正苦于以下问题:C++ Bundle::appendBlob方法的具体用法?C++ Bundle::appendBlob怎么用?C++ Bundle::appendBlob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类network::Bundle
的用法示例。
在下文中一共展示了Bundle::appendBlob方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerPendingAccountToBaseapp
//-------------------------------------------------------------------------------------
void Baseappmgr::registerPendingAccountToBaseapp(Network::Channel* pChannel, MemoryStream& s)
{
std::string loginName;
std::string accountName;
std::string password;
std::string datas;
DBID entityDBID;
uint32 flags;
uint64 deadline;
COMPONENT_TYPE componentType;
s >> loginName >> accountName >> password >> entityDBID >> flags >> deadline >> componentType;
s.readBlob(datas);
Components::ComponentInfos* cinfos = Components::getSingleton().findComponent(pChannel);
if(cinfos == NULL || cinfos->pChannel == NULL)
{
ERROR_MSG("Baseappmgr::registerPendingAccountToBaseapp: not found loginapp!\n");
return;
}
pending_logins_[loginName] = cinfos->cid;
ENTITY_ID eid = 0;
cinfos = Components::getSingleton().findComponent(BASEAPP_TYPE, bestBaseappID_);
if(cinfos == NULL || cinfos->pChannel == NULL || cinfos->state != COMPONENT_STATE_RUN)
{
Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
ForwardItem* pFI = new ForwardItem();
pFI->pBundle = pBundle;
(*pBundle).newMessage(BaseappInterface::registerPendingLogin);
(*pBundle) << loginName << accountName << password << eid << entityDBID << flags << deadline << componentType;
pBundle->appendBlob(datas);
WARNING_MSG("Baseappmgr::registerPendingAccountToBaseapp: not found baseapp, message is buffered.\n");
pFI->pHandler = NULL;
forward_baseapp_messagebuffer_.push(pFI);
return;
}
DEBUG_MSG(fmt::format("Baseappmgr::registerPendingAccountToBaseapp:{0}. allocBaseapp=[{1}].\n",
accountName, bestBaseappID_));
Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
(*pBundle).newMessage(BaseappInterface::registerPendingLogin);
(*pBundle) << loginName << accountName << password << eid << entityDBID << flags << deadline << componentType;
pBundle->appendBlob(datas);
cinfos->pChannel->send(pBundle);
}
示例2: registerPendingAccountToBaseappAddr
//-------------------------------------------------------------------------------------
void Baseappmgr::registerPendingAccountToBaseappAddr(Network::Channel* pChannel, MemoryStream& s)
{
COMPONENT_ID componentID;
std::string loginName;
std::string accountName;
std::string password;
std::string datas;
ENTITY_ID entityID;
DBID entityDBID;
uint32 flags;
uint64 deadline;
COMPONENT_TYPE componentType;
s >> componentID >> loginName >> accountName >> password >> entityID >> entityDBID >> flags >> deadline >> componentType;
s.readBlob(datas);
DEBUG_MSG(fmt::format("Baseappmgr::registerPendingAccountToBaseappAddr:{0}, componentID={1}, entityID={2}.\n",
accountName, componentID, entityID));
Components::ComponentInfos* cinfos = Components::getSingleton().findComponent(pChannel);
if(cinfos == NULL || cinfos->pChannel == NULL)
{
ERROR_MSG("Baseappmgr::registerPendingAccountToBaseapp: not found loginapp!\n");
return;
}
pending_logins_[loginName] = cinfos->cid;
cinfos = Components::getSingleton().findComponent(componentID);
if(cinfos == NULL || cinfos->pChannel == NULL)
{
ERROR_MSG(fmt::format("Baseappmgr::registerPendingAccountToBaseappAddr: not found baseapp({}).\n", componentID));
sendAllocatedBaseappAddr(pChannel, loginName, accountName, "", 0);
return;
}
Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
(*pBundle).newMessage(BaseappInterface::registerPendingLogin);
(*pBundle) << loginName << accountName << password << entityID << entityDBID << flags << deadline << componentType;
pBundle->appendBlob(datas);
cinfos->pChannel->send(pBundle);
}