Пример #1
0
void SendTable_PrintStats( void )
{
	int numTables = 0;
	int numFloats = 0;
	int numStrings = 0;
	int numArrays = 0;
	int numInts = 0;
	int numVecs = 0;
	int numSubTables = 0;
	int numSendProps = 0;
	int numFlatProps = 0;
	int numExcludeProps = 0;

	for ( int i=0; i < g_SendTables.Count(); i++ )
	{
		SendTable *st =  g_SendTables[i];
		
		numTables++;
		numSendProps += st->GetNumProps();
		numFlatProps += st->m_pPrecalc->GetNumProps();

		for ( int j=0; j < st->GetNumProps(); j++ )
		{
			SendProp* sp = st->GetProp( j );

			if ( sp->IsExcludeProp() )
			{
				numExcludeProps++;
				continue; // no real sendprops
			}

			if ( sp->IsInsideArray() )
				continue;

			switch( sp->GetType() )
			{
				case DPT_Int	: numInts++; break;
				case DPT_Float	: numFloats++; break;
				case DPT_Vector : numVecs++; break;
				case DPT_String : numStrings++; break;
				case DPT_Array	: numArrays++; break;
				case DPT_DataTable : numSubTables++; break;
			}
		}
	}

	Msg("Total Send Table stats\n");
	Msg("Send Tables : %i\n", numTables );
	Msg("Send Props  : %i\n", numSendProps );
	Msg("Flat Props  : %i\n", numFlatProps );
	Msg("Int Props   : %i\n", numInts );
	Msg("Float Props : %i\n", numFloats );
	Msg("Vector Props: %i\n", numVecs );
	Msg("String Props: %i\n", numStrings );
	Msg("Array Props : %i\n", numArrays );
	Msg("Table Props : %i\n", numSubTables );
	Msg("Exclu Props : %i\n", numExcludeProps );
}
Пример #2
0
cell_t IsInsideArray(IPluginContext *pContext, const cell_t *params) {
	Handle_t hndl = static_cast<Handle_t>(params[1]);
	HandleError err;
	HandleSecurity sec;
	sec.pOwner = NULL;
	sec.pIdentity = myself->GetIdentity();

	SendProp *pProp;

	if ((err=g_pHandleSys->ReadHandle(hndl, g_SendTableHandle, &sec, (void **)&pProp)) != HandleError_None)
	{
		return pContext->ThrowNativeError("Invalid SendProp handle %x (error %d)", hndl, err);
	}

	return pProp->IsInsideArray();
}