forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecureBootstrapExtension.cs
More file actions
29 lines (27 loc) · 1.26 KB
/
Copy pathSecureBootstrapExtension.cs
File metadata and controls
29 lines (27 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//#define ENABLE_NETCODE_SAMPLE_SECURE
using Unity.NetCode;
namespace Samples.HelloNetcode
{
#if ENABLE_NETCODE_SAMPLE_SECURE
[UnityEngine.Scripting.Preserve]
public class SecureBootStrapExtension : FrontendBootstrap
{
public override bool Initialize(string defaultWorldName)
{
#if !UNITY_EDITOR && NETCODE_DEBUG
UnityEngine.Debug.LogWarning(">>>>>>>>>> SAMPLE CODE: don't ship the certificates as a part of your build <<<<<<<<<<");
#elif !UNITY_EDITOR && !NETCODE_DEBUG
UnityEngine.Debug.LogError(">>>>>>>>>> SAMPLE CODE: Don't ship the certificates as a part of your build <<<<<<<<<<");
#endif
// To set up a custom driver the constructor for it needs to be hooked up
// before world creation in the bootstrap system. The netcode bootstrap is
// already defined in the main connection sample and as there can
// be only one set up in the project, we just add this line here on top of
// the existing NetCodeBootstrap class (normally a project would only have
// the boostrap defined in one place).
NetworkStreamReceiveSystem.DriverConstructor = new SecureDriverConstructor();
return base.Initialize(defaultWorldName);
}
}
#endif
}