123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- #region Header
- #endregion Header
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using OpenMetaverse;
- using OpenSim;
- using OpenSim.Framework;
- using OpenSim.Region.Framework.Interfaces;
- using OpenSim.Region.Framework.Scenes;
- using OpenSim.Region.Physics.Manager;
- using log4net;
- namespace OpenSim.Region.OptionalModules.ContentManagement
- {
- public class CMView
- {
- #region Static Fields
- private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
- #endregion Static Fields
- #region Fields
- CMModel m_model = null;
- #endregion Fields
- #region Constructors
- public CMView()
- {
- }
- #endregion Constructors
- #region Public Methods
-
- public void DisplayAuras(CMEntityCollection auraCollection)
- {
- foreach (Object ent in auraCollection.Auras.Values)
- ((AuraMetaEntity)ent).SendFullUpdateToAll();
- }
-
- public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client)
- {
- foreach (Object ent in auraCollection.Auras.Values)
- ((AuraMetaEntity)ent).SendFullUpdate(client);
- }
-
- public void DisplayAuras(ArrayList list)
- {
- foreach (Object ent in list)
- {
- m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW");
- ((AuraMetaEntity)ent).SendFullUpdateToAll();
- }
- }
-
- public void DisplayEntities(CMEntityCollection entityCollection)
- {
- foreach (Object ent in entityCollection.Entities.Values)
- ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
- }
-
- public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client)
- {
- foreach (Object ent in entityCollection.Entities.Values)
- ((ContentManagementEntity)ent).SendFullDiffUpdate(client);
- }
-
- public void DisplayEntities(ArrayList list)
- {
- foreach (Object ent in list)
- ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
- }
-
- public void DisplayEntity(ContentManagementEntity ent)
- {
- ent.SendFullDiffUpdateToAll();
- }
- public void DisplayHelpMenu(Scene scene)
- {
- string menu = "Menu:\n";
- menu += "commit (ci) - saves current state of the region to a database on the server\n";
- menu += "diff-mode (dm) - displays those aspects of region that have not been saved but changed since the very last revision. Will dynamically update as you change environment.\n";
- SendSimChatMessage(scene, menu);
- }
- public void DisplayMetaEntity(UUID uuid)
- {
- ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid);
- if (group != null)
- group.SendFullDiffUpdateToAll();
- }
-
-
-
- public void DisplayRecentChanges()
- {
- m_log.Debug("[CONTENT MANAGEMENT] Sending update to clients for " + m_model.MetaEntityCollection.Entities.Count + " objects.");
- DisplayEntities(m_model.MetaEntityCollection);
- DisplayAuras(m_model.MetaEntityCollection);
- }
- public void Hide(ContentManagementEntity ent)
- {
- ent.HideFromAll();
- }
- public void HideAllAuras()
- {
- foreach (Object obj in m_model.MetaEntityCollection.Auras.Values)
- ((MetaEntity)obj).HideFromAll();
- }
- public void HideAllMetaEntities()
- {
- foreach (Object obj in m_model.MetaEntityCollection.Entities.Values)
- ((ContentManagementEntity)obj).HideFromAll();
- }
- public void Initialise(CMModel model)
- {
- m_model = model;
- }
-
-
-
-
-
-
- public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group)
- {
-
- if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID))
- ((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
-
- foreach (SceneObjectPart part in group.Parts)
- if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
- ((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
- }
- public void SendMetaEntitiesToNewClient(IClientAPI client)
- {
- }
- public void SendSimChatMessage(Scene scene, string message)
- {
- scene.SimChat(Utils.StringToBytes(message),
- ChatTypeEnum.Broadcast, 0, new Vector3(0,0,0), "Content Manager", UUID.Zero, false);
- }
- #endregion Public Methods
- }
- }
|