BVB Source Codes

CRYENGINE Show GameObjectDispatch.h Source code

Return Download CRYENGINE: download GameObjectDispatch.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: This file implements dispatching RMI calls in C++ to
  8.                 relevant game object code
  9.  
  10.    -------------------------------------------------------------------------
  11.    History:
  12.     - 24 Oct 2005 : Created by Craig Tiller
  13.  
  14. *************************************************************************/
  15.  
  16. #ifndef __GAMEOBJECTDISPATCH_H__
  17. #define __GAMEOBJECTDISPATCH_H__
  18.  
  19. #pragma once
  20.  
  21. #include "IGameObject.h"
  22. #include <vector>
  23.  
  24. class CGameObjectDispatch
  25. {
  26. public:
  27.         CGameObjectDispatch();
  28.         ~CGameObjectDispatch();
  29.  
  30.         void             RegisterInterface(SGameObjectExtensionRMI* pMessages, size_t nCount);
  31.  
  32.         INetMessageSink* GetServerSink() { return &m_serverDef; }
  33.         INetMessageSink* GetClientSink() { return &m_clientDef; }
  34.  
  35.         void             GetMemoryUsage(ICrySizer* s) const;
  36.  
  37. private:
  38.         // safety check: once we start handing out pointers to m_serverCalls, m_clientCalls
  39.         // we should never modify them again
  40.         bool m_bSafety;
  41.         void LockSafety();
  42.  
  43.         // all messages we have registered
  44.         std::vector<SGameObjectExtensionRMI*> m_messages;
  45.  
  46.         // protocol definitions
  47.         std::vector<SNetMessageDef> m_serverCalls;
  48.         std::vector<SNetMessageDef> m_clientCalls;
  49.  
  50.         class CProtocolDef : public INetMessageSink
  51.         {
  52.         public:
  53.                 virtual void DefineProtocol(IProtocolBuilder* pBuilder);
  54.                 virtual bool HasDef(const SNetMessageDef* pDef);
  55.  
  56.                 bool         IsServer();
  57.         };
  58.  
  59.         CProtocolDef                m_serverDef;
  60.         CProtocolDef                m_clientDef;
  61.  
  62.         static CGameObjectDispatch* m_pGOD;
  63.  
  64.         static TNetMessageCallbackResult Trampoline(
  65.           uint32 userId,
  66.           INetMessageSink* handler,
  67.           TSerialize serialize,
  68.           uint32 curSeq,
  69.           uint32 oldSeq,
  70.           uint32 timeFraction32,
  71.           EntityId* entityId, INetChannel*);
  72. };
  73.  
  74. #endif
  75.  
downloadGameObjectDispatch.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