示例#1
0
void ShareSystem::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
	unsigned int i;
	NativeEntry *pEntry;
	CNativeOwner *pOwner;

	pOwner = g_Extensions.GetNativeOwner(myself);

	for (i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
	{
		if ((pEntry = FindNative(natives[i].name)) == NULL)
		{
			continue;
		}

		if (pEntry->owner != g_pCoreNatives)
		{
			continue;
		}

		if (pEntry->replacement.owner != NULL)
		{
			continue;
		}

		/* Now it's safe to add the override */
		pEntry->replacement.func = natives[i].func;
		pEntry->replacement.owner = pOwner;
		pOwner->AddReplacedNative(pEntry);
	}
}
示例#2
0
void ShareSystem::AddNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
	CNativeOwner *pOwner;

	pOwner = g_Extensions.GetNativeOwner(myself);

	pOwner->AddNatives(natives);
}
示例#3
0
static void AddNatives(sp_nativeinfo_t *natives)
{
	g_CoreNatives.AddNatives(natives);
}
示例#4
0
void CoreNativesToAdd::OnSourceModAllInitialized()
{
	g_CoreNatives.AddNatives(m_NativeList);
}