mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
Very early first implementation of grid based assets.
Run this on a major grid, and weep
This commit is contained in:
@@ -71,22 +71,24 @@ namespace OpenSim.Framework.Data.MySQL
|
||||
public AssetBase FetchAsset(LLUUID assetID)
|
||||
{
|
||||
AssetBase asset = null;
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
|
||||
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
||||
p.Value = assetID.GetBytes();
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
|
||||
lock (_dbConnection)
|
||||
{
|
||||
if (dbReader.Read())
|
||||
MySqlCommand cmd = new MySqlCommand("SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection);
|
||||
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
|
||||
p.Value = assetID.GetBytes();
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow))
|
||||
{
|
||||
asset = new AssetBase();
|
||||
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"];
|
||||
if (dbReader.Read())
|
||||
{
|
||||
asset = new AssetBase();
|
||||
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"];
|
||||
}
|
||||
}
|
||||
}
|
||||
return asset;
|
||||
|
||||
Reference in New Issue
Block a user