BVB Source Codes

CRYENGINE Show GenericRecordingListener.cpp Source code

Return Download CRYENGINE: download GenericRecordingListener.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4. #include "GenericRecordingListener.h"
  5. #include "SimulateCreateEntityPart.h"
  6. #include "SimulateRemoveEntityParts.h"
  7. #include "BreakReplicator.h"
  8.  
  9. CGenericRecordingListener::CGenericRecordingListener() : m_pDef(0), m_pInfo(0)
  10. {
  11. }
  12.  
  13. bool CGenericRecordingListener::AcceptJointBroken(const EventPhysJointBroken* pEvt)
  14. {
  15.         GameWarning("CBreakReplicator::AcceptJointBroken: cannot generically replicate broken joints");
  16.         return false;
  17. }
  18.  
  19. bool CGenericRecordingListener::AcceptUpdateMesh(const EventPhysUpdateMesh* pEvent)
  20. {
  21.         GameWarning("CBreakReplicator::AcceptUpdateMesh: cannot generically replicate meshes");
  22.         return false;
  23. }
  24.  
  25. bool CGenericRecordingListener::AcceptCreateEntityPart(const EventPhysCreateEntityPart* pEvent)
  26. {
  27.         GameWarning("CBreakReplicator::AcceptUpdateMesh: cannot generically replicate part creation");
  28.         return false;
  29. }
  30.  
  31. bool CGenericRecordingListener::AcceptRemoveEntityParts(const EventPhysRemoveEntityParts* pEvent)
  32. {
  33.         return false;
  34. }
  35.  
  36. void CGenericRecordingListener::EndEvent(INetContext* pCtx)
  37. {
  38.         if (m_spawned.empty())
  39.                 return;
  40.  
  41.         CRY_ASSERT(m_pDef);
  42.         CRY_ASSERT(m_pInfo != NULL);
  43.         SNetBreakDescription def;
  44.         def.pMessagePayload = m_pInfo;
  45.         def.pEntities = &m_spawned[0];
  46.         def.nEntities = m_spawned.size();
  47.         pCtx->LogBreak(def);
  48.  
  49.         m_pDef = 0;
  50.         m_pInfo = 0;
  51.         m_spawned.resize(0);
  52. }
  53.  
  54. void CGenericRecordingListener::OnRemove(IEntity* pEntity)
  55. {
  56.         for (int i = 0; i < m_spawned.size(); i++)
  57.                 if (m_spawned[i] == pEntity->GetId())
  58.                         m_spawned[i] = 0;
  59. }
  60.  
  61. void CGenericRecordingListener::OnSpawn(IEntity* pEntity, SEntitySpawnParams& params)
  62. {
  63.         m_spawned.push_back(pEntity->GetId());
  64. }
  65.  
downloadGenericRecordingListener.cpp 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