本文整理汇总了C++中INFO_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ INFO_MSG函数的具体用法?C++ INFO_MSG怎么用?C++ INFO_MSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INFO_MSG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:guozanhua,项目名称:kbengine,代码行数:41,代码来源:dbmgr.cpp
示例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;
}
开发者ID:nekit,项目名称:thread_per_client,代码行数:40,代码来源:client.c
示例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;
}
}
}
开发者ID:Benz0X,项目名称:Emul-MIPS,代码行数:40,代码来源:fonctions.c
示例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);
}
}
开发者ID:afreetgo,项目名称:kbengine,代码行数:41,代码来源:loginapp.cpp
示例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();
}
}
开发者ID:MapleEve,项目名称:kbengine,代码行数:22,代码来源:entity_app.hpp
示例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;
}
开发者ID:sdsgwangpeng,项目名称:kbengine,代码行数:23,代码来源:network_interface.cpp
示例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);
}
开发者ID:waluoo,项目名称:kbengine,代码行数:40,代码来源:interfaces_handler.cpp
示例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));
}
}
开发者ID:1564143452,项目名称:kbengine,代码行数:39,代码来源:loginapp.cpp
示例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() ;
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:38,代码来源:NavigationMap.cpp
示例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;
}
}
开发者ID:KitoHo,项目名称:kbengine,代码行数:39,代码来源:serverapp.cpp
示例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);
}
开发者ID:linuxcentos1,项目名称:kbengine,代码行数:39,代码来源:cellapp.cpp
示例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;
}
开发者ID:ESLab,项目名称:rtdl,代码行数:38,代码来源:linker.c
示例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;
}
}
开发者ID:nagisun,项目名称:kbengine,代码行数:39,代码来源:serverapp.cpp
示例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();
}
开发者ID:Ollydbg,项目名称:kbengine,代码行数:24,代码来源:dbmgr.cpp
示例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();
}
开发者ID:ArcherPeng,项目名称:kbengine-cocos2dx,代码行数:24,代码来源:dbmgr.cpp
示例16: sprintf
//-------------------------------------------------------------------------------------
void ServerApp::hello(Network::Channel* pChannel, MemoryStream& s)
{
std::string verInfo, scriptVerInfo, encryptedKey;
s >> verInfo >> scriptVerInfo;
s.readBlob(encryptedKey);
char buf[1024];
if(encryptedKey.size() > 3)
{
char *c = buf;
for (int i=0; i < (int)encryptedKey.size(); ++i)
{
c += sprintf(c, "%02hhX ", (unsigned char)encryptedKey.data()[i]);
}
c[-1] = '\0';
}
else
{
encryptedKey = "";
sprintf(buf, "None");
buf[4] = '\0';
}
INFO_MSG(fmt::format("ServerApp::onHello: verInfo={}, scriptVerInfo={}, encryptedKey={}, addr:{}\n",
verInfo, scriptVerInfo, buf, pChannel->c_str()));
if(verInfo != KBEVersion::versionString())
onVersionNotMatch(pChannel);
else if(scriptVerInfo != KBEVersion::scriptVersionString())
onScriptVersionNotMatch(pChannel);
else
onHello(pChannel, verInfo, scriptVerInfo, encryptedKey);
}
开发者ID:JustDo1989,项目名称:kbengine,代码行数:38,代码来源:serverapp.cpp
示例17: ERROR_MSG
//-------------------------------------------------------------------------------------
void Logger::registerLogWatcher(Network::Channel* pChannel, KBEngine::MemoryStream& s)
{
LogWatcher* pLogwatcher = &logWatchers_[pChannel->addr()];
if(!pLogwatcher->createFromStream(&s))
{
ERROR_MSG(fmt::format("Logger::registerLogWatcher: addr={} is failed!\n",
pChannel->addr().c_str()));
logWatchers_.erase(pChannel->addr());
s.done();
return;
}
pLogwatcher->addr(pChannel->addr());
INFO_MSG(fmt::format("Logger::registerLogWatcher: addr={0} is successfully!\n",
pChannel->addr().c_str()));
bool first;
s >> first;
if(first)
sendInitLogs(*pLogwatcher);
}
开发者ID:ArcherPeng,项目名称:kbengine-cocos2dx,代码行数:25,代码来源:logger.cpp
示例18: INFO_MSG
//-------------------------------------------------------------------------------------
void Dbmgr::accountNewPassword(Mercury::Channel* pChannel, ENTITY_ID entityID, std::string& accountName,
std::string& password, std::string& newpassword)
{
INFO_MSG(boost::format("Dbmgr::accountNewPassword: accountName=%1%.\n") % accountName);
pBillingAccountHandler_->accountNewPassword(pChannel, entityID, accountName, password, newpassword);
}
开发者ID:Ollydbg,项目名称:kbengine,代码行数:7,代码来源:dbmgr.cpp
示例19: eemo_conf_load_modules
//.........这里部分代码省略.........
continue;
}
new_mod->mod_conf_base = (char*) malloc((strlen("modules.") +
strlen(config_setting_name(mod_conf)) +
strlen(".modconf") + 1) * sizeof(char));
if (new_mod->mod_conf_base == NULL)
{
ERROR_MSG("Error allocating memory for a new module");
free(new_mod->mod_path);
free(new_mod);
continue;
}
sprintf(new_mod->mod_conf_base, "modules.%s.modconf", config_setting_name(mod_conf));
/* Now try to load the module */
new_mod->mod_handle = dlopen(new_mod->mod_path, RTLD_NOW | RTLD_LOCAL);
if (new_mod->mod_handle == NULL)
{
ERROR_MSG("Failed to load module %s (%s)", new_mod->mod_path, dlerror());
free(new_mod->mod_path);
free(new_mod->mod_conf_base);
free(new_mod);
continue;
}
INFO_MSG("Loaded module %s", new_mod->mod_path);
/* Retrieve the module entry point */
/* FIXME: we need to use this ugly memcpy kludge in order to avoid the compiler complaining about
* data pointers getting converted to function pointers. The reason for this is that dlsym
* returns a void* which is a data pointer. In effect, dlsym violates the ANSI C standard
* here... See http://pubs.opengroup.org/onlinepubs/009695399/functions/dlsym.html */
mod_entry = dlsym(new_mod->mod_handle, "eemo_plugin_get_fn_table");
memcpy(&mod_getfn, &mod_entry, sizeof(void*));
if (mod_getfn == NULL)
{
ERROR_MSG("Failed to resolve entry point eemo_plugin_get_fn_table in %s", new_mod->mod_path);
free(new_mod->mod_path);
free(new_mod->mod_conf_base);
free(new_mod);
continue;
}
/* Retrieve the module function table */
if ((mod_getfn)(&new_mod->mod_fn_table) != ERV_OK)
{
ERROR_MSG("Failed to retrieve the function table in %s", new_mod->mod_path);
dlclose(new_mod->mod_handle);
free(new_mod->mod_path);
free(new_mod->mod_conf_base);
free(new_mod);
开发者ID:kdhageman,项目名称:eemo,代码行数:66,代码来源:eemo_modules.c
示例20: pivacy_ui_lib_init
pivacy_cardemu_emulator::pivacy_cardemu_emulator()
{
pivacy_ui_lib_init();
reset();
/* Load credentials */
std::string credential_dir;
if ((pivacy_conf_get_string("emulation.credentials", "directory", credential_dir, NULL) != PRV_OK) || credential_dir.empty())
{
ERROR_MSG("Failed to retrieve credential directory from the configuration");
return;
}
/*
* Enumerate all files in the directory and tried to load all
* files with the extension .xml as if they were a pivacy
* credential
*/
DIR* dir = opendir(credential_dir.c_str());
if (dir == NULL)
{
ERROR_MSG("Failed to open directory %s, cannot load credentials", credential_dir.c_str());
return;
}
struct dirent* entry = NULL;
while ((entry = readdir(dir)) != NULL)
{
// Check if this is the . or .. entry
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
{
continue;
}
// Convert the name of the entry to a C++ string
std::string name(entry->d_name);
bool is_regular_file = false;
#if defined(_DIRENT_HAVE_D_TYPE) && defined(_BSD_SOURCE)
// Determine the type of the entry
switch(entry->d_type)
{
case DT_DIR:
// Do nothing
break;
case DT_REG:
// This is a regular file
is_regular_file = true;
break;
default:
// Do nothing
break;
}
#else
// The entry type has to be determined using lstat
struct stat entry_status;
std::string full_path = credential_dir + "/" + name;
if (!lstat(full_path.c_str(), &entry_status))
{
if (S_ISDIR(entry_status.st_mode))
{
// Do nothing
}
else if (S_ISREG(entry_status.st_mode))
{
is_regular_file = true;
}
else
{
// Do nothing
}
}
#endif
if (is_regular_file)
{
// Attempt to read the file as if it were a credential
pivacy_credential* cred = pivacy_credential_xml_rw::i()->read_pivacy_credential(credential_dir + "/" + name);
if (cred != NULL)
{
// Attempt to read the public key belonging to the credential
if (cred->get_issuer_public_key(credential_dir) != NULL)
{
INFO_MSG("Successfully loaded credential %s issued by %s", cred->get_name().c_str(), cred->get_issuer().c_str());
}
credentials.push_back(cred);
}
}
}
//.........这里部分代码省略.........
开发者ID:credentials,项目名称:pivacy,代码行数:101,代码来源:pivacy_cardemu_emulator.cpp
注:本文中的INFO_MSG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论