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.

96 lines
2.4 KiB

  1. //===== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef MM_SESSION_H
  7. #define MM_SESSION_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class IMatchSessionInternal : public IMatchSession, public IMatchEventsSink
  12. {
  13. public:
  14. // Run a frame update
  15. virtual void Update() = 0;
  16. // Destroy the session object
  17. virtual void Destroy() = 0;
  18. // Debug print a session object
  19. virtual void DebugPrint() = 0;
  20. // Check if another session is joinable
  21. virtual bool IsAnotherSessionJoinable( char const *pszAnotherSessionInfo ) = 0;
  22. };
  23. #include "protocol.h"
  24. #ifndef SWDS
  25. #include "sys_session.h"
  26. #include "x360_xlsp_cmd.h"
  27. #include "ds_searcher.h"
  28. #include "match_searcher.h"
  29. #include "mm_session_offline_custom.h"
  30. #include "mm_session_online_host.h"
  31. #include "mm_session_online_client.h"
  32. #include "mm_session_online_search.h"
  33. #include "mm_session_online_teamsearch.h"
  34. void MatchSession_BroadcastSessionSettingsUpdate( KeyValues *pUpdateDeletePackage );
  35. void MatchSession_PrepareClientForConnect( KeyValues *pSettings, uint64 uiReservationCookieOverride = 0ull );
  36. struct MatchSessionServerInfo_t
  37. {
  38. CDsSearcher::DsResult_t m_dsResult;
  39. char m_szConnectCmd[256];
  40. char const *m_szSecureServerAddress;
  41. XUID m_xuidJingle;
  42. uint64 m_uiReservationCookie;
  43. enum ResolveFlags_t
  44. {
  45. RESOLVE_DSRESULT = 0x01,
  46. RESOLVE_CONNECTSTRING = 0x02,
  47. RESOLVE_ALLOW_EXTPEER = 0x04,
  48. RESOLVE_QOS_RATE_PROBE = 0x08,
  49. };
  50. enum ResolveMasks_t
  51. {
  52. RESOLVE_DEFAULT = RESOLVE_DSRESULT | RESOLVE_CONNECTSTRING | RESOLVE_QOS_RATE_PROBE,
  53. };
  54. };
  55. bool MatchSession_ResolveServerInfo( KeyValues *pSettings, CSysSessionBase *pSysSession,
  56. MatchSessionServerInfo_t &info, uint uiResolveFlags = MatchSessionServerInfo_t::RESOLVE_DEFAULT,
  57. uint64 ullCrypt = 0ull );
  58. uint64 MatchSession_GetMachineFlags();
  59. char const * MatchSession_GetTuInstalledString();
  60. enum MatchSessionMachineFlags_t
  61. {
  62. MACHINE_PLATFORM_PS3 = ( 1 << 0 ), // Machine is PS3
  63. };
  64. char const * MatchSession_EncryptAddressString( char const *szAddress, uint64 ullCrypt );
  65. char const * MatchSession_DecryptAddressString( char const *szAddress, uint64 ullCrypt );
  66. #endif // SWDS
  67. #ifdef _X360
  68. // Keeps adjusting client side rate setting based on QOS with server
  69. void MatchSession_RateAdjustmentUpdate();
  70. #endif
  71. #endif // MM_SESSION_H