From 17ddb8b49323777b4678270ebbf4859dd8842abd Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 11 Jul 2007 18:32:32 +0000 Subject: Hopefully texturing prims should now work correctly. --- OpenSim/Region/Capabilities/Caps.cs | 8 +++++--- OpenSim/Region/ClientStack/ClientView.API.cs | 4 ++-- OpenSim/Region/Environment/Scenes/Primitive.cs | 14 +++++++++++++- OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 13 ++++++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 1 + 5 files changed, 33 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index db8df9b..6373f6e 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs @@ -75,10 +75,10 @@ namespace OpenSim.Region.Capabilities string capsBase = "/CAPS/" + m_capsObjectPath; - //AddLegacyCapsHandler( httpListener, m_mapLayerPath, MapLayer); + AddLegacyCapsHandler( httpListener, m_mapLayerPath, MapLayer); - httpListener.AddStreamHandler( - new LLSDStreamhandler("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); + // httpListener.AddStreamHandler( + // new LLSDStreamhandler("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); AddLegacyCapsHandler(httpListener, m_newInventory, NewAgentInventory); @@ -133,6 +133,7 @@ namespace OpenSim.Region.Capabilities /// public string MapLayer(string request, string path, string param) { + Console.WriteLine("map request: " + request); Encoding _enc = Encoding.UTF8; Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(_enc.GetBytes(request)); LLSDMapRequest mapReq = new LLSDMapRequest(); @@ -147,6 +148,7 @@ namespace OpenSim.Region.Capabilities public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) { + Console.WriteLine("Map request " + mapReq.Flags); LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); return mapResponse; diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index d5b6b52..b9eba3a 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -1042,8 +1042,8 @@ namespace OpenSim.Region.ClientStack protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData, LLUUID textureID) { - LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID); - objectData.TextureEntry = ntex.ToBytes(); + + objectData.TextureEntry = primData.TextureEntry; objectData.PCode = primData.PCode; objectData.PathBegin = primData.PathBegin; objectData.PathEnd = primData.PathEnd; diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index d23a569..d28e480 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -242,7 +242,8 @@ namespace OpenSim.Region.Environment.Scenes pShape.PathTaperY = addPacket.ObjectData.PathTaperY; pShape.PathTwist = addPacket.ObjectData.PathTwist; pShape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; - + LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); + pShape.TextureEntry = ntex.ToBytes(); this.updateFlag = 1; } #endregion @@ -501,6 +502,17 @@ namespace OpenSim.Region.Environment.Scenes } #endregion + #region Texture + /// + /// + /// + /// + public void UpdateTextureEntry(byte[] textureEntry) + { + this.m_Shape.TextureEntry = textureEntry; + this.updateFlag = 1; + } + #endregion #region Client Update Methods /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 69eaa75..1753772 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -421,7 +421,18 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) { - + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + prim = ((SceneObject)ent).HasChildPrim(localID); + if (prim != null) + { + prim.UpdateTextureEntry(texture); + } + } + } } /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d1f6038..80c61e1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -477,6 +477,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnUpdatePrimScale += this.UpdatePrimScale; client.OnUpdatePrimShape += this.UpdatePrimShape; client.OnRequestMapBlocks += this.RequestMapBlocks; + client.OnUpdatePrimTexture += this.UpdatePrimTexture; client.OnTeleportLocationRequest += this.RequestTeleportLocation; client.OnObjectSelect += this.SelectPrim; client.OnGrapUpdate += this.MoveObject; -- cgit v1.1