diff options
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLRegionData.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 46aa6c9..d267e41 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -31,7 +31,7 @@ using System.Data; | |||
31 | using System.Data.SqlClient; | 31 | using System.Data.SqlClient; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using libsecondlife; | 34 | using OpenMetaverse; |
35 | using log4net; | 35 | using log4net; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
@@ -174,12 +174,12 @@ namespace OpenSim.Data.MSSQL | |||
174 | /// </summary> | 174 | /// </summary> |
175 | /// <param name="regionUUID">The region UUID.</param> | 175 | /// <param name="regionUUID">The region UUID.</param> |
176 | /// <returns></returns> | 176 | /// <returns></returns> |
177 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) | 177 | public List<SceneObjectGroup> LoadObjects(UUID regionUUID) |
178 | { | 178 | { |
179 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 179 | Dictionary<UUID, SceneObjectGroup> createdObjects = new Dictionary<UUID, SceneObjectGroup>(); |
180 | 180 | ||
181 | //Retrieve all values of current region | 181 | //Retrieve all values of current region |
182 | RetrievePrimsDataForRegion(regionUUID, LLUUID.Zero, ""); | 182 | RetrievePrimsDataForRegion(regionUUID, UUID.Zero, ""); |
183 | 183 | ||
184 | List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); | 184 | List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); |
185 | 185 | ||
@@ -235,7 +235,7 @@ namespace OpenSim.Data.MSSQL | |||
235 | "No shape found for prim in storage, so setting default box shape"); | 235 | "No shape found for prim in storage, so setting default box shape"); |
236 | prim.Shape = PrimitiveBaseShape.Default; | 236 | prim.Shape = PrimitiveBaseShape.Default; |
237 | } | 237 | } |
238 | createdObjects[new LLUUID(objID)].AddPart(prim); | 238 | createdObjects[new UUID(objID)].AddPart(prim); |
239 | } | 239 | } |
240 | 240 | ||
241 | LoadItems(prim); | 241 | LoadItems(prim); |
@@ -292,7 +292,7 @@ namespace OpenSim.Data.MSSQL | |||
292 | // } | 292 | // } |
293 | // else | 293 | // else |
294 | // { | 294 | // { |
295 | // createdObjects[new LLUUID(objID)].AddPart(prim); | 295 | // createdObjects[new UUID(objID)].AddPart(prim); |
296 | // } | 296 | // } |
297 | // } | 297 | // } |
298 | // } | 298 | // } |
@@ -307,7 +307,7 @@ namespace OpenSim.Data.MSSQL | |||
307 | // { | 307 | // { |
308 | // while (readerShapes.Read()) | 308 | // while (readerShapes.Read()) |
309 | // { | 309 | // { |
310 | // LLUUID UUID = new LLUUID((string) readerShapes["UUID"]); | 310 | // UUID UUID = new UUID((string) readerShapes["UUID"]); |
311 | // | 311 | // |
312 | // foreach (SceneObjectGroup objectGroup in createdObjects.Values) | 312 | // foreach (SceneObjectGroup objectGroup in createdObjects.Values) |
313 | // { | 313 | // { |
@@ -324,7 +324,7 @@ namespace OpenSim.Data.MSSQL | |||
324 | #endregion | 324 | #endregion |
325 | } | 325 | } |
326 | 326 | ||
327 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) | 327 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) |
328 | { | 328 | { |
329 | //Retrieve all values of current region, and current scene/or prims | 329 | //Retrieve all values of current region, and current scene/or prims |
330 | //Build primID's, we use IN so I can select all prims from objgroup | 330 | //Build primID's, we use IN so I can select all prims from objgroup |
@@ -341,9 +341,9 @@ namespace OpenSim.Data.MSSQL | |||
341 | 341 | ||
342 | foreach (SceneObjectPart prim in obj.Children.Values) | 342 | foreach (SceneObjectPart prim in obj.Children.Values) |
343 | { | 343 | { |
344 | if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0 | 344 | if ((prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Physics) == 0 |
345 | && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0 | 345 | && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0 |
346 | && (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0) | 346 | && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0) |
347 | { | 347 | { |
348 | lock (_PrimsDataSet) | 348 | lock (_PrimsDataSet) |
349 | { | 349 | { |
@@ -391,7 +391,7 @@ namespace OpenSim.Data.MSSQL | |||
391 | /// </summary> | 391 | /// </summary> |
392 | /// <param name="objectID">id of scenegroup</param> | 392 | /// <param name="objectID">id of scenegroup</param> |
393 | /// <param name="regionUUID">regionUUID (is this used anyway</param> | 393 | /// <param name="regionUUID">regionUUID (is this used anyway</param> |
394 | public void RemoveObject(LLUUID objectID, LLUUID regionUUID) | 394 | public void RemoveObject(UUID objectID, UUID regionUUID) |
395 | { | 395 | { |
396 | _Log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", objectID, regionUUID); | 396 | _Log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", objectID, regionUUID); |
397 | 397 | ||
@@ -418,7 +418,7 @@ namespace OpenSim.Data.MSSQL | |||
418 | /// </summary> | 418 | /// </summary> |
419 | /// <param name="primID"></param> | 419 | /// <param name="primID"></param> |
420 | /// <param name="items"></param> | 420 | /// <param name="items"></param> |
421 | public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) | 421 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) |
422 | { | 422 | { |
423 | _Log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); | 423 | _Log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); |
424 | 424 | ||
@@ -456,7 +456,7 @@ namespace OpenSim.Data.MSSQL | |||
456 | /// </summary> | 456 | /// </summary> |
457 | /// <param name="regionID">regionID.</param> | 457 | /// <param name="regionID">regionID.</param> |
458 | /// <returns></returns> | 458 | /// <returns></returns> |
459 | public double[,] LoadTerrain(LLUUID regionID) | 459 | public double[,] LoadTerrain(UUID regionID) |
460 | { | 460 | { |
461 | double[,] terrain = new double[256, 256]; | 461 | double[,] terrain = new double[256, 256]; |
462 | terrain.Initialize(); | 462 | terrain.Initialize(); |
@@ -501,7 +501,7 @@ namespace OpenSim.Data.MSSQL | |||
501 | /// </summary> | 501 | /// </summary> |
502 | /// <param name="terrain">terrain map data.</param> | 502 | /// <param name="terrain">terrain map data.</param> |
503 | /// <param name="regionID">regionID.</param> | 503 | /// <param name="regionID">regionID.</param> |
504 | public void StoreTerrain(double[,] terrain, LLUUID regionID) | 504 | public void StoreTerrain(double[,] terrain, UUID regionID) |
505 | { | 505 | { |
506 | int revision = Util.UnixTimeSinceEpoch(); | 506 | int revision = Util.UnixTimeSinceEpoch(); |
507 | 507 | ||
@@ -532,7 +532,7 @@ namespace OpenSim.Data.MSSQL | |||
532 | /// </summary> | 532 | /// </summary> |
533 | /// <param name="regionUUID">The region UUID.</param> | 533 | /// <param name="regionUUID">The region UUID.</param> |
534 | /// <returns></returns> | 534 | /// <returns></returns> |
535 | public List<LandData> LoadLandObjects(LLUUID regionUUID) | 535 | public List<LandData> LoadLandObjects(UUID regionUUID) |
536 | { | 536 | { |
537 | List<LandData> landDataForRegion = new List<LandData>(); | 537 | List<LandData> landDataForRegion = new List<LandData>(); |
538 | 538 | ||
@@ -617,7 +617,7 @@ VALUES | |||
617 | /// Removes a land object from DB. | 617 | /// Removes a land object from DB. |
618 | /// </summary> | 618 | /// </summary> |
619 | /// <param name="globalID">UUID of landobject</param> | 619 | /// <param name="globalID">UUID of landobject</param> |
620 | public void RemoveLandObject(LLUUID globalID) | 620 | public void RemoveLandObject(UUID globalID) |
621 | { | 621 | { |
622 | using (AutoClosingSqlCommand cmd = _Database.Query("delete from land where UUID=@UUID")) | 622 | using (AutoClosingSqlCommand cmd = _Database.Query("delete from land where UUID=@UUID")) |
623 | { | 623 | { |
@@ -637,7 +637,7 @@ VALUES | |||
637 | /// </summary> | 637 | /// </summary> |
638 | /// <param name="regionUUID">The region UUID.</param> | 638 | /// <param name="regionUUID">The region UUID.</param> |
639 | /// <returns></returns> | 639 | /// <returns></returns> |
640 | public RegionSettings LoadRegionSettings(LLUUID regionUUID) | 640 | public RegionSettings LoadRegionSettings(UUID regionUUID) |
641 | { | 641 | { |
642 | string sql = "select * from regionsettings where regionUUID = @regionUUID"; | 642 | string sql = "select * from regionsettings where regionUUID = @regionUUID"; |
643 | RegionSettings regionSettings; | 643 | RegionSettings regionSettings; |
@@ -801,7 +801,7 @@ VALUES | |||
801 | //TODO change this is some more generic code so we doesnt have to change it every time a new field is added? | 801 | //TODO change this is some more generic code so we doesnt have to change it every time a new field is added? |
802 | RegionSettings newSettings = new RegionSettings(); | 802 | RegionSettings newSettings = new RegionSettings(); |
803 | 803 | ||
804 | newSettings.RegionUUID = new LLUUID((string)row["regionUUID"]); | 804 | newSettings.RegionUUID = new UUID((string)row["regionUUID"]); |
805 | newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]); | 805 | newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]); |
806 | newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]); | 806 | newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]); |
807 | newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]); | 807 | newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]); |
@@ -815,10 +815,10 @@ VALUES | |||
815 | newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]); | 815 | newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]); |
816 | newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]); | 816 | newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]); |
817 | newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]); | 817 | newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]); |
818 | newSettings.TerrainTexture1 = new LLUUID((String)row["terrain_texture_1"]); | 818 | newSettings.TerrainTexture1 = new UUID((String)row["terrain_texture_1"]); |
819 | newSettings.TerrainTexture2 = new LLUUID((String)row["terrain_texture_2"]); | 819 | newSettings.TerrainTexture2 = new UUID((String)row["terrain_texture_2"]); |
820 | newSettings.TerrainTexture3 = new LLUUID((String)row["terrain_texture_3"]); | 820 | newSettings.TerrainTexture3 = new UUID((String)row["terrain_texture_3"]); |
821 | newSettings.TerrainTexture4 = new LLUUID((String)row["terrain_texture_4"]); | 821 | newSettings.TerrainTexture4 = new UUID((String)row["terrain_texture_4"]); |
822 | newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]); | 822 | newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]); |
823 | newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]); | 823 | newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]); |
824 | newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]); | 824 | newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]); |
@@ -834,7 +834,7 @@ VALUES | |||
834 | newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); | 834 | newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); |
835 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); | 835 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); |
836 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); | 836 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); |
837 | newSettings.Covenant = new LLUUID((String)row["covenant"]); | 837 | newSettings.Covenant = new UUID((String)row["covenant"]); |
838 | 838 | ||
839 | return newSettings; | 839 | return newSettings; |
840 | } | 840 | } |
@@ -848,7 +848,7 @@ VALUES | |||
848 | { | 848 | { |
849 | LandData newData = new LandData(); | 849 | LandData newData = new LandData(); |
850 | 850 | ||
851 | newData.GlobalID = new LLUUID((String)row["UUID"]); | 851 | newData.GlobalID = new UUID((String)row["UUID"]); |
852 | newData.LocalID = Convert.ToInt32(row["LocalLandID"]); | 852 | newData.LocalID = Convert.ToInt32(row["LocalLandID"]); |
853 | 853 | ||
854 | // Bitmap is a byte[512] | 854 | // Bitmap is a byte[512] |
@@ -864,41 +864,41 @@ VALUES | |||
864 | //Enum libsecondlife.Parcel.ParcelCategory | 864 | //Enum libsecondlife.Parcel.ParcelCategory |
865 | newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]); | 865 | newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]); |
866 | newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]); | 866 | newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]); |
867 | newData.GroupID = new LLUUID((String)row["GroupUUID"]); | 867 | newData.GroupID = new UUID((String)row["GroupUUID"]); |
868 | newData.SalePrice = Convert.ToInt32(row["SalePrice"]); | 868 | newData.SalePrice = Convert.ToInt32(row["SalePrice"]); |
869 | newData.Status = (Parcel.ParcelStatus)Convert.ToInt32(row["LandStatus"]); | 869 | newData.Status = (Parcel.ParcelStatus)Convert.ToInt32(row["LandStatus"]); |
870 | //Enum. libsecondlife.Parcel.ParcelStatus | 870 | //Enum. libsecondlife.Parcel.ParcelStatus |
871 | newData.Flags = Convert.ToUInt32(row["LandFlags"]); | 871 | newData.Flags = Convert.ToUInt32(row["LandFlags"]); |
872 | newData.LandingType = Convert.ToByte(row["LandingType"]); | 872 | newData.LandingType = Convert.ToByte(row["LandingType"]); |
873 | newData.MediaAutoScale = Convert.ToByte(row["MediaAutoScale"]); | 873 | newData.MediaAutoScale = Convert.ToByte(row["MediaAutoScale"]); |
874 | newData.MediaID = new LLUUID((String)row["MediaTextureUUID"]); | 874 | newData.MediaID = new UUID((String)row["MediaTextureUUID"]); |
875 | newData.MediaURL = (String)row["MediaURL"]; | 875 | newData.MediaURL = (String)row["MediaURL"]; |
876 | newData.MusicURL = (String)row["MusicURL"]; | 876 | newData.MusicURL = (String)row["MusicURL"]; |
877 | newData.PassHours = Convert.ToSingle(row["PassHours"]); | 877 | newData.PassHours = Convert.ToSingle(row["PassHours"]); |
878 | newData.PassPrice = Convert.ToInt32(row["PassPrice"]); | 878 | newData.PassPrice = Convert.ToInt32(row["PassPrice"]); |
879 | 879 | ||
880 | LLUUID authedbuyer; | 880 | UUID authedbuyer; |
881 | LLUUID snapshotID; | 881 | UUID snapshotID; |
882 | 882 | ||
883 | if (LLUUID.TryParse((string)row["AuthBuyerID"], out authedbuyer)) | 883 | if (UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer)) |
884 | newData.AuthBuyerID = authedbuyer; | 884 | newData.AuthBuyerID = authedbuyer; |
885 | 885 | ||
886 | if (LLUUID.TryParse((string)row["SnapshotUUID"], out snapshotID)) | 886 | if (UUID.TryParse((string)row["SnapshotUUID"], out snapshotID)) |
887 | newData.SnapshotID = snapshotID; | 887 | newData.SnapshotID = snapshotID; |
888 | 888 | ||
889 | try | 889 | try |
890 | { | 890 | { |
891 | newData.UserLocation = | 891 | newData.UserLocation = |
892 | new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), | 892 | new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), |
893 | Convert.ToSingle(row["UserLocationZ"])); | 893 | Convert.ToSingle(row["UserLocationZ"])); |
894 | newData.UserLookAt = | 894 | newData.UserLookAt = |
895 | new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), | 895 | new Vector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), |
896 | Convert.ToSingle(row["UserLookAtZ"])); | 896 | Convert.ToSingle(row["UserLookAtZ"])); |
897 | } | 897 | } |
898 | catch (InvalidCastException) | 898 | catch (InvalidCastException) |
899 | { | 899 | { |
900 | newData.UserLocation = LLVector3.Zero; | 900 | newData.UserLocation = Vector3.Zero; |
901 | newData.UserLookAt = LLVector3.Zero; | 901 | newData.UserLookAt = Vector3.Zero; |
902 | _Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 902 | _Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); |
903 | } | 903 | } |
904 | 904 | ||
@@ -915,7 +915,7 @@ VALUES | |||
915 | private static ParcelManager.ParcelAccessEntry buildLandAccessData(IDataRecord row) | 915 | private static ParcelManager.ParcelAccessEntry buildLandAccessData(IDataRecord row) |
916 | { | 916 | { |
917 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 917 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
918 | entry.AgentID = new LLUUID((string)row["AccessUUID"]); | 918 | entry.AgentID = new UUID((string)row["AccessUUID"]); |
919 | entry.Flags = (ParcelManager.AccessList)Convert.ToInt32(row["Flags"]); | 919 | entry.Flags = (ParcelManager.AccessList)Convert.ToInt32(row["Flags"]); |
920 | entry.Time = new DateTime(); | 920 | entry.Time = new DateTime(); |
921 | return entry; | 921 | return entry; |
@@ -930,7 +930,7 @@ VALUES | |||
930 | { | 930 | { |
931 | SceneObjectPart prim = new SceneObjectPart(); | 931 | SceneObjectPart prim = new SceneObjectPart(); |
932 | 932 | ||
933 | prim.UUID = new LLUUID((String)row["UUID"]); | 933 | prim.UUID = new UUID((String)row["UUID"]); |
934 | // explicit conversion of integers is required, which sort | 934 | // explicit conversion of integers is required, which sort |
935 | // of sucks. No idea if there is a shortcut here or not. | 935 | // of sucks. No idea if there is a shortcut here or not. |
936 | prim.ParentID = Convert.ToUInt32(row["ParentID"]); | 936 | prim.ParentID = Convert.ToUInt32(row["ParentID"]); |
@@ -943,54 +943,54 @@ VALUES | |||
943 | prim.TouchName = (String)row["TouchName"]; | 943 | prim.TouchName = (String)row["TouchName"]; |
944 | // permissions | 944 | // permissions |
945 | prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); | 945 | prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); |
946 | prim.CreatorID = new LLUUID((String)row["CreatorID"]); | 946 | prim.CreatorID = new UUID((String)row["CreatorID"]); |
947 | prim.OwnerID = new LLUUID((String)row["OwnerID"]); | 947 | prim.OwnerID = new UUID((String)row["OwnerID"]); |
948 | prim.GroupID = new LLUUID((String)row["GroupID"]); | 948 | prim.GroupID = new UUID((String)row["GroupID"]); |
949 | prim.LastOwnerID = new LLUUID((String)row["LastOwnerID"]); | 949 | prim.LastOwnerID = new UUID((String)row["LastOwnerID"]); |
950 | prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]); | 950 | prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]); |
951 | prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); | 951 | prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); |
952 | prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); | 952 | prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); |
953 | prim.EveryoneMask = Convert.ToUInt32(row["EveryoneMask"]); | 953 | prim.EveryoneMask = Convert.ToUInt32(row["EveryoneMask"]); |
954 | prim.BaseMask = Convert.ToUInt32(row["BaseMask"]); | 954 | prim.BaseMask = Convert.ToUInt32(row["BaseMask"]); |
955 | // vectors | 955 | // vectors |
956 | prim.OffsetPosition = new LLVector3( | 956 | prim.OffsetPosition = new Vector3( |
957 | Convert.ToSingle(row["PositionX"]), | 957 | Convert.ToSingle(row["PositionX"]), |
958 | Convert.ToSingle(row["PositionY"]), | 958 | Convert.ToSingle(row["PositionY"]), |
959 | Convert.ToSingle(row["PositionZ"]) | 959 | Convert.ToSingle(row["PositionZ"]) |
960 | ); | 960 | ); |
961 | prim.GroupPosition = new LLVector3( | 961 | prim.GroupPosition = new Vector3( |
962 | Convert.ToSingle(row["GroupPositionX"]), | 962 | Convert.ToSingle(row["GroupPositionX"]), |
963 | Convert.ToSingle(row["GroupPositionY"]), | 963 | Convert.ToSingle(row["GroupPositionY"]), |
964 | Convert.ToSingle(row["GroupPositionZ"]) | 964 | Convert.ToSingle(row["GroupPositionZ"]) |
965 | ); | 965 | ); |
966 | prim.Velocity = new LLVector3( | 966 | prim.Velocity = new Vector3( |
967 | Convert.ToSingle(row["VelocityX"]), | 967 | Convert.ToSingle(row["VelocityX"]), |
968 | Convert.ToSingle(row["VelocityY"]), | 968 | Convert.ToSingle(row["VelocityY"]), |
969 | Convert.ToSingle(row["VelocityZ"]) | 969 | Convert.ToSingle(row["VelocityZ"]) |
970 | ); | 970 | ); |
971 | prim.AngularVelocity = new LLVector3( | 971 | prim.AngularVelocity = new Vector3( |
972 | Convert.ToSingle(row["AngularVelocityX"]), | 972 | Convert.ToSingle(row["AngularVelocityX"]), |
973 | Convert.ToSingle(row["AngularVelocityY"]), | 973 | Convert.ToSingle(row["AngularVelocityY"]), |
974 | Convert.ToSingle(row["AngularVelocityZ"]) | 974 | Convert.ToSingle(row["AngularVelocityZ"]) |
975 | ); | 975 | ); |
976 | prim.Acceleration = new LLVector3( | 976 | prim.Acceleration = new Vector3( |
977 | Convert.ToSingle(row["AccelerationX"]), | 977 | Convert.ToSingle(row["AccelerationX"]), |
978 | Convert.ToSingle(row["AccelerationY"]), | 978 | Convert.ToSingle(row["AccelerationY"]), |
979 | Convert.ToSingle(row["AccelerationZ"]) | 979 | Convert.ToSingle(row["AccelerationZ"]) |
980 | ); | 980 | ); |
981 | // quaternions | 981 | // quaternions |
982 | prim.RotationOffset = new LLQuaternion( | 982 | prim.RotationOffset = new Quaternion( |
983 | Convert.ToSingle(row["RotationX"]), | 983 | Convert.ToSingle(row["RotationX"]), |
984 | Convert.ToSingle(row["RotationY"]), | 984 | Convert.ToSingle(row["RotationY"]), |
985 | Convert.ToSingle(row["RotationZ"]), | 985 | Convert.ToSingle(row["RotationZ"]), |
986 | Convert.ToSingle(row["RotationW"]) | 986 | Convert.ToSingle(row["RotationW"]) |
987 | ); | 987 | ); |
988 | prim.SitTargetPositionLL = new LLVector3( | 988 | prim.SitTargetPositionLL = new Vector3( |
989 | Convert.ToSingle(row["SitTargetOffsetX"]), | 989 | Convert.ToSingle(row["SitTargetOffsetX"]), |
990 | Convert.ToSingle(row["SitTargetOffsetY"]), | 990 | Convert.ToSingle(row["SitTargetOffsetY"]), |
991 | Convert.ToSingle(row["SitTargetOffsetZ"]) | 991 | Convert.ToSingle(row["SitTargetOffsetZ"]) |
992 | ); | 992 | ); |
993 | prim.SitTargetOrientationLL = new LLQuaternion( | 993 | prim.SitTargetOrientationLL = new Quaternion( |
994 | Convert.ToSingle(row["SitTargetOrientX"]), | 994 | Convert.ToSingle(row["SitTargetOrientX"]), |
995 | Convert.ToSingle(row["SitTargetOrientY"]), | 995 | Convert.ToSingle(row["SitTargetOrientY"]), |
996 | Convert.ToSingle(row["SitTargetOrientZ"]), | 996 | Convert.ToSingle(row["SitTargetOrientZ"]), |
@@ -1003,14 +1003,14 @@ VALUES | |||
1003 | prim.PayPrice[3] = Convert.ToInt32(row["PayButton3"]); | 1003 | prim.PayPrice[3] = Convert.ToInt32(row["PayButton3"]); |
1004 | prim.PayPrice[4] = Convert.ToInt32(row["PayButton4"]); | 1004 | prim.PayPrice[4] = Convert.ToInt32(row["PayButton4"]); |
1005 | 1005 | ||
1006 | prim.Sound = new LLUUID(row["LoopedSound"].ToString()); | 1006 | prim.Sound = new UUID(row["LoopedSound"].ToString()); |
1007 | prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); | 1007 | prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); |
1008 | prim.SoundFlags = 1; // If it's persisted at all, it's looped | 1008 | prim.SoundFlags = 1; // If it's persisted at all, it's looped |
1009 | 1009 | ||
1010 | if (row["TextureAnimation"] != null && row["TextureAnimation"] != DBNull.Value) | 1010 | if (row["TextureAnimation"] != null && row["TextureAnimation"] != DBNull.Value) |
1011 | prim.TextureAnimation = (Byte[])row["TextureAnimation"]; | 1011 | prim.TextureAnimation = (Byte[])row["TextureAnimation"]; |
1012 | 1012 | ||
1013 | prim.RotationalVelocity = new LLVector3( | 1013 | prim.RotationalVelocity = new Vector3( |
1014 | Convert.ToSingle(row["OmegaX"]), | 1014 | Convert.ToSingle(row["OmegaX"]), |
1015 | Convert.ToSingle(row["OmegaY"]), | 1015 | Convert.ToSingle(row["OmegaY"]), |
1016 | Convert.ToSingle(row["OmegaZ"]) | 1016 | Convert.ToSingle(row["OmegaZ"]) |
@@ -1019,13 +1019,13 @@ VALUES | |||
1019 | // TODO: Rotation | 1019 | // TODO: Rotation |
1020 | // OmegaX, OmegaY, OmegaZ | 1020 | // OmegaX, OmegaY, OmegaZ |
1021 | 1021 | ||
1022 | prim.SetCameraEyeOffset(new LLVector3( | 1022 | prim.SetCameraEyeOffset(new Vector3( |
1023 | Convert.ToSingle(row["CameraEyeOffsetX"]), | 1023 | Convert.ToSingle(row["CameraEyeOffsetX"]), |
1024 | Convert.ToSingle(row["CameraEyeOffsetY"]), | 1024 | Convert.ToSingle(row["CameraEyeOffsetY"]), |
1025 | Convert.ToSingle(row["CameraEyeOffsetZ"]) | 1025 | Convert.ToSingle(row["CameraEyeOffsetZ"]) |
1026 | )); | 1026 | )); |
1027 | 1027 | ||
1028 | prim.SetCameraAtOffset(new LLVector3( | 1028 | prim.SetCameraAtOffset(new Vector3( |
1029 | Convert.ToSingle(row["CameraAtOffsetX"]), | 1029 | Convert.ToSingle(row["CameraAtOffsetX"]), |
1030 | Convert.ToSingle(row["CameraAtOffsetY"]), | 1030 | Convert.ToSingle(row["CameraAtOffsetY"]), |
1031 | Convert.ToSingle(row["CameraAtOffsetZ"]) | 1031 | Convert.ToSingle(row["CameraAtOffsetZ"]) |
@@ -1056,7 +1056,7 @@ VALUES | |||
1056 | private static PrimitiveBaseShape buildShape(DataRow row) | 1056 | private static PrimitiveBaseShape buildShape(DataRow row) |
1057 | { | 1057 | { |
1058 | PrimitiveBaseShape s = new PrimitiveBaseShape(); | 1058 | PrimitiveBaseShape s = new PrimitiveBaseShape(); |
1059 | s.Scale = new LLVector3( | 1059 | s.Scale = new Vector3( |
1060 | Convert.ToSingle(row["ScaleX"]), | 1060 | Convert.ToSingle(row["ScaleX"]), |
1061 | Convert.ToSingle(row["ScaleY"]), | 1061 | Convert.ToSingle(row["ScaleY"]), |
1062 | Convert.ToSingle(row["ScaleZ"]) | 1062 | Convert.ToSingle(row["ScaleZ"]) |
@@ -1108,10 +1108,10 @@ VALUES | |||
1108 | { | 1108 | { |
1109 | TaskInventoryItem taskItem = new TaskInventoryItem(); | 1109 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
1110 | 1110 | ||
1111 | taskItem.ItemID = new LLUUID((String)row["itemID"]); | 1111 | taskItem.ItemID = new UUID((String)row["itemID"]); |
1112 | taskItem.ParentPartID = new LLUUID((String)row["primID"]); | 1112 | taskItem.ParentPartID = new UUID((String)row["primID"]); |
1113 | taskItem.AssetID = new LLUUID((String)row["assetID"]); | 1113 | taskItem.AssetID = new UUID((String)row["assetID"]); |
1114 | taskItem.ParentID = new LLUUID((String)row["parentFolderID"]); | 1114 | taskItem.ParentID = new UUID((String)row["parentFolderID"]); |
1115 | 1115 | ||
1116 | taskItem.InvType = Convert.ToInt32(row["invType"]); | 1116 | taskItem.InvType = Convert.ToInt32(row["invType"]); |
1117 | taskItem.Type = Convert.ToInt32(row["assetType"]); | 1117 | taskItem.Type = Convert.ToInt32(row["assetType"]); |
@@ -1119,10 +1119,10 @@ VALUES | |||
1119 | taskItem.Name = (String)row["name"]; | 1119 | taskItem.Name = (String)row["name"]; |
1120 | taskItem.Description = (String)row["description"]; | 1120 | taskItem.Description = (String)row["description"]; |
1121 | taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); | 1121 | taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); |
1122 | taskItem.CreatorID = new LLUUID((String)row["creatorID"]); | 1122 | taskItem.CreatorID = new UUID((String)row["creatorID"]); |
1123 | taskItem.OwnerID = new LLUUID((String)row["ownerID"]); | 1123 | taskItem.OwnerID = new UUID((String)row["ownerID"]); |
1124 | taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); | 1124 | taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]); |
1125 | taskItem.GroupID = new LLUUID((String)row["groupID"]); | 1125 | taskItem.GroupID = new UUID((String)row["groupID"]); |
1126 | 1126 | ||
1127 | taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); | 1127 | taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); |
1128 | taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); | 1128 | taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); |
@@ -1225,7 +1225,7 @@ VALUES | |||
1225 | /// <param name="land">land parameters.</param> | 1225 | /// <param name="land">land parameters.</param> |
1226 | /// <param name="regionUUID">region UUID.</param> | 1226 | /// <param name="regionUUID">region UUID.</param> |
1227 | /// <returns></returns> | 1227 | /// <returns></returns> |
1228 | private SqlParameter[] CreateLandParameters(LandData land, LLUUID regionUUID) | 1228 | private SqlParameter[] CreateLandParameters(LandData land, UUID regionUUID) |
1229 | { | 1229 | { |
1230 | SqlParameter[] parameters = new SqlParameter[32]; | 1230 | SqlParameter[] parameters = new SqlParameter[32]; |
1231 | 1231 | ||
@@ -1274,7 +1274,7 @@ VALUES | |||
1274 | /// <param name="parcelAccessEntry">parcel access entry.</param> | 1274 | /// <param name="parcelAccessEntry">parcel access entry.</param> |
1275 | /// <param name="parcelID">parcel ID.</param> | 1275 | /// <param name="parcelID">parcel ID.</param> |
1276 | /// <returns></returns> | 1276 | /// <returns></returns> |
1277 | private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, LLUUID parcelID) | 1277 | private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID) |
1278 | { | 1278 | { |
1279 | SqlParameter[] parameters = new SqlParameter[3]; | 1279 | SqlParameter[] parameters = new SqlParameter[3]; |
1280 | 1280 | ||
@@ -1292,7 +1292,7 @@ VALUES | |||
1292 | /// <param name="prim">prim data.</param> | 1292 | /// <param name="prim">prim data.</param> |
1293 | /// <param name="sceneGroupID">scenegroup ID.</param> | 1293 | /// <param name="sceneGroupID">scenegroup ID.</param> |
1294 | /// <param name="regionUUID">regionUUID.</param> | 1294 | /// <param name="regionUUID">regionUUID.</param> |
1295 | private static void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) | 1295 | private static void fillPrimRow(DataRow row, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) |
1296 | { | 1296 | { |
1297 | row["UUID"] = prim.UUID.ToString(); | 1297 | row["UUID"] = prim.UUID.ToString(); |
1298 | row["RegionUUID"] = regionUUID.ToString(); | 1298 | row["RegionUUID"] = regionUUID.ToString(); |
@@ -1340,12 +1340,12 @@ VALUES | |||
1340 | row["RotationW"] = prim.RotationOffset.W; | 1340 | row["RotationW"] = prim.RotationOffset.W; |
1341 | 1341 | ||
1342 | // Sit target | 1342 | // Sit target |
1343 | LLVector3 sitTargetPos = prim.SitTargetPositionLL; | 1343 | Vector3 sitTargetPos = prim.SitTargetPositionLL; |
1344 | row["SitTargetOffsetX"] = sitTargetPos.X; | 1344 | row["SitTargetOffsetX"] = sitTargetPos.X; |
1345 | row["SitTargetOffsetY"] = sitTargetPos.Y; | 1345 | row["SitTargetOffsetY"] = sitTargetPos.Y; |
1346 | row["SitTargetOffsetZ"] = sitTargetPos.Z; | 1346 | row["SitTargetOffsetZ"] = sitTargetPos.Z; |
1347 | 1347 | ||
1348 | LLQuaternion sitTargetOrient = prim.SitTargetOrientationLL; | 1348 | Quaternion sitTargetOrient = prim.SitTargetOrientationLL; |
1349 | row["SitTargetOrientW"] = sitTargetOrient.W; | 1349 | row["SitTargetOrientW"] = sitTargetOrient.W; |
1350 | row["SitTargetOrientX"] = sitTargetOrient.X; | 1350 | row["SitTargetOrientX"] = sitTargetOrient.X; |
1351 | row["SitTargetOrientY"] = sitTargetOrient.Y; | 1351 | row["SitTargetOrientY"] = sitTargetOrient.Y; |
@@ -1364,7 +1364,7 @@ VALUES | |||
1364 | } | 1364 | } |
1365 | else | 1365 | else |
1366 | { | 1366 | { |
1367 | row["LoopedSound"] = LLUUID.Zero; | 1367 | row["LoopedSound"] = UUID.Zero; |
1368 | row["LoopedSoundGain"] = 0.0f; | 1368 | row["LoopedSoundGain"] = 0.0f; |
1369 | } | 1369 | } |
1370 | 1370 | ||
@@ -1446,13 +1446,13 @@ VALUES | |||
1446 | 1446 | ||
1447 | #endregion | 1447 | #endregion |
1448 | 1448 | ||
1449 | private void RetrievePrimsDataForRegion(LLUUID regionUUID, LLUUID sceneGroupID, string primID) | 1449 | private void RetrievePrimsDataForRegion(UUID regionUUID, UUID sceneGroupID, string primID) |
1450 | { | 1450 | { |
1451 | using (SqlConnection connection = _Database.DatabaseConnection()) | 1451 | using (SqlConnection connection = _Database.DatabaseConnection()) |
1452 | { | 1452 | { |
1453 | _PrimDataAdapter.SelectCommand.Connection = connection; | 1453 | _PrimDataAdapter.SelectCommand.Connection = connection; |
1454 | _PrimDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); | 1454 | _PrimDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); |
1455 | if (sceneGroupID != LLUUID.Zero) | 1455 | if (sceneGroupID != UUID.Zero) |
1456 | _PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); | 1456 | _PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); |
1457 | else | 1457 | else |
1458 | _PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; | 1458 | _PrimDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; |
@@ -1462,7 +1462,7 @@ VALUES | |||
1462 | 1462 | ||
1463 | _ShapeDataAdapter.SelectCommand.Connection = connection; | 1463 | _ShapeDataAdapter.SelectCommand.Connection = connection; |
1464 | _ShapeDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); | 1464 | _ShapeDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); |
1465 | if (sceneGroupID != LLUUID.Zero) | 1465 | if (sceneGroupID != UUID.Zero) |
1466 | _ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); | 1466 | _ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); |
1467 | else | 1467 | else |
1468 | _ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; | 1468 | _ShapeDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; |
@@ -1472,7 +1472,7 @@ VALUES | |||
1472 | 1472 | ||
1473 | _ItemsDataAdapter.SelectCommand.Connection = connection; | 1473 | _ItemsDataAdapter.SelectCommand.Connection = connection; |
1474 | _ItemsDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); | 1474 | _ItemsDataAdapter.SelectCommand.Parameters["@RegionUUID"].Value = regionUUID.ToString(); |
1475 | if (sceneGroupID != LLUUID.Zero) | 1475 | if (sceneGroupID != UUID.Zero) |
1476 | _ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); | 1476 | _ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = sceneGroupID.ToString(); |
1477 | else | 1477 | else |
1478 | _ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; | 1478 | _ItemsDataAdapter.SelectCommand.Parameters["@SceneGroupID"].Value = "%"; |