* 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:
Teravus Ovares
2008-09-06 07:52:41 +00:00
parent cbec2bf22b
commit 7d89e12293
388 changed files with 6811 additions and 7138 deletions

View File

@@ -31,7 +31,7 @@ using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Reflection;
using libsecondlife;
using OpenMetaverse;
using log4net;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
@@ -174,12 +174,12 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="regionUUID">The region UUID.</param>
/// <returns></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>();
//Retrieve all values of current region
RetrievePrimsDataForRegion(regionUUID, LLUUID.Zero, "");
RetrievePrimsDataForRegion(regionUUID, UUID.Zero, "");
List<SceneObjectGroup> retvals = new List<SceneObjectGroup>();
@@ -235,7 +235,7 @@ namespace OpenSim.Data.MSSQL
"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);
@@ -292,7 +292,7 @@ namespace OpenSim.Data.MSSQL
// }
// else
// {
// createdObjects[new LLUUID(objID)].AddPart(prim);
// createdObjects[new UUID(objID)].AddPart(prim);
// }
// }
// }
@@ -307,7 +307,7 @@ namespace OpenSim.Data.MSSQL
// {
// while (readerShapes.Read())
// {
// LLUUID UUID = new LLUUID((string) readerShapes["UUID"]);
// UUID UUID = new UUID((string) readerShapes["UUID"]);
//
// foreach (SceneObjectGroup objectGroup in createdObjects.Values)
// {
@@ -324,7 +324,7 @@ namespace OpenSim.Data.MSSQL
#endregion
}
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
//Retrieve all values of current region, and current scene/or prims
//Build primID's, we use IN so I can select all prims from objgroup
@@ -341,9 +341,9 @@ namespace OpenSim.Data.MSSQL
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)
{
lock (_PrimsDataSet)
{
@@ -391,7 +391,7 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="objectID">id of scenegroup</param>
/// <param name="regionUUID">regionUUID (is this used anyway</param>
public void RemoveObject(LLUUID objectID, LLUUID regionUUID)
public void RemoveObject(UUID objectID, UUID regionUUID)
{
_Log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", objectID, regionUUID);
@@ -418,7 +418,7 @@ namespace OpenSim.Data.MSSQL
/// </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)
{
_Log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
@@ -456,7 +456,7 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="regionID">regionID.</param>
/// <returns></returns>
public double[,] LoadTerrain(LLUUID regionID)
public double[,] LoadTerrain(UUID regionID)
{
double[,] terrain = new double[256, 256];
terrain.Initialize();
@@ -501,7 +501,7 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="terrain">terrain map data.</param>
/// <param name="regionID">regionID.</param>
public void StoreTerrain(double[,] terrain, LLUUID regionID)
public void StoreTerrain(double[,] terrain, UUID regionID)
{
int revision = Util.UnixTimeSinceEpoch();
@@ -532,7 +532,7 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="regionUUID">The region UUID.</param>
/// <returns></returns>
public List<LandData> LoadLandObjects(LLUUID regionUUID)
public List<LandData> LoadLandObjects(UUID regionUUID)
{
List<LandData> landDataForRegion = new List<LandData>();
@@ -617,7 +617,7 @@ VALUES
/// Removes a land object from DB.
/// </summary>
/// <param name="globalID">UUID of landobject</param>
public void RemoveLandObject(LLUUID globalID)
public void RemoveLandObject(UUID globalID)
{
using (AutoClosingSqlCommand cmd = _Database.Query("delete from land where UUID=@UUID"))
{
@@ -637,7 +637,7 @@ VALUES
/// </summary>
/// <param name="regionUUID">The region UUID.</param>
/// <returns></returns>
public RegionSettings LoadRegionSettings(LLUUID regionUUID)
public RegionSettings LoadRegionSettings(UUID regionUUID)
{
string sql = "select * from regionsettings where regionUUID = @regionUUID";
RegionSettings regionSettings;
@@ -801,7 +801,7 @@ VALUES
//TODO change this is some more generic code so we doesnt have to change it every time a new field is added?
RegionSettings newSettings = new RegionSettings();
newSettings.RegionUUID = new LLUUID((string)row["regionUUID"]);
newSettings.RegionUUID = new UUID((string)row["regionUUID"]);
newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]);
newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]);
newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]);
@@ -815,10 +815,10 @@ VALUES
newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]);
newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]);
newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]);
newSettings.TerrainTexture1 = new LLUUID((String)row["terrain_texture_1"]);
newSettings.TerrainTexture2 = new LLUUID((String)row["terrain_texture_2"]);
newSettings.TerrainTexture3 = new LLUUID((String)row["terrain_texture_3"]);
newSettings.TerrainTexture4 = new LLUUID((String)row["terrain_texture_4"]);
newSettings.TerrainTexture1 = new UUID((String)row["terrain_texture_1"]);
newSettings.TerrainTexture2 = new UUID((String)row["terrain_texture_2"]);
newSettings.TerrainTexture3 = new UUID((String)row["terrain_texture_3"]);
newSettings.TerrainTexture4 = new UUID((String)row["terrain_texture_4"]);
newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]);
newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]);
newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]);
@@ -834,7 +834,7 @@ VALUES
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = new LLUUID((String)row["covenant"]);
newSettings.Covenant = new UUID((String)row["covenant"]);
return newSettings;
}
@@ -848,7 +848,7 @@ VALUES
{
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]
@@ -864,41 +864,41 @@ VALUES
//Enum libsecondlife.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
newData.Flags = Convert.ToUInt32(row["LandFlags"]);
newData.LandingType = Convert.ToByte(row["LandingType"]);
newData.MediaAutoScale = Convert.ToByte(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"]);
newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
LLUUID authedbuyer;
LLUUID snapshotID;
UUID authedbuyer;
UUID snapshotID;
if (LLUUID.TryParse((string)row["AuthBuyerID"], out authedbuyer))
if (UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer))
newData.AuthBuyerID = authedbuyer;
if (LLUUID.TryParse((string)row["SnapshotUUID"], out snapshotID))
if (UUID.TryParse((string)row["SnapshotUUID"], out snapshotID))
newData.SnapshotID = snapshotID;
try
{
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)
{
newData.UserLocation = LLVector3.Zero;
newData.UserLookAt = LLVector3.Zero;
newData.UserLocation = Vector3.Zero;
newData.UserLookAt = Vector3.Zero;
_Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
}
@@ -915,7 +915,7 @@ VALUES
private static ParcelManager.ParcelAccessEntry buildLandAccessData(IDataRecord 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)Convert.ToInt32(row["Flags"]);
entry.Time = new DateTime();
return entry;
@@ -930,7 +930,7 @@ VALUES
{
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"]);
@@ -943,54 +943,54 @@ VALUES
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"]),
Convert.ToSingle(row["RotationW"])
);
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(row["SitTargetOrientY"]),
Convert.ToSingle(row["SitTargetOrientZ"]),
@@ -1003,14 +1003,14 @@ VALUES
prim.PayPrice[3] = Convert.ToInt32(row["PayButton3"]);
prim.PayPrice[4] = Convert.ToInt32(row["PayButton4"]);
prim.Sound = new LLUUID(row["LoopedSound"].ToString());
prim.Sound = new UUID(row["LoopedSound"].ToString());
prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]);
prim.SoundFlags = 1; // If it's persisted at all, it's looped
if (row["TextureAnimation"] != null && row["TextureAnimation"] != DBNull.Value)
prim.TextureAnimation = (Byte[])row["TextureAnimation"];
prim.RotationalVelocity = new LLVector3(
prim.RotationalVelocity = new Vector3(
Convert.ToSingle(row["OmegaX"]),
Convert.ToSingle(row["OmegaY"]),
Convert.ToSingle(row["OmegaZ"])
@@ -1019,13 +1019,13 @@ VALUES
// TODO: Rotation
// OmegaX, OmegaY, OmegaZ
prim.SetCameraEyeOffset(new LLVector3(
prim.SetCameraEyeOffset(new Vector3(
Convert.ToSingle(row["CameraEyeOffsetX"]),
Convert.ToSingle(row["CameraEyeOffsetY"]),
Convert.ToSingle(row["CameraEyeOffsetZ"])
));
prim.SetCameraAtOffset(new LLVector3(
prim.SetCameraAtOffset(new Vector3(
Convert.ToSingle(row["CameraAtOffsetX"]),
Convert.ToSingle(row["CameraAtOffsetY"]),
Convert.ToSingle(row["CameraAtOffsetZ"])
@@ -1056,7 +1056,7 @@ VALUES
private static 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"])
@@ -1108,10 +1108,10 @@ VALUES
{
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"]);
@@ -1119,10 +1119,10 @@ VALUES
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"]);
@@ -1225,7 +1225,7 @@ VALUES
/// <param name="land">land parameters.</param>
/// <param name="regionUUID">region UUID.</param>
/// <returns></returns>
private SqlParameter[] CreateLandParameters(LandData land, LLUUID regionUUID)
private SqlParameter[] CreateLandParameters(LandData land, UUID regionUUID)
{
SqlParameter[] parameters = new SqlParameter[32];
@@ -1274,7 +1274,7 @@ VALUES
/// <param name="parcelAccessEntry">parcel access entry.</param>
/// <param name="parcelID">parcel ID.</param>
/// <returns></returns>
private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, LLUUID parcelID)
private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID)
{
SqlParameter[] parameters = new SqlParameter[3];
@@ -1292,7 +1292,7 @@ VALUES
/// <param name="prim">prim data.</param>
/// <param name="sceneGroupID">scenegroup ID.</param>
/// <param name="regionUUID">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"] = prim.UUID.ToString();
row["RegionUUID"] = regionUUID.ToString();
@@ -1340,12 +1340,12 @@ VALUES
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;
@@ -1364,7 +1364,7 @@ VALUES
}
else
{
row["LoopedSound"] = LLUUID.Zero;
row["LoopedSound"] = UUID.Zero;
row["LoopedSoundGain"] = 0.0f;
}
@@ -1446,13 +1446,13 @@ VALUES
#endregion
private void RetrievePrimsDataForRegion(LLUUID regionUUID, LLUUID sceneGroupID, string primID)
private void RetrievePrimsDataForRegion(UUID regionUUID, UUID sceneGroupID, string primID)
{
using (SqlConnection connection = _Database.DatabaseConnection())
{
_PrimDataAdapter.SelectCommand.Connection = connection;
_PrimDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString();
if (sceneGroupID != LLUUID.Zero)
if (sceneGroupID != UUID.Zero)
_PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString();
else
_PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%";
@@ -1462,7 +1462,7 @@ VALUES
_ShapeDataAdapter.SelectCommand.Connection = connection;
_ShapeDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString();
if (sceneGroupID != LLUUID.Zero)
if (sceneGroupID != UUID.Zero)
_ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString();
else
_ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%";
@@ -1472,7 +1472,7 @@ VALUES
_ItemsDataAdapter.SelectCommand.Connection = connection;
_ItemsDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString();
if (sceneGroupID != LLUUID.Zero)
if (sceneGroupID != UUID.Zero)
_ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString();
else
_ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%";