!B (CE-20767) Enabled opaque rendering and shadows for GPU particles. Added ZPassGPU...
[CRYENGINE.git] / Code / CryEngine / CryNetwork / CryNetwork.cpp
blobf0fda7d8272fd4cdc6eeda7d0146a32c4d2182bc
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 //
4 // File: crynetwork.cpp
5 // Description: dll entry point
6 //
7 // History:
8 // -July 25,2001:Created by Alberto Demichelis
9 //
10 //////////////////////////////////////////////////////////////////////
12 #include "StdAfx.h"
13 #include "Network.h"
14 // Included only once per DLL module.
15 #include <CryCore/Platform/platform_impl.inl>
17 #include <CrySystem/IEngineModule.h>
18 #include <CryExtension/ICryFactory.h>
19 #include <CryExtension/ClassWeaver.h>
21 //////////////////////////////////////////////////////////////////////////
23 CRYNETWORK_API INetwork* CreateNetwork(ISystem* pSystem, int ncpu)
25 CNetwork* pNetwork = new CNetwork;
27 if (!pNetwork->Init(ncpu))
29 pNetwork->Release();
30 return NULL;
32 return pNetwork;
35 //////////////////////////////////////////////////////////////////////////
36 class CEngineModule_CryNetwork : public INetworkEngineModule
38 CRYINTERFACE_BEGIN()
39 CRYINTERFACE_ADD(Cry::IDefaultModule)
40 CRYINTERFACE_ADD(INetworkEngineModule)
41 CRYINTERFACE_END()
43 CRYGENERATE_SINGLETONCLASS_GUID(CEngineModule_CryNetwork, "EngineModule_CryNetwork", "7dc5c3b8-bb37-4063-a29a-c2d6dd718e0f"_cry_guid)
45 virtual ~CEngineModule_CryNetwork()
47 SAFE_RELEASE(gEnv->pNetwork);
50 //////////////////////////////////////////////////////////////////////////
51 virtual const char* GetName() const override { return "CryNetwork"; };
52 virtual const char* GetCategory() const override { return "CryEngine"; };
54 //////////////////////////////////////////////////////////////////////////
55 virtual bool Initialize(SSystemGlobalEnvironment& env, const SSystemInitParams& initParams) override
57 CNetwork* pNetwork = new CNetwork;
59 int ncpu = env.pi.numCoresAvailableToProcess;
60 if (!pNetwork->Init(ncpu))
62 pNetwork->Release();
63 return false;
65 env.pNetwork = pNetwork;
67 CryLogAlways("[Network Version]: "
68 #if defined(_RELEASE)
69 "RELEASE "
70 #elif defined(_PROFILE)
71 "PROFILE "
72 #else
73 "DEBUG "
74 #endif
76 #if defined(PURE_CLIENT)
77 "PURE CLIENT"
78 #elif (DEDICATED_SERVER)
79 "DEDICATED SERVER"
80 #else
81 "DEVELOPMENT BUILD"
82 #endif
85 #if defined(DEDICATED_SERVER) && defined(PURE_CLIENT)
86 CryFatalError("[Network]: Invalid build configuration - aborting");
87 #endif
89 return true;
93 CRYREGISTER_SINGLETON_CLASS(CEngineModule_CryNetwork);
95 #include <CryCore/CrtDebugStats.h>