本文整理汇总了C++中IServerNetworkable::GetServerClass方法的典型用法代码示例。如果您正苦于以下问题:C++ IServerNetworkable::GetServerClass方法的具体用法?C++ IServerNetworkable::GetServerClass怎么用?C++ IServerNetworkable::GetServerClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServerNetworkable
的用法示例。
在下文中一共展示了IServerNetworkable::GetServerClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
const char *CClassInterface::FindEntityNetClass(int start, const char *classname)
{
edict_t *current;
for (int i = ((start != -1) ? start : 0); i < gpGlobals->maxEntities; i++)
{
current = engine->PEntityOfEntIndex(i);
if (current == NULL)
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
if (strcmp(current->GetClassName(), classname) == 0)
{
ServerClass *sClass = network->GetServerClass();
return sClass->GetName();
}
}
return NULL;
}
示例2: FindEntityByNetClass
int FindEntityByNetClass(int start, const char *classname)
{
edict_t *current;
for (int i = ((start != -1) ? start : 0); i < gpGlobals->maxEntities; i++)
{
current = engine->PEntityOfEntIndex(i);
if (current == NULL || current->IsFree())
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
ServerClass *sClass = network->GetServerClass();
const char *name = sClass->GetName();
if (strcmp(name, classname) == 0)
{
return i;
}
}
return -1;
}
示例3: UTIL_FindServerClassnamePrint
void UTIL_FindServerClassnamePrint(const char *name_cmd)
{
edict_t *current;
for (int i = 0; i < gpGlobals->maxEntities; i++)
{
current = engine->PEntityOfEntIndex(i);
if (current == NULL)
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
ServerClass *sClass = network->GetServerClass();
const char *name = sClass->GetName();
if (strcmp(name, name_cmd) == 0)
{
CBotGlobals::botMessage(NULL,0,"%s",current->GetClassName());
return;
}
}
CBotGlobals::botMessage(NULL,0,"Not found");
}
示例4: GetEntityByClassName
int CSizzPluginContext::GetEntityByClassName( const char *name, edict_t *out[], int max_out )
{
int cur_ents = 0;
if (name && out)
{
int max_ents = m_pGlobals->maxEntities;
for (int i = 0; ((i < max_ents) && (cur_ents < max_out)); ++i)
{
edict_t *pEdict = EdictFromEntIndex(i);
if (pEdict && !pEdict->IsFree())
{
IServerNetworkable *pNetworkable = pEdict->GetNetworkable();
if (pNetworkable)
{
ServerClass *pServerClass = pNetworkable->GetServerClass();
if (pServerClass && SCHelpers::FStrEq(pServerClass->GetName(), name))
{
out[cur_ents++] = pEdict;
}
}
}
}
}
return cur_ents;
}
示例5:
// http://svn.alliedmods.net/viewvc.cgi/trunk/extensions/tf2/extension.cpp?revision=2183&root=sourcemod&pathrev=2183
edict_t *CClassInterface::FindEntityByNetClass(int start, const char *classname)
{
edict_t *current;
for (register short int i = 0; i < MAX_ENTITIES; i++)
{
current = engine->PEntityOfEntIndex(i);
if (current == NULL)
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
ServerClass *sClass = network->GetServerClass();
const char *name = sClass->GetName();
if (strcmp(name, classname) == 0)
{
return current;
}
}
return NULL;
}
示例6: INDEXENT
const char *CClassInterface::FindEntityNetClass(int start, const char *classname)
{
edict_t *current;
for (register short int i = 0; i < MAX_ENTITIES; i++)
{
current = INDEXENT(i);
if (current == NULL)
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
if (strcmp(current->GetClassName(), classname) == 0)
{
ServerClass *sClass = network->GetServerClass();
return sClass->GetName();
}
}
return NULL;
}
示例7: UTIL_FindServerClassnamePrint
void UTIL_FindServerClassnamePrint(const char *name_cmd)
{
edict_t *current;
register short int maxEnts = (short int)MAX_ENTITIES;
for (register short int i = 0; i < maxEnts; i++)
{
current = INDEXENT(i);
if (current == NULL)
{
continue;
}
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
{
continue;
}
ServerClass *sClass = network->GetServerClass();
const char *name = sClass->GetName();
if (strcmp(name, name_cmd) == 0)
{
CBotGlobals::BotMessage(NULL, 0, "%s", current->GetClassName());
return;
}
}
CBotGlobals::BotMessage(NULL, 0, "Not found");
}
示例8: HandleEntityToCollideable
//-----------------------------------------------------------------------------
// Converts a user id to a collideable + username
//-----------------------------------------------------------------------------
void CEngineTraceServer::HandleEntityToCollideable( IHandleEntity *pHandleEntity, ICollideable **ppCollide, const char **ppDebugName )
{
*ppCollide = StaticPropMgr()->GetStaticProp( pHandleEntity );
if ( *ppCollide )
{
*ppDebugName = "static prop";
return;
}
IServerNetworkable *pServerNetworkable = static_cast<IServerNetworkable*>(pHandleEntity);
if ( !pServerNetworkable )
{
*ppCollide = NULL;
*ppDebugName = "<null>";
return;
}
edict_t *pEdict = pServerNetworkable->GetEdict();
Assert( pEdict );
*ppCollide = pEdict->GetCollideable();
*ppDebugName = pServerNetworkable->GetServerClass()->GetName();
}
示例9:
static CBaseEntity *FindEntityByNetClass(int start, const char *classname)
{
int maxEntities = gpGlobals->maxEntities;
for (int i = start; i < maxEntities; i++)
{
edict_t *current = gamehelpers->EdictOfIndex(i);
if (current == NULL || current->IsFree())
continue;
IServerNetworkable *network = current->GetNetworkable();
if (network == NULL)
continue;
ServerClass *sClass = network->GetServerClass();
const char *name = sClass->GetName();
if (!strcmp(name, classname))
return gamehelpers->ReferenceToEntity(gamehelpers->IndexOfEdict(current));
}
return NULL;
}
示例10: EdictFromEntIndex
edict_t *CSizzPluginContext::GetEntityByClassName( const char *name, int start_ent /*= 0*/ )
{
if (name)
{
int max_ents = m_pGlobals->maxEntities;
for (int i = start_ent; i < max_ents; ++i)
{
edict_t *pEdict = EdictFromEntIndex(i);
if (pEdict && !pEdict->IsFree())
{
IServerNetworkable *pNetworkable = pEdict->GetNetworkable();
if (pNetworkable)
{
ServerClass *pServerClass = pNetworkable->GetServerClass();
if (pServerClass && SCHelpers::FStrEq(pServerClass->GetName(), name))
{
return pEdict;
}
}
}
}
}
return nullptr;
}