From 92502687538e2f9dd8d473aad9e9ef1c75091dd8 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 1 Jul 2010 00:47:12 +0100 Subject: [PATCH] have a stab at sending the correct number of media entries to shapes actually, this is probably wrong anyway if there's a default texture it's going to be easier just to gather the object media updates and retain those in-memory now but what the hell --- .../CoreModules/World/Media/Moap/MoapModule.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index b6fa53fafa..30507a4aa3 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -128,8 +128,20 @@ namespace OpenSim.Region.CoreModules.Media.Moap protected string HandleObjectMediaRequestGet( string path, Hashtable osdParams, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - // Yeah, only for cubes right now. I know it's dumb. - int faces = 6; + UUID primId = (UUID)osdParams["object_id"]; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); + + if (null == part) + { + m_log.WarnFormat( + "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in the scene", + primId); + return string.Empty; + } + + int faces = part.GetNumberOfSides(); + m_log.DebugFormat("[MOAP]: Faces [{0}] for [{1}]", faces, primId); MediaEntry[] media = new MediaEntry[faces]; for (int i = 0; i < faces; i++)