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

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

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

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

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

示例1: UnloadIfEmpty

/* true if the instance save is still valid */bool InstanceSave::UnloadIfEmpty(){    if (m_playerList.empty() && m_groupList.empty())    {        if (!sInstanceSaveMgr->lock_instLists)            sInstanceSaveMgr->RemoveInstanceSave(GetInstanceId());        return false;    }    else        return true;}
开发者ID:mynew2,项目名称:trinitycore-1,代码行数:13,


示例2: ShapeLibGetMesh

// push Renderable nodes//virtualbool ControlPointGob::GetRenderables(RenderableNodeCollector* collector, RenderContext* context){      Mesh* mesh = ShapeLibGetMesh(RenderShape::QuadLineStrip);    m_localBounds = mesh->bounds;    const float pointSize = 8; // control point size in pixels    float upp = context->Cam().ComputeUnitPerPixel(float3(&m_world.M41),        context->ViewPort().y);    float scale = pointSize * upp;            Matrix scaleM = Matrix::CreateScale(scale);    float3 objectPos = float3(m_world.M41,m_world.M42,m_world.M43);    Matrix b = Matrix::CreateBillboard(objectPos,context->Cam().CamPos(),context->Cam().CamUp(),context->Cam().CamLook());    Matrix billboard = scaleM * b;    // calculate bounds for screen facing quad    float3 transformed, min, max;    transformed = mesh->pos[0];    transformed.Transform(billboard);    min = max = transformed;    for (auto it = mesh->pos.begin(); it != mesh->pos.end(); ++it)    {        transformed = (*it);        transformed.Transform(billboard);        min = minimize(min, transformed);        max = maximize(max, transformed);    }    m_bounds = AABB(min,max);    // give it same color as curve    int color = 0xFFFF0000;    CurveGob* curve = (CurveGob*)m_parent;    if(curve != NULL)    {        color = curve->GetColor();    }    // set renderable    RenderableNode r;    r.mesh = mesh;    ConvertColor(color, &r.diffuse);    r.objectId = GetInstanceId();    r.bounds = m_bounds;    r.WorldXform = billboard;    r.SetFlag(RenderableNode::kTestAgainstBBoxOnly, true);    r.SetFlag(RenderableNode::kShadowCaster, false);    r.SetFlag(RenderableNode::kShadowReceiver, false);        collector->Add(r, RenderFlags::None, Shaders::BasicShader);    return true;}
开发者ID:macressler,项目名称:LevelEditor,代码行数:53,


示例3: DEBUG_LOG

DungeonPersistentState::~DungeonPersistentState(){    DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());    while (!m_playerList.empty())    {        Player* player = *(m_playerList.begin());        player->UnbindInstance(GetMapId(), true);    }    while (!m_groupList.empty())    {        Group* group = *(m_groupList.begin());        group->UnbindInstance(GetMapId(), true);    }}
开发者ID:249CAAFE40,项目名称:mangos-classic,代码行数:14,


示例4: DeleteFromDB

