本文整理汇总了C++中GetInstanceId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetInstanceId函数的具体用法?C++ GetInstanceId怎么用?C++ GetInstanceId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetInstanceId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:InstanceSaveMgr.cpp
示例2: ShapeLibGetMesh
// push Renderable nodes
//virtual
bool 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,代码来源:ControlPointGob.cpp
示例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,代码来源:MapPersistentStateMgr.cpp
示例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,代码来源:Corpse.cpp
示例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,代码来源:Renderer.cpp
示例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,代码来源:SkyDome.cpp
示例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,代码来源:fastprojectile.cpp
示例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,代码来源:MapPersistentStateMgr.cpp
示例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,代码来源:Locator.cpp
示例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,代码来源:ResourceUICallbacks.cpp
示例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,代码来源:Corpse.cpp
示例12: ConvertColor
//-----------------------------------------------------------------------------------------------------------------------------------
// push Renderable nodes
//virtual
void 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,代码来源:CurveGob.cpp
示例13: Win32ReleaseAllDhcp9x
// Release the DHCP addresses of all virtual LAN cards
void 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,代码来源:VLanWin32.c
示例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,代码来源:MapPersistentStateMgr.cpp
示例15: DEBUG_LOG
DungeonPersistentState::~DungeonPersistentState()
{
DEBUG_LOG("Unloading DungeonPersistantState of map %u instance %u", GetMapId(), GetInstanceId());
UnbindThisState();
}
开发者ID:krullgor,项目名称:mangos-tbc,代码行数:5,代码来源:MapPersistentStateMgr.cpp
示例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,代码来源:MapPersistentStateMgr.cpp
示例17: SaveRespawnTime
void GameObject::SaveRespawnTime()
{
if(m_respawnTime > time(NULL) && m_spawnedByDefault)
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
}
开发者ID:Actionfox,项目名称:mangos,代码行数:5,代码来源:GameObject.cpp
示例18: GetManager
void Mine::OnDie() {
Parent::OnDie();
GetManager()->PostKillObject(GetInstanceId());
}
开发者ID:highfestiva,项目名称:life,代码行数:4,代码来源:mine.cpp
示例19: RouteTrackingStart
// Start tracking of the routing table
void 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,代码来源:VLanWin32.c
示例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,代码来源:GameObject.cpp
注:本文中的GetInstanceId函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论