BVB Source Codes

CRYENGINE Show GameChannel.h Source code

Return Download CRYENGINE: download GameChannel.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Common functionality for CGameServerChannel, CGameClientChannel
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 6:10:2004   11:38 : Created by Craig Tiller
  12.  
  13. *************************************************************************/
  14. #ifndef __GAMECHANNEL_H__
  15. #define __GAMECHANNEL_H__
  16.  
  17. #pragma once
  18.  
  19. class CGameContext;
  20. class CPhysicsSync;
  21.  
  22. #define GAME_CHANNEL_SYNC_CLIENT_SERVER_TIME
  23.  
  24. class CGameChannel : public IGameChannel
  25. {
  26. public:
  27.         CGameChannel();
  28.         ~CGameChannel();
  29.  
  30.         // IGameChannel
  31.         // ~IGameChannel
  32.  
  33.         virtual bool IsServer() const = 0;
  34.  
  35.         // internal, useful stuff
  36.         EntityId      GetPlayerId() const { return m_playerId; }
  37.         INetChannel*  GetNetChannel()     { return m_pNetChannel; }
  38.         CGameContext* GetGameContext()    { return m_pContext; }
  39.         CPhysicsSync* GetPhysicsSync()    { return m_pPhysicsSync.get(); }
  40.  
  41.         void          SetNetChannel(INetChannel* pNetChannel)
  42.         {
  43.                 m_pNetChannel = pNetChannel;
  44.         };
  45.  
  46.         void ConfigureContext(bool isLocal);
  47.  
  48.         void ResetPlayerId() { m_playerId = 0; }
  49.  
  50. protected:
  51.         void Init(INetChannel* pNetChannel, CGameContext* pGameContext);
  52.         void SetPlayerId(EntityId id);
  53.  
  54.         bool ReadPacketHeader(CTimeValue tm);
  55.         bool ReadPacketFooter();
  56.  
  57. protected:
  58.         INetChannel*                  m_pNetChannel;
  59.         CGameContext*                 m_pContext;
  60.         std::unique_ptr<CPhysicsSync> m_pPhysicsSync;
  61.  
  62.         EntityId                      m_playerId;
  63. };
  64.  
  65. #endif
  66.  
downloadGameChannel.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top