您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DeleteInstanceFromDB函数代码示例

51自学网 2021-06-01 20:26:39
  C++
这篇教程C++ DeleteInstanceFromDB函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DeleteInstanceFromDB函数的典型用法代码示例。如果您正苦于以下问题:C++ DeleteInstanceFromDB函数的具体用法?C++ DeleteInstanceFromDB怎么用?C++ DeleteInstanceFromDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DeleteInstanceFromDB函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _ResetSave

void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId){    sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);    Map const* map = sMapMgr->CreateBaseMap(mapid);    if (!map->Instanceable())        return;    InstanceSaveHashMap::iterator itr = m_instanceSaveById.find(instanceId);    if (itr != m_instanceSaveById.end())        _ResetSave(itr);    DeleteInstanceFromDB(instanceId);                       // even if save not loaded    Map* iMap = ((MapInstanced*)map)->FindInstanceMap(instanceId);    if (iMap && iMap->IsDungeon())        ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);    if (iMap)        iMap->DeleteRespawnTimes();    else        Map::DeleteRespawnTimesInDB(mapid, instanceId);    // Free up the instance id and allow it to be reused    sMapMgr->FreeInstanceId(instanceId);}
开发者ID:kmN666,项目名称:Leroy,代码行数:26,


示例2: DEBUG_LOG

void MapPersistentStateManager::_ResetInstance(uint32 mapid, uint32 instanceId){    DEBUG_LOG("MapPersistentStateManager::_ResetInstance %u, %u", mapid, instanceId);    bool isExtended = false;    QueryResult *result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM character_instance WHERE instance = '%u' AND extend = 1 ", instanceId);    if (result)    {        Field *fields=result->Fetch();        isExtended = fields[0].GetBool();        delete result;    }    PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.find(instanceId);    if (itr != m_instanceSaveByInstanceId.end() && !isExtended)    {        // delay reset until map unload for loaded map        if (Map * iMap = itr->second->GetMap())        {            MANGOS_ASSERT(iMap->IsDungeon());            ((DungeonMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);            return;        }        _ResetSave(m_instanceSaveByInstanceId, itr);    }    DeleteInstanceFromDB(instanceId, isExtended);                       // even if state not loaded}
开发者ID:Heuristicks,项目名称:core,代码行数:30,


示例3: DeleteInstanceFromDB

void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId){    sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);    Map *map = (MapInstanced*)MapManager::Instance().CreateBaseMap(mapid);    if (!map->Instanceable())        return;    InstanceSaveHashMap::iterator itr = m_instanceSaveById.find(instanceId);    if (itr != m_instanceSaveById.end()) _ResetSave(itr);    DeleteInstanceFromDB(instanceId);                       // even if save not loaded    Map* iMap = ((MapInstanced*)map)->FindMap(instanceId);    if (iMap && iMap->IsDungeon()) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);    else objmgr.DeleteRespawnTimeForInstance(instanceId);   // even if map is not loaded}
开发者ID:Amara1231,项目名称:blizzlikecore,代码行数:15,


示例4: DEBUG_LOG

void MapPersistentStateManager::_ResetInstance(uint32 mapid, uint32 instanceId){    DEBUG_LOG("MapPersistentStateManager::_ResetInstance %u, %u", mapid, instanceId);    PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.find(instanceId);    if (itr != m_instanceSaveByInstanceId.end())    {        // delay reset until map unload for loaded map        if (Map* iMap = itr->second->GetMap())        {            MANGOS_ASSERT(iMap->IsDungeon());            ((DungeonMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);            return;        }        _ResetSave(m_instanceSaveByInstanceId, itr);    }    DeleteInstanceFromDB(instanceId);                       // even if state not loaded}
开发者ID:HerrTrigger,项目名称:mangos-wotlk,代码行数:21,


示例5: time

void MapPersistentStateManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime){    // global reset for all instances of the given map    MapEntry const *mapEntry = sMapStore.LookupEntry(mapid);    if (!mapEntry->Instanceable())        return;    time_t now = time(NULL);    if (!warn)    {        MapDifficultyEntry const* mapDiff = GetMapDifficultyData(mapid,difficulty);        if (!mapDiff || !mapDiff->resetTime)        {            sLog.outError("MapPersistentStateManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);            return;        }        // remove all binds to instances of the given map        for(PersistentStateMap::iterator itr = m_instanceSaveByInstanceId.begin(); itr != m_instanceSaveByInstanceId.end();)        {            if (itr->second->GetMapId() == mapid && itr->second->GetDifficulty() == difficulty)            {                if (!((DungeonPersistentState*)itr->second)->IsExtended())                {                    _ResetSave(m_instanceSaveByInstanceId, itr);                    DeleteInstanceFromDB(itr->first, false);                }                else                {                    DeleteInstanceFromDB(itr->first, true);                    ++itr;                }            }            else                ++itr;        }        // calculate the next reset time        time_t next_reset = DungeonResetScheduler::CalculateNextResetTime(mapDiff, resetTime);        // update it in the DB        CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '%u' WHERE mapid = '%u' AND difficulty = '%u'", (uint64)next_reset, mapid, difficulty);        m_Scheduler.SetResetTimeFor(mapid,difficulty,next_reset);        m_Scheduler.ScheduleReset(true, next_reset-3600, DungeonResetEvent(RESET_EVENT_INFORM_1, mapid, difficulty, 0));    }    // note: this isn't fast but it's meant to be executed very rarely    const MapManager::MapMapType& maps = sMapMgr.Maps();    MapManager::MapMapType::const_iterator iter_last = maps.lower_bound(MapID(mapid + 1));    for(MapManager::MapMapType::const_iterator mitr = maps.lower_bound(MapID(mapid)); mitr != iter_last; ++mitr)    {        Map *map2 = mitr->second;        if(map2->GetId() != mapid)            break;        if ((DungeonPersistentState*)map2->GetPersistentState() && ((DungeonPersistentState*)map2->GetPersistentState())->IsExtended())            break;        if (warn)            ((DungeonMap*)map2)->SendResetWarnings(resetTime - now);        else            ((DungeonMap*)map2)->Reset(INSTANCE_RESET_GLOBAL);    }}
开发者ID:GlassFace,项目名称:core-1,代码行数:65,



注:本文中的DeleteInstanceFromDB函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DeleteItem函数代码示例
C++ DeleteFileW函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。