From 87e2a694e200f5774f71d38041247912b5ccf98d Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 27 Dec 2007 14:00:30 +0000
Subject: * AssetServerBase: _ProcessRequest is now called GetAsset *
PrimitiveBaseShape: The textures are now exposed as a 'TextureEntry
Textures'; all serialization still using the 'byte[] TextureEntry' for
backwards compatibility. * Scene: Re-added AddTree, since the Tree type isn't
gone from libsl, merely relocated.
---
.../Framework/Communications/Cache/AssetServer.cs | 2 +-
.../Communications/Cache/AssetServerBase.cs | 8 ++---
.../Communications/Cache/GridAssetClient.cs | 2 +-
.../Communications/Cache/SQLAssetServer.cs | 2 +-
OpenSim/Framework/Data.MySQL/MySQLDataStore.cs | 5 ++-
OpenSim/Framework/PrimitiveBaseShape.cs | 42 +++++++++++++++++++---
6 files changed, 48 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs
index 4ad0f60..ae6494f 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
- protected override AssetBase _ProcessRequest(AssetRequest req)
+ protected override AssetBase GetAsset(AssetRequest req)
{
byte[] idata = null;
bool found = false;
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index f5ebab7..43d3dd9 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -54,16 +54,16 @@ namespace OpenSim.Framework.Communications.Cache
///
///
///
- protected abstract AssetBase _ProcessRequest(AssetRequest req);
+ protected abstract AssetBase GetAsset(AssetRequest req);
///
- /// Process an asset request. This method will call _ProcessRequest(AssetRequest req)
+ /// Process an asset request. This method will call GetAsset(AssetRequest req)
/// on the subclass.
///
///
- protected void ProcessRequest(AssetRequest req)
+ protected virtual void ProcessRequest(AssetRequest req)
{
- AssetBase asset = _ProcessRequest(req);
+ AssetBase asset = GetAsset(req);
if (asset != null)
{
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 5801aa8..9c460c7 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Cache
#region IAssetServer Members
- protected override AssetBase _ProcessRequest(AssetRequest req)
+ protected override AssetBase GetAsset(AssetRequest req)
{
Stream s = null;
try
diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
index 4fa7684..7fcff10 100644
--- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Framework.Communications.Cache
m_assetProviderPlugin.CommitAssets();
}
- protected override AssetBase _ProcessRequest(AssetRequest req)
+ protected override AssetBase GetAsset(AssetRequest req)
{
AssetBase asset;
lock (syncLock)
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
index 61b22a0..06a5814 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
@@ -916,7 +916,10 @@ namespace OpenSim.Framework.Data.MySQL
s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]);
s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]);
s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]);
- s.TextureEntry = (byte[])row["Texture"];
+
+ byte[] textureEntry = (byte[])row["Texture"];
+ s.TextureEntry = textureEntry;
+
s.ExtraParams = (byte[])row["ExtraParams"];
return s;
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index b06a885..98e583e 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -28,6 +28,7 @@
using System.Xml.Serialization;
using libsecondlife;
+using System;
namespace OpenSim.Framework
{
@@ -63,9 +64,10 @@ namespace OpenSim.Framework
Flexible = 128
}
+ [Serializable]
public class PrimitiveBaseShape
{
- private static readonly byte[] m_defaultTextureEntry;
+ private static readonly LLObject.TextureEntry m_defaultTexture;
public byte State;
public byte PCode;
@@ -88,7 +90,35 @@ namespace OpenSim.Framework
public sbyte PathTaperY;
public sbyte PathTwist;
public sbyte PathTwistBegin;
- public byte[] TextureEntry; // a LL textureEntry in byte[] format
+
+ [XmlIgnore]
+ public LLObject.TextureEntry Textures
+ {
+ get
+ {
+ return new LLObject.TextureEntry(m_textureEntry, 0, m_textureEntry.Length);
+ }
+
+ set
+ {
+ m_textureEntry = value.ToBytes();
+ }
+ }
+
+ private byte[] m_textureEntry;
+ public byte[] TextureEntry
+ {
+ get
+ {
+ return m_textureEntry;
+ }
+
+ set
+ {
+ m_textureEntry = value;
+ }
+ }
+
public byte[] ExtraParams;
public ProfileShape ProfileShape
@@ -117,17 +147,19 @@ namespace OpenSim.Framework
get { return Scale; }
}
+
+
static PrimitiveBaseShape()
{
- m_defaultTextureEntry =
- new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")).ToBytes();
+ m_defaultTexture =
+ new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
}
public PrimitiveBaseShape()
{
PCode = (byte) PCodeEnum.Primitive;
ExtraParams = new byte[1];
- TextureEntry = m_defaultTextureEntry;
+ Textures = m_defaultTexture;
}
public static PrimitiveBaseShape Create()
--
cgit v1.1