当前位置: 首页>>代码示例>>C++>>正文


C++ IServerNetworkable::GetServerClass方法代码示例

本文整理汇总了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;
}
开发者ID:knobik,项目名称:rcbot2,代码行数:30,代码来源:bot_getprop.cpp

示例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;
}
开发者ID:404UserNotFound,项目名称:sourcemod,代码行数:31,代码来源:extension.cpp

示例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");
}
开发者ID:knobik,项目名称:rcbot2,代码行数:32,代码来源:bot_getprop.cpp

示例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;
}
开发者ID:SizzlingStats,项目名称:sizzlingplugins,代码行数:25,代码来源:SizzPluginContext.cpp

示例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;
}
开发者ID:Deathreus,项目名称:AFKBot,代码行数:32,代码来源:bot_getprop.cpp

示例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;
}
开发者ID:Deathreus,项目名称:AFKBot,代码行数:30,代码来源:bot_getprop.cpp

示例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");
}
开发者ID:Deathreus,项目名称:AFKBot,代码行数:33,代码来源:bot_getprop.cpp

示例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();
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:25,代码来源:enginetrace.cpp

示例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;
}
开发者ID:DJLaca,项目名称:sourcemod,代码行数:22,代码来源:gamerulesnatives.cpp

示例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;
}
开发者ID:SizzlingStats,项目名称:sizzlingplugins,代码行数:24,代码来源:SizzPluginContext.cpp


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