aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ContentManagementSystem
diff options
context:
space:
mode:
authorJeff Ames2008-09-09 01:26:48 +0000
committerJeff Ames2008-09-09 01:26:48 +0000
commitfae34bb10cfa10702faf5c19d8c8517faa018cb5 (patch)
tree2001f24703b010957254dbb49ef5e222ff30b84d /OpenSim/Region/Environment/Modules/ContentManagementSystem
parentFix state xxx within state xxx itself triggering a state "change" to (diff)
downloadopensim-SC_OLD-fae34bb10cfa10702faf5c19d8c8517faa018cb5.zip
opensim-SC_OLD-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.gz
opensim-SC_OLD-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.bz2
opensim-SC_OLD-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.xz
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ContentManagementSystem')
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs70
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs56
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs394
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs52
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs48
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs44
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs310
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs159
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs68
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs74
12 files changed, 647 insertions, 640 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
index dd592dd..aab863a 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/AuraMetaEntity.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
90 public void SetAura(Vector3 color, float radius) 90 public void SetAura(Vector3 color, float radius)
91 { 91 {
92 SceneObjectPart From = m_Entity.RootPart; 92 SceneObjectPart From = m_Entity.RootPart;
93 93
94 //m_log.Debug("[META ENTITY] BEFORE: radius = " + radius); 94 //m_log.Debug("[META ENTITY] BEFORE: radius = " + radius);
95 float burstRadius = 0.1f; 95 float burstRadius = 0.1f;
96 Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None; 96 Primitive.ParticleSystem.SourcePattern patternFlags = Primitive.ParticleSystem.SourcePattern.None;
@@ -98,12 +98,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
98 float burstRate = 0.4f; 98 float burstRate = 0.4f;
99 if (radius >= 8.0f) 99 if (radius >= 8.0f)
100 { 100 {
101 //float sizeOfObject = radius / 2.0f; 101 //float sizeOfObject = radius / 2.0f;
102 burstRadius = (radius - 8.0f)/3f; 102 burstRadius = (radius - 8.0f)/3f;
103 burstRate = 1.5f; 103 burstRate = 1.5f;
104 radius = 7.99f; 104 radius = 7.99f;
105 patternFlags = Primitive.ParticleSystem.SourcePattern.Explode; 105 patternFlags = Primitive.ParticleSystem.SourcePattern.Explode;
106 age = 4.0f; 106 age = 4.0f;
107 } 107 }
108 SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags); 108 SetAura(From, color, radius, burstRadius, age, burstRate, patternFlags);
109 } 109 }
@@ -111,48 +111,48 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
111 public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags) 111 public void SetAura(SceneObjectPart From, Vector3 color, float radius, float burstRadius, float age, float burstRate, Primitive.ParticleSystem.SourcePattern patternFlags)
112 { 112 {
113 Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); 113 Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
114 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | 114 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
115 // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS 115 // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
116 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam | 116 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
117 // Primitive.ParticleSystem.ParticleDataFlags.TargetPos; 117 // Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
118 prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR 118 prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
119 prules.PartStartColor.G = color.Y; 119 prules.PartStartColor.G = color.Y;
120 prules.PartStartColor.B = color.Z; 120 prules.PartStartColor.B = color.Z;
121 prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency 121 prules.PartStartColor.A = 0.5f; //PSYS_PART_START_ALPHA, transparency
122 prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR 122 prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
123 prules.PartEndColor.G = color.Y; 123 prules.PartEndColor.G = color.Y;
124 prules.PartEndColor.B = color.Z; 124 prules.PartEndColor.B = color.Z;
125 prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency 125 prules.PartEndColor.A = 0.5f; //PSYS_PART_END_ALPHA, transparency
126 /*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE 126 /*prules.PartStartScaleX = 0.5f; //PSYS_PART_START_SCALE
127 prules.PartStartScaleY = 0.5f; 127 prules.PartStartScaleY = 0.5f;
128 prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE 128 prules.PartEndScaleX = 0.5f; //PSYS_PART_END_SCALE
129 prules.PartEndScaleY = 0.5f; 129 prules.PartEndScaleY = 0.5f;
130 */ 130 */
131 prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE 131 prules.PartStartScaleX = radius; //PSYS_PART_START_SCALE
132 prules.PartStartScaleY = radius; 132 prules.PartStartScaleY = radius;
133 prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE 133 prules.PartEndScaleX = radius; //PSYS_PART_END_SCALE
134 prules.PartEndScaleY = radius; 134 prules.PartEndScaleY = radius;
135 prules.PartMaxAge = age; //PSYS_PART_MAX_AGE 135 prules.PartMaxAge = age; //PSYS_PART_MAX_AGE
136 prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL 136 prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
137 prules.PartAcceleration.Y = 0.0f; 137 prules.PartAcceleration.Y = 0.0f;
138 prules.PartAcceleration.Z = 0.0f; 138 prules.PartAcceleration.Z = 0.0f;
139 prules.Pattern = patternFlags; //PSYS_SRC_PATTERN 139 prules.Pattern = patternFlags; //PSYS_SRC_PATTERN
140 //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank 140 //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
141 prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE 141 prules.BurstRate = burstRate; //PSYS_SRC_BURST_RATE
142 prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT 142 prules.BurstPartCount = 2; //PSYS_SRC_BURST_PART_COUNT
143 //prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS 143 //prules.BurstRadius = radius; //PSYS_SRC_BURST_RADIUS
144 prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS 144 prules.BurstRadius = burstRadius; //PSYS_SRC_BURST_RADIUS
145 prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN 145 prules.BurstSpeedMin = 0.001f; //PSYS_SRC_BURST_SPEED_MIN
146 prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX 146 prules.BurstSpeedMax = 0.001f; //PSYS_SRC_BURST_SPEED_MAX
147 prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE 147 prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
148 //prules.Target = To; //PSYS_SRC_TARGET_KEY 148 //prules.Target = To; //PSYS_SRC_TARGET_KEY
149 prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA 149 prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
150 prules.AngularVelocity.Y = 0.0f; 150 prules.AngularVelocity.Y = 0.0f;
151 prules.AngularVelocity.Z = 0.0f; 151 prules.AngularVelocity.Z = 0.0f;
152 prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN 152 prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
153 prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END 153 prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
154 154
155 prules.CRC = 1; //activates the particle system?? 155 prules.CRC = 1; //activates the particle system??
156 From.AddNewParticleSystem(prules); 156 From.AddNewParticleSystem(prules);
157 } 157 }
158 158
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
index 301de56..ca20ee6 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/BeamMetaEntity.cs
@@ -79,15 +79,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
79 Vector3 FromPos = From.GetWorldPosition(); 79 Vector3 FromPos = From.GetWorldPosition();
80 Vector3 ToPos = From.GetWorldPosition(); 80 Vector3 ToPos = From.GetWorldPosition();
81 // UUID toUUID = To.UUID; 81 // UUID toUUID = To.UUID;
82 float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) + 82 float distance = (float) (Math.Sqrt(Math.Pow(FromPos.X-ToPos.X, 2) +
83 Math.Pow(FromPos.X-ToPos.Y, 2) + 83 Math.Pow(FromPos.X-ToPos.Y, 2) +
84 Math.Pow(FromPos.X-ToPos.Z, 2) 84 Math.Pow(FromPos.X-ToPos.Z, 2)
85 ) 85 )
86 ); 86 );
87 //float rate = (float) (distance/4f); 87 //float rate = (float) (distance/4f);
88 float rate = 0.5f; 88 float rate = 0.5f;
89 float scale = (float) (distance/128f); 89 float scale = (float) (distance/128f);
90 float speed = (float) (2.0f - distance/128f); 90 float speed = (float) (2.0f - distance/128f);
91 91
92 SetBeamToUUID(From, To, color, rate, scale, speed); 92 SetBeamToUUID(From, To, color, rate, scale, speed);
93 } 93 }
@@ -95,42 +95,42 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
95 public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed) 95 public void SetBeamToUUID(SceneObjectPart From, SceneObjectPart To, Vector3 color, float rate, float scale, float speed)
96 { 96 {
97 Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); 97 Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
98 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive | 98 //prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Emissive |
99 // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS 99 // Primitive.ParticleSystem.ParticleDataFlags.FollowSrc; //PSYS_PART_FLAGS
100 prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam | 100 prules.PartDataFlags = Primitive.ParticleSystem.ParticleDataFlags.Beam |
101 Primitive.ParticleSystem.ParticleDataFlags.TargetPos; 101 Primitive.ParticleSystem.ParticleDataFlags.TargetPos;
102 prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR 102 prules.PartStartColor.R = color.X; //PSYS_PART_START_COLOR
103 prules.PartStartColor.G = color.Y; 103 prules.PartStartColor.G = color.Y;
104 prules.PartStartColor.B = color.Z; 104 prules.PartStartColor.B = color.Z;
105 prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency 105 prules.PartStartColor.A = 1.0f; //PSYS_PART_START_ALPHA, transparency
106 prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR 106 prules.PartEndColor.R = color.X; //PSYS_PART_END_COLOR
107 prules.PartEndColor.G = color.Y; 107 prules.PartEndColor.G = color.Y;
108 prules.PartEndColor.B = color.Z; 108 prules.PartEndColor.B = color.Z;
109 prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency 109 prules.PartEndColor.A = 1.0f; //PSYS_PART_END_ALPHA, transparency
110 prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE 110 prules.PartStartScaleX = scale; //PSYS_PART_START_SCALE
111 prules.PartStartScaleY = scale; 111 prules.PartStartScaleY = scale;
112 prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE 112 prules.PartEndScaleX = scale; //PSYS_PART_END_SCALE
113 prules.PartEndScaleY = scale; 113 prules.PartEndScaleY = scale;
114 prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE 114 prules.PartMaxAge = 1.0f; //PSYS_PART_MAX_AGE
115 prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL 115 prules.PartAcceleration.X = 0.0f; //PSYS_SRC_ACCEL
116 prules.PartAcceleration.Y = 0.0f; 116 prules.PartAcceleration.Y = 0.0f;
117 prules.PartAcceleration.Z = 0.0f; 117 prules.PartAcceleration.Z = 0.0f;
118 //prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN 118 //prules.Pattern = Primitive.ParticleSystem.SourcePattern.Explode; //PSYS_SRC_PATTERN
119 //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank 119 //prules.Texture = UUID.Zero;//= UUID //PSYS_SRC_TEXTURE, default used if blank
120 prules.BurstRate = rate; //PSYS_SRC_BURST_RATE 120 prules.BurstRate = rate; //PSYS_SRC_BURST_RATE
121 prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT 121 prules.BurstPartCount = 1; //PSYS_SRC_BURST_PART_COUNT
122 prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS 122 prules.BurstRadius = 0.5f; //PSYS_SRC_BURST_RADIUS
123 prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN 123 prules.BurstSpeedMin = speed; //PSYS_SRC_BURST_SPEED_MIN
124 prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX 124 prules.BurstSpeedMax = speed; //PSYS_SRC_BURST_SPEED_MAX
125 prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE 125 prules.MaxAge = 0.0f; //PSYS_SRC_MAX_AGE
126 prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY 126 prules.Target = To.UUID; //PSYS_SRC_TARGET_KEY
127 prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA 127 prules.AngularVelocity.X = 0.0f; //PSYS_SRC_OMEGA
128 prules.AngularVelocity.Y = 0.0f; 128 prules.AngularVelocity.Y = 0.0f;
129 prules.AngularVelocity.Z = 0.0f; 129 prules.AngularVelocity.Z = 0.0f;
130 prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN 130 prules.InnerAngle = 0.0f; //PSYS_SRC_ANGLE_BEGIN
131 prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END 131 prules.OuterAngle = 0.0f; //PSYS_SRC_ANGLE_END
132 132
133 prules.CRC = 1; //activates the particle system?? 133 prules.CRC = 1; //activates the particle system??
134 From.AddNewParticleSystem(prules); 134 From.AddNewParticleSystem(prules);
135 } 135 }
136 136
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs
index 072de5e..cdd4f4e 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
82 CMModel m_model = null; 82 CMModel m_model = null;
83 83
84 /// <value> 84 /// <value>
85 /// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region. 85 /// A list of all the scenes that should be revisioned. Controller is the only class that keeps track of all scenes in the region.
86 /// </value> 86 /// </value>
87 Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable()); 87 Hashtable m_sceneList = Hashtable.Synchronized(new Hashtable());
88 State m_state = State.NONE; 88 State m_state = State.NONE;
@@ -129,31 +129,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
129 /// </summary> 129 /// </summary>
130 private SceneObjectGroup GetGroupByPrim(uint localID) 130 private SceneObjectGroup GetGroupByPrim(uint localID)
131 { 131 {
132 foreach(Object currScene in m_sceneList.Values) 132 foreach (Object currScene in m_sceneList.Values)
133 { 133 {
134 foreach (EntityBase ent in ((Scene)currScene).GetEntities()) 134 foreach (EntityBase ent in ((Scene)currScene).GetEntities())
135 { 135 {
136 if (ent is SceneObjectGroup) 136 if (ent is SceneObjectGroup)
137 { 137 {
138 if (((SceneObjectGroup)ent).HasChildPrim(localID)) 138 if (((SceneObjectGroup)ent).HasChildPrim(localID))
139 return (SceneObjectGroup)ent; 139 return (SceneObjectGroup)ent;
140 } 140 }
141 } 141 }
142 } 142 }
143 return null; 143 return null;
144 } 144 }
145 145
146 private void Initialize(CMModel model, CMView view, Scene scene, int channel) 146 private void Initialize(CMModel model, CMView view, Scene scene, int channel)
147 { 147 {
148 lock(this) 148 lock (this)
149 { 149 {
150 m_estateModule = scene.RequestModuleInterface<IEstateModule>(); 150 m_estateModule = scene.RequestModuleInterface<IEstateModule>();
151 m_thread = new Thread( MainLoop ); 151 m_thread = new Thread(MainLoop);
152 m_thread.Name = "Content Management"; 152 m_thread.Name = "Content Management";
153 m_thread.IsBackground = true; 153 m_thread.IsBackground = true;
154 m_thread.Start(); 154 m_thread.Start();
155 ThreadTracker.Add(m_thread); 155 ThreadTracker.Add(m_thread);
156 m_state = State.NONE; 156 m_state = State.NONE;
157 } 157 }
158 } 158 }
159 159
@@ -164,41 +164,41 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
164 { 164 {
165 CMModel model = m_model; CMView view = m_view; int channel = m_channel; 165 CMModel model = m_model; CMView view = m_view; int channel = m_channel;
166 Work currentJob = new Work(); 166 Work currentJob = new Work();
167 while(true) 167 while (true)
168 { 168 {
169 currentJob = m_WorkQueue.Dequeue(); 169 currentJob = m_WorkQueue.Dequeue();
170 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request"); 170 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request");
171 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type); 171 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type);
172 switch(currentJob.Type) 172 switch (currentJob.Type)
173 { 173 {
174 case WorkType.NONE: 174 case WorkType.NONE:
175 break; 175 break;
176 case WorkType.OBJECTATTRIBUTECHANGE: 176 case WorkType.OBJECTATTRIBUTECHANGE:
177 ObjectAttributeChanged(model, view, currentJob.LocalId); 177 ObjectAttributeChanged(model, view, currentJob.LocalId);
178 break; 178 break;
179 case WorkType.PRIMITIVEADDED: 179 case WorkType.PRIMITIVEADDED:
180 PrimitiveAdded(model, view, currentJob); 180 PrimitiveAdded(model, view, currentJob);
181 break; 181 break;
182 case WorkType.OBJECTDUPLICATED: 182 case WorkType.OBJECTDUPLICATED:
183 ObjectDuplicated(model, view, currentJob.LocalId); 183 ObjectDuplicated(model, view, currentJob.LocalId);
184 break; 184 break;
185 case WorkType.OBJECTKILLED: 185 case WorkType.OBJECTKILLED:
186 ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1); 186 ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1);
187 break; 187 break;
188 case WorkType.UNDODID: 188 case WorkType.UNDODID:
189 UndoDid(model, view, currentJob.UUID); 189 UndoDid(model, view, currentJob.UUID);
190 break; 190 break;
191 case WorkType.NEWCLIENT: 191 case WorkType.NEWCLIENT:
192 NewClient(view, (IClientAPI) currentJob.Data1); 192 NewClient(view, (IClientAPI) currentJob.Data1);
193 break; 193 break;
194 case WorkType.SIMCHAT: 194 case WorkType.SIMCHAT:
195 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message); 195 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message);
196 SimChat(model, view, (OSChatMessage) currentJob.Data1, channel); 196 SimChat(model, view, (OSChatMessage) currentJob.Data1, channel);
197 break; 197 break;
198 default: 198 default:
199 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?"); 199 m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?");
200 break; 200 break;
201 } 201 }
202 } 202 }
203 } 203 }
204 204
@@ -207,24 +207,24 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
207 /// </summary> 207 /// </summary>
208 private void NewClient(CMView view, IClientAPI client) 208 private void NewClient(CMView view, IClientAPI client)
209 { 209 {
210 if ((m_state & State.SHOWING_CHANGES) > 0) 210 if ((m_state & State.SHOWING_CHANGES) > 0)
211 view.SendMetaEntitiesToNewClient(client); 211 view.SendMetaEntitiesToNewClient(client);
212 } 212 }
213 213
214 /// <summary> 214 /// <summary>
215 /// Only called by the MainLoop. 215 /// Only called by the MainLoop.
216 /// </summary> 216 /// </summary>
217 private void ObjectAttributeChanged(CMModel model, CMView view, uint LocalId) 217 private void ObjectAttributeChanged(CMModel model, CMView view, uint LocalId)
218 { 218 {
219 SceneObjectGroup group = null; 219 SceneObjectGroup group = null;
220 if ((m_state & State.SHOWING_CHANGES) > 0) 220 if ((m_state & State.SHOWING_CHANGES) > 0)
221 { 221 {
222 group = GetGroupByPrim(LocalId); 222 group = GetGroupByPrim(LocalId);
223 if (group != null) 223 if (group != null)
224 { 224 {
225 view.DisplayAuras( model.UpdateNormalEntityEffects(group) ); //Might be a normal entity (green aura) 225 view.DisplayAuras(model.UpdateNormalEntityEffects(group)); //Might be a normal entity (green aura)
226 m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura) 226 m_view.DisplayMetaEntity(group.UUID); //Might be a meta entity (blue aura)
227 } 227 }
228 } 228 }
229 } 229 }
230 230
@@ -234,43 +234,43 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
234 private void ObjectDuplicated(CMModel model, CMView view, uint localId) 234 private void ObjectDuplicated(CMModel model, CMView view, uint localId)
235 { 235 {
236 if ((m_state & State.SHOWING_CHANGES) > 0) 236 if ((m_state & State.SHOWING_CHANGES) > 0)
237 view.DisplayAuras(model.CheckForNewEntitiesMissingAuras( GetGroupByPrim(localId).Scene )); 237 view.DisplayAuras(model.CheckForNewEntitiesMissingAuras(GetGroupByPrim(localId).Scene));
238 } 238 }
239 239
240 /// <summary> 240 /// <summary>
241 /// Only called by the MainLoop. 241 /// Only called by the MainLoop.
242 /// </summary> 242 /// </summary>
243 private void ObjectKilled(CMModel model, CMView view, SceneObjectGroup group) 243 private void ObjectKilled(CMModel model, CMView view, SceneObjectGroup group)
244 { 244 {
245 if ((m_state & State.SHOWING_CHANGES) > 0) 245 if ((m_state & State.SHOWING_CHANGES) > 0)
246 { 246 {
247 view.RemoveOrUpdateDeletedEntity(group); 247 view.RemoveOrUpdateDeletedEntity(group);
248 model.RemoveOrUpdateDeletedEntity(group); 248 model.RemoveOrUpdateDeletedEntity(group);
249 } 249 }
250 } 250 }
251 251
252 /// <summary> 252 /// <summary>
253 /// Only called by the MainLoop. 253 /// Only called by the MainLoop.
254 /// </summary> 254 /// </summary>
255 private void PrimitiveAdded(CMModel model, CMView view, Work currentJob) 255 private void PrimitiveAdded(CMModel model, CMView view, Work currentJob)
256 { 256 {
257 if ((m_state & State.SHOWING_CHANGES) > 0) 257 if ((m_state & State.SHOWING_CHANGES) > 0)
258 { 258 {
259 foreach(Object scene in m_sceneList.Values) 259 foreach (Object scene in m_sceneList.Values)
260 m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene)); 260 m_view.DisplayAuras(model.CheckForNewEntitiesMissingAuras((Scene) scene));
261 } 261 }
262 } 262 }
263 263
264 /// <summary> 264 /// <summary>
265 /// Only called by the MainLoop. 265 /// Only called by the MainLoop.
266 /// </summary> 266 /// </summary>
267 private void UndoDid(CMModel model, CMView view, UUID uuid) 267 private void UndoDid(CMModel model, CMView view, UUID uuid)
268 { 268 {
269 if ((m_state & State.SHOWING_CHANGES) > 0) 269 if ((m_state & State.SHOWING_CHANGES) > 0)
270 { 270 {
271 ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid); 271 ContentManagementEntity ent = model.FindMetaEntityAffectedByUndo(uuid);
272 if (ent != null) 272 if (ent != null)
273 view.DisplayEntity(ent); 273 view.DisplayEntity(ent);
274 } 274 }
275 } 275 }
276 276
@@ -328,38 +328,38 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
328 /// <summary> 328 /// <summary>
329 /// Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument. 329 /// Takes a list of scenes and forms a new orderd list according to the proximity of scenes to the second argument.
330 /// </summary> 330 /// </summary>
331 protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity( Hashtable sceneList, Scene scene) 331 protected static System.Collections.Generic.List<Scene> ScenesInOrderOfProximity(Hashtable sceneList, Scene scene)
332 { 332 {
333 int somethingAddedToList = 1; 333 int somethingAddedToList = 1;
334 System.Collections.Generic.List<Scene> newList = new List<Scene>(); 334 System.Collections.Generic.List<Scene> newList = new List<Scene>();
335 newList.Add(scene); 335 newList.Add(scene);
336 336
337 if (! sceneList.ContainsValue(scene)) 337 if (!sceneList.ContainsValue(scene))
338 { 338 {
339 foreach(Object sceneObj in sceneList) 339 foreach (Object sceneObj in sceneList)
340 newList.Add((Scene) sceneObj); 340 newList.Add((Scene) sceneObj);
341 return newList; 341 return newList;
342 } 342 }
343 343
344 while(somethingAddedToList > 0) 344 while (somethingAddedToList > 0)
345 { 345 {
346 somethingAddedToList = 0; 346 somethingAddedToList = 0;
347 for(int i = 0; i < newList.Count; i++) 347 for (int i = 0; i < newList.Count; i++)
348 { 348 {
349 foreach(Object sceneObj in sceneList.Values) 349 foreach (Object sceneObj in sceneList.Values)
350 { 350 {
351 if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (! newList.Contains((Scene)sceneObj)) ) 351 if (newList[i].CheckNeighborRegion(((Scene)sceneObj).RegionInfo) && (!newList.Contains((Scene)sceneObj)))
352 { 352 {
353 newList.Add((Scene)sceneObj); 353 newList.Add((Scene)sceneObj);
354 somethingAddedToList++; 354 somethingAddedToList++;
355 } 355 }
356 } 356 }
357 } 357 }
358 } 358 }
359 359
360 foreach(Object sceneObj in sceneList.Values) 360 foreach (Object sceneObj in sceneList.Values)
361 if (! newList.Contains((Scene)sceneObj)) 361 if (!newList.Contains((Scene)sceneObj))
362 newList.Add((Scene)sceneObj); 362 newList.Add((Scene)sceneObj);
363 363
364 return newList; 364 return newList;
365 } 365 }
@@ -381,7 +381,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
381 protected void StartManaging(IClientAPI client) 381 protected void StartManaging(IClientAPI client)
382 { 382 {
383 m_log.Debug("[CONTENT MANAGEMENT] Registering channel with chat services."); 383 m_log.Debug("[CONTENT MANAGEMENT] Registering channel with chat services.");
384 client.OnChatFromViewer += SimChatSent; 384 client.OnChatFromViewer += SimChatSent;
385 //init = true; 385 //init = true;
386 386
387 OnNewClient(client); 387 OnNewClient(client);
@@ -401,19 +401,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
401 } 401 }
402 402
403 /// <summary> 403 /// <summary>
404 /// 404 ///
405 /// </summary> 405 /// </summary>
406 protected void StopManaging(UUID clientUUID) 406 protected void StopManaging(UUID clientUUID)
407 { 407 {
408 foreach(Object sceneobj in m_sceneList.Values) 408 foreach (Object sceneobj in m_sceneList.Values)
409 { 409 {
410 ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID); 410 ScenePresence presence = ((Scene)sceneobj).GetScenePresence(clientUUID);
411 if (presence != null) 411 if (presence != null)
412 { 412 {
413 IClientAPI client = presence.ControllingClient; 413 IClientAPI client = presence.ControllingClient;
414 m_log.Debug("[CONTENT MANAGEMENT] Unregistering channel with chat services."); 414 m_log.Debug("[CONTENT MANAGEMENT] Unregistering channel with chat services.");
415 client.OnChatFromViewer -= SimChatSent; 415 client.OnChatFromViewer -= SimChatSent;
416 416
417 m_log.Debug("[CONTENT MANAGEMENT] Removing handlers to client"); 417 m_log.Debug("[CONTENT MANAGEMENT] Removing handlers to client");
418 client.OnUpdatePrimScale -= UpdateSingleScale; 418 client.OnUpdatePrimScale -= UpdateSingleScale;
419 client.OnUpdatePrimGroupScale -= UpdateMultipleScale; 419 client.OnUpdatePrimGroupScale -= UpdateMultipleScale;
@@ -427,10 +427,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
427 client.OnUndo -= OnUnDid; 427 client.OnUndo -= OnUnDid;
428 //client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation; 428 //client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation;
429 return; 429 return;
430 } 430 }
431 } 431 }
432 } 432 }
433 433
434 protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient) 434 protected void UpdateMultiplePosition(uint localID, Vector3 pos, IClientAPI remoteClient)
435 { 435 {
436 Work moreWork = new Work(); 436 Work moreWork = new Work();
@@ -479,7 +479,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
479 } 479 }
480 480
481 /// <summary> 481 /// <summary>
482 /// 482 ///
483 /// </summary> 483 /// </summary>
484 protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient) 484 protected void UpdateSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient)
485 { 485 {
@@ -504,47 +504,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
504 /// </summary> 504 /// </summary>
505 protected void commit(string message, Scene scene, CMModel model, CMView view) 505 protected void commit(string message, Scene scene, CMModel model, CMView view)
506 { 506 {
507 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); 507 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
508 508
509 string[] args = message.Split(new char[] {' '}); 509 string[] args = message.Split(new char[] {' '});
510 510
511 char[] logMessage = {' '}; 511 char[] logMessage = {' '};
512 if (args.Length > 1) 512 if (args.Length > 1)
513 { 513 {
514 logMessage = new char[message.Length - (args[0].Length)]; 514 logMessage = new char[message.Length - (args[0].Length)];
515 message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length)); 515 message.CopyTo(args[0].Length, logMessage, 0, message.Length - (args[0].Length));
516 } 516 }
517 517
518 m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region."); 518 m_log.Debug("[CONTENT MANAGEMENT] Saving terrain and objects of region.");
519 foreach(Scene currScene in proximitySceneList) 519 foreach (Scene currScene in proximitySceneList)
520 { 520 {
521 model.CommitRegion(currScene, new String(logMessage)); 521 model.CommitRegion(currScene, new String(logMessage));
522 view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName); 522 view.SendSimChatMessage(scene, "Region Saved Successfully: " + currScene.RegionInfo.RegionName);
523 } 523 }
524 524
525 view.SendSimChatMessage(scene, "Successfully saved all regions."); 525 view.SendSimChatMessage(scene, "Successfully saved all regions.");
526 m_state |= State.DIRTY; 526 m_state |= State.DIRTY;
527 527
528 if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES 528 if ((m_state & State.SHOWING_CHANGES) > 0) //DISPLAY NEW CHANGES INSTEAD OF OLD CHANGES
529 { 529 {
530 view.SendSimChatMessage(scene, "Updating differences between new revision and current environment."); 530 view.SendSimChatMessage(scene, "Updating differences between new revision and current environment.");
531 //Hide objects from users and Forget about them 531 //Hide objects from users and Forget about them
532 view.HideAllMetaEntities(); 532 view.HideAllMetaEntities();
533 view.HideAllAuras(); 533 view.HideAllAuras();
534 model.DeleteAllMetaObjects(); 534 model.DeleteAllMetaObjects();
535 535
536 //Recreate them from backend files 536 //Recreate them from backend files
537 foreach(Scene currScene in proximitySceneList) 537 foreach (Scene currScene in proximitySceneList)
538 { 538 {
539 model.UpdateCMEntities(currScene); 539 model.UpdateCMEntities(currScene);
540 view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName); 540 view.SendSimChatMessage(scene, "Finished updating differences between current scene and last revision: " + currScene.RegionInfo.RegionName);
541 } 541 }
542 542
543 //Display new objects to users1 543 //Display new objects to users1
544 view.DisplayRecentChanges(); 544 view.DisplayRecentChanges();
545 view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE."); 545 view.SendSimChatMessage(scene, "Finished updating for DIFF-MODE.");
546 m_state &= ~(State.DIRTY); 546 m_state &= ~(State.DIRTY);
547 m_state |= State.SHOWING_CHANGES; 547 m_state |= State.SHOWING_CHANGES;
548 } 548 }
549 } 549 }
550 550
@@ -553,74 +553,74 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
553 /// </summary> 553 /// </summary>
554 protected void diffmode(Scene scene, CMModel model, CMView view) 554 protected void diffmode(Scene scene, CMModel model, CMView view)
555 { 555 {
556 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); 556 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
557 557
558 if ((m_state & State.SHOWING_CHANGES) > 0) // TURN OFF 558 if ((m_state & State.SHOWING_CHANGES) > 0) // TURN OFF
559 { 559 {
560 view.SendSimChatMessage(scene, "Hiding all meta objects."); 560 view.SendSimChatMessage(scene, "Hiding all meta objects.");
561 view.HideAllMetaEntities(); 561 view.HideAllMetaEntities();
562 view.HideAllAuras(); 562 view.HideAllAuras();
563 view.SendSimChatMessage(scene, "Diff-mode = OFF"); 563 view.SendSimChatMessage(scene, "Diff-mode = OFF");
564 564
565 m_state &= ~State.SHOWING_CHANGES; 565 m_state &= ~State.SHOWING_CHANGES;
566 return; 566 return;
567 } 567 }
568 else // TURN ON 568 else // TURN ON
569 { 569 {
570 if ((m_state & State.DIRTY) != 0 || m_state == State.NONE) 570 if ((m_state & State.DIRTY) != 0 || m_state == State.NONE)
571 { 571 {
572 view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision"); 572 view.SendSimChatMessage(scene, "Hiding meta objects and replacing with latest revision");
573 //Hide objects from users and Forget about them 573 //Hide objects from users and Forget about them
574 view.HideAllMetaEntities(); 574 view.HideAllMetaEntities();
575 view.HideAllAuras(); 575 view.HideAllAuras();
576 model.DeleteAllMetaObjects(); 576 model.DeleteAllMetaObjects();
577 //Recreate them from backend files 577 //Recreate them from backend files
578 foreach(Object currScene in m_sceneList.Values) 578 foreach (Object currScene in m_sceneList.Values)
579 model.UpdateCMEntities((Scene) currScene); 579 model.UpdateCMEntities((Scene) currScene);
580 } 580 }
581 else if ((m_state & State.DIRTY) != 0) { 581 else if ((m_state & State.DIRTY) != 0) {
582 view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision"); 582 view.SendSimChatMessage(scene, "Forming list of meta entities with latest revision");
583 foreach(Scene currScene in proximitySceneList) 583 foreach (Scene currScene in proximitySceneList)
584 model.UpdateCMEntities(currScene); 584 model.UpdateCMEntities(currScene);
585 } 585 }
586 586
587 view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment"); 587 view.SendSimChatMessage(scene, "Displaying differences between last revision and current environment");
588 foreach(Scene currScene in proximitySceneList) 588 foreach (Scene currScene in proximitySceneList)
589 model.CheckForNewEntitiesMissingAuras(currScene); 589 model.CheckForNewEntitiesMissingAuras(currScene);
590 view.DisplayRecentChanges(); 590 view.DisplayRecentChanges();
591 591
592 view.SendSimChatMessage(scene, "Diff-mode = ON"); 592 view.SendSimChatMessage(scene, "Diff-mode = ON");
593 m_state |= State.SHOWING_CHANGES; 593 m_state |= State.SHOWING_CHANGES;
594 m_state &= ~State.DIRTY; 594 m_state &= ~State.DIRTY;
595 } 595 }
596 } 596 }
597 597
598 /// <summary> 598 /// <summary>
599 /// Only called from within the SimChat method. Hides all auras and meta entities, 599 /// Only called from within the SimChat method. Hides all auras and meta entities,
600 /// retrieves the current scene object list with the most recent revision retrieved from the model for each scene, 600 /// retrieves the current scene object list with the most recent revision retrieved from the model for each scene,
601 /// then lets the view update the clients of the new objects. 601 /// then lets the view update the clients of the new objects.
602 /// </summary> 602 /// </summary>
603 protected void rollback(Scene scene, CMModel model, CMView view) 603 protected void rollback(Scene scene, CMModel model, CMView view)
604 { 604 {
605 if ((m_state & State.SHOWING_CHANGES) > 0) 605 if ((m_state & State.SHOWING_CHANGES) > 0)
606 { 606 {
607 view.HideAllAuras(); 607 view.HideAllAuras();
608 view.HideAllMetaEntities(); 608 view.HideAllMetaEntities();
609 } 609 }
610 610
611 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity( m_sceneList, scene); 611 System.Collections.Generic.List<Scene> proximitySceneList = ScenesInOrderOfProximity(m_sceneList, scene);
612 foreach(Scene currScene in proximitySceneList) 612 foreach (Scene currScene in proximitySceneList)
613 model.RollbackRegion(currScene); 613 model.RollbackRegion(currScene);
614 614
615 if ((m_state & State.DIRTY) != 0 ) 615 if ((m_state & State.DIRTY) != 0)
616 { 616 {
617 model.DeleteAllMetaObjects(); 617 model.DeleteAllMetaObjects();
618 foreach(Scene currScene in proximitySceneList) 618 foreach (Scene currScene in proximitySceneList)
619 model.UpdateCMEntities(currScene); 619 model.UpdateCMEntities(currScene);
620 } 620 }
621 621
622 if ((m_state & State.SHOWING_CHANGES) > 0) 622 if ((m_state & State.SHOWING_CHANGES) > 0)
623 view.DisplayRecentChanges(); 623 view.DisplayRecentChanges();
624 } 624 }
625 625
626 #endregion Protected Methods 626 #endregion Protected Methods
@@ -642,7 +642,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
642 642
643 scene.EventManager.OnNewClient += StartManaging; 643 scene.EventManager.OnNewClient += StartManaging;
644 scene.EventManager.OnRemovePresence += StopManaging; 644 scene.EventManager.OnRemovePresence += StopManaging;
645 // scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; 645 // scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
646 scene.EventManager.OnObjectBeingRemovedFromScene += GroupBeingDeleted; 646 scene.EventManager.OnObjectBeingRemovedFromScene += GroupBeingDeleted;
647 } 647 }
648 648
@@ -652,9 +652,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
652 public void SimChat(CMModel model, CMView view, OSChatMessage e, int channel) 652 public void SimChat(CMModel model, CMView view, OSChatMessage e, int channel)
653 { 653 {
654 if (e.Channel != channel) 654 if (e.Channel != channel)
655 return; 655 return;
656 if (e.Sender == null) 656 if (e.Sender == null)
657 return; 657 return;
658 658
659 m_log.Debug("[CONTENT MANAGEMENT] Message received: " + e.Message); 659 m_log.Debug("[CONTENT MANAGEMENT] Message received: " + e.Message);
660 660
@@ -667,31 +667,31 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
667 667
668 if (!(m_estateModule.IsManager(avatar.UUID))) 668 if (!(m_estateModule.IsManager(avatar.UUID)))
669 { 669 {
670 m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring."); 670 m_log.Debug("[CONTENT MANAGEMENT] Message sent from non Estate Manager ... ignoring.");
671 view.SendSimChatMessage(scene, "You must be an estate manager to perform that action."); 671 view.SendSimChatMessage(scene, "You must be an estate manager to perform that action.");
672 return; 672 return;
673 } 673 }
674 674
675 switch(args[0]) 675 switch (args[0])
676 { 676 {
677 case "ci": 677 case "ci":
678 case "commit": 678 case "commit":
679 commit(message, scene, model, view); 679 commit(message, scene, model, view);
680 break; 680 break;
681 case "dm": 681 case "dm":
682 case "diff-mode": 682 case "diff-mode":
683 diffmode(scene, model, view); 683 diffmode(scene, model, view);
684 break; 684 break;
685 case "rb": 685 case "rb":
686 case "rollback": 686 case "rollback":
687 rollback(scene, model, view); 687 rollback(scene, model, view);
688 break; 688 break;
689 case "help": 689 case "help":
690 m_view.DisplayHelpMenu(scene); 690 m_view.DisplayHelpMenu(scene);
691 break; 691 break;
692 default: 692 default:
693 view.SendSimChatMessage(scene, "Command not found: " + args[0]); 693 view.SendSimChatMessage(scene, "Command not found: " + args[0]);
694 break; 694 break;
695 } 695 }
696 } 696 }
697 697
@@ -705,7 +705,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
705 [Flags] 705 [Flags]
706 private enum State 706 private enum State
707 { 707 {
708 NONE = 0, 708 NONE = 0,
709 DIRTY = 1, // The meta entities may not correctly represent the last revision. 709 DIRTY = 1, // The meta entities may not correctly represent the last revision.
710 SHOWING_CHANGES = 1<<1 // The meta entities are being shown to user. 710 SHOWING_CHANGES = 1<<1 // The meta entities are being shown to user.
711 } 711 }
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
index 996badf..6bbc30c 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMEntityCollection.cs
@@ -58,8 +58,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
58 { 58 {
59 #region Fields 59 #region Fields
60 60
61 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 61 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
62 // Any ContentManagementEntities that represent old versions of current SceneObjectGroups or 62 // Any ContentManagementEntities that represent old versions of current SceneObjectGroups or
63 // old versions of deleted SceneObjectGroups will be stored in this hash table. 63 // old versions of deleted SceneObjectGroups will be stored in this hash table.
64 // The UUID keys are from the SceneObjectGroup RootPart UUIDs 64 // The UUID keys are from the SceneObjectGroup RootPart UUIDs
65 protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity 65 protected Hashtable m_CMEntityHash = Hashtable.Synchronized(new Hashtable()); //UUID to ContentManagementEntity
@@ -97,7 +97,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
97 public bool AddAura(ContentManagementEntity aura) 97 public bool AddAura(ContentManagementEntity aura)
98 { 98 {
99 if (m_NewlyCreatedEntityAura.ContainsKey(aura.UUID)) 99 if (m_NewlyCreatedEntityAura.ContainsKey(aura.UUID))
100 return false; 100 return false;
101 m_NewlyCreatedEntityAura.Add(aura.UUID, aura); 101 m_NewlyCreatedEntityAura.Add(aura.UUID, aura);
102 return true; 102 return true;
103 } 103 }
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
105 public bool AddEntity(ContentManagementEntity ent) 105 public bool AddEntity(ContentManagementEntity ent)
106 { 106 {
107 if (m_CMEntityHash.ContainsKey(ent.UUID)) 107 if (m_CMEntityHash.ContainsKey(ent.UUID))
108 return false; 108 return false;
109 m_CMEntityHash.Add(ent.UUID, ent); 109 m_CMEntityHash.Add(ent.UUID, ent);
110 return true; 110 return true;
111 } 111 }
@@ -115,23 +115,23 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
115 { 115 {
116 System.Collections.ArrayList missingList = new System.Collections.ArrayList(); 116 System.Collections.ArrayList missingList = new System.Collections.ArrayList();
117 SceneObjectGroup temp = null; 117 SceneObjectGroup temp = null;
118 foreach( EntityBase currObj in currList ) 118 foreach (EntityBase currObj in currList)
119 { 119 {
120 if (! (currObj is SceneObjectGroup)) 120 if (!(currObj is SceneObjectGroup))
121 continue; 121 continue;
122 temp = (SceneObjectGroup) currObj; 122 temp = (SceneObjectGroup) currObj;
123 123
124 if (m_CMEntityHash.ContainsKey(temp.UUID)) 124 if (m_CMEntityHash.ContainsKey(temp.UUID))
125 { 125 {
126 foreach(SceneObjectPart part in temp.Children.Values) 126 foreach (SceneObjectPart part in temp.Children.Values)
127 if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID)) 127 if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID))
128 missingList.Add(part); 128 missingList.Add(part);
129 } 129 }
130 else //Entire group is missing from revision. (and is a new part in region) 130 else //Entire group is missing from revision. (and is a new part in region)
131 { 131 {
132 foreach(SceneObjectPart part in temp.Children.Values) 132 foreach (SceneObjectPart part in temp.Children.Values)
133 missingList.Add(part); 133 missingList.Add(part);
134 } 134 }
135 } 135 }
136 return missingList; 136 return missingList;
137 } 137 }
@@ -146,9 +146,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
146 public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part) 146 public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
147 { 147 {
148 AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene, 148 AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
149 part.ParentGroup.Scene.PrimIDAllocate(), 149 part.ParentGroup.Scene.PrimIDAllocate(),
150 part.GetWorldPosition(), 150 part.GetWorldPosition(),
151 MetaEntity.TRANSLUCENT, 151 MetaEntity.TRANSLUCENT,
152 new Vector3(0,254,0), 152 new Vector3(0,254,0),
153 part.Scale 153 part.Scale
154 ); 154 );
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
168 { 168 {
169 ContentManagementEntity ent = new ContentManagementEntity(xml, scene, false); 169 ContentManagementEntity ent = new ContentManagementEntity(xml, scene, false);
170 if (ent == null) 170 if (ent == null)
171 return null; 171 return null;
172 m_CMEntityHash.Add(ent.UnchangedEntity.UUID, ent); 172 m_CMEntityHash.Add(ent.UnchangedEntity.UUID, ent);
173 return ent; 173 return ent;
174 } 174 }
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
176 public bool RemoveEntity(UUID uuid) 176 public bool RemoveEntity(UUID uuid)
177 { 177 {
178 if (!m_CMEntityHash.ContainsKey(uuid)) 178 if (!m_CMEntityHash.ContainsKey(uuid))
179 return false; 179 return false;
180 m_CMEntityHash.Remove(uuid); 180 m_CMEntityHash.Remove(uuid);
181 return true; 181 return true;
182 } 182 }
@@ -184,7 +184,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
184 public bool RemoveNewlyCreatedEntityAura(UUID uuid) 184 public bool RemoveNewlyCreatedEntityAura(UUID uuid)
185 { 185 {
186 if (!m_NewlyCreatedEntityAura.ContainsKey(uuid)) 186 if (!m_NewlyCreatedEntityAura.ContainsKey(uuid))
187 return false; 187 return false;
188 m_NewlyCreatedEntityAura.Remove(uuid); 188 m_NewlyCreatedEntityAura.Remove(uuid);
189 return true; 189 return true;
190 } 190 }
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
index e1b4129..1a41c7b 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMModel.cs
@@ -27,8 +27,8 @@
27 27
28#region Header 28#region Header
29 29
30// CMModel.cs 30// CMModel.cs
31// User: bongiojp 31// User: bongiojp
32// 32//
33// 33//
34 34
@@ -100,13 +100,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
100 ArrayList missingList = null; 100 ArrayList missingList = null;
101 ArrayList newList = new ArrayList(); 101 ArrayList newList = new ArrayList();
102 102
103 m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName); 103 m_log.Debug("[CONTENT MANAGEMENT] Checking for new scene object parts in scene: " + scene.RegionInfo.RegionName);
104 104
105 //Check if the current scene has groups not included in the current list of MetaEntities 105 //Check if the current scene has groups not included in the current list of MetaEntities
106 //If so, then the current scene's parts that are new should be marked green. 106 //If so, then the current scene's parts that are new should be marked green.
107 missingList = m_MetaEntityCollection.CheckForMissingEntities(scene.GetEntities()); 107 missingList = m_MetaEntityCollection.CheckForMissingEntities(scene.GetEntities());
108 108
109 foreach(Object missingPart in missingList) 109 foreach (Object missingPart in missingList)
110 { 110 {
111 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID)) 111 if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
112 continue; 112 continue;
@@ -175,16 +175,16 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
175 public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group) 175 public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group)
176 { 176 {
177 // Deal with new parts not revisioned that have been deleted. 177 // Deal with new parts not revisioned that have been deleted.
178 foreach(SceneObjectPart part in group.Children.Values) 178 foreach (SceneObjectPart part in group.Children.Values)
179 if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) 179 if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
180 m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID); 180 m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID);
181 } 181 }
182 182
183 /// <summary> 183 /// <summary>
184 /// Retrieves the latest revision of a region in xml form, 184 /// Retrieves the latest revision of a region in xml form,
185 /// converts it to scene object groups and scene presences, 185 /// converts it to scene object groups and scene presences,
186 /// swaps the current scene's entity list with the revision's list. 186 /// swaps the current scene's entity list with the revision's list.
187 /// Note: Since deleted objects while 187 /// Note: Since deleted objects while
188 /// </summary> 188 /// </summary>
189 public void RollbackRegion(Scene scene) 189 public void RollbackRegion(Scene scene)
190 { 190 {
@@ -214,26 +214,26 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
214 try{ 214 try{
215 temp = new SceneObjectGroup(xml); 215 temp = new SceneObjectGroup(xml);
216 temp.SetScene(scene); 216 temp.SetScene(scene);
217 foreach(SceneObjectPart part in temp.Children.Values) 217 foreach (SceneObjectPart part in temp.Children.Values)
218 part.RegionHandle = scene.RegionInfo.RegionHandle; 218 part.RegionHandle = scene.RegionInfo.RegionHandle;
219 ReplacementList.Add(temp.UUID, (EntityBase)temp); 219 ReplacementList.Add(temp.UUID, (EntityBase)temp);
220 } 220 }
221 catch(Exception e) 221 catch(Exception e)
222 { 222 {
223 m_log.Info("[CMMODEL]: Error while creating replacement list for rollback: " + e); 223 m_log.Info("[CMMODEL]: Error while creating replacement list for rollback: " + e);
224 } 224 }
225 } 225 }
226 226
227 //If in scene but not in revision and not a client, remove them 227 //If in scene but not in revision and not a client, remove them
228 while (true) 228 while (true)
229 { 229 {
230 try 230 try
231 { 231 {
232 foreach(EntityBase entity in scene.GetEntities()) 232 foreach (EntityBase entity in scene.GetEntities())
233 { 233 {
234 if (entity == null) 234 if (entity == null)
235 continue; 235 continue;
236 236
237 if (entity is ScenePresence) 237 if (entity is ScenePresence)
238 { 238 {
239 ReplacementList.Add(entity.UUID, entity); 239 ReplacementList.Add(entity.UUID, entity);
@@ -253,9 +253,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
253 break; 253 break;
254 } 254 }
255 255
256 foreach(UUID uuid in deleteListUUIDs.Keys) 256 foreach (UUID uuid in deleteListUUIDs.Keys)
257 { 257 {
258 try 258 try
259 { 259 {
260 // I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles. 260 // I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles.
261 ((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]); 261 ((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup((SceneObjectGroup)scene.Entities[uuid]);
@@ -275,13 +275,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
275 scene.Entities = ReplacementList; 275 scene.Entities = ReplacementList;
276 } 276 }
277 277
278 foreach(EntityBase ent in ReplacementList.Values) 278 foreach (EntityBase ent in ReplacementList.Values)
279 { 279 {
280 try 280 try
281 { 281 {
282 if (!(ent is SceneObjectGroup)) 282 if (!(ent is SceneObjectGroup))
283 continue; 283 continue;
284 284
285 if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0) 285 if ((((SceneObjectGroup)ent).RootPart.GetEffectiveObjectFlags() & (uint) PrimFlags.Phantom) == 0)
286 ((SceneObjectGroup)ent).ApplyPhysics(true); 286 ((SceneObjectGroup)ent).ApplyPhysics(true);
287 ((SceneObjectGroup)ent).AttachToBackup(); 287 ((SceneObjectGroup)ent).AttachToBackup();
@@ -319,15 +319,15 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
319 m_MetaEntityCollection.CreateNewEntity(xml, scene); 319 m_MetaEntityCollection.CreateNewEntity(xml, scene);
320 y.Stop(); 320 y.Stop();
321 TimeToConvertXml += y.ElapsedMilliseconds; 321 TimeToConvertXml += y.ElapsedMilliseconds;
322 m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds); 322 m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities for " + scene.RegionInfo.RegionName + ": " + y.ElapsedMilliseconds);
323 m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml); 323 m_log.Info("[FileSystemDatabase] Time spent converting xml to metaentities so far: " + TimeToConvertXml);
324 324
325 m_log.Info("[FSDB]: checking for new scene object parts missing green auras and create the auras"); 325 m_log.Info("[FSDB]: checking for new scene object parts missing green auras and create the auras");
326 CheckForNewEntitiesMissingAuras(scene); 326 CheckForNewEntitiesMissingAuras(scene);
327 327
328 x.Stop(); 328 x.Stop();
329 TimeToUpdate += x.ElapsedMilliseconds; 329 TimeToUpdate += x.ElapsedMilliseconds;
330 m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds); 330 m_log.Info("[FileSystemDatabase] Time spent Updating entity list for " + scene.RegionInfo.RegionName + ": " + x.ElapsedMilliseconds);
331 m_log.Info("[FileSystemDatabase] Time spent Updating so far: " + TimeToUpdate); 331 m_log.Info("[FileSystemDatabase] Time spent Updating so far: " + TimeToUpdate);
332 } 332 }
333 333
@@ -340,7 +340,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
340 System.Collections.ArrayList auraList = new System.Collections.ArrayList(); 340 System.Collections.ArrayList auraList = new System.Collections.ArrayList();
341 if (group == null) 341 if (group == null)
342 return null; 342 return null;
343 foreach(SceneObjectPart part in group.Children.Values) 343 foreach (SceneObjectPart part in group.Children.Values)
344 { 344 {
345 if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) 345 if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID))
346 { 346 {
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs
index 90ef6ef..88f4a67 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMView.cs
@@ -78,46 +78,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
78 // Auras To 78 // Auras To
79 public void DisplayAuras(CMEntityCollection auraCollection) 79 public void DisplayAuras(CMEntityCollection auraCollection)
80 { 80 {
81 foreach( Object ent in auraCollection.Auras.Values) 81 foreach (Object ent in auraCollection.Auras.Values)
82 ((AuraMetaEntity)ent).SendFullUpdateToAll(); 82 ((AuraMetaEntity)ent).SendFullUpdateToAll();
83 } 83 }
84 84
85 // Auras To Client 85 // Auras To Client
86 public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client) 86 public void DisplayAuras(CMEntityCollection auraCollection, IClientAPI client)
87 { 87 {
88 foreach( Object ent in auraCollection.Auras.Values) 88 foreach (Object ent in auraCollection.Auras.Values)
89 ((AuraMetaEntity)ent).SendFullUpdate(client); 89 ((AuraMetaEntity)ent).SendFullUpdate(client);
90 } 90 }
91 91
92 // Auras from List To ALL 92 // Auras from List To ALL
93 public void DisplayAuras(ArrayList list) 93 public void DisplayAuras(ArrayList list)
94 { 94 {
95 foreach( Object ent in list) 95 foreach (Object ent in list)
96 { 96 {
97 m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW"); 97 m_log.Debug("[CONTENT MANAGEMENT] displaying new aura riiiiiiiiiiiight NOW");
98 ((AuraMetaEntity)ent).SendFullUpdateToAll(); 98 ((AuraMetaEntity)ent).SendFullUpdateToAll();
99 } 99 }
100 } 100 }
101 101
102 // Entities to ALL 102 // Entities to ALL
103 public void DisplayEntities(CMEntityCollection entityCollection) 103 public void DisplayEntities(CMEntityCollection entityCollection)
104 { 104 {
105 foreach( Object ent in entityCollection.Entities.Values) 105 foreach (Object ent in entityCollection.Entities.Values)
106 ((ContentManagementEntity)ent).SendFullDiffUpdateToAll(); 106 ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
107 } 107 }
108 108
109 // Entities to Client 109 // Entities to Client
110 public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client) 110 public void DisplayEntities(CMEntityCollection entityCollection, IClientAPI client)
111 { 111 {
112 foreach( Object ent in entityCollection.Entities.Values) 112 foreach (Object ent in entityCollection.Entities.Values)
113 ((ContentManagementEntity)ent).SendFullDiffUpdate(client); 113 ((ContentManagementEntity)ent).SendFullDiffUpdate(client);
114 } 114 }
115 115
116 // Entities from List to ALL 116 // Entities from List to ALL
117 public void DisplayEntities(ArrayList list) 117 public void DisplayEntities(ArrayList list)
118 { 118 {
119 foreach( Object ent in list) 119 foreach (Object ent in list)
120 ((ContentManagementEntity)ent).SendFullDiffUpdateToAll(); 120 ((ContentManagementEntity)ent).SendFullDiffUpdateToAll();
121 } 121 }
122 122
123 // Entity to ALL 123 // Entity to ALL
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
138 { 138 {
139 ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid); 139 ContentManagementEntity group = m_model.GetMetaGroupByPrim(uuid);
140 if (group != null) 140 if (group != null)
141 group.SendFullDiffUpdateToAll(); 141 group.SendFullDiffUpdateToAll();
142 } 142 }
143 143
144 /// <summary> 144 /// <summary>
@@ -158,14 +158,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
158 158
159 public void HideAllAuras() 159 public void HideAllAuras()
160 { 160 {
161 foreach(Object obj in m_model.MetaEntityCollection.Auras.Values) 161 foreach (Object obj in m_model.MetaEntityCollection.Auras.Values)
162 ((MetaEntity)obj).HideFromAll(); 162 ((MetaEntity)obj).HideFromAll();
163 } 163 }
164 164
165 public void HideAllMetaEntities() 165 public void HideAllMetaEntities()
166 { 166 {
167 foreach(Object obj in m_model.MetaEntityCollection.Entities.Values) 167 foreach (Object obj in m_model.MetaEntityCollection.Entities.Values)
168 ((ContentManagementEntity)obj).HideFromAll(); 168 ((ContentManagementEntity)obj).HideFromAll();
169 } 169 }
170 170
171 public void Initialise(CMModel model) 171 public void Initialise(CMModel model)
@@ -183,12 +183,12 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
183 { 183 {
184 // Deal with revisioned parts that have been deleted. 184 // Deal with revisioned parts that have been deleted.
185 if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID)) 185 if (m_model.MetaEntityCollection.Entities.ContainsKey(group.UUID))
186 ((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll(); 186 ((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll();
187 187
188 // Deal with new parts not revisioned that have been deleted. 188 // Deal with new parts not revisioned that have been deleted.
189 foreach(SceneObjectPart part in group.Children.Values) 189 foreach (SceneObjectPart part in group.Children.Values)
190 if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID)) 190 if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID))
191 ((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll(); 191 ((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll();
192 } 192 }
193 193
194 public void SendMetaEntitiesToNewClient(IClientAPI client) 194 public void SendMetaEntitiesToNewClient(IClientAPI client)
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
index 819ff87..13f5cc0 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementEntity.cs
@@ -104,13 +104,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
104 #region Private Methods 104 #region Private Methods
105 105
106 /// <summary> 106 /// <summary>
107 /// Check if an entitybase list (like that returned by scene.GetEntities() ) contains a group with the rootpart uuid that matches the current uuid. 107 /// Check if an entitybase list (like that returned by scene.GetEntities()) contains a group with the rootpart uuid that matches the current uuid.
108 /// </summary> 108 /// </summary>
109 private bool ContainsKey(List<EntityBase> list, UUID uuid) 109 private bool ContainsKey(List<EntityBase> list, UUID uuid)
110 { 110 {
111 foreach( EntityBase part in list) 111 foreach (EntityBase part in list)
112 if (part.UUID == uuid) 112 if (part.UUID == uuid)
113 return true; 113 return true;
114 return false; 114 return false;
115 } 115 }
116 116
@@ -118,9 +118,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
118 { 118 {
119 foreach (EntityBase ent in list) 119 foreach (EntityBase ent in list)
120 { 120 {
121 if (ent is SceneObjectGroup) 121 if (ent is SceneObjectGroup)
122 if (ent.UUID == uuid) 122 if (ent.UUID == uuid)
123 return (SceneObjectGroup)ent; 123 return (SceneObjectGroup)ent;
124 } 124 }
125 return null; 125 return null;
126 } 126 }
@@ -138,49 +138,49 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
138 System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities(); 138 System.Collections.Generic.List<EntityBase> sceneEntityList = m_Entity.Scene.GetEntities();
139 DiffersFromSceneGroup = false; 139 DiffersFromSceneGroup = false;
140 // if group is not contained in scene's list 140 // if group is not contained in scene's list
141 if(!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID)) 141 if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID))
142 { 142 {
143 foreach(SceneObjectPart part in m_UnchangedEntity.Children.Values) 143 foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
144 { 144 {
145 // if scene list no longer contains this part, display translucent part and mark with red aura 145 // if scene list no longer contains this part, display translucent part and mark with red aura
146 if(! ContainsKey(sceneEntityList, part.UUID)) 146 if (!ContainsKey(sceneEntityList, part.UUID))
147 { 147 {
148 // if already displaying a red aura over part, make sure its red 148 // if already displaying a red aura over part, make sure its red
149 if (m_AuraEntities.ContainsKey(part.UUID)) 149 if (m_AuraEntities.ContainsKey(part.UUID))
150 { 150 {
151 m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale); 151 m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale);
152 } 152 }
153 else 153 else
154 { 154 {
155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 155 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
156 m_Entity.Scene.PrimIDAllocate(), 156 m_Entity.Scene.PrimIDAllocate(),
157 part.GetWorldPosition(), 157 part.GetWorldPosition(),
158 MetaEntity.TRANSLUCENT, 158 MetaEntity.TRANSLUCENT,
159 new Vector3(254,0,0), 159 new Vector3(254,0,0),
160 part.Scale 160 part.Scale
161 ); 161 );
162 m_AuraEntities.Add(part.UUID, auraGroup); 162 m_AuraEntities.Add(part.UUID, auraGroup);
163 } 163 }
164 SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum); 164 SceneObjectPart metaPart = m_Entity.GetLinkNumPart(part.LinkNum);
165 SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT); 165 SetPartTransparency(metaPart, MetaEntity.TRANSLUCENT);
166 } 166 }
167 // otherwise, scene will not contain the part. note: a group can not remove a part without changing group id 167 // otherwise, scene will not contain the part. note: a group can not remove a part without changing group id
168 } 168 }
169 169
170 // a deleted part has no where to point a beam particle system, 170 // a deleted part has no where to point a beam particle system,
171 // if a metapart had a particle system (maybe it represented a moved part) remove it 171 // if a metapart had a particle system (maybe it represented a moved part) remove it
172 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 172 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
173 { 173 {
174 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 174 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
175 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 175 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
176 } 176 }
177 177
178 DiffersFromSceneGroup = true; 178 DiffersFromSceneGroup = true;
179 } 179 }
180 // if scene list does contain group, compare each part in group for differences and display beams and auras appropriately 180 // if scene list does contain group, compare each part in group for differences and display beams and auras appropriately
181 else 181 else
182 { 182 {
183 MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID)); 183 MarkWithDifferences((SceneObjectGroup)GetGroupByUUID(sceneEntityList, m_UnchangedEntity.UUID));
184 } 184 }
185 } 185 }
186 186
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
190 public bool HasChildPrim(UUID uuid) 190 public bool HasChildPrim(UUID uuid)
191 { 191 {
192 if (m_UnchangedEntity.Children.ContainsKey(uuid)) 192 if (m_UnchangedEntity.Children.ContainsKey(uuid))
193 return true; 193 return true;
194 return false; 194 return false;
195 } 195 }
196 196
@@ -199,28 +199,28 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
199 /// </summary> 199 /// </summary>
200 public bool HasChildPrim(uint localID) 200 public bool HasChildPrim(uint localID)
201 { 201 {
202 foreach( SceneObjectPart part in m_UnchangedEntity.Children.Values) 202 foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values)
203 if ( part.LocalId == localID ) 203 if (part.LocalId == localID)
204 return true; 204 return true;
205 return false; 205 return false;
206 } 206 }
207 207
208 public override void Hide(IClientAPI client) 208 public override void Hide(IClientAPI client)
209 { 209 {
210 base.Hide(client); 210 base.Hide(client);
211 foreach(MetaEntity group in m_AuraEntities.Values) 211 foreach (MetaEntity group in m_AuraEntities.Values)
212 group.Hide(client); 212 group.Hide(client);
213 foreach(MetaEntity group in m_BeamEntities.Values) 213 foreach (MetaEntity group in m_BeamEntities.Values)
214 group.Hide(client); 214 group.Hide(client);
215 } 215 }
216 216
217 public override void HideFromAll() 217 public override void HideFromAll()
218 { 218 {
219 base.HideFromAll(); 219 base.HideFromAll();
220 foreach(MetaEntity group in m_AuraEntities.Values) 220 foreach (MetaEntity group in m_AuraEntities.Values)
221 group.HideFromAll(); 221 group.HideFromAll();
222 foreach(MetaEntity group in m_BeamEntities.Values) 222 foreach (MetaEntity group in m_BeamEntities.Values)
223 group.HideFromAll(); 223 group.HideFromAll();
224 } 224 }
225 225
226 /// <summary> 226 /// <summary>
@@ -234,92 +234,92 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
234 Diff differences; 234 Diff differences;
235 bool changed = false; 235 bool changed = false;
236 236
237 // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user 237 // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user
238 // had originally saved. 238 // had originally saved.
239 // m_Entity will NOT necessarily be the same entity as the user had saved. 239 // m_Entity will NOT necessarily be the same entity as the user had saved.
240 foreach(SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values) 240 foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values)
241 { 241 {
242 //This is the part that we use to show changes. 242 //This is the part that we use to show changes.
243 metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum); 243 metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum);
244 if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID)) 244 if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID))
245 { 245 {
246 sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID]; 246 sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID];
247 differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart); 247 differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart);
248 if (differences != Diff.NONE) 248 if (differences != Diff.NONE)
249 metaEntityPart.Text = "CHANGE: " + differences.ToString(); 249 metaEntityPart.Text = "CHANGE: " + differences.ToString();
250 if (differences != 0) 250 if (differences != 0)
251 { 251 {
252 // Root Part that has been modified 252 // Root Part that has been modified
253 if ((differences&Diff.POSITION) > 0) 253 if ((differences&Diff.POSITION) > 0)
254 { 254 {
255 // If the position of any part has changed, make sure the RootPart of the 255 // If the position of any part has changed, make sure the RootPart of the
256 // meta entity is pointing with a beam particle system 256 // meta entity is pointing with a beam particle system
257 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 257 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
258 { 258 {
259 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 259 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
260 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 260 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
261 } 261 }
262 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene, 262 BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
263 m_Entity.Scene.PrimIDAllocate(), 263 m_Entity.Scene.PrimIDAllocate(),
264 m_UnchangedEntity.RootPart.GetWorldPosition(), 264 m_UnchangedEntity.RootPart.GetWorldPosition(),
265 MetaEntity.TRANSLUCENT, 265 MetaEntity.TRANSLUCENT,
266 sceneEntityPart, 266 sceneEntityPart,
267 new Vector3(0,0,254) 267 new Vector3(0,0,254)
268 ); 268 );
269 m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup); 269 m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup);
270 } 270 }
271 271
272 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 272 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
273 { 273 {
274 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 274 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
275 m_AuraEntities.Remove(UnchangedPart.UUID); 275 m_AuraEntities.Remove(UnchangedPart.UUID);
276 } 276 }
277 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 277 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
278 m_Entity.Scene.PrimIDAllocate(), 278 m_Entity.Scene.PrimIDAllocate(),
279 UnchangedPart.GetWorldPosition(), 279 UnchangedPart.GetWorldPosition(),
280 MetaEntity.TRANSLUCENT, 280 MetaEntity.TRANSLUCENT,
281 new Vector3(0,0,254), 281 new Vector3(0,0,254),
282 UnchangedPart.Scale 282 UnchangedPart.Scale
283 ); 283 );
284 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); 284 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
285 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); 285 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
286 286
287 DiffersFromSceneGroup = true; 287 DiffersFromSceneGroup = true;
288 } 288 }
289 else // no differences between scene part and meta part 289 else // no differences between scene part and meta part
290 { 290 {
291 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID)) 291 if (m_BeamEntities.ContainsKey(m_UnchangedEntity.RootPart.UUID))
292 { 292 {
293 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll(); 293 m_BeamEntities[m_UnchangedEntity.RootPart.UUID].HideFromAll();
294 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); 294 m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
295 } 295 }
296 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 296 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
297 { 297 {
298 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 298 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
299 m_AuraEntities.Remove(UnchangedPart.UUID); 299 m_AuraEntities.Remove(UnchangedPart.UUID);
300 } 300 }
301 SetPartTransparency(metaEntityPart, MetaEntity.NONE); 301 SetPartTransparency(metaEntityPart, MetaEntity.NONE);
302 } 302 }
303 } 303 }
304 else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted. 304 else //The entity currently in the scene is missing parts from the metaentity saved, so mark parts red as deleted.
305 { 305 {
306 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID)) 306 if (m_AuraEntities.ContainsKey(UnchangedPart.UUID))
307 { 307 {
308 m_AuraEntities[UnchangedPart.UUID].HideFromAll(); 308 m_AuraEntities[UnchangedPart.UUID].HideFromAll();
309 m_AuraEntities.Remove(UnchangedPart.UUID); 309 m_AuraEntities.Remove(UnchangedPart.UUID);
310 } 310 }
311 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, 311 AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
312 m_Entity.Scene.PrimIDAllocate(), 312 m_Entity.Scene.PrimIDAllocate(),
313 UnchangedPart.GetWorldPosition(), 313 UnchangedPart.GetWorldPosition(),
314 MetaEntity.TRANSLUCENT, 314 MetaEntity.TRANSLUCENT,
315 new Vector3(254,0,0), 315 new Vector3(254,0,0),
316 UnchangedPart.Scale 316 UnchangedPart.Scale
317 ); 317 );
318 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); 318 m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
319 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); 319 SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
320 320
321 DiffersFromSceneGroup = true; 321 DiffersFromSceneGroup = true;
322 } 322 }
323 } 323 }
324 return changed; 324 return changed;
325 } 325 }
@@ -328,8 +328,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
328 { 328 {
329 if (DiffersFromSceneGroup) 329 if (DiffersFromSceneGroup)
330 { 330 {
331 foreach(AuraMetaEntity group in m_AuraEntities.Values) 331 foreach (AuraMetaEntity group in m_AuraEntities.Values)
332 group.SendFullUpdate(client); 332 group.SendFullUpdate(client);
333 } 333 }
334 } 334 }
335 335
@@ -337,8 +337,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
337 { 337 {
338 if (DiffersFromSceneGroup) 338 if (DiffersFromSceneGroup)
339 { 339 {
340 foreach(AuraMetaEntity group in m_AuraEntities.Values) 340 foreach (AuraMetaEntity group in m_AuraEntities.Values)
341 group.SendFullUpdateToAll(); 341 group.SendFullUpdateToAll();
342 } 342 }
343 } 343 }
344 344
@@ -346,8 +346,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
346 { 346 {
347 if (DiffersFromSceneGroup) 347 if (DiffersFromSceneGroup)
348 { 348 {
349 foreach(BeamMetaEntity group in m_BeamEntities.Values) 349 foreach (BeamMetaEntity group in m_BeamEntities.Values)
350 group.SendFullUpdate(client); 350 group.SendFullUpdate(client);
351 } 351 }
352 } 352 }
353 353
@@ -355,8 +355,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
355 { 355 {
356 if (DiffersFromSceneGroup) 356 if (DiffersFromSceneGroup)
357 { 357 {
358 foreach(BeamMetaEntity group in m_BeamEntities.Values) 358 foreach (BeamMetaEntity group in m_BeamEntities.Values)
359 group.SendFullUpdateToAll(); 359 group.SendFullUpdateToAll();
360 } 360 }
361 } 361 }
362 362
@@ -365,9 +365,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
365 FindDifferences(); 365 FindDifferences();
366 if (DiffersFromSceneGroup) 366 if (DiffersFromSceneGroup)
367 { 367 {
368 SendFullUpdate(client); 368 SendFullUpdate(client);
369 SendFullAuraUpdate(client); 369 SendFullAuraUpdate(client);
370 SendFullBeamUpdate(client); 370 SendFullBeamUpdate(client);
371 } 371 }
372 } 372 }
373 373
@@ -376,9 +376,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
376 FindDifferences(); 376 FindDifferences();
377 if (DiffersFromSceneGroup) 377 if (DiffersFromSceneGroup)
378 { 378 {
379 SendFullUpdateToAll(); 379 SendFullUpdateToAll();
380 SendFullAuraUpdateToAll(); 380 SendFullAuraUpdateToAll();
381 SendFullBeamUpdateToAll(); 381 SendFullBeamUpdateToAll();
382 } 382 }
383 } 383 }
384 384
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs
index 85eb927..f52c3b8 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/ContentManagementModule.cs
@@ -27,7 +27,7 @@
27 27
28#region Header 28#region Header
29 29
30// ContentManagementModule.cs 30// ContentManagementModule.cs
31// User: bongiojp 31// User: bongiojp
32 32
33#endregion Header 33#endregion Header
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
98 { 98 {
99 if (source.Configs["CMS"] == null) 99 if (source.Configs["CMS"] == null)
100 return; 100 return;
101 101
102 m_enabled = source.Configs["CMS"].GetBoolean("enabled", false); 102 m_enabled = source.Configs["CMS"].GetBoolean("enabled", false);
103 databaseDir = source.Configs["CMS"].GetString("directory", databaseDir); 103 databaseDir = source.Configs["CMS"].GetString("directory", databaseDir);
104 database = source.Configs["CMS"].GetString("database", database); 104 database = source.Configs["CMS"].GetString("database", database);
@@ -122,7 +122,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
122 return; 122 return;
123 } 123 }
124 124
125 lock(this) 125 lock (this)
126 { 126 {
127 if (!initialised) //only init once 127 if (!initialised) //only init once
128 { 128 {
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
131 m_control = new CMController(m_model, m_view, scene, channel); 131 m_control = new CMController(m_model, m_view, scene, channel);
132 m_model.Initialise(database); 132 m_model.Initialise(database);
133 m_view.Initialise(m_model); 133 m_view.Initialise(m_model);
134 134
135 initialised = true; 135 initialised = true;
136 m_model.InitialiseDatabase(scene, databaseDir); 136 m_model.InitialiseDatabase(scene, databaseDir);
137 } 137 }
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
148 if (! m_enabled) 148 if (! m_enabled)
149 return; 149 return;
150 150
151 lock(this) 151 lock (this)
152 { 152 {
153 if (!m_posted) //only post once 153 if (!m_posted) //only post once
154 { 154 {
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs
index 66d279a..607f6a9 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/FileSystemDatabase.cs
@@ -28,7 +28,7 @@
28#region Header 28#region Header
29 29
30// FileSystemDatabase.cs 30// FileSystemDatabase.cs
31// User: bongiojp 31// User: bongiojp
32 32
33#endregion Header 33#endregion Header
34 34
@@ -88,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
88 { 88 {
89 string scenedir; 89 string scenedir;
90 if (!Directory.Exists(m_repodir)) 90 if (!Directory.Exists(m_repodir))
91 Directory.CreateDirectory(m_repodir); 91 Directory.CreateDirectory(m_repodir);
92 92
93 foreach (UUID region in m_scenes.Keys) 93 foreach (UUID region in m_scenes.Keys)
94 { 94 {
95 scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar; 95 scenedir = m_repodir + Slash.DirectorySeparatorChar + region + Slash.DirectorySeparatorChar;
96 if (!Directory.Exists(scenedir)) 96 if (!Directory.Exists(scenedir))
97 Directory.CreateDirectory(scenedir); 97 Directory.CreateDirectory(scenedir);
98 } 98 }
99 } 99 }
100 100
@@ -102,10 +102,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
102 private void SetupSerialiser() 102 private void SetupSerialiser()
103 { 103 {
104 if (m_serialiser.Count == 0) 104 if (m_serialiser.Count == 0)
105 foreach(UUID region in m_scenes.Keys) 105 {
106 m_serialiser.Add(region, 106 foreach (UUID region in m_scenes.Keys)
107 m_scenes[region].RequestModuleInterface<IRegionSerialiser>() 107 {
108 ); 108 m_serialiser.Add(region,
109 m_scenes[region].RequestModuleInterface<IRegionSerialiser>()
110 );
111 }
112 }
109 } 113 }
110 114
111 #endregion Private Methods 115 #endregion Private Methods
@@ -120,7 +124,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
120 public string GetRegionObjectHeightMap(UUID regionid) 124 public string GetRegionObjectHeightMap(UUID regionid)
121 { 125 {
122 String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + 126 String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
123 Slash.DirectorySeparatorChar + "heightmap.r32"; 127 Slash.DirectorySeparatorChar + "heightmap.r32";
124 FileStream fs = new FileStream( filename, FileMode.Open); 128 FileStream fs = new FileStream( filename, FileMode.Open);
125 StreamReader sr = new StreamReader(fs); 129 StreamReader sr = new StreamReader(fs);
126 String result = sr.ReadToEnd(); 130 String result = sr.ReadToEnd();
@@ -132,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
132 public string GetRegionObjectHeightMap(UUID regionid, int revision) 136 public string GetRegionObjectHeightMap(UUID regionid, int revision)
133 { 137 {
134 String filename = m_repodir + Slash.DirectorySeparatorChar + regionid + 138 String filename = m_repodir + Slash.DirectorySeparatorChar + regionid +
135 Slash.DirectorySeparatorChar + "heightmap.r32"; 139 Slash.DirectorySeparatorChar + "heightmap.r32";
136 FileStream fs = new FileStream( filename, FileMode.Open); 140 FileStream fs = new FileStream( filename, FileMode.Open);
137 StreamReader sr = new StreamReader(fs); 141 StreamReader sr = new StreamReader(fs);
138 String result = sr.ReadToEnd(); 142 String result = sr.ReadToEnd();
@@ -144,14 +148,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
144 public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision) 148 public System.Collections.ArrayList GetRegionObjectXMLList(UUID regionid, int revision)
145 { 149 {
146 System.Collections.ArrayList objectList = new System.Collections.ArrayList(); 150 System.Collections.ArrayList objectList = new System.Collections.ArrayList();
147 string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + 151 string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
148 + revision + Slash.DirectorySeparatorChar + "objects.xml"; 152 + revision + Slash.DirectorySeparatorChar + "objects.xml";
149 XmlDocument doc = new XmlDocument(); 153 XmlDocument doc = new XmlDocument();
150 XmlNode rootNode; 154 XmlNode rootNode;
151 //int primCount = 0; 155 //int primCount = 0;
152 //SceneObjectGroup obj = null; 156 //SceneObjectGroup obj = null;
153 157
154 if(File.Exists(filename)) 158 if (File.Exists(filename))
155 { 159 {
156 XmlTextReader reader = new XmlTextReader(filename); 160 XmlTextReader reader = new XmlTextReader(filename);
157 reader.WhitespaceHandling = WhitespaceHandling.None; 161 reader.WhitespaceHandling = WhitespaceHandling.None;
@@ -160,9 +164,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
160 rootNode = doc.FirstChild; 164 rootNode = doc.FirstChild;
161 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 165 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
162 { 166 {
163 objectList.Add(aPrimNode.OuterXml); 167 objectList.Add(aPrimNode.OuterXml);
164 } 168 }
165 return objectList; 169 return objectList;
166 } 170 }
167 return null; 171 return null;
168 } 172 }
@@ -172,45 +176,46 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
172 int revision = NumOfRegionRev(regionid); 176 int revision = NumOfRegionRev(regionid);
173 m_log.Info("[FSDB]: found revisions:" + revision); 177 m_log.Info("[FSDB]: found revisions:" + revision);
174 System.Collections.ArrayList xmlList = new System.Collections.ArrayList(); 178 System.Collections.ArrayList xmlList = new System.Collections.ArrayList();
175 string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar + 179 string filename = m_repodir + Slash.DirectorySeparatorChar + regionid + Slash.DirectorySeparatorChar +
176 + revision + Slash.DirectorySeparatorChar + "objects.xml"; 180 + revision + Slash.DirectorySeparatorChar + "objects.xml";
177 XmlDocument doc = new XmlDocument(); 181 XmlDocument doc = new XmlDocument();
178 XmlNode rootNode; 182 XmlNode rootNode;
179 183
180
181 m_log.Info("[FSDB]: Checking if " + filename + " exists."); 184 m_log.Info("[FSDB]: Checking if " + filename + " exists.");
182 if(File.Exists(filename)) 185 if (File.Exists(filename))
183 { 186 {
184 Stopwatch x = new Stopwatch(); 187 Stopwatch x = new Stopwatch();
185 x.Start(); 188 x.Start();
186 189
187 XmlTextReader reader = new XmlTextReader(filename); 190 XmlTextReader reader = new XmlTextReader(filename);
188 reader.WhitespaceHandling = WhitespaceHandling.None; 191 reader.WhitespaceHandling = WhitespaceHandling.None;
189 doc.Load(reader); 192 doc.Load(reader);
190 reader.Close(); 193 reader.Close();
191 rootNode = doc.FirstChild; 194 rootNode = doc.FirstChild;
192 195
193 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 196 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
194 xmlList.Add(aPrimNode.OuterXml); 197 {
195 198 xmlList.Add(aPrimNode.OuterXml);
196 x.Stop(); 199 }
197 TimeToDownload += x.ElapsedMilliseconds; 200
198 m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload); 201 x.Stop();
199 202 TimeToDownload += x.ElapsedMilliseconds;
200 return xmlList; 203 m_log.Info("[FileSystemDatabase] Time spent retrieving xml files so far: " + TimeToDownload);
204
205 return xmlList;
201 } 206 }
202 return null; 207 return null;
203 } 208 }
204 209
205 public void Initialise(Scene scene, string dir) 210 public void Initialise(Scene scene, string dir)
206 { 211 {
207 lock(this) 212 lock (this)
208 { 213 {
209 if (m_repodir == null) 214 if (m_repodir == null)
210 m_repodir = dir; 215 m_repodir = dir;
211 } 216 }
212 lock(m_scenes) 217 lock (m_scenes)
213 m_scenes.Add(scene.RegionInfo.RegionID, scene); 218 m_scenes.Add(scene.RegionInfo.RegionID, scene);
214 } 219 }
215 220
216 public System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID regionid) 221 public System.Collections.Generic.SortedDictionary<string, string> ListOfRegionRevisions(UUID regionid)
@@ -224,19 +229,21 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
224 StreamReader sr = null; 229 StreamReader sr = null;
225 String logMessage = ""; 230 String logMessage = "";
226 String logLocation = ""; 231 String logLocation = "";
227 foreach(string revisionDir in directories) 232 foreach (string revisionDir in directories)
228 { 233 {
229 try { 234 try
230 logLocation = revisionDir + Slash.DirectorySeparatorChar + "log"; 235 {
231 fs = new FileStream( logLocation, FileMode.Open); 236 logLocation = revisionDir + Slash.DirectorySeparatorChar + "log";
232 sr = new StreamReader(fs); 237 fs = new FileStream( logLocation, FileMode.Open);
233 logMessage = sr.ReadToEnd(); 238 sr = new StreamReader(fs);
234 sr.Close(); 239 logMessage = sr.ReadToEnd();
235 fs.Close(); 240 sr.Close();
236 revisionDict.Add(revisionDir, logMessage); 241 fs.Close();
237 } 242 revisionDict.Add(revisionDir, logMessage);
238 catch (Exception) 243 }
239 {} 244 catch (Exception)
245 {
246 }
240 } 247 }
241 248
242 return revisionDict; 249 return revisionDict;
@@ -254,9 +261,9 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
254 public void PostInitialise() 261 public void PostInitialise()
255 { 262 {
256 SetupSerialiser(); 263 SetupSerialiser();
257 264
258 m_log.Info("[FSDB]: Creating repository in " + m_repodir + "."); 265 m_log.Info("[FSDB]: Creating repository in " + m_repodir + ".");
259 CreateDirectory(); 266 CreateDirectory();
260 } 267 }
261 268
262 public void SaveRegion(UUID regionid, string regionName, string logMessage) 269 public void SaveRegion(UUID regionid, string regionName, string logMessage)
@@ -266,44 +273,44 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
266 273
267 m_log.Info("[FSDB]: checking if scene directory exists: " + scenedir); 274 m_log.Info("[FSDB]: checking if scene directory exists: " + scenedir);
268 if (!Directory.Exists(scenedir)) 275 if (!Directory.Exists(scenedir))
269 Directory.CreateDirectory(scenedir); 276 Directory.CreateDirectory(scenedir);
270 277
271 int newRevisionNum = GetMostRecentRevision(regionid)+1; 278 int newRevisionNum = GetMostRecentRevision(regionid)+1;
272 string revisiondir = scenedir + newRevisionNum + Slash.DirectorySeparatorChar; 279 string revisiondir = scenedir + newRevisionNum + Slash.DirectorySeparatorChar;
273 280
274 m_log.Info("[FSDB]: checking if revision directory exists: " + revisiondir); 281 m_log.Info("[FSDB]: checking if revision directory exists: " + revisiondir);
275 if (!Directory.Exists(revisiondir)) 282 if (!Directory.Exists(revisiondir))
276 Directory.CreateDirectory(revisiondir); 283 Directory.CreateDirectory(revisiondir);
277 284
278 try { 285 try {
279 Stopwatch x = new Stopwatch(); 286 Stopwatch x = new Stopwatch();
280 x.Start(); 287 x.Start();
281 if (m_scenes.ContainsKey(regionid)) 288 if (m_scenes.ContainsKey(regionid))
282 { 289 {
283 m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir); 290 m_serialiser[regionid].SerialiseRegion(m_scenes[regionid], revisiondir);
284 } 291 }
285 x.Stop(); 292 x.Stop();
286 TimeToSave += x.ElapsedMilliseconds; 293 TimeToSave += x.ElapsedMilliseconds;
287 m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds); 294 m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk for " + regionName + ": " + x.ElapsedMilliseconds);
288 m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave); 295 m_log.Info("[FileSystemDatabase] Time spent serialising regions to files on disk so far: " + TimeToSave);
289 } 296 }
290 catch (Exception e) 297 catch (Exception e)
291 { 298 {
292 m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e); 299 m_log.ErrorFormat("[FSDB]: Serialisation of region failed: " + e);
293 return; 300 return;
294 } 301 }
295 302
296 try { 303 try {
297 // Finish by writing log message. 304 // Finish by writing log message.
298 FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite); 305 FileStream file = new FileStream(revisiondir + "log", FileMode.Create, FileAccess.ReadWrite);
299 StreamWriter sw = new StreamWriter(file); 306 StreamWriter sw = new StreamWriter(file);
300 sw.Write(logMessage); 307 sw.Write(logMessage);
301 sw.Close(); 308 sw.Close();
302 } 309 }
303 catch (Exception e) 310 catch (Exception e)
304 { 311 {
305 m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e); 312 m_log.ErrorFormat("[FSDB]: Failed trying to save log file " + e);
306 return; 313 return;
307 } 314 }
308 } 315 }
309 316
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
index 5a6dbc8..a494ff6 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/MetaEntity.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
84 } 84 }
85 85
86 /// <summary> 86 /// <summary>
87 /// Makes a new meta entity by copying the given scene object group. 87 /// Makes a new meta entity by copying the given scene object group.
88 /// The physics boolean is just a stub right now. 88 /// The physics boolean is just a stub right now.
89 /// </summary> 89 /// </summary>
90 public MetaEntity(SceneObjectGroup orig, bool physics) 90 public MetaEntity(SceneObjectGroup orig, bool physics)
@@ -160,19 +160,19 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
160 { 160 {
161 //make new uuids 161 //make new uuids
162 Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>(); 162 Dictionary<UUID, SceneObjectPart> parts = new Dictionary<UUID, SceneObjectPart>();
163 foreach(SceneObjectPart part in m_Entity.Children.Values) 163 foreach (SceneObjectPart part in m_Entity.Children.Values)
164 { 164 {
165 part.ResetIDs(part.LinkNum); 165 part.ResetIDs(part.LinkNum);
166 parts.Add(part.UUID, part); 166 parts.Add(part.UUID, part);
167 } 167 }
168 168
169 // make new localids 169 // make new localids
170 foreach (SceneObjectPart part in m_Entity.Children.Values) 170 foreach (SceneObjectPart part in m_Entity.Children.Values)
171 part.LocalId = m_Entity.Scene.PrimIDAllocate(); 171 part.LocalId = m_Entity.Scene.PrimIDAllocate();
172 172
173 //finalize 173 //finalize
174 m_Entity.UpdateParentIDs(); 174 m_Entity.UpdateParentIDs();
175 m_Entity.RootPart.PhysActor = null; 175 m_Entity.RootPart.PhysActor = null;
176 m_Entity.Children = parts; 176 m_Entity.Children = parts;
177 } 177 }
178 178
@@ -188,8 +188,8 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
188 //This deletes the group without removing from any databases. 188 //This deletes the group without removing from any databases.
189 //This is important because we are not IN any database. 189 //This is important because we are not IN any database.
190 //m_Entity.FakeDeleteGroup(); 190 //m_Entity.FakeDeleteGroup();
191 foreach( SceneObjectPart part in m_Entity.Children.Values) 191 foreach (SceneObjectPart part in m_Entity.Children.Values)
192 client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); 192 client.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId);
193 } 193 }
194 194
195 /// <summary> 195 /// <summary>
@@ -197,10 +197,10 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
197 /// </summary> 197 /// </summary>
198 public virtual void HideFromAll() 198 public virtual void HideFromAll()
199 { 199 {
200 foreach( SceneObjectPart part in m_Entity.Children.Values) 200 foreach (SceneObjectPart part in m_Entity.Children.Values)
201 m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller) 201 m_Entity.Scene.ClientManager.ForEachClient(delegate(IClientAPI controller)
202 { controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); } 202 { controller.SendKiPrimitive(m_Entity.RegionHandle, part.LocalId); }
203 ); 203 );
204 } 204 }
205 205
206 public void SendFullUpdate(IClientAPI client) 206 public void SendFullUpdate(IClientAPI client)
@@ -239,40 +239,40 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
239 Color4 texcolor; 239 Color4 texcolor;
240 try 240 try
241 { 241 {
242 tex = part.Shape.Textures; 242 tex = part.Shape.Textures;
243 texcolor = new Color4(); 243 texcolor = new Color4();
244 } 244 }
245 catch(Exception) 245 catch(Exception)
246 { 246 {
247 //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e); 247 //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing textures of scene object: " + e);
248 return; 248 return;
249 } 249 }
250 250
251 for (uint i = 0; i < tex.FaceTextures.Length; i++) 251 for (uint i = 0; i < tex.FaceTextures.Length; i++)
252 { 252 {
253 try { 253 try {
254 if (tex.FaceTextures[i] != null) 254 if (tex.FaceTextures[i] != null)
255 { 255 {
256 texcolor = tex.FaceTextures[i].RGBA; 256 texcolor = tex.FaceTextures[i].RGBA;
257 texcolor.A = transparencyAmount; 257 texcolor.A = transparencyAmount;
258 tex.FaceTextures[i].RGBA = texcolor; 258 tex.FaceTextures[i].RGBA = texcolor;
259 } 259 }
260 } 260 }
261 catch (Exception) 261 catch (Exception)
262 { 262 {
263 //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e); 263 //m_log.ErrorFormat("[Content Management]: Exception thrown while accessing different face textures of object: " + e);
264 continue; 264 continue;
265 } 265 }
266 } 266 }
267 try { 267 try {
268 texcolor = tex.DefaultTexture.RGBA; 268 texcolor = tex.DefaultTexture.RGBA;
269 texcolor.A = transparencyAmount; 269 texcolor.A = transparencyAmount;
270 tex.DefaultTexture.RGBA = texcolor; 270 tex.DefaultTexture.RGBA = texcolor;
271 part.Shape.TextureEntry = tex.ToBytes(); 271 part.Shape.TextureEntry = tex.ToBytes();
272 } 272 }
273 catch (Exception) 273 catch (Exception)
274 { 274 {
275 //m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e); 275 //m_log.Info("[Content Management]: Exception thrown while accessing default face texture of object: " + e);
276 } 276 }
277 } 277 }
278 278
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
index b0c6955..81746c5 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
89 y.UUID = uuid; 89 y.UUID = uuid;
90 90
91 y.LocalId = LocalId; 91 y.LocalId = LocalId;
92 92
93 y.Shape = PrimitiveBaseShape.CreateBox(); 93 y.Shape = PrimitiveBaseShape.CreateBox();
94 y.Scale = new Vector3(0.01f,0.01f,0.01f); 94 y.Scale = new Vector3(0.01f,0.01f,0.01f);
95 y.LastOwnerID = UUID.Zero; 95 y.LastOwnerID = UUID.Zero;
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
index ba937f5..79e970d 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
@@ -106,13 +106,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
106 106
107 private static bool AreVectorsEquivalent(Vector3 first, Vector3 second) 107 private static bool AreVectorsEquivalent(Vector3 first, Vector3 second)
108 { 108 {
109 if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) 109 if (TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2)
110 && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) 110 && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2)
111 && TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2) 111 && TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2)
112 ) 112 )
113 return true; 113 return true;
114 else 114 else
115 return false; 115 return false;
116 } 116 }
117 117
118 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs 118 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
126 private static int TruncateSignificant(float num, int digits) 126 private static int TruncateSignificant(float num, int digits)
127 { 127 {
128 return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits)); 128 return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits));
129 // return (int) ((num * (10*digits))/10*digits); 129 // return (int) ((num * (10*digits))/10*digits);
130 } 130 }
131 131
132 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs 132 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
153 #region Public Methods 153 #region Public Methods
154 154
155 /// <summary> 155 /// <summary>
156 /// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts 156 /// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts
157 /// and returns a Diff bitmask which details what the differences are. 157 /// and returns a Diff bitmask which details what the differences are.
158 /// </summary> 158 /// </summary>
159 public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second) 159 public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second)
@@ -164,47 +164,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
164 Diff result = 0; 164 Diff result = 0;
165 165
166 // VECTOR COMPARISONS 166 // VECTOR COMPARISONS
167 if(! AreVectorsEquivalent(first.Acceleration, second.Acceleration)) 167 if (!AreVectorsEquivalent(first.Acceleration, second.Acceleration))
168 result |= Diff.ACCELERATION; 168 result |= Diff.ACCELERATION;
169 if(! AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition)) 169 if (!AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition))
170 result |= Diff.POSITION; 170 result |= Diff.POSITION;
171 if(! AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity)) 171 if (!AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity))
172 result |= Diff.ANGULARVELOCITY; 172 result |= Diff.ANGULARVELOCITY;
173 if(! AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition)) 173 if (!AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition))
174 result |= Diff.OFFSETPOSITION; 174 result |= Diff.OFFSETPOSITION;
175 if(! AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity)) 175 if (!AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity))
176 result |= Diff.ROTATIONALVELOCITY; 176 result |= Diff.ROTATIONALVELOCITY;
177 if(! AreVectorsEquivalent(first.Scale, second.Scale)) 177 if (!AreVectorsEquivalent(first.Scale, second.Scale))
178 result |= Diff.SCALE; 178 result |= Diff.SCALE;
179 if(! AreVectorsEquivalent(first.Velocity, second.Velocity)) 179 if (!AreVectorsEquivalent(first.Velocity, second.Velocity))
180 result |= Diff.VELOCITY; 180 result |= Diff.VELOCITY;
181 181
182 182
183 // QUATERNION COMPARISONS 183 // QUATERNION COMPARISONS
184 if(! AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset)) 184 if (!AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset))
185 result |= Diff.ROTATIONOFFSET; 185 result |= Diff.ROTATIONOFFSET;
186 186
187 187
188 // MISC COMPARISONS (UUID, Byte) 188 // MISC COMPARISONS (UUID, Byte)
189 if(first.ClickAction != second.ClickAction) 189 if (first.ClickAction != second.ClickAction)
190 result |= Diff.CLICKACTION; 190 result |= Diff.CLICKACTION;
191 if(first.ObjectOwner != second.ObjectOwner) 191 if (first.ObjectOwner != second.ObjectOwner)
192 result |= Diff.OBJECTOWNER; 192 result |= Diff.OBJECTOWNER;
193 193
194 194
195 // STRING COMPARISONS 195 // STRING COMPARISONS
196 if(first.Description != second.Description) 196 if (first.Description != second.Description)
197 result |= Diff.DESCRIPTION; 197 result |= Diff.DESCRIPTION;
198 if(first.Material != second.Material) 198 if (first.Material != second.Material)
199 result |= Diff.MATERIAL; 199 result |= Diff.MATERIAL;
200 if(first.Name != second.Name) 200 if (first.Name != second.Name)
201 result |= Diff.NAME; 201 result |= Diff.NAME;
202 if(first.SitName != second.SitName) 202 if (first.SitName != second.SitName)
203 result |= Diff.SITNAME; 203 result |= Diff.SITNAME;
204 if(first.Text != second.Text) 204 if (first.Text != second.Text)
205 result |= Diff.TEXT; 205 result |= Diff.TEXT;
206 if(first.TouchName != second.TouchName) 206 if (first.TouchName != second.TouchName)
207 result |= Diff.TOUCHNAME; 207 result |= Diff.TOUCHNAME;
208 208
209 x.Stop(); 209 x.Stop();
210 TimeToDiff += x.ElapsedMilliseconds; 210 TimeToDiff += x.ElapsedMilliseconds;