本文整理汇总了C++中IServerUnknown::GetNetworkable方法的典型用法代码示例。如果您正苦于以下问题:C++ IServerUnknown::GetNetworkable方法的具体用法?C++ IServerUnknown::GetNetworkable怎么用?C++ IServerUnknown::GetNetworkable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServerUnknown
的用法示例。
在下文中一共展示了IServerUnknown::GetNetworkable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
inline edict_t *BaseEntityToEdict(CBaseEntity *pEntity) {
IServerUnknown *pUnk = (IServerUnknown *)pEntity;
IServerNetworkable *pNet = pUnk->GetNetworkable();
if(!pNet)
return NULL;
return pNet->GetEdict();
}
示例2: OnEntityCreated
void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
edict_t *pEdict;
if (EdictFromBaseEntity(pEntity, pEdict)) {
IServerUnknown* pServerUnknown = pEdict->GetUnknown();
if (pServerUnknown)
pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
}
CALL_LISTENERS(OnEntityCreated, ptr((CBaseEntityWrapper*) pEntity));
}
示例3: OnEntityCreated
void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
int iIndex = IndexFromBaseEntity(pEntity);
edict_t *pEdict = EdictFromIndex(iIndex);
if (pEdict)
{
IServerUnknown* pServerUnknown = pEdict->GetUnknown();
if (pServerUnknown)
pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
}
CALL_LISTENERS(OnEntityCreated, iIndex, ptr((CBaseEntityWrapper*) pEntity));
}
示例4: GetEntityWrapper
SMJS_Entity* GetEntityWrapper(CBaseEntity *pEntity){
if(pEntity == NULL) return NULL;
auto ref = gamehelpers->EntityToReference(pEntity);
auto it = refs.find(ref);
if(it != refs.end()) return it->second;
IServerUnknown *pUnk = (IServerUnknown *)pEntity;
IServerNetworkable *pNet = pUnk->GetNetworkable();
SMJS_Entity *wrapper = new SMJS_Entity(pEntity);
refs.insert(std::make_pair(ref, wrapper));
return wrapper;
}
示例5: SetEntity
void SMJS_Entity::SetEntity(CBaseEntity *ent){
if(this->ent != NULL){
if(this->ent != ent){
throw "Cannot set entity twice";
}
return;
}
this->valid = false;
if(ent == NULL) return;
this->ent = ent;
IServerUnknown *pUnk = (IServerUnknown *)ent;
IServerNetworkable *pNet = pUnk->GetNetworkable();
if(pNet){
edict = pNet->GetEdict();
entIndex = gamehelpers->IndexOfEdict(edict);
}
this->valid = true;
}