예제 #1
0
        public override void UpdateAfterSimulation()
        {
            try
            {
                if (Placer != null)
                {
                    UpdatePlacer();
                }
                if (!DedicatedServer)
                {
                    ProcessAnimations();
                }

                if (GridTask.IsComplete)
                {
                    CheckDirtyGrids();
                }

                if (IsClient)
                {
                    if (!MTask.IsComplete)
                    {
                        MTask.Wait();
                    }

                    if (MTask.IsComplete && MTask.valid && MTask.Exceptions != null)
                    {
                        TaskHasErrors(ref MTask, "MTask");
                    }
                }
            }
            catch (Exception ex) { Log.Line($"Exception in SessionAfterSim: {ex}"); }
        }
예제 #2
0
        public override void UpdateAfterSimulation()
        {
            try
            {
                if (Placer != null)
                {
                    UpdatePlacer();
                }
                if (!DedicatedServer)
                {
                    ProcessAnimations();
                }

                /*
                 * DsUtil.Start("projectiles");
                 * if (!DedicatedServer && false)
                 * {
                 *  if (!PTask.IsComplete)
                 *      PTask.Wait();
                 *
                 *  if (PTask.IsComplete && PTask.valid && PTask.Exceptions != null)
                 *      TaskHasErrors(ref PTask, "PTask");
                 * }
                 * else Projectiles.Update();
                 *
                 * DsUtil.Complete("projectiles", true);
                 */
                if (_effectedCubes.Count > 0)
                {
                    ApplyGridEffect();
                }

                if (Tick60)
                {
                    GridEffects();
                }

                if (GridTask.IsComplete)
                {
                    CheckDirtyGrids();
                }

                DsUtil.Start("damage");
                if (Hits.Count > 0)
                {
                    ProcessHits();
                }
                DsUtil.Complete("damage", true);

                if (IsClient)
                {
                    if (!MTask.IsComplete)
                    {
                        MTask.Wait();
                    }

                    if (MTask.IsComplete && MTask.valid && MTask.Exceptions != null)
                    {
                        TaskHasErrors(ref MTask, "MTask");
                    }
                }

                /*
                 * DsUtil.Start("network");
                 * if (!DedicatedServer)
                 * {
                 *  if (!NTask.IsComplete)
                 *      NTask.Wait();
                 *
                 *  if (NTask.IsComplete && NTask.valid && NTask.Exceptions != null)
                 *      TaskHasErrors(ref NTask, "NTask");
                 * }
                 * else if (WeaponsToSync.Count > 0) Proccessor.Proccess();
                 */

                DsUtil.Start("network2");
                Proccessor.AddPackets();

                if (MpActive && !HandlesInput)
                {
                    if (PacketsToClient.Count > 0)
                    {
                        ProccessServerPacketsForClients();
                    }
                    if (PacketsToServer.Count > 0)
                    {
                        ProccessClientPacketsForServer();
                    }
                }
                DsUtil.Complete("network2", true);
            }
            catch (Exception ex) { Log.Line($"Exception in SessionAfterSim: {ex}"); }
        }