public static void Simulate()
 {
     if (Registered == false)
     {
         if (NetworkHelper.IsConnected)
         {
             Register();
             Registered = true;
         }
         return;
     }
     if (SimulateNetworking)
     {
     }
     else
     {
         if (isConnected)
         {
             while (bufferedSendData.Count > 0)
             {
                 Distribute(bufferedSendData.Pop());
             }
             if (NetworkHelper.IsServer)
             {
                 LSServer.Simulate();
             }
         }
     }
 }
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (GameStarted == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            EffectManager.Deactivate();
            ClientManager.Deactivate();

            ClientManager.Quit();
            PhysicsManager.Deactivate();
            GameStarted = false;
            LSServer.Deactivate();
            DefaultMessageRaiser.LateDeactivate();
            CoroutineManager.Deactivate();

            if (MainGameManager.gameObject != null)
            {
                GameObject.Destroy(MainGameManager.gameObject);
            }
        }
 public static void Setup()
 {
     if (SimulateNetworking)
     {
         ServerSimulator.Setup();
     }
     LSServer.Setup();
 }
示例#4
0
        public static void Setup(NetworkHelper networkHelper)
        {
            NetworkHelper = networkHelper;
            if (SimulateNetworking)
            {
                ServerSimulator.Setup();
            }

            NetworkHelper.OnFrameData += HandleFrameData;
            NetworkHelper.OnInitData  += HandleInitData;
            LSServer.Setup();
        }
示例#5
0
 public static void Initialize()
 {
     LSServer.Initialize();
     GameStarted = false;
     if (SimulateNetworking)
     {
         ServerSimulator.Initialize();
     }
     else
     {
     }
     Registered = false;
 }
        public static void Initialize(NetworkHelper networkHelper)
        {
            NetworkHelper              = networkHelper;
            NetworkHelper.OnFrameData += HandleFrameData;
            NetworkHelper.OnInitData  += HandleInitData;

            LSServer.Initialize();
            GameStarted = false;
            if (SimulateNetworking)
            {
                ServerSimulator.Initialize();
            }
            else
            {
            }
            Registered = false;
        }
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (GameStarted == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            EffectManager.Deactivate();
            ClientManager.Deactivate();

            TeamManager.Deactivate();
            ClientManager.Quit();
            PhysicsManager.Deactivate();
            GameStarted = false;
            LSServer.Deactivate();
            DefaultMessageRaiser.LateDeactivate();
        }