diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index 839e0f21ac..0fc937f79e 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -223,7 +223,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.writer.WriteAttributeString("name", asset.Name); rdata.writer.WriteAttributeString("desc", asset.Description); rdata.writer.WriteAttributeString("type", asset.Type.ToString()); - rdata.writer.WriteAttributeString("invtype", asset.InvType.ToString()); rdata.writer.WriteAttributeString("local", asset.Local.ToString()); rdata.writer.WriteAttributeString("temporary", asset.Temporary.ToString()); diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index 0fc10f9a5b..780d218328 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -1492,7 +1492,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory private void CollectAsset(XmlInventoryCollection ic) { - Rest.Log.DebugFormat("{0} Interpret asset element", MsgId); AssetBase asset = null; @@ -1500,7 +1499,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory string name = String.Empty; string desc = String.Empty; sbyte type = (sbyte) AssetType.Unknown; - sbyte itype = (sbyte) AssetType.Unknown; bool temp = false; bool local = false; @@ -1534,10 +1532,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory temp = Boolean.Parse(ic.xml.Value); break; - case "invtype" : - itype = SByte.Parse(ic.xml.Value); - break; - case "uuid" : uuid = new LLUUID(ic.xml.Value); break; @@ -1603,7 +1597,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory asset.Description = desc; asset.Type = type; // type == 0 == texture - asset.InvType = itype; asset.Local = local; asset.Temporary = temp; diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 44d78ed17c..3f2e8a75c9 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -63,6 +63,7 @@ namespace OpenSim.Data.MSSQL database.ExecuteResourceSql("CreateAssetsTable.sql"); return; } + } /// @@ -114,9 +115,9 @@ namespace OpenSim.Data.MSSQL SqlCommand cmd = new SqlCommand( - "INSERT INTO assets ([id], [name], [description], [assetType], [invType], [local], [temporary], [data])" + + "INSERT INTO assets ([id], [name], [description], [assetType], [local], [temporary], [data])" + " VALUES " + - "(@id, @name, @description, @assetType, @invType, @local, @temporary, @data)", + "(@id, @name, @description, @assetType, @local, @temporary, @data)", database.getConnection()); using (cmd) @@ -128,8 +129,6 @@ namespace OpenSim.Data.MSSQL cmd.Parameters.AddWithValue("description", asset.Description); SqlParameter e = cmd.Parameters.Add("assetType", SqlDbType.TinyInt); e.Value = asset.Type; - SqlParameter f = cmd.Parameters.Add("invType", SqlDbType.TinyInt); - f.Value = asset.InvType; SqlParameter g = cmd.Parameters.Add("local", SqlDbType.TinyInt); g.Value = asset.Local; SqlParameter h = cmd.Parameters.Add("temporary", SqlDbType.TinyInt); @@ -159,7 +158,6 @@ namespace OpenSim.Data.MSSQL "name = @name, " + "description = @description," + "assetType = @assetType," + - "invType = @invType," + "local = @local," + "temporary = @temporary," + "data = @data where " + @@ -168,7 +166,6 @@ namespace OpenSim.Data.MSSQL SqlParameter param2 = new SqlParameter("@name", asset.Name); SqlParameter param3 = new SqlParameter("@description", asset.Description); SqlParameter param4 = new SqlParameter("@assetType", asset.Type); - SqlParameter param5 = new SqlParameter("@invType", asset.InvType); SqlParameter param6 = new SqlParameter("@local", asset.Local); SqlParameter param7 = new SqlParameter("@temporary", asset.Temporary); SqlParameter param8 = new SqlParameter("@data", asset.Data); @@ -177,7 +174,6 @@ namespace OpenSim.Data.MSSQL command.Parameters.Add(param2); command.Parameters.Add(param3); command.Parameters.Add(param4); - command.Parameters.Add(param5); command.Parameters.Add(param6); command.Parameters.Add(param7); command.Parameters.Add(param8); diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index bea02fe4e6..e421c5d4e3 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -405,7 +405,6 @@ namespace OpenSim.Data.MSSQL asset.Data = (byte[])reader["data"]; asset.Description = (string)reader["description"]; asset.FullID = new LLUUID((string)reader["id"]); - asset.InvType = Convert.ToSByte(reader["invType"]); asset.Local = Convert.ToBoolean(reader["local"]); // ((sbyte)reader["local"]) != 0 ? true : false; asset.Name = (string)reader["name"]; asset.Type = Convert.ToSByte(reader["assetType"]); diff --git a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql index c7cb21adf5..4d94699b72 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql @@ -6,7 +6,6 @@ CREATE TABLE [assets] ( [name] [varchar](64) NOT NULL, [description] [varchar](64) NOT NULL, [assetType] [tinyint] NOT NULL, - [invType] [tinyint] NOT NULL, [local] [tinyint] NOT NULL, [temporary] [tinyint] NOT NULL, [data] [image] NOT NULL, diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index d66a5c2005..21d730d4c0 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -164,7 +164,7 @@ namespace OpenSim.Data.MySQL { MySqlCommand cmd = new MySqlCommand( - "SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", + "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection); cmd.Parameters.AddWithValue("?id", assetID.ToString()); @@ -178,7 +178,6 @@ namespace OpenSim.Data.MySQL asset.Data = (byte[]) dbReader["data"]; asset.Description = (string) dbReader["description"]; asset.FullID = assetID; - asset.InvType = (sbyte) dbReader["invType"]; asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; asset.Name = (string) dbReader["name"]; asset.Type = (sbyte) dbReader["assetType"]; @@ -216,8 +215,8 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand( - "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + - "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", + "REPLACE INTO assets(id, name, description, assetType, local, temporary, data)" + + "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?data)", _dbConnection.Connection); // need to ensure we dispose @@ -229,7 +228,6 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?name", asset.Name); cmd.Parameters.AddWithValue("?description", asset.Description); cmd.Parameters.AddWithValue("?assetType", asset.Type); - cmd.Parameters.AddWithValue("?invType", asset.InvType); cmd.Parameters.AddWithValue("?local", asset.Local); cmd.Parameters.AddWithValue("?temporary", asset.Temporary); cmd.Parameters.AddWithValue("?data", asset.Data); diff --git a/OpenSim/Data/MySQL/Resources/004_AssetStore.sql b/OpenSim/Data/MySQL/Resources/004_AssetStore.sql new file mode 100644 index 0000000000..9e9b9fe796 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/004_AssetStore.sql @@ -0,0 +1,5 @@ +BEGIN; + +ALTER TABLE assets drop InvType; + +COMMIT; diff --git a/OpenSim/Data/SQLite/Resources/002_AssetStore.sql b/OpenSim/Data/SQLite/Resources/002_AssetStore.sql new file mode 100644 index 0000000000..41ca640290 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/002_AssetStore.sql @@ -0,0 +1,10 @@ +BEGIN TRANSACTION; + +CREATE TEMPORARY TABLE assets_backup(UUID,Name,Description,Type,Local,Temporary,Data); +INSERT INTO assets_backup SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets; +DROP TABLE assets; +CREATE TABLE assets(UUID,Name,Description,Type,Local,Temporary,Data); +INSERT INTO assets SELECT UUID,Name,Description,Type,Local,Temporary,Data FROM assets_backup; +DROP TABLE assets_backup; + +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 24c75e3079..8fa09fc015 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -50,8 +50,8 @@ namespace OpenSim.Data.SQLite /// private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; - private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, InvType, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :InvType, :Local, :Temporary, :Data)"; - private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, InvType=:InvType, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID"; + private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Data)"; + private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID"; private const string assetSelect = "select * from assets"; private SqliteConnection m_conn; @@ -134,7 +134,6 @@ namespace OpenSim.Data.SQLite cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); - cmd.Parameters.Add(new SqliteParameter(":InvType", asset.InvType)); cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); @@ -158,7 +157,6 @@ namespace OpenSim.Data.SQLite cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); - cmd.Parameters.Add(new SqliteParameter(":InvType", asset.InvType)); cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); @@ -180,9 +178,9 @@ namespace OpenSim.Data.SQLite int assetLength = (asset.Data != null) ? asset.Data.Length : 0; m_log.Info("[ASSET DB]: " + - string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)", + string.Format("Loaded {6} {5} Asset: [{0}][{3}] \"{1}\":{2} ({7} bytes)", asset.FullID, asset.Name, asset.Description, asset.Type, - asset.InvType, temporary, local, assetLength)); + temporary, local, assetLength)); } /// @@ -258,7 +256,6 @@ namespace OpenSim.Data.SQLite // SQLiteUtil.createCol(assets, "Name", typeof (String)); // SQLiteUtil.createCol(assets, "Description", typeof (String)); // SQLiteUtil.createCol(assets, "Type", typeof (Int32)); - // SQLiteUtil.createCol(assets, "InvType", typeof (Int32)); // SQLiteUtil.createCol(assets, "Local", typeof (Boolean)); // SQLiteUtil.createCol(assets, "Temporary", typeof (Boolean)); // SQLiteUtil.createCol(assets, "Data", typeof (Byte[])); @@ -291,7 +288,6 @@ namespace OpenSim.Data.SQLite asset.Name = (String) row["Name"]; asset.Description = (String) row["Description"]; asset.Type = Convert.ToSByte(row["Type"]); - asset.InvType = Convert.ToSByte(row["InvType"]); asset.Local = Convert.ToBoolean(row["Local"]); asset.Temporary = Convert.ToBoolean(row["Temporary"]); asset.Data = (byte[]) row["Data"]; diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 2b37daaedc..c3e4095f24 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -76,15 +76,6 @@ namespace OpenSim.Framework set { _type = value; } } - /// - /// PLEASE DON'T USE ME. I'm probably going away soon. - /// - public virtual sbyte InvType - { - get { return _invtype; } - set { _invtype = value; } - } - public virtual string Name { get { return _name; } diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 95af28b604..f160ce40c3 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -701,7 +701,6 @@ namespace OpenSim.Framework.Communications.Cache Data = aBase.Data; FullID = aBase.FullID; Type = aBase.Type; - InvType = aBase.InvType; Name = aBase.Name; Description = aBase.Description; } @@ -718,7 +717,6 @@ namespace OpenSim.Framework.Communications.Cache Data = aBase.Data; FullID = aBase.FullID; Type = aBase.Type; - InvType = aBase.InvType; Name = aBase.Name; Description = aBase.Description; } diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 5aba086898..7350d4d38d 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -670,7 +670,6 @@ namespace OpenSim.Framework.Communications.Capabilities asset = new AssetBase(); asset.FullID = assetID; asset.Type = assType; - asset.InvType = inType; asset.Name = assetName; asset.Data = data; m_assetCache.AddAsset(asset); diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs index f2185abf3d..bc1d710df1 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -216,7 +216,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction ourClient = remoteClient; Asset = new AssetBase(); Asset.FullID = assetID; - Asset.InvType = type; Asset.Type = type; Asset.Data = data; Asset.Name = "blank"; @@ -314,7 +313,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction Asset.Name = name; Asset.Description = description; Asset.Type = type; - Asset.InvType = invType; m_createItem = true; if (m_finished) { @@ -351,7 +349,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction asset.FullID = LLUUID.Random(); asset.Name = item.Name; asset.Description = item.Description; - asset.InvType = (sbyte) item.InvType; asset.Type = (sbyte) item.AssetType; item.AssetID = asset.FullID;