Hopefully texturing prims should now work correctly.

afrisby
MW 2007-07-11 18:32:32 +00:00
parent 2ceff87a02
commit 17ddb8b493
5 changed files with 33 additions and 7 deletions

View File

@ -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<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer ));
// httpListener.AddStreamHandler(
// new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer ));
AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest);
AddLegacyCapsHandler(httpListener, m_newInventory, NewAgentInventory);
@ -133,6 +133,7 @@ namespace OpenSim.Region.Capabilities
/// <returns></returns>
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;

View File

@ -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;

View File

@ -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
/// <summary>
///
/// </summary>
/// <param name="textureEntry"></param>
public void UpdateTextureEntry(byte[] textureEntry)
{
this.m_Shape.TextureEntry = textureEntry;
this.updateFlag = 1;
}
#endregion
#region Client Update Methods
/// <summary>

View File

@ -421,7 +421,18 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
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);
}
}
}
}
/// <summary>

View File

@ -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;