//------------------------------------------------------------------------------------- void Dbmgr::executeRawDatabaseCommand(Mercury::Channel* pChannel, KBEngine::MemoryStream& s) { dbThreadPool_.addTask(new DBTaskExecuteRawDatabaseCommand(pChannel->addr(), s)); s.opfini(); numExecuteRawDatabaseCommand_++; }
//------------------------------------------------------------------------------------- void Dbmgr::syncEntityStreamTemplate(Mercury::Channel* pChannel, KBEngine::MemoryStream& s) { KBEAccountTable* pTable = static_cast<KBEAccountTable*>(EntityTables::getSingleton().findKBETable("kbe_accountinfos")); KBE_ASSERT(pTable); pTable->accountDefMemoryStream(s); s.opfini(); }
//------------------------------------------------------------------------------------- void Dbmgr::writeEntity(Mercury::Channel* pChannel, KBEngine::MemoryStream& s) { ENTITY_ID eid; DBID entityDBID; COMPONENT_ID componentID; s >> componentID >> eid >> entityDBID; bufferedDBTasks_.addTask(new DBTaskWriteEntity(pChannel->addr(), componentID, eid, entityDBID, s)); s.opfini(); numWrittenEntity_++; }
//------------------------------------------------------------------------------------- void Dbmgr::executeRawDatabaseCommand(Mercury::Channel* pChannel, KBEngine::MemoryStream& s) { ENTITY_ID entityID = -1; s >> entityID; if(entityID == -1) dbThreadPool_.addTask(new DBTaskExecuteRawDatabaseCommand(pChannel->addr(), s)); else bufferedDBTasks_.addTask(new DBTaskExecuteRawDatabaseCommandByEntity(pChannel->addr(), s, entityID)); s.opfini(); numExecuteRawDatabaseCommand_++; }
//------------------------------------------------------------------------------------- void ClientObjectBase::onRemoteMethodCall(Mercury::Channel * pChannel, KBEngine::MemoryStream& s) { ENTITY_ID eid; s >> eid; client::Entity* entity = pEntities_->find(eid); if(entity == NULL) { s.opfini(); ERROR_MSG(boost::format("ClientObjectBase::onRemoteMethodCall: not found entity(%1%).\n") % eid); return; } entity->onRemoteMethodCall(this->pServerChannel(), s); }
//------------------------------------------------------------------------------------- void Dbmgr::removeEntity(Mercury::Channel* pChannel, KBEngine::MemoryStream& s) { ENTITY_ID eid; DBID entityDBID; COMPONENT_ID componentID; s >> componentID >> eid >> entityDBID; KBE_ASSERT(entityDBID > 0); bufferedDBTasks_.addTask(new DBTaskRemoveEntity(pChannel->addr(), componentID, eid, entityDBID, s)); s.opfini(); numRemovedEntity_++; }