Ejemplo n.º 1
0
        /// <summary>
        /// Only called from within the SimChat method. Hides all auras and meta entities,
        /// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
        /// then lets the view update the clients of the new objects.
        /// </summary>
        protected void rollback(Scene scene, CMModel model, CMView view)
        {
            if ((m_state & State.SHOWING_CHANGES) > 0)
            {
                view.HideAllAuras();
                view.HideAllMetaEntities();
            }

            System.Collections.Generic.List <Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
            foreach (Scene currScene in proximitySceneList)
            {
                model.RollbackRegion(currScene);
            }

            if ((m_state & State.DIRTY) != 0)
            {
                model.DeleteAllMetaObjects();
                foreach (Scene currScene in proximitySceneList)
                {
                    model.UpdateCMEntities(currScene);
                }
            }

            if ((m_state & State.SHOWING_CHANGES) > 0)
            {
                view.DisplayRecentChanges();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Only called from within the SimChat method.
        /// </summary>
        protected void diffmode(Scene scene, CMModel model, CMView view)
        {
            System.Collections.Generic.List <Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);

            if ((m_state & State.SHOWING_CHANGES) > 0)  // TURN OFF
            {
                view.SendSimChatMessage(scene, "Hiding all meta objects.");
                view.HideAllMetaEntities();
                view.HideAllAuras();
                view.SendSimChatMessage(scene, "Diff-mode = OFF");

                m_state &= ~State.SHOWING_CHANGES;
                return;
            }
            else // TURN ON
            {
                if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
                {
                    view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
                    //Hide objects from users and Forget about them
                    view.HideAllMetaEntities();
                    view.HideAllAuras();
                    model.DeleteAllMetaObjects();
                    //Recreate them from backend files
                    foreach (Object currScene in m_sceneList.Values)
                    {
                        model.UpdateCMEntities((Scene)currScene);
                    }
                }
                else if ((m_state & State.DIRTY) != 0)
                {
                    view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
                    foreach (Scene currScene in proximitySceneList)
                    {
                        model.UpdateCMEntities(currScene);
                    }
                }

                view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
                foreach (Scene currScene in proximitySceneList)
                {
                    model.CheckForNewEntitiesMissingAuras(currScene);
                }
                view.DisplayRecentChanges();

                view.SendSimChatMessage(scene, "Diff-mode = ON");
                m_state |= State.SHOWING_CHANGES;
                m_state &= ~State.DIRTY;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Only called from within the SimChat method.
        /// </summary>
        protected void commit(string message, Scene scene, CMModel model, CMView view)
        {
            System.Collections.Generic.List <Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);

            string[] args = message.Split(new  char[] { ' ' });

            char[] logMessage = { ' ' };
            if (args.Length > 1)
            {
                logMessage = new char[message.Length - (args[0].Length)];
                message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
            }

            m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region.");
            foreach (Scene currScene in proximitySceneList)
            {
                model.CommitRegion(currScene, new String(logMessage));
                view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
            }

            view.SendSimChatMessage(scene, "Successfully saved all regions.");
            m_state |= State.DIRTY;

            if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES
            {
                view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
                //Hide objects from users and Forget about them
                view.HideAllMetaEntities();
                view.HideAllAuras();
                model.DeleteAllMetaObjects();

                //Recreate them from backend files
                foreach (Scene currScene in proximitySceneList)
                {
                    model.UpdateCMEntities(currScene);
                    view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
                }

                //Display new objects to users1
                view.DisplayRecentChanges();
                view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
                m_state &= ~(State.DIRTY);
                m_state |= State.SHOWING_CHANGES;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Only called from within the SimChat method. Hides all auras and meta entities,
        /// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
        /// then lets the view update the clients of the new objects.
        /// </summary>
        protected void rollback(Scene scene, CMModel model, CMView view)
        {
            if ((m_state & State.SHOWING_CHANGES) > 0)
            {
                view.HideAllAuras();
                view.HideAllMetaEntities();
            }

            System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
            foreach (Scene currScene in proximitySceneList)
                model.RollbackRegion(currScene);

            if ((m_state & State.DIRTY) != 0)
            {
                model.DeleteAllMetaObjects();
                foreach (Scene currScene in proximitySceneList)
                    model.UpdateCMEntities(currScene);
            }

            if ((m_state & State.SHOWING_CHANGES) > 0)
                view.DisplayRecentChanges();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Only called from within the SimChat method.
        /// </summary>
        protected void diffmode(Scene scene, CMModel model, CMView view)
        {
            System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);

            if ((m_state & State.SHOWING_CHANGES) > 0)  // TURN OFF
            {
                view.SendSimChatMessage(scene, "Hiding all meta objects.");
                view.HideAllMetaEntities();
                view.HideAllAuras();
                view.SendSimChatMessage(scene, "Diff-mode = OFF");

                m_state &= ~State.SHOWING_CHANGES;
                return;
            }
            else // TURN ON
            {
                if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
                {
                    view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
                    //Hide objects from users and Forget about them
                    view.HideAllMetaEntities();
                    view.HideAllAuras();
                    model.DeleteAllMetaObjects();
                    //Recreate them from backend files
                    foreach (Object currScene in m_sceneList.Values)
                        model.UpdateCMEntities((Scene) currScene);
                }
                else if ((m_state & State.DIRTY) != 0) {
                    view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
                    foreach (Scene currScene in proximitySceneList)
                        model.UpdateCMEntities(currScene);
                }

                view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
                foreach (Scene currScene in proximitySceneList)
                    model.CheckForNewEntitiesMissingAuras(currScene);
                view.DisplayRecentChanges();

                view.SendSimChatMessage(scene, "Diff-mode = ON");
                m_state |= State.SHOWING_CHANGES;
                m_state &= ~State.DIRTY;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Only called from within the SimChat method.
        /// </summary>
        protected void commit(string message, Scene scene, CMModel model, CMView view)
        {
            System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);

            string[] args = message.Split(new  char[] {' '});

            char[] logMessage = {' '};
            if (args.Length > 1)
            {
                logMessage = new char[message.Length - (args[0].Length)];
                message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
            }

            m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region.");
            foreach (Scene currScene in proximitySceneList)
            {
                model.CommitRegion(currScene, new String(logMessage));
                view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
            }

            view.SendSimChatMessage(scene, "Successfully saved all regions.");
            m_state |= State.DIRTY;

            if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES
            {
                view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
                //Hide objects from users and Forget about them
                view.HideAllMetaEntities();
                view.HideAllAuras();
                model.DeleteAllMetaObjects();

                //Recreate them from backend files
                foreach (Scene currScene in proximitySceneList)
                {
                    model.UpdateCMEntities(currScene);
                    view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
                }

                //Display new objects to users1
                view.DisplayRecentChanges();
                view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
                m_state &= ~(State.DIRTY);
                m_state |= State.SHOWING_CHANGES;
            }
        }