public void CleanupLastWorld()
        {
            if (vm == null)
            {
                return;
            }

            //clear our cache too, if the setting lets us do that
            TimedReferenceController.Clear();
            TimedReferenceController.Clear();

            vm.Context.Ambience.Kill();
            foreach (var ent in vm.Entities)
            { //stop object sounds
                var threads = ent.SoundThreads;
                for (int i = 0; i < threads.Count; i++)
                {
                    threads[i].Sound.RemoveOwner(ent.ObjectID);
                }
                threads.Clear();
            }
            vm.CloseNet(VMCloseNetReason.LeaveLot);
            GameFacade.Scenes.Remove(World);
            World.Dispose();
            vm.SuppressBHAVChanges();
            vm     = null;
            World  = null;
            Driver = null;
        }
Exemple #2
0
        public void CleanupLastWorld()
        {
            if (vm == null)
            {
                return;
            }

            //clear our cache too, if the setting lets us do that
            DiscordRpcEngine.SendFSOPresence(gizmo.CurrentAvatar.Value.Avatar_Name, null, 0, 0, 0, 0, gizmo.CurrentAvatar.Value.Avatar_PrivacyMode > 0);
            TimedReferenceController.Clear();
            TimedReferenceController.Clear();

            if (ZoomLevel < 4)
            {
                ZoomLevel = 5;
            }
            vm.Context.Ambience.Kill();
            foreach (var ent in vm.Entities)   //stop object sounds
            {
                var threads = ent.SoundThreads;
                for (int i = 0; i < threads.Count; i++)
                {
                    threads[i].Sound.RemoveOwner(ent.ObjectID);
                }
                threads.Clear();
            }
            vm.CloseNet(VMCloseNetReason.LeaveLot);
            Driver.OnClientCommand -= VMSendCommand;
            GameFacade.Scenes.Remove(World);
            World.Dispose();
            LotControl.Dispose();
            this.Remove(LotControl);
            ucp.SetPanel(-1);
            ucp.SetInLot(false);
            vm.SuppressBHAVChanges();
            vm         = null;
            World      = null;
            Driver     = null;
            LotControl = null;
            CityRenderer.DisposeOnLot();
        }
Exemple #3
0
        public void CleanupLastWorld()
        {
            if (vm == null)
            {
                return;
            }

            //clear our cache too, if the setting lets us do that
            TimedReferenceController.Clear();
            TimedReferenceController.Clear();
            VM.ClearAssembled();

            vm.Context.Ambience.Kill();
            foreach (var ent in vm.Entities)
            { //stop object sounds
                var threads = ent.SoundThreads;
                for (int i = 0; i < threads.Count; i++)
                {
                    threads[i].Sound.RemoveOwner(ent.ObjectID);
                }
                threads.Clear();
            }
            vm.CloseNet(VMCloseNetReason.LeaveLot);
            //Driver.OnClientCommand -= VMSendCommand;
            GameFacade.Scenes.Remove(World);
            World.Dispose();
            LotControl.Dispose();
            this.Remove(LotControl);
            ucp.SetPanel(-1);
            ucp.SetInLot(false);
            vm.SuppressBHAVChanges();
            vm         = null;
            World      = null;
            Driver     = null;
            LotControl = null;

            SandServer?.Shutdown();
            SandCli?.Disconnect();
            SandServer = null;
            SandCli    = null;
        }