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.

106 lines
1.7 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #include "mm_framework.h"
  7. #ifdef _X360
  8. #include "xonline.h"
  9. #else
  10. #include "xbox/xboxstubs.h"
  11. #endif
  12. #include "matchsystem.h"
  13. #include "playermanager.h"
  14. #include "servermanager.h"
  15. #include "datacenter.h"
  16. #ifndef SWDS
  17. #include "searchmanager.h"
  18. #include "leaderboards.h"
  19. #endif
  20. // NOTE: This has to be the last file included!
  21. #include "tier0/memdbgon.h"
  22. static CMatchSystem s_MatchSystem;
  23. CMatchSystem *g_pMatchSystem = &s_MatchSystem;
  24. bool IsValidXNKID( XNKID xnkid )
  25. {
  26. for(int i = 0; i < 8; ++i)
  27. {
  28. if(xnkid.ab[i])
  29. return true;
  30. }
  31. return false;
  32. }
  33. CMatchSystem::CMatchSystem()
  34. {
  35. }
  36. CMatchSystem::~CMatchSystem()
  37. {
  38. }
  39. IPlayerManager * CMatchSystem::GetPlayerManager()
  40. {
  41. return g_pPlayerManager;
  42. }
  43. IMatchVoice * CMatchSystem::GetMatchVoice()
  44. {
  45. return g_pMatchVoice;
  46. }
  47. IServerManager * CMatchSystem::GetUserGroupsServerManager()
  48. {
  49. return g_pServerManager;
  50. }
  51. ISearchManager * CMatchSystem::CreateGameSearchManager( KeyValues *pParams )
  52. {
  53. #ifndef SWDS
  54. return new CSearchManager( pParams );
  55. #else
  56. return NULL;
  57. #endif
  58. }
  59. IDatacenter * CMatchSystem::GetDatacenter()
  60. {
  61. return g_pDatacenter;
  62. }
  63. IDlcManager * CMatchSystem::GetDlcManager()
  64. {
  65. return g_pDlcManager;
  66. }
  67. void CMatchSystem::Update()
  68. {
  69. if ( g_pPlayerManager )
  70. g_pPlayerManager->Update();
  71. if ( g_pServerManager )
  72. g_pServerManager->Update();
  73. #ifndef SWDS
  74. CSearchManager::UpdateAll();
  75. if ( g_pLeaderboardRequestQueue )
  76. g_pLeaderboardRequestQueue->Update();
  77. #endif
  78. if ( g_pDatacenter )
  79. g_pDatacenter->Update();
  80. if ( g_pDlcManager )
  81. g_pDlcManager->Update();
  82. }