void Corpse::SaveToDB(){    // prevent DB data inconsistance problems and duplicates    CharacterDatabase.BeginTransaction();    DeleteFromDB();    std::ostringstream ss;    ss  << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance) VALUES ("        << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", "        << GetOrientation() << ", "  << GetZoneId() << ", "  << GetMapId() << ", '";    for(uint16 i = 0; i < m_valuesCount; i++ )        ss << GetUInt32Value(i) << " ";    ss << "'," << uint64(m_time) <<", " << uint32(GetType()) << ", " << int(GetInstanceId()) << ")";    CharacterDatabase.Execute( ss.str().c_str() );    CharacterDatabase.CommitTransaction();}
开发者ID:Anderss,项目名称:mangos,代码行数:16,


示例5: assert

bool Renderer::AddTexture(const char * filename, TextureCategory category, TextureWrap wrapS, TextureWrap wrapT, bool invertY){	assert(filename != nullptr);	uint32_t width = 128;	uint32_t height = 128;	TextureManager::GetTiffImageSize(filename, width, height);	uint16_t rendererId = (uint16_t)GetInstanceId();	TextureInfo textureInfo(filename, rendererId, category, (GLsizei)width, (GLsizei)height, wrapS, wrapT, invertY);	mTextureInfoList.push_back(textureInfo);	return true;}
开发者ID:doodoonovitch,项目名称:GameTech,代码行数:17,


示例6: ShapeLibGetMesh

    void SkyDome::Render( RenderContext* context)    {        if(IsVisible() == false)             return;               RenderableNode r;                r.mesh = ShapeLibGetMesh(RenderShape::Sphere);        r.objectId = GetInstanceId();            r.textures[TextureType::Cubemap] = m_texture ? m_texture : TextureLib::Inst()->GetDefault(TextureType::Cubemap);               r.SetFlag( RenderableNode::kShadowCaster, false );        r.SetFlag( RenderableNode::kShadowReceiver, false );        SkyDomeShader* pShader =(SkyDomeShader*) ShaderLib::Inst()->GetShader(Shaders::SkyDomeShader);         pShader->Begin( context);        pShader->SetRenderFlag( RenderFlags::None );   // call this *after* Begin()                pShader->Draw(r);                pShader->End();    }
开发者ID:Anters,项目名称:LevelEditor,代码行数:19,


示例7: StartBullet

void FastProjectile::StartBullet(float muzzle_velocity) {	const bool is_synchronized = !GetManager()->IsLocalGameObjectId(GetInstanceId());	const bool has_barrel = (GetOwnerInstanceId() != 0);	ProjectileUtil::StartBullet(this, muzzle_velocity, !is_synchronized && has_barrel);	if (is_synchronized && has_barrel) {		// Move mesh to muzzle and let it lerp towards object.		xform transform;		vec3 velocity;		ProjectileUtil::GetBarrel(this, transform, velocity);		for (size_t x = 0; x < mesh_resource_array_.size(); ++x) {			UiCure::UserGeometryReferenceResource* resource = mesh_resource_array_[x];			tbc::GeometryBase* gfx_geometry = resource->GetRamData();			gfx_geometry->SetTransformation(transform);		}		EnableMeshSlide(true);		ActivateLerp();	}}
开发者ID:highfestiva,项目名称:life,代码行数:19,


示例8: GetDifficulty

void DungeonPersistentState::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit* source){    DungeonEncounterList const* encounters = sObjectMgr.GetDungeonEncounterList(GetInstanceId(), GetDifficulty());    if (!encounters)        return;    uint32 dungeonId = 0;    for (DungeonEncounterList::const_iterator itr = encounters->begin(); itr != encounters->end(); ++itr)    {        DungeonEncounter const* encounter = *itr;        if (encounter->creditType == type && encounter->creditEntry == creditEntry &&            encounter->difficulty == -1 || (encounter->difficulty == GetDifficulty()))        {            m_completedEncountersMask |= 1 << encounter->dbcEntry->encounterIndex;            if (encounter->lastEncounterDungeon)            {                dungeonId = encounter->lastEncounterDungeon;                sLog.outDebug("UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", GetMap()->GetMapName(), GetInstanceId(), encounter->dbcEntry->encounterName[0], dungeonId);                break;            }        }    }    if (dungeonId)    {        Map::PlayerList const& players = GetMap()->GetPlayers();        for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)        {            if (Player* player = i->getSource())            {                if (Group* grp = player->GetGroup())                {                    if (grp->isLFGGroup())                    {                        sLFGMgr.FinishDungeon(grp->GetObjectGuid(), dungeonId);                        return;                    }                }            }        }    }}
开发者ID:Calixa,项目名称:murlocs_434,代码行数:42,


示例9: assert

    void Locator::BuildRenderables()    {        m_renderables.clear();        Model* model = NULL;        assert(m_resource);        model = (Model*)m_resource->GetTarget();                assert(model && model->IsReady());        const NodeDict& nodes = model->Nodes();        for(auto nodeIt = nodes.begin(); nodeIt != nodes.end(); ++nodeIt)        {            Node* node = nodeIt->second;            assert(m_modelTransforms.size() >= node->index);            const Matrix& world = m_modelTransforms[node->index]; // transform array holds world matricies already, not local            for(auto geoIt = node->geometries.begin(); geoIt != node->geometries.end(); ++geoIt)            {                Geometry* geo = (*geoIt);                Material * mat = geo->material;                RenderableNode renderNode;                renderNode.mesh = geo->mesh;                renderNode.WorldXform = world;                renderNode.bounds = geo->mesh->bounds;                renderNode.bounds.Transform(renderNode.WorldXform);                renderNode.objectId = GetInstanceId();                renderNode.diffuse =  mat->diffuse;                renderNode.specular = mat->specular.xyz();                renderNode.specPower = mat->power;                renderNode.SetFlag( RenderableNode::kShadowCaster, GetCastsShadows() );                renderNode.SetFlag( RenderableNode::kShadowReceiver, GetReceivesShadows() );                LightingState::Inst()->UpdateLightEnvironment(renderNode);                for(unsigned int i = TextureType::MIN; i < TextureType::MAX; ++i)                {                    renderNode.textures[i] = geo->material->textures[i];                }                m_renderables.push_back(renderNode);            }        }    }
开发者ID:Averroes,项目名称:LevelEditor,代码行数:41,


示例10: lock

std::string ResourceUIScriptRuntime::AddCallbackRef(ResUIResultCallback resultCallback){	std::unique_lock<std::recursive_mutex> lock(m_refMutex);	// add the ref to the list	int32_t idx = m_refIdx;	m_refs[idx] = resultCallback;	m_refIdx++;	// canonicalize the ref	char* refString;	m_scriptHost->CanonicalizeRef(idx, GetInstanceId(), &refString);	// turn into a std::string and free	std::string retval = refString;	fwFree(refString);	// return the value	return retval;}
开发者ID:ghost30812,项目名称:client,代码行数:21,


示例11: DeleteFromDB

void Corpse::SaveToDB(){    // prevent DB data inconsistence problems and duplicates    SQLTransaction trans = CharacterDatabase.BeginTransaction();    DeleteFromDB(trans);    uint16 index = 0;    PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE);    stmt->setUInt64(index++, GetGUID().GetCounter());                                 // corpseGuid    stmt->setUInt64(index++, GetOwnerGUID().GetCounter());                            // guid    stmt->setFloat (index++, GetPositionX());                                         // posX    stmt->setFloat (index++, GetPositionY());                                         // posY    stmt->setFloat (index++, GetPositionZ());                                         // posZ    stmt->setFloat (index++, GetOrientation());                                       // orientation    stmt->setUInt16(index++, GetMapId());                                             // mapId    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID));                // displayId    stmt->setString(index++, _ConcatFields(CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END));   // itemCache    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_1));                   // bytes1    stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_2));                   // bytes2    stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_FLAGS));                     // flags    stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS));             // dynFlags    stmt->setUInt32(index++, uint32(m_time));                                         // time    stmt->setUInt8 (index++, GetType());                                              // corpseType    stmt->setUInt32(index++, GetInstanceId());                                        // instanceId    trans->Append(stmt);    for (uint32 phaseId : GetPhases())    {        index = 0;        stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CORPSE_PHASES);        stmt->setUInt32(index++, GetGUID().GetCounter());                                       // Guid (corpse's)        stmt->setUInt32(index++, phaseId);                                            // PhaseId        stmt->setUInt32(index++, GetOwnerGUID().GetCounter());                        // OwnerGuid        stmt->setUInt32(index++, uint32(m_time));                                     // Time        stmt->setUInt8(index++, GetType());                                           // CorpseType        trans->Append(stmt);    }    CharacterDatabase.CommitTransaction(trans);}
开发者ID:DrYaling,项目名称:eluna-wod,代码行数:40,


示例12: ConvertColor

//-----------------------------------------------------------------------------------------------------------------------------------// push Renderable nodes//virtualvoid CurveGob::GetRenderables(RenderableNodeCollector* collector, RenderContext* context){	if (!IsVisible(context->Cam().GetFrustum()) || m_points.size() < 2)		return;    	super::GetRenderables(collector, context);        RenderableNode r;    r.mesh = &m_mesh;    ConvertColor(m_color, &r.diffuse);    r.objectId = GetInstanceId();    r.SetFlag( RenderableNode::kShadowCaster, false );    r.SetFlag( RenderableNode::kShadowReceiver, false );    r.bounds = m_bounds;    r.WorldXform = m_world;           collector->Add( r, RenderFlags::None, Shaders::BasicShader );    // draw control points.    for( auto it = m_points.begin(); it != m_points.end(); ++it)    {        (*it)->GetRenderables(collector,context);    }}
开发者ID:Anters,项目名称:LevelEditor,代码行数:26,


示例13: Win32ReleaseAllDhcp9x

// Release the DHCP addresses of all virtual LAN cardsvoid Win32ReleaseAllDhcp9x(bool wait){	TOKEN_LIST *t;	UINT i;	t = MsEnumNetworkAdapters(VLAN_ADAPTER_NAME, VLAN_ADAPTER_NAME_OLD);	if (t == NULL)	{		return;	}	for (i = 0;i < t->NumTokens;i++)	{		char *name = t->Token[i];		UINT id = GetInstanceId(name);		if (id != 0)		{			Win32ReleaseDhcp9x(id, wait);		}	}	FreeToken(t);}
开发者ID:RexSi,项目名称:SoftEtherVPN,代码行数:24,


示例14: VALUES

/*    Called from AddPersistentState*/void DungeonPersistentState::SaveToDB(){    // state instance data too    std::string data;    if (Map* map = GetMap())    {        InstanceData* iData = map->GetInstanceData();        if (iData && iData->Save())        {            data = iData->Save();            CharacterDatabase.escape_string(data);        }    }    CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '" UI64FMTD "', '%u', '%u', '%s')", GetInstanceId(), GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), GetCompletedEncountersMask(), data.c_str());}
开发者ID:krullgor,项目名称:mangos-tbc,代码行数:20,


示例15: DEBUG_LOG

DungeonPersistentState::~DungeonPersistentState(){    DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());    UnbindThisState();}
开发者ID:krullgor,项目名称:mangos-tbc,代码行数:5,


示例16: GetDifficulty

void DungeonPersistentState::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Player* player){    DungeonEncounterList const* encounterList = sObjectMgr.GetDungeonEncounterList(GetMapId(), GetDifficulty());    if (!encounterList)        return;    for (DungeonEncounterList::const_iterator itr = encounterList->begin(); itr != encounterList->end(); ++itr)    {        if ((*itr)->creditType == type && (*itr)->creditEntry == creditEntry)        {            uint32 oldMask = m_completedEncountersMask;            m_completedEncountersMask |= 1 << (*itr)->dbcEntry->encounterIndex;            if ( m_completedEncountersMask != oldMask)            {                CharacterDatabase.PExecute("UPDATE instance SET encountersMask = '%u' WHERE id = '%u'", m_completedEncountersMask, GetInstanceId());                DEBUG_LOG("DungeonPersistentState: Dungeon %s (Id %u) completed encounter %s", GetMap()->GetMapName(), GetInstanceId(), (*itr)->dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]);                if (uint32 dungeonId = (*itr)->lastEncounterDungeon)                {                    DEBUG_LOG("DungeonPersistentState:: Dungeon %s (Id %u) completed last encounter %s", GetMap()->GetMapName(), GetInstanceId(), (*itr)->dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]);                    // Place LFG reward there!                }                DungeonMap* dungeon = (DungeonMap*)GetMap();                if (dungeon && player)                    dungeon->PermBindAllPlayers(player, dungeon->IsRaidOrHeroicDungeon());                SaveToDB();            }            return;        }    }}
开发者ID:GlassFace,项目名称:core-1,代码行数:35,


示例17: SaveRespawnTime

void GameObject::SaveRespawnTime(){    if(m_respawnTime > time(NULL) && m_spawnedByDefault)        objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);}
开发者ID:Actionfox,项目名称:mangos,代码行数:5,


示例18: GetManager

void Mine::OnDie() {	Parent::OnDie();	GetManager()->PostKillObject(GetInstanceId());}
开发者ID:highfestiva,项目名称:life,代码行数:4,


示例19: RouteTrackingStart

// Start tracking of the routing tablevoid RouteTrackingStart(SESSION *s){	VLAN *v;	ROUTE_TRACKING *t;	UINT if_id = 0;	ROUTE_ENTRY *e;	ROUTE_ENTRY *dns = NULL;	ROUTE_ENTRY *route_to_real_server_global = NULL;	char tmp[64];	UINT exclude_if_id = 0;	bool already_exists = false;	bool already_exists_by_other_account = false;	IP eight;	// Validate arguments	if (s == NULL)	{		return;	}	v = (VLAN *)s->PacketAdapter->Param;	if (v->RouteState != NULL)	{		return;	}	// Get the interface ID of the virtual LAN card	if_id = GetInstanceId(v->InstanceName);	Debug("[InstanceId of %s] = 0x%x/n", v->InstanceName, if_id);	if (MsIsVista())	{		// The routing table by the virtual LAN card body should be		// excluded explicitly in Windows Vista		exclude_if_id = if_id;	}	// Get the route to the server	e = GetBestRouteEntryEx(&s->ServerIP, exclude_if_id);	if (e == NULL)	{		// Acquisition failure		Debug("Failed to get GetBestRouteEntry()./n");		return;	}	IPToStr(tmp, sizeof(tmp), &e->GatewayIP);	Debug("GetBestRouteEntry() Succeed. [Gateway: %s]/n", tmp);	// Add a route	if (MsIsVista())	{		e->Metric = e->OldIfMetric;	}	if (AddRouteEntryEx(e, &already_exists) == false)	{		FreeRouteEntry(e);		e = NULL;	}	Debug("already_exists: %u/n", already_exists);	if (already_exists)	{		if (s->Cedar->Client != NULL && s->Account != NULL)		{			UINT i;			ACCOUNT *a;			for (i = 0;i < LIST_NUM(s->Cedar->Client->AccountList);i++)			{				a = LIST_DATA(s->Cedar->Client->AccountList, i);				Lock(a->lock);				{					SESSION *sess = a->ClientSession;					if (sess != NULL && sess != s)					{						VLAN *v = sess->PacketAdapter->Param;						if (v != NULL)						{							ROUTE_TRACKING *tr = v->RouteState;							if (tr != NULL && e != NULL)							{								if (Cmp(tr->RouteToServer, e, sizeof(ROUTE_ENTRY)) == 0)								{									already_exists_by_other_account = true;								}							}						}					}				}				Unlock(a->lock);			}		}		if (already_exists_by_other_account)		{			Debug("already_exists_by_other_account = %u/n", already_exists_by_other_account);			already_exists = false;		}	}	// Get the routing table to the DNS server//.........这里部分代码省略.........
开发者ID:RexSi,项目名称:SoftEtherVPN,代码行数:101,


示例20: DeleteFromDB

void GameObject::DeleteFromDB(){    objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);    objmgr.DeleteGOData(m_DBTableGuid);    WorldDatabase.PExecute("DELETE FROM `gameobject` WHERE `guid` = '%u'", m_DBTableGuid);}
开发者ID:Artea,项目名称:mangos-svn,代码行数:6,


示例21: ON

bool GameObject::LoadFromDB(uint32 guid, QueryResult *result, uint32 InstanceId){    bool external = (result != NULL);    if (!external)        //                                0    1     2            3            4            5             6           7           8           9           10     11              12             13         14            15        result = sDatabase.PQuery("SELECT `id`,`map`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`loot`,`spawntimesecs`,`animprogress`,`dynflags`,`respawntime`,`guid` "            "FROM `gameobject` LEFT JOIN `gameobject_respawn` ON ((`gameobject`.`guid`=`gameobject_respawn`.`guid`) AND (`gameobject_respawn`.`instance` = '%u')) WHERE `gameobject`.`guid` = '%u'", InstanceId, guid);    if( !result )    {        sLog.outErrorDb("ERROR: Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);        return false;    }    Field *fields = result->Fetch();    uint32 entry = fields[0].GetUInt32();    uint32 map_id=fields[1].GetUInt32();    float x = fields[2].GetFloat();    float y = fields[3].GetFloat();    float z = fields[4].GetFloat();    float ang = fields[5].GetFloat();    float rotation0 = fields[6].GetFloat();    float rotation1 = fields[7].GetFloat();    float rotation2 = fields[8].GetFloat();    float rotation3 = fields[9].GetFloat();    uint32 animprogress = fields[12].GetUInt32();    uint32 dynflags = fields[13].GetUInt32();    uint32 stored_guid = guid;    if (InstanceId != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);    SetInstanceId(InstanceId);    if (!Create(guid,entry, map_id, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, dynflags) )    {        if (!external) delete result;        return false;    }    m_DBTableGuid = stored_guid;    lootid=fields[10].GetUInt32();    m_respawnDelayTime=fields[11].GetUInt32();    m_respawnTime=fields[14].GetUInt64();    if(m_respawnTime && m_respawnTime <= time(NULL))        // ready to respawn    {        m_respawnTime = 0;        sDatabase.PExecute("DELETE FROM `gameobject_respawn` WHERE `guid` = '%u' AND `instance` = '%u'", m_DBTableGuid, GetInstanceId());    }    if (!external) delete result;    _LoadQuests();    return true;}
开发者ID:Aion,项目名称:caldari,代码行数:56,


示例22: GetInstanceId

void GameObject::DeleteFromDB(){    sDatabase.PExecute("DELETE FROM `gameobject` WHERE `guid` = '%u'", m_DBTableGuid);    sDatabase.PExecute("DELETE FROM `gameobject_respawn` WHERE `guid` = '%u' AND `instance` = '%u'", m_DBTableGuid, GetInstanceId());}
开发者ID:Aion,项目名称:caldari,代码行数:5,


示例23: DeleteFromDB

void DungeonPersistentState::DeleteFromDB() const{    MapPersistentStateManager::DeleteInstanceFromDB(GetInstanceId());}
开发者ID:krullgor,项目名称:mangos-tbc,代码行数:4,


示例24: GetInstanceId

void DungeonPersistentState::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry){    DungeonEncounterMapBounds bounds = sObjectMgr.GetDungeonEncounterBounds(creditEntry);    for (DungeonEncounterMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter)    {        DungeonEncounterEntry const* dbcEntry = iter->second->dbcEntry;        if (iter->second->creditType == type && Difficulty(dbcEntry->Difficulty) == GetDifficulty() && dbcEntry->mapId == GetMapId())        {            m_completedEncountersMask |= 1 << dbcEntry->encounterIndex;            CharacterDatabase.PExecute("UPDATE instance SET encountersMask = '%u' WHERE id = '%u'", m_completedEncountersMask, GetInstanceId());            DEBUG_LOG("DungeonPersistentState: Dungeon %s (Id %u) completed encounter %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]);            if (/*uint32 dungeonId =*/ iter->second->lastEncounterDungeon)            {                DEBUG_LOG("DungeonPersistentState:: Dungeon %s (Instance-Id %u) completed last encounter %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()]);                // Place LFG reward here            }            return;        }    }}
开发者ID:krullgor,项目名称:mangos-tbc,代码行数:24,


示例25: GetInstanceId

void DungeonPersistentState::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry){    DungeonEncounterMapBounds bounds = sObjectMgr.GetDungeonEncounterBounds(creditEntry);    for (DungeonEncounterMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)    {        DungeonEncounterEntry const* dbcEntry = itr->second->dbcEntry;        if (itr->second->creditType == type && Difficulty(dbcEntry->Difficulty) == GetDifficulty() && dbcEntry->mapId == GetMapId())        {            uint32 oldMask = m_completedEncountersMask;            m_completedEncountersMask |= 1 << dbcEntry->encounterIndex;            DungeonMap* dungeon = (DungeonMap*)GetMap();            if (!dungeon || dungeon->GetPlayers().isEmpty())                return;            Player* player = dungeon->GetPlayers().begin()->getSource();            if ( m_completedEncountersMask != oldMask)            {                if (dungeon && player)                    dungeon->PermBindAllPlayers(player, dungeon->IsRaidOrHeroicDungeon());                CharacterDatabase.PExecute("UPDATE instance SET encountersMask = '%u' WHERE id = '%u'", m_completedEncountersMask, GetInstanceId());                uint32 dungeonId = itr->second->lastEncounterDungeon;                DEBUG_LOG("DungeonPersistentState: Dungeon %s (Id %u) completed encounter %s %s", GetMap()->GetMapName(), GetInstanceId(), dbcEntry->encounterName[sWorld.GetDefaultDbcLocale()], dungeonId ? "(last)" : "");                if (dungeon && player && player->GetGroup() && player->GetGroup()->isLFGGroup())                {                    sLFGMgr.DungeonEncounterReached(player->GetGroup());                    if ((sWorld.getConfig(CONFIG_BOOL_LFG_ONLYLASTENCOUNTER) && dungeonId)                        || IsCompleted())                        sLFGMgr.SendLFGRewards(player->GetGroup());                }            }            return;        }    }}
开发者ID:klyxmaster,项目名称:mangos,代码行数:44,


示例26: return

float WorldLocation::GetDistance(WorldLocation const& loc) const{    return (!HasMap() || !loc.HasMap() || ((GetMapId() == loc.GetMapId()) && (GetInstanceId() == loc.GetInstanceId()))) ?        ((Position)*this).GetDistance((Position)loc) :        MAX_VISIBILITY_DISTANCE + 1.0f;};
开发者ID:AnthoDevMoP,项目名称:mangos4,代码行数:6,


示例27: Gameobject

bool GameObject::LoadFromDB(uint32 guid, Map *map){    GameObjectData const* data = objmgr.GetGOData(guid);    if( !data )    {        sLog.outErrorDb("ERROR: Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid);        return false;    }    uint32 entry = data->id;    //uint32 map_id = data->mapid;                          // already used before call    float x = data->posX;    float y = data->posY;    float z = data->posZ;    float ang = data->orientation;    float rotation0 = data->rotation0;    float rotation1 = data->rotation1;    float rotation2 = data->rotation2;    float rotation3 = data->rotation3;    uint32 animprogress = data->animprogress;    uint32 go_state = data->go_state;    m_DBTableGuid = guid;    if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);    if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) )        return false;    switch(GetGOInfo()->type)    {        case GAMEOBJECT_TYPE_DOOR:        case GAMEOBJECT_TYPE_BUTTON:            /* this code (in comment) isn't correct because in battlegrounds we need despawnable doors and buttons, pls remove            SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);            m_spawnedByDefault = true;            m_respawnDelayTime = 0;            m_respawnTime = 0;            break;*/        default:            if(data->spawntimesecs >= 0)            {                m_spawnedByDefault = true;                m_respawnDelayTime = data->spawntimesecs;                m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());                                                            // ready to respawn                if(m_respawnTime && m_respawnTime <= time(NULL))                {                    m_respawnTime = 0;                    objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);                }            }            else            {                m_spawnedByDefault = false;                m_respawnDelayTime = -data->spawntimesecs;                m_respawnTime = 0;            }            break;    }    return true;}
开发者ID:Actionfox,项目名称:mangos,代码行数:66,


示例28: DeleteFromDB

void InstanceSave::DeleteFromDB(){    InstanceSaveManager::DeleteInstanceFromDB(GetInstanceId());}
开发者ID:Amara1231,项目名称:blizzlikecore,代码行数:4,



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


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