aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTleiades Hax2007-10-13 09:10:53 +0000
committerTleiades Hax2007-10-13 09:10:53 +0000
commite8c1de8e7298e6c210a89b2449d636493f516c5e (patch)
treec22b35960503372c0a49675b82651d3a2d06c29c
parentAsset server implementation. Again one of these "plumbing" releases, where no... (diff)
downloadopensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.zip
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.gz
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.bz2
opensim-SC_OLD-e8c1de8e7298e6c210a89b2449d636493f516c5e.tar.xz
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLAssetData.cs23
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs7
-rw-r--r--OpenSim/Framework/Data.MySQL/Resources/CreateAssetsTable.sql4
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs4
4 files changed, 31 insertions, 7 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
index 70e04b6..5a169ac 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLAssetData.cs
@@ -40,9 +40,28 @@ namespace OpenSim.Framework.Data.MySQL
40 40
41 } 41 }
42 42
43 public AssetBase FetchAsset(LLUUID uuid) 43 public AssetBase FetchAsset(LLUUID assetID)
44 { 44 {
45 throw new Exception("The method or operation is not implemented."); 45 AssetBase asset = null;
46
47 MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
48 MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
49 p.Value = assetID.GetBytes();
50 using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
51 {
52 if (dbReader.Read())
53 {
54 asset = new AssetBase();
55 asset.Data = (byte[])dbReader["data"];
56 asset.Description = (string)dbReader["description"];
57 asset.FullID = assetID;
58 asset.InvType = (sbyte)dbReader["invType"];
59 asset.Local = ((sbyte)dbReader["local"])!=0?true:false;
60 asset.Name = (string)dbReader["name"];
61 asset.Type = (sbyte)dbReader["assetType"];
62 }
63 }
64 return asset;
46 } 65 }
47 66
48 public void CreateAsset(AssetBase asset) 67 public void CreateAsset(AssetBase asset)
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
index 6423f28..7bd1273 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
@@ -225,10 +225,13 @@ namespace OpenSim.Framework.Data.MySQL
225 MySqlDataReader reader = result.ExecuteReader(); 225 MySqlDataReader reader = result.ExecuteReader();
226 226
227 List<InventoryFolderBase> items = new List<InventoryFolderBase>(); 227 List<InventoryFolderBase> items = new List<InventoryFolderBase>();
228 while(reader.Read()) 228 while (reader.Read())
229 items.Add(readInventoryFolder(reader)); 229 items.Add(readInventoryFolder(reader));
230 230
231 InventoryFolderBase rootFolder = items[0]; //should only be one folder with parent set to zero (the root one). 231 InventoryFolderBase rootFolder = null;
232 if (items.Count > 0)
233 rootFolder = items[0]; //should only be one folder with parent set to zero (the root one).
234
232 reader.Close(); 235 reader.Close();
233 result.Dispose(); 236 result.Dispose();
234 237
diff --git a/OpenSim/Framework/Data.MySQL/Resources/CreateAssetsTable.sql b/OpenSim/Framework/Data.MySQL/Resources/CreateAssetsTable.sql
index 049a3a2..3b6fff2 100644
--- a/OpenSim/Framework/Data.MySQL/Resources/CreateAssetsTable.sql
+++ b/OpenSim/Framework/Data.MySQL/Resources/CreateAssetsTable.sql
@@ -2,8 +2,8 @@ CREATE TABLE `assets` (
2 `id` binary(16) NOT NULL, 2 `id` binary(16) NOT NULL,
3 `name` varchar(64) NOT NULL, 3 `name` varchar(64) NOT NULL,
4 `description` varchar(64) NOT NULL, 4 `description` varchar(64) NOT NULL,
5 `assetType` smallint(5) unsigned NOT NULL, 5 `assetType` TINYINT(4) NOT NULL,
6 `invType` smallint(5) unsigned NOT NULL, 6 `invType` TINYINT(4) NOT NULL,
7 `local` tinyint(1) NOT NULL, 7 `local` tinyint(1) NOT NULL,
8 `temporary` tinyint(1) NOT NULL, 8 `temporary` tinyint(1) NOT NULL,
9 `data` longblob NOT NULL, 9 `data` longblob NOT NULL,
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 20152d8..7af8064 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -80,6 +80,7 @@ namespace OpenSim
80 private string standaloneWelcomeMessage = null; 80 private string standaloneWelcomeMessage = null;
81 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 81 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
82 private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll"; 82 private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
83 private string standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll";
83 84
84 private string m_assetStorage = "db4o"; 85 private string m_assetStorage = "db4o";
85 86
@@ -131,6 +132,7 @@ namespace OpenSim
131 standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false); 132 standaloneAuthenticate = configSource.Configs["StandAlone"].GetBoolean("accounts_authenticate", false);
132 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim"); 133 standaloneWelcomeMessage = configSource.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
133 standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll"); 134 standaloneInventoryPlugin = configSource.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
135 standaloneAssetPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.SQLite.dll");
134 standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll"); 136 standaloneUserPlugin = configSource.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
135 137
136 m_networkServersInfo.loadFromConfiguration(configSource); 138 m_networkServersInfo.loadFromConfiguration(configSource);
@@ -283,7 +285,7 @@ namespace OpenSim
283 } 285 }
284 else 286 else
285 { 287 {
286 assetServer = new SQLAssetServer("OpenSim.Framework.Data.SQLite.dll"); 288 assetServer = new SQLAssetServer(standaloneAssetPlugin);
287 } 289 }
288 assetServer.SetServerInfo(m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); 290 assetServer.SetServerInfo(m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
289 m_assetCache = new AssetCache(assetServer); 291 m_assetCache = new AssetCache(assetServer);