本文整理汇总了C++中INFO_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ INFO_MSG函数的具体用法?C++ INFO_MSG怎么用?C++ INFO_MSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INFO_MSG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GlobalDataServer
//-------------------------------------------------------------------------------------
bool Dbmgr::initializeEnd()
{
// 添加一个timer, 每秒检查一些状态
loopCheckTimerHandle_ = this->getMainDispatcher().addTimer(1000000, this,
reinterpret_cast<void *>(TIMEOUT_CHECK_STATUS));
mainProcessTimer_ = this->getMainDispatcher().addTimer(1000000 / g_kbeSrvConfig.gameUpdateHertz(), this,
reinterpret_cast<void *>(TIMEOUT_TICK));
// 添加globalData, globalBases, cellAppData支持
pGlobalData_ = new GlobalDataServer(GlobalDataServer::GLOBAL_DATA);
pGlobalBases_ = new GlobalDataServer(GlobalDataServer::GLOBAL_BASES);
pCellAppData_ = new GlobalDataServer(GlobalDataServer::CELLAPP_DATA);
pGlobalData_->addConcernComponentType(CELLAPP_TYPE);
pGlobalData_->addConcernComponentType(BASEAPP_TYPE);
pGlobalBases_->addConcernComponentType(BASEAPP_TYPE);
pCellAppData_->addConcernComponentType(CELLAPP_TYPE);
ENGINE_COMPONENT_INFO& dbcfg = g_kbeSrvConfig.getDBMgr();
pDBInterface_ = DBUtil::create(dbcfg.db_type, dbcfg.db_ip, dbcfg.db_port,
dbcfg.db_username, dbcfg.db_password, dbcfg.db_numConnections);
if(pDBInterface_ == NULL)
{
ERROR_MSG("Dbmgr::initializeEnd: can't create dbinterface!\n");
return false;
}
if(!pDBInterface_->attach(dbcfg.db_name))
{
ERROR_MSG("Dbmgr::initializeEnd: can't attach to database! %s.\n", pDBInterface_->c_str());
return false;
}
else
{
INFO_MSG("Dbmgr::initializeEnd: %s!\n", pDBInterface_->c_str());
}
return EntityTables::getSingleton().load(pDBInterface_) && EntityTables::getSingleton().syncToDB();
}
示例2: run_client
int run_client ( run_mode_t run_mode ) {
INFO_MSG ( "Client starting\n" );
pthread_t thread[run_mode.thread_amount];
pthread_t statistic_thread;
client_task_t client_task;
statistic_task_t statistic_task;
if ( 0 != make_client_task ( &run_mode, &client_task ) ) {
DEBUG_MSG ( "make_client_task error\n" );
return 1;
}
statistic_task.reporting_timeout = run_mode.reporting_timeout;
statistic_task.statistic_p = &client_task.statistic;
pthread_create ( &statistic_thread, NULL, statistics, (void *) &statistic_task );
int i;
for ( i = 0; i < run_mode.thread_amount; ++i ) {
sleep ( 0 );
if ( 0 != pthread_create( &thread[i], NULL, client, (void *) &client_task ) ) {
DEBUG_MSG ( "thread create problem\n");
return 1;
}
}
for ( i = 0; i < run_mode.thread_amount; ++i )
pthread_join ( thread[i], NULL );
pthread_join ( statistic_thread, NULL );
DEBUG_MSG ( "client finish\n" );
return 0;
}
示例3: initprog
void initprog() {
INFO_MSG("Program initialisation");
//Initialisation des Pipeblocks
totalexectime=0;
nbcycle=0;
vpipeline[IF].ins.value=-1;
vpipeline[IF].dico_entry=-1;
vpipeline[IF].step=IF;
vpipeline[ID].ins.value=-1;
vpipeline[ID].dico_entry=-1;
vpipeline[ID].step=ID;
vpipeline[EX].ins.value=-1;
vpipeline[EX].dico_entry=-1;
vpipeline[EX].step=EX;
vpipeline[MEM].ins.value=-1;
vpipeline[MEM].dico_entry=-1;
vpipeline[MEM].step=MEM;
vpipeline[WB].ins.value=-1;
vpipeline[WB].dico_entry=-1;
vpipeline[WB].step=WB;
int j;
for (j=0; j < NBREG+3; ++j)
{
reg_mips[j]=0; //Initialisation des registres pour debug avant load
}
//Initialisation de stack
reg_mips[29]=0xFFFFF000-4;
//Initialisation de PC
//Recuperation de la plage .text
int k;
for (k = 0; k < memory->nseg; k++) {
if(strcmp(memory->seg[k].name,".text")==0) {
reg_mips[PC]=memory->seg[k].start._32;
}
}
}
示例4: INFO_MSG
//-------------------------------------------------------------------------------------
void Loginapp::reqAccountResetPassword(Mercury::Channel* pChannel, std::string& accountName)
{
accountName = KBEngine::strutil::kbe_trim(accountName);
INFO_MSG(boost::format("Loginapp::reqAccountResetPassword: accountName(%1%)\n") %
accountName);
Components::COMPONENTS& cts = Components::getSingleton().getComponents(DBMGR_TYPE);
Components::ComponentInfos* dbmgrinfos = NULL;
if(cts.size() > 0)
dbmgrinfos = &(*cts.begin());
if(dbmgrinfos == NULL || dbmgrinfos->pChannel == NULL || dbmgrinfos->cid == 0)
{
ERROR_MSG(boost::format("Loginapp::_createAccount: create(%1%), not found dbmgr!\n") %
accountName);
Mercury::Bundle bundle;
bundle.newMessage(ClientInterface::onReqAccountResetPasswordCB);
SERVER_ERROR_CODE retcode = SERVER_ERR_SRV_NO_READY;
bundle << retcode;
bundle.send(this->getNetworkInterface(), pChannel);
return;
}
{
Mercury::Bundle bundle;
bundle.newMessage(DbmgrInterface::accountReqResetPassword);
bundle << accountName;
bundle.send(this->getNetworkInterface(), dbmgrinfos->pChannel);
}
{
Mercury::Bundle bundle;
bundle.newMessage(ClientInterface::onReqAccountResetPasswordCB);
SERVER_ERROR_CODE retcode = SERVER_SUCCESS;
bundle << retcode;
bundle.send(this->getNetworkInterface(), pChannel);
}
}
示例5: INFO_MSG
void EntityApp<E>::onDbmgrInitCompleted(Mercury::Channel* pChannel,
GAME_TIME gametime, ENTITY_ID startID, ENTITY_ID endID, int32 startGlobalOrder, int32 startGroupOrder, const std::string& digest)
{
INFO_MSG(boost::format("EntityApp::onDbmgrInitCompleted: entityID alloc(%1%-%2%), startGlobalOrder=%3%, startGroupOrder=%4%, digest=%5%.\n") %
startID % endID % startGlobalOrder % startGroupOrder % digest);
startGlobalOrder_ = startGlobalOrder;
startGroupOrder_ = startGroupOrder;
g_componentGlobalOrder = startGlobalOrder;
g_componentGroupOrder = startGroupOrder;
idClient_.onAddRange(startID, endID);
g_kbetime = gametime;
if(digest != EntityDef::md5().getDigestStr())
{
ERROR_MSG(boost::format("EntityApp::onDbmgrInitCompleted: digest not match. curr(%1%) != dbmgr(%2%)\n") %
EntityDef::md5().getDigestStr() % digest);
this->shutDown();
}
}
示例6: KBE_ASSERT
//-------------------------------------------------------------------------------------
bool NetworkInterface::deregisterChannel(Channel* pChannel)
{
const Address & addr = pChannel->addr();
KBE_ASSERT(pChannel->endpoint() != NULL);
if(pChannelDeregisterHandler_)
{
pChannelDeregisterHandler_->onChannelDeregister(pChannel);
}
INFO_MSG("NetworkInterface::deregisterChannel: del channel: %s\n", pChannel->c_str());
if (!channelMap_.erase(addr))
{
CRITICAL_MSG( "NetworkInterface::deregisterChannel: "
"Channel not found %s!\n",
pChannel->c_str() );
return false;
}
return true;
}
示例7: INFO_MSG
//-------------------------------------------------------------------------------------
void InterfacesHandler_ThirdParty::onChargeCB(KBEngine::MemoryStream& s)
{
std::string chargeID;
std::string datas;
CALLBACK_ID cbid;
COMPONENT_ID cid;
DBID dbid;
SERVER_ERROR_CODE retcode;
s >> cid;
s >> chargeID;
s >> dbid;
s.readBlob(datas);
s >> cbid;
s >> retcode;
INFO_MSG(fmt::format("InterfacesHandler_ThirdParty::onChargeCB: chargeID={0}, dbid={3}, cbid={1}, cid={4}, datas={2}!\n",
chargeID, cbid, datas, dbid, cid));
Components::ComponentInfos* cinfos = Components::getSingleton().findComponent(BASEAPP_TYPE, cid);
if(cinfos == NULL || cinfos->pChannel == NULL || cinfos->pChannel->isDestroyed())
{
ERROR_MSG(fmt::format("InterfacesHandler_ThirdParty::onChargeCB: baseapp not found!, chargeID={}, cid={}.\n",
chargeID, cid));
return;
}
Network::Bundle* pBundle = Network::Bundle::ObjPool().createObject();
(*pBundle).newMessage(BaseappInterface::onChargeCB);
(*pBundle) << chargeID;
(*pBundle) << dbid;
(*pBundle).appendBlob(datas);
(*pBundle) << cbid;
(*pBundle) << retcode;
cinfos->pChannel->send(pBundle);
}
示例8: INFO_MSG
//-------------------------------------------------------------------------------------
void Loginapp::onReqAccountResetPasswordCB(Network::Channel* pChannel, std::string& accountName, std::string& email,
SERVER_ERROR_CODE failedcode, std::string& code)
{
INFO_MSG(fmt::format("Loginapp::onReqAccountResetPasswordCB: {}, email={}, failedcode={}!\n",
accountName, email, failedcode));
if(failedcode == SERVER_SUCCESS)
{
Components::COMPONENTS& loginapps = Components::getSingleton().getComponents(LOGINAPP_TYPE);
std::string http_host = "localhost";
if(startGroupOrder_ == 1)
{
if(strlen((const char*)&g_kbeSrvConfig.getLoginApp().externalAddress) > 0)
http_host = g_kbeSrvConfig.getBaseApp().externalAddress;
else
http_host = inet_ntoa((struct in_addr&)Loginapp::getSingleton().networkInterface().extaddr().ip);
}
else
{
Components::COMPONENTS::iterator iter = loginapps.begin();
for(; iter != loginapps.end(); ++iter)
{
if((*iter).groupOrderid == 1)
{
if(strlen((const char*)&(*iter).externalAddressEx) > 0)
http_host = (*iter).externalAddressEx;
else
http_host = inet_ntoa((struct in_addr&)(*iter).pExtAddr->ip);
}
}
}
threadPool_.addTask(new SendResetPasswordEMailTask(email, code,
http_host,
g_kbeSrvConfig.getLoginApp().http_cbport));
}
}
示例9: INFO_MSG
void CNavigationMap::handleKeyEvent( const KeyEvent & event )
{
//if( !InputDevices::isKeyDown( KeyEvent::KEY_LEFTMOUSE ) )
// return;
POINT pt = WorldManager::instance().currentCursorPosition();
INFO_MSG("Êó±ê×ø±ê£º%d,%d\n", pt.x,pt.y );
if( pt.x<m_LeftTop.x || pt.x>m_RightDown.x || pt.y<m_LeftTop.y || pt.y>m_RightDown.y)
return;
float xratio = (pt.x - m_center.x) / m_fNavWidth;
float zratio = (pt.y - m_center.y) / m_fNavWidth;
BoundingBox spaceBB(ChunkManager::instance().cameraSpace()->gridBounds());
const Vector3& minB = spaceBB.minBounds();
const Vector3& maxB = spaceBB.maxBounds();
//INFO_MSG("%f,%f,%f\n", spaceBB.width(), spaceBB.height(), spaceBB.depth());
float fWidth = spaceBB.width();
float fDepth = spaceBB.depth();
Vector3 camerapos = Moo::rc().invView().applyToOrigin();
camerapos.x = fWidth*xratio/2.0f;
camerapos.z = -fDepth*zratio/2.0f;
Vector3 cameradir = Moo::rc().invView().applyToUnitAxisVector(2);
CCustomWorldCamera::Instance().TeleportCamera( camerapos, cameradir);
//Vector3 worldRay = WorldManager::instance().getWorldRay(pt);
//Vector3 start = Moo::rc().invView().applyToOrigin();
//Vector3 extent = start + worldRay * Moo::rc().camera().farPlane();
//CustomCollision sc;
//float fRet = ChunkManager::instance().cameraSpace()->collide( start, extent, sc );
//Vector3 vMousePt = start + worldRay * sc.getCollideDist() ;
}
示例10: INFO_MSG
//-------------------------------------------------------------------------------------
void ServerApp::onRegisterNewApp(Mercury::Channel* pChannel, int32 uid, std::string& username,
int8 componentType, uint64 componentID, int8 globalorderID, int8 grouporderID,
uint32 intaddr, uint16 intport, uint32 extaddr, uint16 extport, std::string& extaddrEx)
{
if(pChannel->isExternal())
return;
INFO_MSG(boost::format("ServerApp::onRegisterNewApp: uid:%1%, username:%2%, componentType:%3%, "
"componentID:%4%, globalorderID=%10%, grouporderID=%11%, intaddr:%5%, intport:%6%, extaddr:%7%, extport:%8%, from %9%.\n") %
uid %
username.c_str() %
COMPONENT_NAME_EX((COMPONENT_TYPE)componentType) %
componentID %
inet_ntoa((struct in_addr&)intaddr) %
ntohs(intport) %
(extaddr != 0 ? inet_ntoa((struct in_addr&)extaddr) : "nonsupport") %
ntohs(extport) %
pChannel->c_str() %
((int32)globalorderID) %
((int32)grouporderID));
Components::ComponentInfos* cinfos = Componentbridge::getComponents().findComponent((
KBEngine::COMPONENT_TYPE)componentType, uid, componentID);
pChannel->componentID(componentID);
if(cinfos == NULL)
{
Componentbridge::getComponents().addComponent(uid, username.c_str(),
(KBEngine::COMPONENT_TYPE)componentType, componentID, globalorderID, grouporderID, intaddr, intport, extaddr, extport, extaddrEx, 0,
0.f, 0.f, 0, 0, 0, 0, 0, pChannel);
}
else
{
KBE_ASSERT(cinfos->pIntAddr->ip == intaddr && cinfos->pIntAddr->port == intport);
cinfos->pChannel = pChannel;
}
}
示例11: ERROR_MSG
//-------------------------------------------------------------------------------------
void Cellapp::executeRawDatabaseCommand(const char* datas, uint32 size, PyObject* pycallback, ENTITY_ID eid)
{
if(datas == NULL)
{
ERROR_MSG("KBEngine::executeRawDatabaseCommand: execute is error!\n");
return;
}
Components::COMPONENTS& cts = Components::getSingleton().getComponents(DBMGR_TYPE);
Components::ComponentInfos* dbmgrinfos = NULL;
if(cts.size() > 0)
dbmgrinfos = &(*cts.begin());
if(dbmgrinfos == NULL || dbmgrinfos->pChannel == NULL || dbmgrinfos->cid == 0)
{
ERROR_MSG("KBEngine::executeRawDatabaseCommand: not found dbmgr!\n");
return;
}
INFO_MSG(boost::format("KBEngine::executeRawDatabaseCommand%1%:%2%.\n") % (eid > 0 ? (boost::format("(entityID=%1%)") % eid).str() : "") % datas);
Mercury::Bundle* pBundle = Mercury::Bundle::ObjPool().createObject();
(*pBundle).newMessage(DbmgrInterface::executeRawDatabaseCommand);
(*pBundle) << eid;
(*pBundle) << componentID_ << componentType_;
CALLBACK_ID callbackID = 0;
if(pycallback && PyCallable_Check(pycallback))
callbackID = callbackMgr().save(pycallback);
(*pBundle) << callbackID;
(*pBundle) << size;
(*pBundle).append(datas, size);
(*pBundle).send(this->getNetworkInterface(), dbmgrinfos->pChannel);
Mercury::Bundle::ObjPool().reclaimObject(pBundle);
}
示例12: find_section
Elf32_Sym *find_symbol(char *name, Elf32_Ehdr *elf_h)
{
int i;
char *tname;
Elf32_Shdr *symtab_sect = find_section(".symtab", elf_h);
Elf32_Shdr *strtab_sect = find_section(".strtab", elf_h);
DEBUG_MSG("Searching for symbol %s in elf @ 0x%x\n", name, (npi_t)elf_h);
if (symtab_sect == NULL) {
ERROR_MSG("Found no .symtab section\n");
return NULL;
}
if (strtab_sect == NULL) {
ERROR_MSG("Found no .strtab section\n");
return NULL;
}
if (symtab_sect->sh_entsize != sizeof(Elf32_Sym)) {
ERROR_MSG("Wrong .symtab entry size\n");
return NULL;
}
Elf32_Sym *syms = (Elf32_Sym *)((u_int32_t)elf_h + symtab_sect->sh_offset);
u_int32_t n = symtab_sect->sh_size / symtab_sect->sh_entsize;
INFO_MSG("Found %i entries in .symtab (sect at address 0x%x)\n", n, (unsigned int)syms);
for (i = 0; i < n; i++) {
tname = get_shstr(elf_h, strtab_sect, syms[i].st_name);
if (strcmp(tname, name) == 0) {
return &syms[i];
}
}
return NULL;
}
示例13: INFO_MSG
//-------------------------------------------------------------------------------------
void ServerApp::onRegisterNewApp(Network::Channel* pChannel, int32 uid, std::string& username,
COMPONENT_TYPE componentType, COMPONENT_ID componentID, COMPONENT_ORDER globalorderID, COMPONENT_ORDER grouporderID,
uint32 intaddr, uint16 intport, uint32 extaddr, uint16 extport, std::string& extaddrEx)
{
if(pChannel->isExternal())
return;
INFO_MSG(fmt::format("ServerApp::onRegisterNewApp: uid:{0}, username:{1}, componentType:{2}, "
"componentID:{3}, globalorderID={9}, grouporderID={10}, intaddr:{4}, intport:{5}, extaddr:{6}, extport:{7}, from {8}.\n",
uid,
username.c_str(),
COMPONENT_NAME_EX((COMPONENT_TYPE)componentType),
componentID,
inet_ntoa((struct in_addr&)intaddr),
ntohs(intport),
(extaddr != 0 ? inet_ntoa((struct in_addr&)extaddr) : "nonsupport"),
ntohs(extport),
pChannel->c_str(),
((int32)globalorderID),
((int32)grouporderID)));
Components::ComponentInfos* cinfos = Components::getSingleton().findComponent((
KBEngine::COMPONENT_TYPE)componentType, uid, componentID);
pChannel->componentID(componentID);
if(cinfos == NULL)
{
Components::getSingleton().addComponent(uid, username.c_str(),
(KBEngine::COMPONENT_TYPE)componentType, componentID, globalorderID, grouporderID, intaddr, intport, extaddr, extport, extaddrEx, 0,
0.f, 0.f, 0, 0, 0, 0, 0, pChannel);
}
else
{
KBE_ASSERT(cinfos->pIntAddr->ip == intaddr && cinfos->pIntAddr->port == intport);
cinfos->pChannel = pChannel;
}
}
示例14: GlobalDataServer
//-------------------------------------------------------------------------------------
bool Dbmgr::initializeEnd()
{
// 添加一个timer, 每秒检查一些状态
loopCheckTimerHandle_ = this->getMainDispatcher().addTimer(1000000, this,
reinterpret_cast<void *>(TIMEOUT_CHECK_STATUS));
mainProcessTimer_ = this->getMainDispatcher().addTimer(1000000 / g_kbeSrvConfig.gameUpdateHertz(), this,
reinterpret_cast<void *>(TIMEOUT_TICK));
// 添加globalData, baseAppData, cellAppData支持
pGlobalData_ = new GlobalDataServer(GlobalDataServer::GLOBAL_DATA);
pBaseAppData_ = new GlobalDataServer(GlobalDataServer::BASEAPP_DATA);
pCellAppData_ = new GlobalDataServer(GlobalDataServer::CELLAPP_DATA);
pGlobalData_->addConcernComponentType(CELLAPP_TYPE);
pGlobalData_->addConcernComponentType(BASEAPP_TYPE);
pBaseAppData_->addConcernComponentType(BASEAPP_TYPE);
pCellAppData_->addConcernComponentType(CELLAPP_TYPE);
INFO_MSG(boost::format("Dbmgr::initializeEnd: digest(%1%)\n") %
EntityDef::md5().getDigestStr());
return initBillingHandler() && initDB();
}
示例15: GlobalDataServer
//-------------------------------------------------------------------------------------
bool Dbmgr::initializeEnd()
{
// 添加一个timer, 每秒检查一些状态
loopCheckTimerHandle_ = this->dispatcher().addTimer(1000000, this,
reinterpret_cast<void *>(TIMEOUT_CHECK_STATUS));
mainProcessTimer_ = this->dispatcher().addTimer(1000000 / 50, this,
reinterpret_cast<void *>(TIMEOUT_TICK));
// 添加globalData, baseAppData, cellAppData支持
pGlobalData_ = new GlobalDataServer(GlobalDataServer::GLOBAL_DATA);
pBaseAppData_ = new GlobalDataServer(GlobalDataServer::BASEAPP_DATA);
pCellAppData_ = new GlobalDataServer(GlobalDataServer::CELLAPP_DATA);
pGlobalData_->addConcernComponentType(CELLAPP_TYPE);
pGlobalData_->addConcernComponentType(BASEAPP_TYPE);
pBaseAppData_->addConcernComponentType(BASEAPP_TYPE);
pCellAppData_->addConcernComponentType(CELLAPP_TYPE);
INFO_MSG(fmt::format("Dbmgr::initializeEnd: digest({})\n",
EntityDef::md5().getDigestStr()));
return initInterfacesHandler() && initDB();
}