1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 // File: crynetwork.cpp
5 // Description: dll entry point
8 // -July 25,2001:Created by Alberto Demichelis
10 //////////////////////////////////////////////////////////////////////
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
))
35 //////////////////////////////////////////////////////////////////////////
36 class CEngineModule_CryNetwork
: public INetworkEngineModule
39 CRYINTERFACE_ADD(Cry::IDefaultModule
)
40 CRYINTERFACE_ADD(INetworkEngineModule
)
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
))
65 env
.pNetwork
= pNetwork
;
67 CryLogAlways("[Network Version]: "
70 #elif defined(_PROFILE)
76 #if defined(PURE_CLIENT)
78 #elif (DEDICATED_SERVER)
85 #if defined(DEDICATED_SERVER) && defined(PURE_CLIENT)
86 CryFatalError("[Network]: Invalid build configuration - aborting");
93 CRYREGISTER_SINGLETON_CLASS(CEngineModule_CryNetwork
);
95 #include <CryCore/CrtDebugStats.h>