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.2 KiB

  1. //===== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #ifndef MM_SESSION_ONLINE_CLIENT_H
  7. #define MM_SESSION_ONLINE_CLIENT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //
  12. // CMatchSessionOnlineClient
  13. //
  14. // Implementation of an online session of a client machine
  15. //
  16. class CMatchSessionOnlineClient : public IMatchSessionInternal
  17. {
  18. // Methods of IMatchSession
  19. public:
  20. // Get an internal pointer to session system-specific data
  21. virtual KeyValues * GetSessionSystemData();
  22. // Get an internal pointer to session settings
  23. virtual KeyValues * GetSessionSettings();
  24. // Update session settings, only changing keys and values need
  25. // to be passed and they will be updated
  26. virtual void UpdateSessionSettings( KeyValues *pSettings );
  27. virtual void UpdateTeamProperties( KeyValues *pTeamProperties );
  28. // Issue a session command
  29. virtual void Command( KeyValues *pCommand );
  30. virtual uint64 GetSessionID();
  31. // Run a frame update
  32. virtual void Update();
  33. // Destroy the session object
  34. virtual void Destroy();
  35. // Debug print a session object
  36. virtual void DebugPrint();
  37. // Check if another session is joinable
  38. virtual bool IsAnotherSessionJoinable( char const *pszAnotherSessionInfo );
  39. // Process event
  40. virtual void OnEvent( KeyValues *pEvent );
  41. void Init();
  42. public:
  43. explicit CMatchSessionOnlineClient( KeyValues *pSettings );
  44. explicit CMatchSessionOnlineClient( CSysSessionClient *pSysSession, KeyValues *pSettings );
  45. explicit CMatchSessionOnlineClient( CSysSessionHost *pSysSession, KeyValues *pExtendedSettings );
  46. ~CMatchSessionOnlineClient();
  47. public:
  48. void OnClientFullyConnectedToSession();
  49. void OnEndGameToLobby();
  50. protected:
  51. void InitializeGameSettings();
  52. void OnRunCommand( KeyValues *pCommand );
  53. void OnRunCommand_QueueConnect( KeyValues *pCommand );
  54. void ConnectGameServer();
  55. protected:
  56. KeyValues *m_pSettings;
  57. KeyValues::AutoDelete m_autodelete_pSettings;
  58. KeyValues *m_pSysData;
  59. KeyValues::AutoDelete m_autodelete_pSysData;
  60. enum State_t
  61. {
  62. STATE_INIT,
  63. STATE_CREATING,
  64. STATE_LOBBY,
  65. STATE_GAME,
  66. STATE_ENDING,
  67. STATE_MIGRATE
  68. };
  69. State_t m_eState;
  70. CSysSessionClient *m_pSysSession;
  71. };
  72. #endif