aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs40
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
index b259f52..52fa908 100644
--- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
+++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
@@ -59,8 +59,8 @@ namespace OpenSim.Region.OptionalModules.Materials
59 { 59 {
60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 60 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
61 61
62 public string Name { get { return "MaterialsModule"; } } 62 public string Name { get { return "MaterialsModule"; } }
63 63
64 public Type ReplaceableInterface { get { return null; } } 64 public Type ReplaceableInterface { get { return null; } }
65 65
66 IAssetCache m_cache; 66 IAssetCache m_cache;
@@ -88,13 +88,13 @@ namespace OpenSim.Region.OptionalModules.Materials
88 if (m_enabled) 88 if (m_enabled)
89 m_log.DebugFormat("[Materials]: Initialized"); 89 m_log.DebugFormat("[Materials]: Initialized");
90 } 90 }
91 91
92 public void Close() 92 public void Close()
93 { 93 {
94 if (!m_enabled) 94 if (!m_enabled)
95 return; 95 return;
96 } 96 }
97 97
98 public void AddRegion(Scene scene) 98 public void AddRegion(Scene scene)
99 { 99 {
100 if (!m_enabled) 100 if (!m_enabled)
@@ -152,7 +152,7 @@ namespace OpenSim.Region.OptionalModules.Materials
152 m_scene.AssetService.Store(a); 152 m_scene.AssetService.Store(a);
153 } 153 }
154 }); 154 });
155 } 155 }
156 } 156 }
157 157
158 private void EventManager_OnObjectAddedToScene(SceneObjectGroup obj) 158 private void EventManager_OnObjectAddedToScene(SceneObjectGroup obj)
@@ -166,7 +166,7 @@ namespace OpenSim.Region.OptionalModules.Materials
166 { 166 {
167 string capsBase = "/CAPS/" + caps.CapsObjectPath; 167 string capsBase = "/CAPS/" + caps.CapsObjectPath;
168 168
169 IRequestHandler renderMaterialsPostHandler 169 IRequestHandler renderMaterialsPostHandler
170 = new RestStreamHandler("POST", capsBase + "/", 170 = new RestStreamHandler("POST", capsBase + "/",
171 (request, path, param, httpRequest, httpResponse) 171 (request, path, param, httpRequest, httpResponse)
172 => RenderMaterialsPostCap(request, agentID), 172 => RenderMaterialsPostCap(request, agentID),
@@ -177,7 +177,7 @@ namespace OpenSim.Region.OptionalModules.Materials
177 // and POST handlers, (at least at the time this was originally written), so we first set up a POST 177 // and POST handlers, (at least at the time this was originally written), so we first set up a POST
178 // handler normally and then add a GET handler via MainServer 178 // handler normally and then add a GET handler via MainServer
179 179
180 IRequestHandler renderMaterialsGetHandler 180 IRequestHandler renderMaterialsGetHandler
181 = new RestStreamHandler("GET", capsBase + "/", 181 = new RestStreamHandler("GET", capsBase + "/",
182 (request, path, param, httpRequest, httpResponse) 182 (request, path, param, httpRequest, httpResponse)
183 => RenderMaterialsGetCap(request), 183 => RenderMaterialsGetCap(request),
@@ -185,14 +185,14 @@ namespace OpenSim.Region.OptionalModules.Materials
185 MainServer.Instance.AddStreamHandler(renderMaterialsGetHandler); 185 MainServer.Instance.AddStreamHandler(renderMaterialsGetHandler);
186 186
187 // materials viewer seems to use either POST or PUT, so assign POST handler for PUT as well 187 // materials viewer seems to use either POST or PUT, so assign POST handler for PUT as well
188 IRequestHandler renderMaterialsPutHandler 188 IRequestHandler renderMaterialsPutHandler
189 = new RestStreamHandler("PUT", capsBase + "/", 189 = new RestStreamHandler("PUT", capsBase + "/",
190 (request, path, param, httpRequest, httpResponse) 190 (request, path, param, httpRequest, httpResponse)
191 => RenderMaterialsPutCap(request, agentID), 191 => RenderMaterialsPutCap(request, agentID),
192 "RenderMaterials", null); 192 "RenderMaterials", null);
193 MainServer.Instance.AddStreamHandler(renderMaterialsPutHandler); 193 MainServer.Instance.AddStreamHandler(renderMaterialsPutHandler);
194 } 194 }
195 195
196 public void RemoveRegion(Scene scene) 196 public void RemoveRegion(Scene scene)
197 { 197 {
198 if (!m_enabled) 198 if (!m_enabled)
@@ -201,8 +201,8 @@ namespace OpenSim.Region.OptionalModules.Materials
201 m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; 201 m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
202 m_scene.EventManager.OnObjectAddedToScene -= EventManager_OnObjectAddedToScene; 202 m_scene.EventManager.OnObjectAddedToScene -= EventManager_OnObjectAddedToScene;
203 m_scene.EventManager.OnBackup -= EventManager_OnBackup; 203 m_scene.EventManager.OnBackup -= EventManager_OnBackup;
204 } 204 }
205 205
206 public void RegionLoaded(Scene scene) 206 public void RegionLoaded(Scene scene)
207 { 207 {
208 if (!m_enabled) return; 208 if (!m_enabled) return;
@@ -285,7 +285,7 @@ namespace OpenSim.Region.OptionalModules.Materials
285 /// Find the materials used in the SOP, and add them to 'm_regionMaterials'. 285 /// Find the materials used in the SOP, and add them to 'm_regionMaterials'.
286 /// </summary> 286 /// </summary>
287 private void GetStoredMaterialsInPart(SceneObjectPart part) 287 private void GetStoredMaterialsInPart(SceneObjectPart part)
288 { 288 {
289 if (part.Shape == null) 289 if (part.Shape == null)
290 return; 290 return;
291 291
@@ -299,7 +299,7 @@ namespace OpenSim.Region.OptionalModules.Materials
299 GetStoredMaterialInFace(part, te.DefaultTexture); 299 GetStoredMaterialInFace(part, te.DefaultTexture);
300 else 300 else
301 m_log.WarnFormat( 301 m_log.WarnFormat(
302 "[Materials]: Default texture for part {0} (part of object {1}) in {2} unexpectedly null. Ignoring.", 302 "[Materials]: Default texture for part {0} (part of object {1}) in {2} unexpectedly null. Ignoring.",
303 part.Name, part.ParentGroup.Name, m_scene.Name); 303 part.Name, part.ParentGroup.Name, m_scene.Name);
304 304
305 foreach (Primitive.TextureEntryFace face in te.FaceTextures) 305 foreach (Primitive.TextureEntryFace face in te.FaceTextures)
@@ -363,7 +363,7 @@ namespace OpenSim.Region.OptionalModules.Materials
363 363
364 byte[] inBytes = req["Zipped"].AsBinary(); 364 byte[] inBytes = req["Zipped"].AsBinary();
365 365
366 try 366 try
367 { 367 {
368 osd = ZDecompressBytesToOsd(inBytes); 368 osd = ZDecompressBytesToOsd(inBytes);
369 369
@@ -409,7 +409,7 @@ namespace OpenSim.Region.OptionalModules.Materials
409 //return ""; 409 //return "";
410 } 410 }
411 } 411 }
412 412
413 resp["Zipped"] = ZCompressOSD(respArr, false); 413 resp["Zipped"] = ZCompressOSD(respArr, false);
414 string response = OSDParser.SerializeLLSDXmlString(resp); 414 string response = OSDParser.SerializeLLSDXmlString(resp);
415 415
@@ -435,7 +435,7 @@ namespace OpenSim.Region.OptionalModules.Materials
435 435
436 byte[] inBytes = req["Zipped"].AsBinary(); 436 byte[] inBytes = req["Zipped"].AsBinary();
437 437
438 try 438 try
439 { 439 {
440 osd = ZDecompressBytesToOsd(inBytes); 440 osd = ZDecompressBytesToOsd(inBytes);
441 441
@@ -493,7 +493,7 @@ namespace OpenSim.Region.OptionalModules.Materials
493 m_log.WarnFormat("[Materials]: Error in TextureEntry for SOP {0} {1}", sop.Name, sop.UUID); 493 m_log.WarnFormat("[Materials]: Error in TextureEntry for SOP {0} {1}", sop.Name, sop.UUID);
494 continue; 494 continue;
495 } 495 }
496 496
497 UUID id; 497 UUID id;
498 if (mat == null) 498 if (mat == null)
499 { 499 {
@@ -588,7 +588,7 @@ namespace OpenSim.Region.OptionalModules.Materials
588 //return ""; 588 //return "";
589 } 589 }
590 } 590 }
591 591
592 resp["Zipped"] = ZCompressOSD(respArr, false); 592 resp["Zipped"] = ZCompressOSD(respArr, false);
593 string response = OSDParser.SerializeLLSDXmlString(resp); 593 string response = OSDParser.SerializeLLSDXmlString(resp);
594 594
@@ -684,7 +684,7 @@ namespace OpenSim.Region.OptionalModules.Materials
684 684
685 if (sop.Name != "Primitive") 685 if (sop.Name != "Primitive")
686 return sop.Name; 686 return sop.Name;
687 687
688 if ((sop.ParentGroup != null) && (sop.ParentGroup.Name != "Primitive")) 688 if ((sop.ParentGroup != null) && (sop.ParentGroup.Name != "Primitive"))
689 return sop.ParentGroup.Name; 689 return sop.ParentGroup.Name;
690 690
@@ -748,7 +748,7 @@ namespace OpenSim.Region.OptionalModules.Materials
748 748
749 using (MemoryStream msSinkCompressed = new MemoryStream()) 749 using (MemoryStream msSinkCompressed = new MemoryStream())
750 { 750 {
751 using (Ionic.Zlib.ZlibStream zOut = new Ionic.Zlib.ZlibStream(msSinkCompressed, 751 using (Ionic.Zlib.ZlibStream zOut = new Ionic.Zlib.ZlibStream(msSinkCompressed,
752 Ionic.Zlib.CompressionMode.Compress, CompressionLevel.BestCompression, true)) 752 Ionic.Zlib.CompressionMode.Compress, CompressionLevel.BestCompression, true))
753 { 753 {
754 zOut.Write(data, 0, data.Length); 754 zOut.Write(data, 0, data.Length);