Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

  1. //========= Copyright (c), Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Code for the CEconGameAccount object
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "econ_game_account_server.h"
  9. using namespace GCSDK;
  10. #ifdef GC_DLL
  11. IMPLEMENT_CLASS_MEMPOOL( CEconGameServerAccount, 100, UTLMEMORYPOOL_GROW_SLOW );
  12. void GameServerAccount_GenerateIdentityToken( char* pIdentityToken, uint32 unMaxChars )
  13. {
  14. static const char s_ValidChars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./+!$%^-_+?<>()&~:";
  15. const int nLastValidIndex = ARRAYSIZE(s_ValidChars) - 2; // last = size - 1, minus another one for null terminator
  16. // create a randomized token
  17. for ( uint32 i = 0; i < unMaxChars - 1; ++i )
  18. {
  19. pIdentityToken[i] = s_ValidChars[ RandomInt( 0, nLastValidIndex ) ];
  20. }
  21. pIdentityToken[unMaxChars - 1] = 0;
  22. }
  23. #endif
  24. // memdbgon must be the last include file in a .cpp file!!!
  25. #include "tier0/memdbgon.h"