Ejemplo n.º 1
0
 private static void Initialize(BoltNetworkModes modes, UdpEndPoint endpoint, BoltConfig config)
 {
     BoltNetworkInternal.DebugDrawer   = new UnityDebugDrawer();
     BoltNetworkInternal.UsingUnityPro = true;
     if (BoltLauncher.< > f__mg$cache0 == null)
     {
         BoltLauncher.< > f__mg$cache0 = new Func <int, string>(BoltLauncher.GetSceneName);
     }
     BoltNetworkInternal.GetSceneName = BoltLauncher.< > f__mg$cache0;
     if (BoltLauncher.< > f__mg$cache1 == null)
     {
         BoltLauncher.< > f__mg$cache1 = new Func <string, int>(BoltLauncher.GetSceneIndex);
     }
     BoltNetworkInternal.GetSceneIndex = BoltLauncher.< > f__mg$cache1;
     if (BoltLauncher.< > f__mg$cache2 == null)
     {
         BoltLauncher.< > f__mg$cache2 = new Func <List <STuple <BoltGlobalBehaviourAttribute, Type> > >(BoltLauncher.GetGlobalBehaviourTypes);
     }
     BoltNetworkInternal.GetGlobalBehaviourTypes = BoltLauncher.< > f__mg$cache2;
     if (BoltLauncher.< > f__mg$cache3 == null)
     {
         BoltLauncher.< > f__mg$cache3 = new Action(BoltNetworkInternal_User.EnvironmentSetup);
     }
     BoltNetworkInternal.EnvironmentSetup = BoltLauncher.< > f__mg$cache3;
     if (BoltLauncher.< > f__mg$cache4 == null)
     {
         BoltLauncher.< > f__mg$cache4 = new Action(BoltNetworkInternal_User.EnvironmentReset);
     }
     BoltNetworkInternal.EnvironmentReset = BoltLauncher.< > f__mg$cache4;
     BoltNetworkInternal.__Initialize(modes, endpoint, config, BoltLauncher.CreateUdpPlatform(), null);
 }
Ejemplo n.º 2
0
 public static void Shutdown()
 {
     if (!BoltNetwork.isRunning)
     {
         return;
     }
     Debug.Log("Bolt shutdown");
     BoltNetworkInternal.__Shutdown();
 }
Ejemplo n.º 3
0
    static void Initialize(BoltNetworkModes modes, UdpEndPoint endpoint, BoltConfig config)
    {
        BoltNetworkInternal.DebugDrawer = new BoltInternal.UnityDebugDrawer();

#if UNITY_PRO_LICENSE
        BoltNetworkInternal.UsingUnityPro = true;
#else
        BoltNetworkInternal.UsingUnityPro = false;
#endif

#if BOLT_UPNP_SUPPORT
        BoltNetworkInternal.NatCommunicator = new BoltInternal.StandaloneNatCommunicator();
#endif

        BoltNetworkInternal.GetSceneName            = GetSceneName;
        BoltNetworkInternal.GetSceneIndex           = GetSceneIndex;
        BoltNetworkInternal.GetGlobalBehaviourTypes = GetGlobalBehaviourTypes;
        BoltNetworkInternal.EnvironmentSetup        = BoltInternal.BoltNetworkInternal_User.EnvironmentSetup;
        BoltNetworkInternal.EnvironmentReset        = BoltInternal.BoltNetworkInternal_User.EnvironmentReset;
        BoltNetworkInternal.__Initialize(modes, endpoint, config, CreateUdpPlatform());
    }
Ejemplo n.º 4
0
    // Utils

    /// <summary>
    /// Utility function to initialize Bolt with the specified modes, endpoint, config and scene.
    /// </summary>
    /// <param name="modes">Bolt mode. <see cref="BoltNetworkModes"/></param>
    /// <param name="endpoint">Custom EndPoint where Bolt will try to bind</param>
    /// <param name="config">Custom Bolt configuration</param>
    /// <param name="scene">Default Scene loaded by Bolt when the initialization is complete</param>
    static void Initialize(BoltNetworkModes modes, UdpEndPoint endpoint, BoltConfig config, string scene = null)
    {
        BoltDynamicData.Setup();
        BoltNetworkInternal.Initialize(modes, endpoint, config, TargetPlatform, scene);
    }
Ejemplo n.º 5
0
 public static void Shutdown()
 {
     BoltNetworkInternal.__Shutdown();
 }
Ejemplo n.º 6
0
 public static void Shutdown(bool waitForShutdown)
 {
     BoltNetworkInternal.__Shutdown(waitForShutdown);
 }
Ejemplo n.º 7
0
 public static System.Threading.ManualResetEvent Shutdown()
 {
     return(BoltNetworkInternal.__Shutdown());
 }