OldSchoolHack

Register / Login English

M-i-K-e's AA:PG SDK 7 Aug 2014

not available
  • Category: Americas Army 4
  • Developer:
  • Uploaded by: KN4CK3R
  • Uploaded at:
  • System: Windows
Download (290.98 KB)

VirusTotal Result: 0/53

virustotal

Description

This America's Army: Proving Grounds SDK alignment is correct as of 7 Aug 2014.

CPP Code:
  1. template < class T >
  2. T* FindInstance( void )
  3. {
  4. for( int i(0); i < pGObjects->m_count; i++ )
  5. {
  6. UObject* pObject = pGObjects->m_data[ i ];
  7.  
  8. if( pObject &&
  9. pObject->IsA( T::StaticClass() ) &&
  10. !strstr( pObject->getName(), "Default__" ) )
  11. return (T*)pObject;
  12. }
  13.  
  14. return NULL;
  15. }
  16.  
  17. template< class T >
  18. T* UObject::FindObject ( char* objectName )
  19. {
  20. for ( int i = 0; i < pGObjects->m_count; ++i )
  21. {
  22. UObject* object = pGObjects->m_data[ i ];
  23.  
  24. if ( object
  25. && !strcmp( object->getFullName(), objectName ) )
  26. return ( T* )object;
  27. }
  28.  
  29. return NULL;
  30. }
  31.  
  32. bool UObject::IsA( UClass* objectClass )
  33. { // loop through this class and all supers to find a match
  34. for ( UClass* C = this->Class; C; C = ( UClass* )C->m_superField )
  35. {
  36. if ( C == objectClass )
  37. return true; //match found
  38. }
  39.  
  40. return false; //no match
  41. }
  42.  
  43. char* UObject::getName( void )
  44. {
  45. if ( this->Name.m_index >= 0
  46. && this->Name.m_index < pGNames->m_count
  47. && pGNames->m_data[ this->Name.m_index ] )
  48. return pGNames->m_data[ this->Name.m_index ]->m_name;
  49.  
  50. return "(invalid name)";
  51. }
  52.  
  53. char* UObject::getNameCPP( void )
  54. {
  55. char objectName[ 256 ];
  56.  
  57. if( this->IsA( UClass::StaticClass() ) )
  58. {
  59. UClass* classPtr = ( UClass* )this;
  60.  
  61. while ( classPtr )
  62. { //if 0 (strings match) pre-fix A for Actor
  63. if ( !strcmp( classPtr->getName(), "Actor" ) )
  64. {
  65. strcpy( objectName, "A" );
  66. break;
  67. }//pre-fix U for UObject
  68. else if ( !strcmp( classPtr->getName(), "Object" ) )
  69. {
  70. strcpy( objectName, "U" );
  71. break;
  72. }
  73. //Loop the supers
  74. classPtr = ( UClass* )classPtr->m_superField;
  75. }
  76. }
  77. else //Not a UClass
  78. strcpy( objectName, "F" );
  79.  
  80. strcat( objectName, this->getName() ); //Join the name to pre-fix
  81.  
  82. return objectName; //Return pre-fixed name
  83. }
  84.  
  85. char* UObject::getFullName( void )
  86. {
  87. static char result[ 256 ];
  88.  
  89. strcpy( result, "(invalid name)" ); //Start with invalid name
  90.  
  91. if ( this->Outer //Not dealing with outermost
  92. && this->Class ) //Make sure this class instance is valid
  93. {
  94. if ( this->Outer->Outer ) //Has 2 outers
  95. sprintf( result, "%s %s.%s.%s", this->Class->getName(), this->Outer->Outer->getName(), this->Outer->getName(), this->getName() );
  96. else //Has 1
  97. sprintf( result, "%s %s.%s", this->Class->getName(), this->Outer->getName(), this->getName() );
  98. }
  99.  
  100. return result; //Return either invalid or name with packages
  101. }

Download M-i-K-e's AA:PG SDK 7 Aug 2014