mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/RegionSettings.cs OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs OpenSim/Region/Framework/Interfaces/IInterregionComms.cs OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
This commit is contained in:
@@ -31,10 +31,34 @@ namespace OpenSim.Framework
|
||||
{
|
||||
public interface IImprovedAssetCache
|
||||
{
|
||||
/// <summary>
|
||||
/// Cache the specified asset.
|
||||
/// </summary>
|
||||
/// <param name='asset'></param>
|
||||
void Cache(AssetBase asset);
|
||||
|
||||
/// <summary>
|
||||
/// Get an asset by its id.
|
||||
/// </summary>
|
||||
/// <param name='id'></param>
|
||||
/// <returns>null if the asset does not exist.</returns>
|
||||
AssetBase Get(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Check whether an asset with the specified id exists in the cache.
|
||||
/// </summary>
|
||||
/// <param name='id'></param>
|
||||
bool Check(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Expire an asset from the cache.
|
||||
/// </summary>
|
||||
/// <param name='id'></param>
|
||||
void Expire(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Clear the cache.
|
||||
/// </summary>
|
||||
void Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -504,21 +504,14 @@ namespace OpenSim.Framework
|
||||
set { m_TelehubEnabled = value; }
|
||||
}
|
||||
|
||||
// Connected Telehub object
|
||||
private UUID m_TelehubObject = UUID.Zero;
|
||||
public UUID TelehubObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_TelehubObject;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TelehubObject = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Connected Telehub object
|
||||
/// </summary>
|
||||
public UUID TelehubObject { get; set; }
|
||||
|
||||
// Our Connected Telehub's SpawnPoints
|
||||
/// <summary>
|
||||
/// Our connected Telehub's SpawnPoints
|
||||
/// </summary>
|
||||
public List<SpawnPoint> l_SpawnPoints = new List<SpawnPoint>();
|
||||
|
||||
// Add a SpawnPoint
|
||||
@@ -549,4 +542,4 @@ namespace OpenSim.Framework
|
||||
l_SpawnPoints.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,32 @@ namespace OpenSim.Framework
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Asset types used only in OpenSim.
|
||||
/// To avoid clashing with the code numbers used in Second Life, use only negative numbers here.
|
||||
/// </summary>
|
||||
public enum OpenSimAssetType : sbyte
|
||||
{
|
||||
Material = -2
|
||||
}
|
||||
|
||||
|
||||
#region SL / file extension / content-type conversions
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Enum entry corresponding to the given code, regardless of whether it belongs
|
||||
/// to the AssetType or OpenSimAssetType enums.
|
||||
/// </summary>
|
||||
public static object AssetTypeFromCode(sbyte assetType)
|
||||
{
|
||||
if (Enum.IsDefined(typeof(OpenMetaverse.AssetType), assetType))
|
||||
return (OpenMetaverse.AssetType)assetType;
|
||||
else if (Enum.IsDefined(typeof(OpenSimAssetType), assetType))
|
||||
return (OpenSimAssetType)assetType;
|
||||
else
|
||||
return OpenMetaverse.AssetType.Unknown;
|
||||
}
|
||||
|
||||
private class TypeMapping
|
||||
{
|
||||
private sbyte assetType;
|
||||
@@ -56,12 +80,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public object AssetType
|
||||
{
|
||||
get {
|
||||
if (Enum.IsDefined(typeof(OpenMetaverse.AssetType), assetType))
|
||||
return (OpenMetaverse.AssetType)assetType;
|
||||
else
|
||||
return OpenMetaverse.AssetType.Unknown;
|
||||
}
|
||||
get { return AssetTypeFromCode(assetType); }
|
||||
}
|
||||
|
||||
public InventoryType InventoryType
|
||||
@@ -102,6 +121,11 @@ namespace OpenSim.Framework
|
||||
: this((sbyte)assetType, inventoryType, contentType, null, extension)
|
||||
{
|
||||
}
|
||||
|
||||
public TypeMapping(OpenSimAssetType assetType, InventoryType inventoryType, string contentType, string extension)
|
||||
: this((sbyte)assetType, inventoryType, contentType, null, extension)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,7 +166,9 @@ namespace OpenSim.Framework
|
||||
new TypeMapping(AssetType.CurrentOutfitFolder, InventoryType.Unknown, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"),
|
||||
new TypeMapping(AssetType.OutfitFolder, InventoryType.Unknown, "application/vnd.ll.outfitfolder", "outfitfolder"),
|
||||
new TypeMapping(AssetType.MyOutfitsFolder, InventoryType.Unknown, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"),
|
||||
new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm")
|
||||
new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm"),
|
||||
|
||||
new TypeMapping(OpenSimAssetType.Material, InventoryType.Unknown, "application/llsd+xml", "material")
|
||||
};
|
||||
|
||||
private static Dictionary<sbyte, string> asset2Content;
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenSimAssetType = OpenSim.Framework.SLUtil.OpenSimAssetType;
|
||||
|
||||
namespace OpenSim.Framework.Serialization
|
||||
{
|
||||
@@ -128,6 +129,7 @@ namespace OpenSim.Framework.Serialization
|
||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Texture] = ASSET_EXTENSION_SEPARATOR + "texture.jp2";
|
||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TextureTGA] = ASSET_EXTENSION_SEPARATOR + "texture.tga";
|
||||
ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.TrashFolder] = ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"; // Not sure if we'll ever see this
|
||||
ASSET_TYPE_TO_EXTENSION[(sbyte)OpenSimAssetType.Material] = ASSET_EXTENSION_SEPARATOR + "material.xml"; // Not sure if we'll ever see this
|
||||
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "animation.bvh"] = (sbyte)AssetType.Animation;
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bodypart.txt"] = (sbyte)AssetType.Bodypart;
|
||||
@@ -152,6 +154,7 @@ namespace OpenSim.Framework.Serialization
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.jp2"] = (sbyte)AssetType.Texture;
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "texture.tga"] = (sbyte)AssetType.TextureTGA;
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "trashfolder.txt"] = (sbyte)AssetType.TrashFolder;
|
||||
EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "material.xml"] = (sbyte)OpenSimAssetType.Material;
|
||||
}
|
||||
|
||||
public static string CreateOarLandDataPath(LandData ld)
|
||||
|
||||
@@ -1043,7 +1043,7 @@ namespace OpenSim.Framework
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
val = cnf.GetInt(varname, (int)val);
|
||||
else if (typeof(T) == typeof(float))
|
||||
val = cnf.GetFloat(varname, (int)val);
|
||||
val = cnf.GetFloat(varname, (float)val);
|
||||
else
|
||||
m_log.ErrorFormat("[UTIL]: Unhandled type {0}", typeof(T));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user