Switch prim items type representation to use int rather than strings.

ThreadPoolClientBranch
Justin Clarke Casey 2008-01-11 14:55:27 +00:00
parent 8ccc470e2a
commit 1e981a7c1c
5 changed files with 17 additions and 22 deletions

View File

@ -690,8 +690,8 @@ namespace OpenSim.Framework.Data.SQLite
createCol(items, "assetID", typeof (String)); createCol(items, "assetID", typeof (String));
createCol(items, "parentFolderID", typeof (String)); createCol(items, "parentFolderID", typeof (String));
createCol(items, "invType", typeof (String)); createCol(items, "invType", typeof (Int32));
createCol(items, "assetType", typeof (String)); createCol(items, "assetType", typeof (Int32));
createCol(items, "name", typeof (String)); createCol(items, "name", typeof (String));
createCol(items, "description", typeof (String)); createCol(items, "description", typeof (String));
@ -895,8 +895,8 @@ namespace OpenSim.Framework.Data.SQLite
taskItem.asset_id = new LLUUID((String)row["assetID"]); taskItem.asset_id = new LLUUID((String)row["assetID"]);
taskItem.parent_id = new LLUUID((String)row["parentFolderID"]); taskItem.parent_id = new LLUUID((String)row["parentFolderID"]);
taskItem.inv_type = (String)row["invType"]; taskItem.inv_type = Convert.ToInt32(row["invType"]);
taskItem.type = (String)row["assetType"]; taskItem.type = Convert.ToInt32(row["assetType"]);
taskItem.name = (String)row["name"]; taskItem.name = (String)row["name"];
taskItem.desc = (String)row["description"]; taskItem.desc = (String)row["description"];

View File

@ -89,8 +89,8 @@ namespace OpenSim.Framework
public LLUUID group_id = LLUUID.Zero; public LLUUID group_id = LLUUID.Zero;
public LLUUID asset_id = LLUUID.Zero; public LLUUID asset_id = LLUUID.Zero;
public string type = ""; public int type = 0;
public string inv_type = ""; public int inv_type = 0;
public uint flags = 0; public uint flags = 0;
public string name = ""; public string name = "";
public string desc = ""; public string desc = "";

View File

@ -175,8 +175,8 @@ namespace OpenSim.Region.Environment.Scenes
taskItem.desc = item.inventoryDescription; taskItem.desc = item.inventoryDescription;
taskItem.owner_id = item.avatarID; taskItem.owner_id = item.avatarID;
taskItem.creator_id = item.creatorsID; taskItem.creator_id = item.creatorsID;
taskItem.type = TaskInventoryItem.Types[item.assetType]; taskItem.type = item.assetType;
taskItem.inv_type = TaskInventoryItem.InvTypes[item.invType]; taskItem.inv_type = item.invType;
part.AddInventoryItem(taskItem); part.AddInventoryItem(taskItem);
// It might seem somewhat crude to update the whole group for a single prim inventory change, // It might seem somewhat crude to update the whole group for a single prim inventory change,

View File

@ -89,7 +89,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
foreach (TaskInventoryItem item in m_taskInventory.Values) foreach (TaskInventoryItem item in m_taskInventory.Values)
{ {
if ("lsltext" == item.type) // XXX more hardcoding badness. Should be an enum in TaskInventoryItem
if (10 == item.type)
{ {
StartScript(item); StartScript(item);
} }
@ -251,17 +252,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (m_taskInventory.ContainsKey(itemID)) if (m_taskInventory.ContainsKey(itemID))
{ {
string type = m_taskInventory[itemID].inv_type; int type = m_taskInventory[itemID].inv_type;
m_taskInventory.Remove(itemID); m_taskInventory.Remove(itemID);
m_inventorySerial++; m_inventorySerial++;
if (type == "lsltext")
{ return type;
return 10;
}
else
{
return 0;
}
} }
else else
{ {
@ -317,8 +312,8 @@ namespace OpenSim.Region.Environment.Scenes
invString.AddSectionEnd(); invString.AddSectionEnd();
invString.AddNameValueLine("asset_id", item.asset_id.ToString()); invString.AddNameValueLine("asset_id", item.asset_id.ToString());
invString.AddNameValueLine("type", item.type); invString.AddNameValueLine("type", TaskInventoryItem.Types[item.type]);
invString.AddNameValueLine("inv_type", item.inv_type); invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.inv_type]);
invString.AddNameValueLine("flags", "0x00"); invString.AddNameValueLine("flags", "0x00");
invString.AddNameValueLine("name", item.name + "|"); invString.AddNameValueLine("name", item.name + "|");
invString.AddNameValueLine("desc", item.desc + "|"); invString.AddNameValueLine("desc", item.desc + "|");

View File

@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment
{ {
IRegionDataStore plug = IRegionDataStore plug =
(IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); (IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise(connectionstring, false); plug.Initialise(connectionstring, true);
m_dataStore = plug; m_dataStore = plug;