mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Data.SqliteClient;
|
||||
using OpenSim.Framework;
|
||||
@@ -87,7 +87,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">UUID of ... ?</param>
|
||||
/// <returns>Asset base</returns>
|
||||
override public AssetBase FetchAsset(LLUUID uuid)
|
||||
override public AssetBase FetchAsset(UUID uuid)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
@@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">The asset UUID</param>
|
||||
/// <returns>True if exist, or false.</returns>
|
||||
override public bool ExistsAsset(LLUUID uuid)
|
||||
override public bool ExistsAsset(UUID uuid)
|
||||
{
|
||||
lock (this) {
|
||||
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
|
||||
@@ -217,7 +217,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Delete an asset from database
|
||||
/// </summary>
|
||||
/// <param name="uuid"></param>
|
||||
public void DeleteAsset(LLUUID uuid)
|
||||
public void DeleteAsset(UUID uuid)
|
||||
{
|
||||
using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
|
||||
{
|
||||
@@ -239,7 +239,7 @@ namespace OpenSim.Data.SQLite
|
||||
// back out. Not enough time to figure it out yet.
|
||||
AssetBase asset = new AssetBase();
|
||||
|
||||
asset.FullID = new LLUUID((String) row["UUID"]);
|
||||
asset.FullID = new UUID((String) row["UUID"]);
|
||||
asset.Name = (String) row["Name"];
|
||||
asset.Description = (String) row["Description"];
|
||||
asset.Type = Convert.ToSByte(row["Type"]);
|
||||
|
||||
@@ -31,7 +31,7 @@ using System.Data;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using Mono.Data.SqliteClient;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
@@ -83,7 +83,7 @@ namespace OpenSim.Data.SQLite
|
||||
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
|
||||
}
|
||||
|
||||
public EstateSettings LoadEstateSettings(LLUUID regionID)
|
||||
public EstateSettings LoadEstateSettings(UUID regionID)
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
@@ -109,11 +109,11 @@ namespace OpenSim.Data.SQLite
|
||||
else
|
||||
m_FieldMap[name].SetValue(es, false);
|
||||
}
|
||||
else if (m_FieldMap[name].GetValue(es) is libsecondlife.LLUUID)
|
||||
else if(m_FieldMap[name].GetValue(es) is OpenMetaverse.UUID)
|
||||
{
|
||||
LLUUID uuid = LLUUID.Zero;
|
||||
UUID uuid = UUID.Zero;
|
||||
|
||||
LLUUID.TryParse(r[name].ToString(), out uuid);
|
||||
UUID.TryParse(r[name].ToString(), out uuid);
|
||||
m_FieldMap[name].SetValue(es, uuid);
|
||||
}
|
||||
else
|
||||
@@ -258,8 +258,8 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
EstateBan eb = new EstateBan();
|
||||
|
||||
LLUUID uuid = new LLUUID();
|
||||
LLUUID.TryParse(r["bannedUUID"].ToString(), out uuid);
|
||||
UUID uuid = new UUID();
|
||||
UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
|
||||
|
||||
eb.bannedUUID = uuid;
|
||||
eb.bannedIP = "0.0.0.0";
|
||||
@@ -292,7 +292,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
}
|
||||
|
||||
void SaveUUIDList(uint EstateID, string table, LLUUID[] data)
|
||||
void SaveUUIDList(uint EstateID, string table, UUID[] data)
|
||||
{
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
cmd.CommandText = "insert into "+table+" (EstateID, uuid) values ( :EstateID, :uuid )";
|
||||
|
||||
foreach (LLUUID uuid in data)
|
||||
foreach (UUID uuid in data)
|
||||
{
|
||||
cmd.Parameters.Add(":EstateID", EstateID.ToString());
|
||||
cmd.Parameters.Add(":uuid", uuid.ToString());
|
||||
@@ -315,9 +315,9 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
}
|
||||
|
||||
LLUUID[] LoadUUIDList(uint EstateID, string table)
|
||||
UUID[] LoadUUIDList(uint EstateID, string table)
|
||||
{
|
||||
List<LLUUID> uuids = new List<LLUUID>();
|
||||
List<UUID> uuids = new List<UUID>();
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
@@ -330,8 +330,8 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
// EstateBan eb = new EstateBan();
|
||||
|
||||
LLUUID uuid = new LLUUID();
|
||||
LLUUID.TryParse(r["uuid"].ToString(), out uuid);
|
||||
UUID uuid = new UUID();
|
||||
UUID.TryParse(r["uuid"].ToString(), out uuid);
|
||||
|
||||
uuids.Add(uuid);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ using System.Data;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">The region UUID</param>
|
||||
/// <returns>The sim profile</returns>
|
||||
override public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
|
||||
override public RegionProfileData GetProfileByUUID(UUID uuid)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
param["uuid"] = uuid.ToString();
|
||||
@@ -181,7 +181,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Returns a list of avatar and UUIDs that match the query
|
||||
/// </summary>
|
||||
/// <remarks>do nothing yet</remarks>
|
||||
public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
|
||||
public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query)
|
||||
{
|
||||
//Do nothing yet
|
||||
List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
|
||||
@@ -217,14 +217,14 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="handle">The attempted regionHandle of the challenger</param>
|
||||
/// <param name="authkey">The secret</param>
|
||||
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
|
||||
override public bool AuthenticateSim(LLUUID uuid, ulong handle, string authkey)
|
||||
override public bool AuthenticateSim(UUID uuid, ulong handle, string authkey)
|
||||
{
|
||||
bool throwHissyFit = false; // Should be true by 1.0
|
||||
|
||||
if (throwHissyFit)
|
||||
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
|
||||
|
||||
RegionProfileData data = GetProfileByLLUUID(uuid);
|
||||
RegionProfileData data = GetProfileByUUID(uuid);
|
||||
|
||||
return (handle == data.regionHandle && authkey == data.regionSecret);
|
||||
}
|
||||
@@ -238,7 +238,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="authhash"></param>
|
||||
/// <param name="challenge"></param>
|
||||
/// <returns></returns>
|
||||
public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge)
|
||||
public bool AuthenticateSim(UUID uuid, ulong handle, string authhash, string challenge)
|
||||
{
|
||||
// SHA512Managed HashProvider = new SHA512Managed();
|
||||
// Encoding TextProvider = new UTF8Encoding();
|
||||
|
||||
@@ -29,7 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Data.SqliteClient;
|
||||
using OpenSim.Framework;
|
||||
@@ -109,13 +109,13 @@ namespace OpenSim.Data.SQLite
|
||||
public InventoryItemBase buildItem(DataRow row)
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
item.ID = new LLUUID((string) row["UUID"]);
|
||||
item.AssetID = new LLUUID((string) row["assetID"]);
|
||||
item.ID = new UUID((string) row["UUID"]);
|
||||
item.AssetID = new UUID((string) row["assetID"]);
|
||||
item.AssetType = Convert.ToInt32(row["assetType"]);
|
||||
item.InvType = Convert.ToInt32(row["invType"]);
|
||||
item.Folder = new LLUUID((string) row["parentFolderID"]);
|
||||
item.Owner = new LLUUID((string) row["avatarID"]);
|
||||
item.Creator = new LLUUID((string) row["creatorsID"]);
|
||||
item.Folder = new UUID((string) row["parentFolderID"]);
|
||||
item.Owner = new UUID((string) row["avatarID"]);
|
||||
item.Creator = new UUID((string) row["creatorsID"]);
|
||||
item.Name = (string) row["inventoryName"];
|
||||
item.Description = (string) row["inventoryDescription"];
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim.Data.SQLite
|
||||
item.CreationDate = Convert.ToInt32(row["creationDate"]);
|
||||
|
||||
if (!Convert.IsDBNull(row["groupID"]))
|
||||
item.GroupID = new LLUUID((string)row["groupID"]);
|
||||
item.GroupID = new UUID((string)row["groupID"]);
|
||||
|
||||
if (!Convert.IsDBNull(row["groupOwned"]))
|
||||
item.GroupOwned = Convert.ToBoolean(row["groupOwned"]);
|
||||
@@ -317,7 +317,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="folderID">The UUID of the target folder</param>
|
||||
/// <returns>A List of InventoryItemBase items</returns>
|
||||
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
|
||||
public List<InventoryItemBase> getInventoryInFolder(UUID folderID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -339,20 +339,20 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="user">The user whos inventory is to be searched</param>
|
||||
/// <returns>A list of folder objects</returns>
|
||||
public List<InventoryFolderBase> getUserRootFolders(LLUUID user)
|
||||
public List<InventoryFolderBase> getUserRootFolders(UUID user)
|
||||
{
|
||||
return new List<InventoryFolderBase>();
|
||||
}
|
||||
|
||||
// see InventoryItemBase.getUserRootFolder
|
||||
public InventoryFolderBase getUserRootFolder(LLUUID user)
|
||||
public InventoryFolderBase getUserRootFolder(UUID user)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
|
||||
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
|
||||
string selectExp = "agentID = '" + Util.ToRawUuidString(user) + "' AND parentID = '" +
|
||||
Util.ToRawUuidString(LLUUID.Zero) + "'";
|
||||
Util.ToRawUuidString(UUID.Zero) + "'";
|
||||
DataRow[] rows = inventoryFolderTable.Select(selectExp);
|
||||
foreach (DataRow row in rows)
|
||||
{
|
||||
@@ -378,7 +378,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="folders">list where folders will be appended</param>
|
||||
/// <param name="parentID">ID of parent</param>
|
||||
protected void getInventoryFolders(ref List<InventoryFolderBase> folders, LLUUID parentID)
|
||||
protected void getInventoryFolders(ref List<InventoryFolderBase> folders, UUID parentID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -398,7 +398,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="parentID">The folder to get subfolders for</param>
|
||||
/// <returns>A list of inventory folders</returns>
|
||||
public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID)
|
||||
public List<InventoryFolderBase> getInventoryFolders(UUID parentID)
|
||||
{
|
||||
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
|
||||
getInventoryFolders(ref folders, Util.ToRawUuidString(parentID));
|
||||
@@ -410,7 +410,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="parentID"></param>
|
||||
/// <returns></returns>
|
||||
public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID)
|
||||
public List<InventoryFolderBase> getFolderHierarchy(UUID parentID)
|
||||
{
|
||||
/* Note: There are subtle changes between this implementation of getFolderHierarchy and the previous one
|
||||
* - We will only need to hit the database twice instead of n times.
|
||||
@@ -441,7 +441,7 @@ namespace OpenSim.Data.SQLite
|
||||
if (parentRow.GetLength(0) >= 1) // No result means parent folder does not exist
|
||||
{
|
||||
parentFolder = buildFolder(parentRow[0]);
|
||||
LLUUID agentID = parentFolder.Owner;
|
||||
UUID agentID = parentFolder.Owner;
|
||||
selectExp = "agentID = '" + Util.ToRawUuidString(agentID) + "'";
|
||||
folderRows = inventoryFolderTable.Select(selectExp);
|
||||
}
|
||||
@@ -451,7 +451,7 @@ namespace OpenSim.Data.SQLite
|
||||
/* if we're querying the root folder, just return an unordered list of all folders in the user's
|
||||
* inventory
|
||||
*/
|
||||
if (parentFolder.ParentID == LLUUID.Zero)
|
||||
if (parentFolder.ParentID == UUID.Zero)
|
||||
{
|
||||
foreach (DataRow row in folderRows)
|
||||
{
|
||||
@@ -470,13 +470,13 @@ namespace OpenSim.Data.SQLite
|
||||
{ // Querying a non-root folder
|
||||
|
||||
// Build a hash table of all user's inventory folders, indexed by each folder's parent ID
|
||||
Dictionary<LLUUID, List<InventoryFolderBase>> hashtable =
|
||||
new Dictionary<LLUUID, List<InventoryFolderBase>>(folderRows.GetLength(0));
|
||||
Dictionary<UUID, List<InventoryFolderBase>> hashtable =
|
||||
new Dictionary<UUID, List<InventoryFolderBase>>(folderRows.GetLength(0));
|
||||
|
||||
foreach (DataRow row in folderRows)
|
||||
{
|
||||
InventoryFolderBase curFolder = buildFolder(row);
|
||||
if (curFolder.ParentID != LLUUID.Zero) // Discard root of tree - not needed
|
||||
if (curFolder.ParentID != UUID.Zero) // Discard root of tree - not needed
|
||||
{
|
||||
if (hashtable.ContainsKey(curFolder.ParentID))
|
||||
{
|
||||
@@ -514,7 +514,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="item">The UUID of the item to be returned</param>
|
||||
/// <returns>A class containing item information</returns>
|
||||
public InventoryItemBase getInventoryItem(LLUUID item)
|
||||
public InventoryItemBase getInventoryItem(UUID item)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -535,7 +535,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="folder">The UUID of the folder to be returned</param>
|
||||
/// <returns>A class containing folder information</returns>
|
||||
public InventoryFolderBase getInventoryFolder(LLUUID folder)
|
||||
public InventoryFolderBase getInventoryFolder(UUID folder)
|
||||
{
|
||||
// TODO: Deep voodoo here. If you enable this code then
|
||||
// multi region breaks. No idea why, but I figured it was
|
||||
@@ -578,7 +578,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Delete an inventory item
|
||||
/// </summary>
|
||||
/// <param name="item">The item UUID</param>
|
||||
public void deleteInventoryItem(LLUUID itemID)
|
||||
public void deleteInventoryItem(UUID itemID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -599,7 +599,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="folderId">id of the folder, whose item content should be deleted</param>
|
||||
/// <todo>this is horribly inefficient, but I don't want to ruin the overall structure of this implementation</todo>
|
||||
private void deleteItemsInFolder(LLUUID folderId)
|
||||
private void deleteItemsInFolder(UUID folderId)
|
||||
{
|
||||
List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId));
|
||||
|
||||
@@ -641,7 +641,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// This will clean-up any child folders and child items as well
|
||||
/// </remarks>
|
||||
/// <param name="folderID">the folder UUID</param>
|
||||
public void deleteInventoryFolder(LLUUID folderID)
|
||||
public void deleteInventoryFolder(UUID folderID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -791,10 +791,10 @@ namespace OpenSim.Data.SQLite
|
||||
private static InventoryFolderBase buildFolder(DataRow row)
|
||||
{
|
||||
InventoryFolderBase folder = new InventoryFolderBase();
|
||||
folder.ID = new LLUUID((string) row["UUID"]);
|
||||
folder.ID = new UUID((string) row["UUID"]);
|
||||
folder.Name = (string) row["name"];
|
||||
folder.Owner = new LLUUID((string) row["agentID"]);
|
||||
folder.ParentID = new LLUUID((string) row["parentID"]);
|
||||
folder.Owner = new UUID((string) row["agentID"]);
|
||||
folder.ParentID = new UUID((string) row["parentID"]);
|
||||
folder.Type = Convert.ToInt16(row["type"]);
|
||||
folder.Version = Convert.ToUInt16(row["version"]);
|
||||
return folder;
|
||||
|
||||
@@ -30,7 +30,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SQLite;
|
||||
using System.Reflection;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
@@ -118,7 +118,7 @@ namespace OpenSim.Data.SQLite
|
||||
// Region Main
|
||||
retval.regionHandle = (ulong) reader["regionHandle"];
|
||||
retval.regionName = (string) reader["regionName"];
|
||||
retval.UUID = new LLUUID((string) reader["uuid"]);
|
||||
retval.UUID = new UUID((string) reader["uuid"]);
|
||||
|
||||
// Secrets
|
||||
retval.regionRecvKey = (string) reader["regionRecvKey"];
|
||||
@@ -182,7 +182,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
parameters["regionHandle"] = profile.regionHandle.ToString();
|
||||
parameters["regionName"] = profile.regionName;
|
||||
parameters["uuid"] = profile.UUID.ToString();
|
||||
parameters["uuid"] = profile.ToString();
|
||||
parameters["regionRecvKey"] = profile.regionRecvKey;
|
||||
parameters["regionSendKey"] = profile.regionSendKey;
|
||||
parameters["regionDataURI"] = profile.regionDataURI;
|
||||
|
||||
@@ -31,7 +31,7 @@ using System.Data;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Data.SqliteClient;
|
||||
using OpenSim.Framework;
|
||||
@@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
}
|
||||
|
||||
public RegionSettings LoadRegionSettings(LLUUID regionUUID)
|
||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -200,15 +200,15 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="obj">the object</param>
|
||||
/// <param name="regionUUID">the region UUID</param>
|
||||
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
|
||||
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
foreach (SceneObjectPart prim in obj.Children.Values)
|
||||
{
|
||||
if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0)
|
||||
if ((prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0
|
||||
&& (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0)
|
||||
{
|
||||
//m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
|
||||
@@ -235,9 +235,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="obj">the object</param>
|
||||
/// <param name="regionUUID">the region UUID</param>
|
||||
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
|
||||
public void RemoveObject(UUID obj, UUID regionUUID)
|
||||
{
|
||||
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.Guid, regionUUID);
|
||||
|
||||
DataTable prims = ds.Tables["prims"];
|
||||
DataTable shapes = ds.Tables["primshapes"];
|
||||
@@ -249,7 +249,7 @@ namespace OpenSim.Data.SQLite
|
||||
foreach (DataRow row in primRows)
|
||||
{
|
||||
// Remove shape rows
|
||||
LLUUID uuid = new LLUUID((string) row["UUID"]);
|
||||
UUID uuid = new UUID((string) row["UUID"]);
|
||||
DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(uuid));
|
||||
if (shapeRow != null)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// The caller must acquire the necessrary synchronization locks and commit or rollback changes.
|
||||
/// </summary>
|
||||
/// <param name="uuid">The item UUID</param>
|
||||
private void RemoveItems(LLUUID uuid)
|
||||
private void RemoveItems(UUID uuid)
|
||||
{
|
||||
DataTable items = ds.Tables["primitems"];
|
||||
|
||||
@@ -289,9 +289,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="regionUUID">The region UUID</param>
|
||||
/// <returns>List of loaded groups</returns>
|
||||
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
|
||||
public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
|
||||
{
|
||||
Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>();
|
||||
Dictionary<UUID, SceneObjectGroup> createdObjects = new Dictionary<UUID, SceneObjectGroup>();
|
||||
|
||||
List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace OpenSim.Data.SQLite
|
||||
"[REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
prim.Shape = PrimitiveBaseShape.Default;
|
||||
}
|
||||
createdObjects[new LLUUID(objID)].AddPart(prim);
|
||||
createdObjects[new UUID(objID)].AddPart(prim);
|
||||
}
|
||||
|
||||
LoadItems(prim);
|
||||
@@ -379,7 +379,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
|
||||
String sql = String.Format("primID = '{0}'", prim.ToString());
|
||||
DataRow[] dbItemRows = dbItems.Select(sql);
|
||||
|
||||
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
|
||||
@@ -407,7 +407,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="ter">terrain heightfield</param>
|
||||
/// <param name="regionID">region UUID</param>
|
||||
public void StoreTerrain(double[,] ter, LLUUID regionID)
|
||||
public void StoreTerrain(double[,] ter, UUID regionID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -451,7 +451,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="regionID">the region UUID</param>
|
||||
/// <returns>Heightfield data</returns>
|
||||
public double[,] LoadTerrain(LLUUID regionID)
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -499,7 +499,7 @@ namespace OpenSim.Data.SQLite
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="globalID"></param>
|
||||
public void RemoveLandObject(LLUUID globalID)
|
||||
public void RemoveLandObject(UUID globalID)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -563,7 +563,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="regionUUID"></param>
|
||||
/// <returns></returns>
|
||||
public List<LandData> LoadLandObjects(LLUUID regionUUID)
|
||||
public List<LandData> LoadLandObjects(UUID regionUUID)
|
||||
{
|
||||
List<LandData> landDataForRegion = new List<LandData>();
|
||||
lock (ds)
|
||||
@@ -821,12 +821,12 @@ namespace OpenSim.Data.SQLite
|
||||
createCol(land, "IsGroupOwned", typeof (Boolean));
|
||||
createCol(land, "Area", typeof (Int32));
|
||||
createCol(land, "AuctionID", typeof (Int32)); //Unemplemented
|
||||
createCol(land, "Category", typeof (Int32)); //Enum libsecondlife.Parcel.ParcelCategory
|
||||
createCol(land, "Category", typeof (Int32)); //Enum OpenMetaverse.Parcel.ParcelCategory
|
||||
createCol(land, "ClaimDate", typeof (Int32));
|
||||
createCol(land, "ClaimPrice", typeof (Int32));
|
||||
createCol(land, "GroupUUID", typeof (string));
|
||||
createCol(land, "SalePrice", typeof (Int32));
|
||||
createCol(land, "LandStatus", typeof (Int32)); //Enum. libsecondlife.Parcel.ParcelStatus
|
||||
createCol(land, "LandStatus", typeof (Int32)); //Enum. OpenMetaverse.Parcel.ParcelStatus
|
||||
createCol(land, "LandFlags", typeof (UInt32));
|
||||
createCol(land, "LandingType", typeof (Byte));
|
||||
createCol(land, "MediaAutoScale", typeof (Byte));
|
||||
@@ -882,7 +882,7 @@ namespace OpenSim.Data.SQLite
|
||||
// interesting has to be done to actually get these values
|
||||
// back out. Not enough time to figure it out yet.
|
||||
SceneObjectPart prim = new SceneObjectPart();
|
||||
prim.UUID = new LLUUID((String) row["UUID"]);
|
||||
prim.UUID = new UUID((String) row["UUID"]);
|
||||
// explicit conversion of integers is required, which sort
|
||||
// of sucks. No idea if there is a shortcut here or not.
|
||||
prim.ParentID = Convert.ToUInt32(row["ParentID"]);
|
||||
@@ -895,43 +895,43 @@ namespace OpenSim.Data.SQLite
|
||||
prim.TouchName = (String) row["TouchName"];
|
||||
// permissions
|
||||
prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]);
|
||||
prim.CreatorID = new LLUUID((String) row["CreatorID"]);
|
||||
prim.OwnerID = new LLUUID((String) row["OwnerID"]);
|
||||
prim.GroupID = new LLUUID((String) row["GroupID"]);
|
||||
prim.LastOwnerID = new LLUUID((String) row["LastOwnerID"]);
|
||||
prim.CreatorID = new UUID((String) row["CreatorID"]);
|
||||
prim.OwnerID = new UUID((String) row["OwnerID"]);
|
||||
prim.GroupID = new UUID((String) row["GroupID"]);
|
||||
prim.LastOwnerID = new UUID((String) row["LastOwnerID"]);
|
||||
prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]);
|
||||
prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]);
|
||||
prim.GroupMask = Convert.ToUInt32(row["GroupMask"]);
|
||||
prim.EveryoneMask = Convert.ToUInt32(row["EveryoneMask"]);
|
||||
prim.BaseMask = Convert.ToUInt32(row["BaseMask"]);
|
||||
// vectors
|
||||
prim.OffsetPosition = new LLVector3(
|
||||
prim.OffsetPosition = new Vector3(
|
||||
Convert.ToSingle(row["PositionX"]),
|
||||
Convert.ToSingle(row["PositionY"]),
|
||||
Convert.ToSingle(row["PositionZ"])
|
||||
);
|
||||
prim.GroupPosition = new LLVector3(
|
||||
prim.GroupPosition = new Vector3(
|
||||
Convert.ToSingle(row["GroupPositionX"]),
|
||||
Convert.ToSingle(row["GroupPositionY"]),
|
||||
Convert.ToSingle(row["GroupPositionZ"])
|
||||
);
|
||||
prim.Velocity = new LLVector3(
|
||||
prim.Velocity = new Vector3(
|
||||
Convert.ToSingle(row["VelocityX"]),
|
||||
Convert.ToSingle(row["VelocityY"]),
|
||||
Convert.ToSingle(row["VelocityZ"])
|
||||
);
|
||||
prim.AngularVelocity = new LLVector3(
|
||||
prim.AngularVelocity = new Vector3(
|
||||
Convert.ToSingle(row["AngularVelocityX"]),
|
||||
Convert.ToSingle(row["AngularVelocityY"]),
|
||||
Convert.ToSingle(row["AngularVelocityZ"])
|
||||
);
|
||||
prim.Acceleration = new LLVector3(
|
||||
prim.Acceleration = new Vector3(
|
||||
Convert.ToSingle(row["AccelerationX"]),
|
||||
Convert.ToSingle(row["AccelerationY"]),
|
||||
Convert.ToSingle(row["AccelerationZ"])
|
||||
);
|
||||
// quaternions
|
||||
prim.RotationOffset = new LLQuaternion(
|
||||
prim.RotationOffset = new Quaternion(
|
||||
Convert.ToSingle(row["RotationX"]),
|
||||
Convert.ToSingle(row["RotationY"]),
|
||||
Convert.ToSingle(row["RotationZ"]),
|
||||
@@ -940,11 +940,11 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
try
|
||||
{
|
||||
prim.SitTargetPositionLL = new LLVector3(
|
||||
prim.SitTargetPositionLL = new Vector3(
|
||||
Convert.ToSingle(row["SitTargetOffsetX"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetY"]),
|
||||
Convert.ToSingle(row["SitTargetOffsetZ"]));
|
||||
prim.SitTargetOrientationLL = new LLQuaternion(
|
||||
prim.SitTargetOrientationLL = new Quaternion(
|
||||
Convert.ToSingle(
|
||||
row["SitTargetOrientX"]),
|
||||
Convert.ToSingle(
|
||||
@@ -993,10 +993,10 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
TaskInventoryItem taskItem = new TaskInventoryItem();
|
||||
|
||||
taskItem.ItemID = new LLUUID((String)row["itemID"]);
|
||||
taskItem.ParentPartID = new LLUUID((String)row["primID"]);
|
||||
taskItem.AssetID = new LLUUID((String)row["assetID"]);
|
||||
taskItem.ParentID = new LLUUID((String)row["parentFolderID"]);
|
||||
taskItem.ItemID = new UUID((String)row["itemID"]);
|
||||
taskItem.ParentPartID = new UUID((String)row["primID"]);
|
||||
taskItem.AssetID = new UUID((String)row["assetID"]);
|
||||
taskItem.ParentID = new UUID((String)row["parentFolderID"]);
|
||||
|
||||
taskItem.InvType = Convert.ToInt32(row["invType"]);
|
||||
taskItem.Type = Convert.ToInt32(row["assetType"]);
|
||||
@@ -1004,10 +1004,10 @@ namespace OpenSim.Data.SQLite
|
||||
taskItem.Name = (String)row["name"];
|
||||
taskItem.Description = (String)row["description"];
|
||||
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
|
||||
taskItem.CreatorID = new LLUUID((String)row["creatorID"]);
|
||||
taskItem.OwnerID = new LLUUID((String)row["ownerID"]);
|
||||
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
|
||||
taskItem.GroupID = new LLUUID((String)row["groupID"]);
|
||||
taskItem.CreatorID = new UUID((String)row["creatorID"]);
|
||||
taskItem.OwnerID = new UUID((String)row["ownerID"]);
|
||||
taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]);
|
||||
taskItem.GroupID = new UUID((String)row["groupID"]);
|
||||
|
||||
taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
|
||||
taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
|
||||
@@ -1028,7 +1028,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
LandData newData = new LandData();
|
||||
|
||||
newData.GlobalID = new LLUUID((String) row["UUID"]);
|
||||
newData.GlobalID = new UUID((String) row["UUID"]);
|
||||
newData.LocalID = Convert.ToInt32(row["LocalLandID"]);
|
||||
|
||||
// Bitmap is a byte[512]
|
||||
@@ -1041,17 +1041,17 @@ namespace OpenSim.Data.SQLite
|
||||
newData.Area = Convert.ToInt32(row["Area"]);
|
||||
newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented
|
||||
newData.Category = (Parcel.ParcelCategory) Convert.ToInt32(row["Category"]);
|
||||
//Enum libsecondlife.Parcel.ParcelCategory
|
||||
//Enum OpenMetaverse.Parcel.ParcelCategory
|
||||
newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
|
||||
newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
|
||||
newData.GroupID = new LLUUID((String) row["GroupUUID"]);
|
||||
newData.GroupID = new UUID((String) row["GroupUUID"]);
|
||||
newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
|
||||
newData.Status = (Parcel.ParcelStatus) Convert.ToInt32(row["LandStatus"]);
|
||||
//Enum. libsecondlife.Parcel.ParcelStatus
|
||||
//Enum. OpenMetaverse.Parcel.ParcelStatus
|
||||
newData.Flags = Convert.ToUInt32(row["LandFlags"]);
|
||||
newData.LandingType = (Byte) row["LandingType"];
|
||||
newData.MediaAutoScale = (Byte) row["MediaAutoScale"];
|
||||
newData.MediaID = new LLUUID((String) row["MediaTextureUUID"]);
|
||||
newData.MediaID = new UUID((String) row["MediaTextureUUID"]);
|
||||
newData.MediaURL = (String) row["MediaURL"];
|
||||
newData.MusicURL = (String) row["MusicURL"];
|
||||
newData.PassHours = Convert.ToSingle(row["PassHours"]);
|
||||
@@ -1061,25 +1061,25 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
||||
newData.UserLocation =
|
||||
new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
|
||||
new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
|
||||
Convert.ToSingle(row["UserLocationZ"]));
|
||||
newData.UserLookAt =
|
||||
new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
|
||||
new Vector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
|
||||
Convert.ToSingle(row["UserLookAtZ"]));
|
||||
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
|
||||
newData.UserLocation = LLVector3.Zero;
|
||||
newData.UserLookAt = LLVector3.Zero;
|
||||
newData.UserLocation = Vector3.Zero;
|
||||
newData.UserLookAt = Vector3.Zero;
|
||||
}
|
||||
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
|
||||
LLUUID authBuyerID = LLUUID.Zero;
|
||||
UUID authBuyerID = UUID.Zero;
|
||||
|
||||
try
|
||||
{
|
||||
Helpers.TryParse((string)row["AuthbuyerID"], out authBuyerID);
|
||||
UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);
|
||||
}
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
@@ -1120,7 +1120,7 @@ namespace OpenSim.Data.SQLite
|
||||
private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row)
|
||||
{
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = new LLUUID((string) row["AccessUUID"]);
|
||||
entry.AgentID = new UUID((string) row["AccessUUID"]);
|
||||
entry.Flags = (ParcelManager.AccessList) row["Flags"];
|
||||
entry.Time = new DateTime();
|
||||
return entry;
|
||||
@@ -1144,7 +1144,7 @@ namespace OpenSim.Data.SQLite
|
||||
return str.ToArray();
|
||||
}
|
||||
|
||||
// private void fillTerrainRow(DataRow row, LLUUID regionUUID, int rev, double[,] val)
|
||||
// private void fillTerrainRow(DataRow row, UUID regionUUID, int rev, double[,] val)
|
||||
// {
|
||||
// row["RegionUUID"] = regionUUID;
|
||||
// row["Revision"] = rev;
|
||||
@@ -1167,7 +1167,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="prim"></param>
|
||||
/// <param name="sceneGroupID"></param>
|
||||
/// <param name="regionUUID"></param>
|
||||
private static void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID)
|
||||
private static void fillPrimRow(DataRow row, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
|
||||
{
|
||||
row["UUID"] = Util.ToRawUuidString(prim.UUID);
|
||||
row["RegionUUID"] = Util.ToRawUuidString(regionUUID);
|
||||
@@ -1215,12 +1215,12 @@ namespace OpenSim.Data.SQLite
|
||||
row["RotationW"] = prim.RotationOffset.W;
|
||||
|
||||
// Sit target
|
||||
LLVector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
Vector3 sitTargetPos = prim.SitTargetPositionLL;
|
||||
row["SitTargetOffsetX"] = sitTargetPos.X;
|
||||
row["SitTargetOffsetY"] = sitTargetPos.Y;
|
||||
row["SitTargetOffsetZ"] = sitTargetPos.Z;
|
||||
|
||||
LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
Quaternion sitTargetOrient = prim.SitTargetOrientationLL;
|
||||
row["SitTargetOrientW"] = sitTargetOrient.W;
|
||||
row["SitTargetOrientX"] = sitTargetOrient.X;
|
||||
row["SitTargetOrientY"] = sitTargetOrient.Y;
|
||||
@@ -1263,7 +1263,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="row"></param>
|
||||
/// <param name="land"></param>
|
||||
/// <param name="regionUUID"></param>
|
||||
private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID)
|
||||
private static void fillLandRow(DataRow row, LandData land, UUID regionUUID)
|
||||
{
|
||||
row["UUID"] = Util.ToRawUuidString(land.GlobalID);
|
||||
row["RegionUUID"] = Util.ToRawUuidString(regionUUID);
|
||||
@@ -1278,12 +1278,12 @@ namespace OpenSim.Data.SQLite
|
||||
row["IsGroupOwned"] = land.IsGroupOwned;
|
||||
row["Area"] = land.Area;
|
||||
row["AuctionID"] = land.AuctionID; //Unemplemented
|
||||
row["Category"] = land.Category; //Enum libsecondlife.Parcel.ParcelCategory
|
||||
row["Category"] = land.Category; //Enum OpenMetaverse.Parcel.ParcelCategory
|
||||
row["ClaimDate"] = land.ClaimDate;
|
||||
row["ClaimPrice"] = land.ClaimPrice;
|
||||
row["GroupUUID"] = Util.ToRawUuidString(land.GroupID);
|
||||
row["SalePrice"] = land.SalePrice;
|
||||
row["LandStatus"] = land.Status; //Enum. libsecondlife.Parcel.ParcelStatus
|
||||
row["LandStatus"] = land.Status; //Enum. OpenMetaverse.Parcel.ParcelStatus
|
||||
row["LandFlags"] = land.Flags;
|
||||
row["LandingType"] = land.LandingType;
|
||||
row["MediaAutoScale"] = land.MediaAutoScale;
|
||||
@@ -1308,7 +1308,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="row"></param>
|
||||
/// <param name="entry"></param>
|
||||
/// <param name="parcelID"></param>
|
||||
private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID)
|
||||
private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, UUID parcelID)
|
||||
{
|
||||
row["LandUUID"] = Util.ToRawUuidString(parcelID);
|
||||
row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID);
|
||||
@@ -1323,7 +1323,7 @@ namespace OpenSim.Data.SQLite
|
||||
private PrimitiveBaseShape buildShape(DataRow row)
|
||||
{
|
||||
PrimitiveBaseShape s = new PrimitiveBaseShape();
|
||||
s.Scale = new LLVector3(
|
||||
s.Scale = new Vector3(
|
||||
Convert.ToSingle(row["ScaleX"]),
|
||||
Convert.ToSingle(row["ScaleY"]),
|
||||
Convert.ToSingle(row["ScaleZ"])
|
||||
@@ -1418,7 +1418,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="prim"></param>
|
||||
/// <param name="sceneGroupID"></param>
|
||||
/// <param name="regionUUID"></param>
|
||||
private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID)
|
||||
private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
|
||||
{
|
||||
DataTable prims = ds.Tables["prims"];
|
||||
DataTable shapes = ds.Tables["primshapes"];
|
||||
@@ -1453,7 +1453,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="primID"></param>
|
||||
/// <param name="items"></param>
|
||||
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
|
||||
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using libsecondlife;
|
||||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using Mono.Data.SqliteClient;
|
||||
using OpenSim.Framework;
|
||||
@@ -59,7 +59,7 @@ namespace OpenSim.Data.SQLite
|
||||
private const string AvatarPickerAndSQL = "select * from users where username like :username and surname like :surname";
|
||||
private const string AvatarPickerOrSQL = "select * from users where username like :username or surname like :surname";
|
||||
|
||||
private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>();
|
||||
private Dictionary<UUID, AvatarAppearance> aplist = new Dictionary<UUID, AvatarAppearance>();
|
||||
private DataSet ds;
|
||||
private SqliteDataAdapter da;
|
||||
private SqliteDataAdapter daf;
|
||||
@@ -124,7 +124,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">User UUID</param>
|
||||
/// <returns>user profile data</returns>
|
||||
override public UserProfileData GetUserByUUID(LLUUID uuid)
|
||||
override public UserProfileData GetUserByUUID(UUID uuid)
|
||||
{
|
||||
lock (ds)
|
||||
{
|
||||
@@ -184,21 +184,21 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="friendlistowner">UUID of the friendlist owner</param>
|
||||
/// <param name="friend">UUID of the friend to add</param>
|
||||
/// <param name="perms">permission flag</param>
|
||||
override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
|
||||
override public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
|
||||
{
|
||||
string InsertFriends = "insert into userfriends(ownerID, friendID, friendPerms) values(:ownerID, :friendID, :perms)";
|
||||
|
||||
using (SqliteCommand cmd = new SqliteCommand(InsertFriends, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":perms", perms));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
using (SqliteCommand cmd = new SqliteCommand(InsertFriends, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friend.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friendlistowner.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friend.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friendlistowner.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":perms", perms));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
@@ -209,13 +209,13 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="friendlistowner">UUID of the friendlist owner</param>
|
||||
/// <param name="friend">UUID of the friend to remove</param>
|
||||
override public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend)
|
||||
override public void RemoveUserFriend(UUID friendlistowner, UUID friend)
|
||||
{
|
||||
string DeletePerms = "delete from friendlist where (ownerID=:ownerID and friendID=:friendID) or (ownerID=:friendID and friendID=:ownerID)";
|
||||
using (SqliteCommand cmd = new SqliteCommand(DeletePerms, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.ToString()));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@@ -226,14 +226,14 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="friendlistowner">UUID of the friendlist owner</param>
|
||||
/// <param name="friend">UUID of the friend to modify</param>
|
||||
/// <param name="perms">updated permission flag</param>
|
||||
override public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms)
|
||||
override public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
|
||||
{
|
||||
string UpdatePerms = "update friendlist set perms=:perms where ownerID=:ownerID and friendID=:friendID";
|
||||
using (SqliteCommand cmd = new SqliteCommand(UpdatePerms, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":perms", perms));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":friendID", friend.ToString()));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@@ -243,13 +243,13 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="friendlistowner">UUID of the friendlist owner</param>
|
||||
/// <returns>The friendlist list</returns>
|
||||
override public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner)
|
||||
override public List<FriendListItem> GetUserFriendList(UUID friendlistowner)
|
||||
{
|
||||
List<FriendListItem> returnlist = new List<FriendListItem>();
|
||||
|
||||
using (SqliteCommand cmd = new SqliteCommand(SelectFriendsByUUID, g_conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.ToString()));
|
||||
|
||||
try
|
||||
{
|
||||
@@ -259,7 +259,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
FriendListItem user = new FriendListItem();
|
||||
user.FriendListOwner = friendlistowner;
|
||||
user.Friend = new LLUUID((string)reader[0]);
|
||||
user.Friend = new UUID((string)reader[0]);
|
||||
user.FriendPerms = Convert.ToUInt32(reader[1]);
|
||||
user.FriendListOwnerPerms = Convert.ToUInt32(reader[2]);
|
||||
returnlist.Add(user);
|
||||
@@ -288,7 +288,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="regionuuid">UUID of the region</param>
|
||||
/// <param name="regionhandle">region handle</param>
|
||||
/// <remarks>DO NOTHING</remarks>
|
||||
override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle)
|
||||
override public void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle)
|
||||
{
|
||||
//m_log.Info("[USER DB]: Stub UpdateUserCUrrentRegion called");
|
||||
}
|
||||
@@ -299,7 +299,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="queryID"></param>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
override public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
|
||||
override public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query)
|
||||
{
|
||||
List<AvatarPickerAvatar> returnlist = new List<AvatarPickerAvatar>();
|
||||
string[] querysplit;
|
||||
@@ -316,7 +316,7 @@ namespace OpenSim.Data.SQLite
|
||||
while (reader.Read())
|
||||
{
|
||||
AvatarPickerAvatar user = new AvatarPickerAvatar();
|
||||
user.AvatarID = new LLUUID((string) reader["UUID"]);
|
||||
user.AvatarID = new UUID((string) reader["UUID"]);
|
||||
user.firstName = (string) reader["username"];
|
||||
user.lastName = (string) reader["surname"];
|
||||
returnlist.Add(user);
|
||||
@@ -337,7 +337,7 @@ namespace OpenSim.Data.SQLite
|
||||
while (reader.Read())
|
||||
{
|
||||
AvatarPickerAvatar user = new AvatarPickerAvatar();
|
||||
user.AvatarID = new LLUUID((string) reader["UUID"]);
|
||||
user.AvatarID = new UUID((string) reader["UUID"]);
|
||||
user.firstName = (string) reader["username"];
|
||||
user.lastName = (string) reader["surname"];
|
||||
returnlist.Add(user);
|
||||
@@ -354,7 +354,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="uuid">The user's account ID</param>
|
||||
/// <returns>A matching user profile</returns>
|
||||
override public UserAgentData GetAgentByUUID(LLUUID uuid)
|
||||
override public UserAgentData GetAgentByUUID(UUID uuid)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -399,7 +399,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="AgentID">UUID of the user</param>
|
||||
/// <param name="WebLoginKey">UUID of the weblogin</param>
|
||||
override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey)
|
||||
override public void StoreWebLoginKey(UUID AgentID, UUID WebLoginKey)
|
||||
{
|
||||
DataTable users = ds.Tables["users"];
|
||||
lock (ds)
|
||||
@@ -520,7 +520,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="to">End account</param>
|
||||
/// <param name="amount">The amount to move</param>
|
||||
/// <returns>Success?</returns>
|
||||
override public bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount)
|
||||
override public bool MoneyTransferRequest(UUID from, UUID to, uint amount)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="to">Receivers account</param>
|
||||
/// <param name="item">Inventory item</param>
|
||||
/// <returns>Success?</returns>
|
||||
override public bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
|
||||
override public bool InventoryTransferRequest(UUID from, UUID to, UUID item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -545,7 +545,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="user">The user UUID</param>
|
||||
/// <returns>Avatar Appearence</returns>
|
||||
override public AvatarAppearance GetUserAppearance(LLUUID user)
|
||||
override public AvatarAppearance GetUserAppearance(UUID user)
|
||||
{
|
||||
AvatarAppearance aa = null;
|
||||
try {
|
||||
@@ -562,7 +562,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// </summary>
|
||||
/// <param name="user">the user UUID</param>
|
||||
/// <param name="appearance">appearence</param>
|
||||
override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance)
|
||||
override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance)
|
||||
{
|
||||
appearance.Owner = user;
|
||||
aplist[user] = appearance;
|
||||
@@ -707,8 +707,8 @@ namespace OpenSim.Data.SQLite
|
||||
private static UserProfileData buildUserProfile(DataRow row)
|
||||
{
|
||||
UserProfileData user = new UserProfileData();
|
||||
LLUUID tmp;
|
||||
LLUUID.TryParse((String)row["UUID"], out tmp);
|
||||
UUID tmp;
|
||||
UUID.TryParse((String)row["UUID"], out tmp);
|
||||
user.ID = tmp;
|
||||
user.FirstName = (String) row["username"];
|
||||
user.SurName = (String) row["surname"];
|
||||
@@ -717,39 +717,39 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]);
|
||||
user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]);
|
||||
user.HomeLocation = new LLVector3(
|
||||
user.HomeLocation = new Vector3(
|
||||
Convert.ToSingle(row["homeLocationX"]),
|
||||
Convert.ToSingle(row["homeLocationY"]),
|
||||
Convert.ToSingle(row["homeLocationZ"])
|
||||
);
|
||||
user.HomeLookAt = new LLVector3(
|
||||
user.HomeLookAt = new Vector3(
|
||||
Convert.ToSingle(row["homeLookAtX"]),
|
||||
Convert.ToSingle(row["homeLookAtY"]),
|
||||
Convert.ToSingle(row["homeLookAtZ"])
|
||||
);
|
||||
|
||||
LLUUID regionID = LLUUID.Zero;
|
||||
LLUUID.TryParse(row["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero
|
||||
UUID regionID = UUID.Zero;
|
||||
UUID.TryParse(row["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use UUID.Zero
|
||||
user.HomeRegionID = regionID;
|
||||
|
||||
user.Created = Convert.ToInt32(row["created"]);
|
||||
user.LastLogin = Convert.ToInt32(row["lastLogin"]);
|
||||
user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]);
|
||||
user.RootInventoryFolderID = new UUID((String) row["rootInventoryFolderID"]);
|
||||
user.UserInventoryURI = (String) row["userInventoryURI"];
|
||||
user.UserAssetURI = (String) row["userAssetURI"];
|
||||
user.CanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
|
||||
user.WantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
|
||||
user.AboutText = (String) row["profileAboutText"];
|
||||
user.FirstLifeAboutText = (String) row["profileFirstText"];
|
||||
LLUUID.TryParse((String)row["profileImage"], out tmp);
|
||||
UUID.TryParse((String)row["profileImage"], out tmp);
|
||||
user.Image = tmp;
|
||||
LLUUID.TryParse((String)row["profileFirstImage"], out tmp);
|
||||
UUID.TryParse((String)row["profileFirstImage"], out tmp);
|
||||
user.FirstLifeImage = tmp;
|
||||
user.WebLoginKey = new LLUUID((String) row["webLoginKey"]);
|
||||
user.WebLoginKey = new UUID((String) row["webLoginKey"]);
|
||||
user.UserFlags = Convert.ToInt32(row["userFlags"]);
|
||||
user.GodLevel = Convert.ToInt32(row["godLevel"]);
|
||||
user.CustomType = row["customType"].ToString();
|
||||
user.Partner = new LLUUID((String) row["partner"]);
|
||||
user.Partner = new UUID((String) row["partner"]);
|
||||
|
||||
return user;
|
||||
}
|
||||
@@ -814,18 +814,18 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
UserAgentData ua = new UserAgentData();
|
||||
|
||||
ua.ProfileID = new LLUUID((String) row["UUID"]);
|
||||
ua.ProfileID = new UUID((String) row["UUID"]);
|
||||
ua.AgentIP = (String) row["agentIP"];
|
||||
ua.AgentPort = Convert.ToUInt32(row["agentPort"]);
|
||||
ua.AgentOnline = Convert.ToBoolean(row["agentOnline"]);
|
||||
ua.SessionID = new LLUUID((String) row["sessionID"]);
|
||||
ua.SecureSessionID = new LLUUID((String) row["secureSessionID"]);
|
||||
ua.InitialRegion = new LLUUID((String) row["regionID"]);
|
||||
ua.SessionID = new UUID((String) row["sessionID"]);
|
||||
ua.SecureSessionID = new UUID((String) row["secureSessionID"]);
|
||||
ua.InitialRegion = new UUID((String) row["regionID"]);
|
||||
ua.LoginTime = Convert.ToInt32(row["loginTime"]);
|
||||
ua.LogoutTime = Convert.ToInt32(row["logoutTime"]);
|
||||
ua.Region = new LLUUID((String) row["currentRegion"]);
|
||||
ua.Region = new UUID((String) row["currentRegion"]);
|
||||
ua.Handle = Convert.ToUInt64(row["currentHandle"]);
|
||||
ua.Position = new LLVector3(
|
||||
ua.Position = new Vector3(
|
||||
Convert.ToSingle(row["currentPosX"]),
|
||||
Convert.ToSingle(row["currentPosY"]),
|
||||
Convert.ToSingle(row["currentPosZ"])
|
||||
@@ -906,7 +906,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
}
|
||||
|
||||
override public void ResetAttachments(LLUUID userID)
|
||||
override public void ResetAttachments(UUID userID)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user