revert changes to asset desc size, my bad.. this field will possible go away in future

melanie
UbitUmarov 2016-11-24 14:39:08 +00:00
parent 94ec5884b7
commit 5202ae7bb4
5 changed files with 17 additions and 37 deletions

View File

@ -170,14 +170,6 @@ namespace OpenSim.Data.MySQL
} }
string assetDescription = asset.Description; string assetDescription = asset.Description;
if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC)
{
if(asset.Type == (sbyte) AssetType.Landmark)
assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC);
else
assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC);
}
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{ {
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);

View File

@ -214,12 +214,12 @@ namespace OpenSim.Data.MySQL
} }
string assetDescription = asset.Description; string assetDescription = asset.Description;
if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{ {
if(asset.Type == (sbyte) AssetType.Landmark) assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); m_log.WarnFormat(
else "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
} }
if (m_enableCompression) if (m_enableCompression)

View File

@ -175,12 +175,12 @@ namespace OpenSim.Data.PGSQL
} }
string assetDescription = asset.Description; string assetDescription = asset.Description;
if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{ {
if(asset.Type == (sbyte) AssetType.Landmark) assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); m_log.WarnFormat(
else "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
} }
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))

View File

@ -143,12 +143,12 @@ namespace OpenSim.Data.SQLite
} }
string assetDescription = asset.Description; string assetDescription = asset.Description;
if(assetDescription.Length > AssetBase.MAX_LMASSET_DESC) if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{ {
if(asset.Type == (sbyte) AssetType.Landmark) assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
assetDescription = assetDescription.Substring(0, AssetBase.MAX_LMASSET_DESC); m_log.WarnFormat(
else "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
assetDescription = assetDescription.Substring(0, AssetBase.MAX_ASSET_DESC); asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
} }
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());

View File

@ -51,8 +51,7 @@ namespace OpenSim.Framework
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static readonly int MAX_ASSET_NAME = 64; public static readonly int MAX_ASSET_NAME = 64;
public static readonly int MAX_ASSET_DESC = 127; public static readonly int MAX_ASSET_DESC = 64;
public static readonly int MAX_LMASSET_DESC = 255;
/// <summary> /// <summary>
/// Data of the Asset /// Data of the Asset
@ -306,18 +305,7 @@ namespace OpenSim.Framework
public string Description public string Description
{ {
get { return m_description; } get { return m_description; }
set set { m_description = value; }
{
if(value.Length > AssetBase.MAX_LMASSET_DESC)
{
if(m_type == (sbyte) AssetType.Landmark)
m_description = value.Substring(0, AssetBase.MAX_LMASSET_DESC);
else
m_description = value.Substring(0, AssetBase.MAX_ASSET_DESC);
}
else
m_description = value;
}
} }
public DateTime CreationDate public DateTime CreationDate