29 using System.Collections.Generic;
33 using System.Reflection;
36 using OpenSim.Framework;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Region.Framework.Scenes;
41 namespace OpenSim.Data.PGSQL
48 private const string _migrationStore =
"RegionStore";
49 private const string LogHeader =
"[REGION DB PGSQL]";
52 private static readonly ILog _Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
58 private string m_connectionString;
59 protected virtual Assembly Assembly
61 get {
return GetType().Assembly; }
70 Initialise(connectionString);
79 m_connectionString = connectionString;
82 using (NpgsqlConnection conn =
new NpgsqlConnection(connectionString))
96 #region SceneObjectGroup region for loading and Store of the scene.
105 UUID lastGroupID = UUID.Zero;
107 Dictionary<UUID, SceneObjectPart> prims =
new Dictionary<UUID, SceneObjectPart>();
108 Dictionary<UUID, SceneObjectGroup> objects =
new Dictionary<UUID, SceneObjectGroup>();
111 string sql =
@"SELECT *,
112 CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort
114 LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID""
115 WHERE ""RegionUUID"" = :RegionUUID
116 ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc";
118 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
119 using (NpgsqlCommand command =
new NpgsqlCommand(sql, conn))
121 command.Parameters.Add(_Database.CreateParameter(
"regionUUID", regionUUID));
123 using (NpgsqlDataReader reader = command.ExecuteReader())
125 while (reader.Read())
128 if (reader[
"Shape"] is DBNull)
129 sceneObjectPart.Shape = PrimitiveBaseShape.Default;
131 sceneObjectPart.Shape = BuildShape(reader);
133 prims[sceneObjectPart.UUID] = sceneObjectPart;
135 UUID groupID =
new UUID((Guid)reader[
"SceneGroupID"]);
137 if (groupID != lastGroupID)
140 objects[grp.UUID] = grp;
142 lastGroupID = groupID;
149 if (sceneObjectPart.
UUID != groupID && groupID !=
UUID.Zero)
152 "[REGION DB]: Found root prim {0} {1} at {2} where group was actually {3}. Forcing UUID to group UUID",
153 sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID);
155 sceneObjectPart.UUID = groupID;
164 int link = sceneObjectPart.LinkNum;
166 grp.AddPart(sceneObjectPart);
169 sceneObjectPart.LinkNum = link;
176 objects[grp.UUID] = grp;
182 List<SceneObjectPart> primsWithInventory =
new List<SceneObjectPart>();
183 string qry =
"select distinct \"primID\" from primitems";
184 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
185 using (NpgsqlCommand command =
new NpgsqlCommand(qry, conn))
188 using (NpgsqlDataReader itemReader = command.ExecuteReader())
190 while (itemReader.Read())
192 if (!(itemReader[
"primID"] is DBNull))
194 UUID primID =
new UUID(itemReader[
"primID"].ToString());
195 if (prims.ContainsKey(primID))
197 primsWithInventory.Add(prims[primID]);
204 LoadItems(primsWithInventory);
206 _Log.DebugFormat(
"[REGION DB]: Loaded {0} objects using {1} prims", objects.Count, prims.Count);
208 return new List<SceneObjectGroup>(objects.Values);
215 private void LoadItems(List<SceneObjectPart> allPrimsWithInventory)
217 string sql =
@"SELECT * FROM primitems WHERE ""primID"" = :PrimID";
218 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
219 using (NpgsqlCommand command =
new NpgsqlCommand(sql, conn))
224 command.Parameters.Clear();
225 command.Parameters.Add(_Database.CreateParameter(
"PrimID", objectPart.UUID));
227 List<TaskInventoryItem> inventory =
new List<TaskInventoryItem>();
229 using (NpgsqlDataReader reader = command.ExecuteReader())
231 while (reader.Read())
235 item.ParentID = objectPart.UUID;
241 objectPart.Inventory.RestoreInventoryItems(inventory);
253 uint flags = obj.RootPart.GetEffectiveObjectFlags();
256 if ((flags & (uint)
PrimFlags.Temporary) != 0)
258 if ((flags & (uint)
PrimFlags.TemporaryOnRez) != 0)
263 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
266 NpgsqlTransaction transaction = conn.BeginTransaction();
273 using (NpgsqlCommand sqlCommand = conn.CreateCommand())
275 sqlCommand.Transaction = transaction;
278 StoreSceneObjectPrim(sceneObjectPart, sqlCommand, obj.
UUID, regionUUID);
280 catch (NpgsqlException sqlEx)
282 _Log.ErrorFormat(
"[REGION DB]: Store SceneObjectPrim SQL error: {0} at line {1}", sqlEx.Message, sqlEx.Line);
288 using (NpgsqlCommand sqlCommand = conn.CreateCommand())
290 sqlCommand.Transaction = transaction;
293 StoreSceneObjectPrimShapes(sceneObjectPart, sqlCommand, obj.
UUID, regionUUID);
295 catch (NpgsqlException sqlEx)
297 _Log.ErrorFormat(
"[REGION DB]: Store SceneObjectPrimShapes SQL error: {0} at line {1}", sqlEx.Message, sqlEx.Line);
303 transaction.Commit();
307 _Log.ErrorFormat(
"[REGION DB]: Store SceneObjectGroup error: {0}, Rolling back...", ex.Message);
310 transaction.Rollback();
312 catch (Exception ex2)
315 _Log.InfoFormat(
"[REGION DB]: Rollback of SceneObjectGroup store transaction failed with error: {0}", ex2.Message);
329 private void StoreSceneObjectPrim(
SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
333 string queryPrims =
@"
335 ""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName,
336 ""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask,
337 ""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ,
338 ""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX,
339 ""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY,
340 ""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY,
341 ""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW,
342 ""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ,
343 ""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY,
344 ""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID,
345 ""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2,
346 ""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain,
347 ""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX,
348 ""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX,
349 ""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
350 ""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
351 ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem,
352 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
353 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
354 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
355 WHERE ""UUID"" = :UUID ;
359 ""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"",
360 ""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"",
361 ""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"",
362 ""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"",
363 ""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"",
364 ""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"",
365 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
366 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
367 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
368 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution""
370 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
371 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
372 :VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ,
373 :RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW,
374 :SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID,
375 :PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX,
376 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
377 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
378 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
379 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution
380 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
384 sqlCommand.CommandText = queryPrims;
386 sqlCommand.Parameters.AddRange(CreatePrimParameters(sceneObjectPart, sceneGroupID, regionUUID));
389 sqlCommand.ExecuteNonQuery();
399 private void StoreSceneObjectPrimShapes(
SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
403 string queryPrimShapes =
@"
404 UPDATE primshapes SET
405 ""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin,
406 ""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY,
407 ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions,
408 ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin,
409 ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow,
410 ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media
411 WHERE ""UUID"" = :UUID ;
415 ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"",
416 ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"",
417 ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media""
420 :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY,
421 :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin,
422 :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media
423 where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID);
427 sqlCommand.CommandText = queryPrimShapes;
430 sqlCommand.Parameters.AddRange(CreatePrimShapeParameters(sceneObjectPart, sceneGroupID, regionUUID));
433 sqlCommand.ExecuteNonQuery();
448 string sqlPrims =
@"DELETE FROM PRIMS WHERE ""SceneGroupID"" = :objectID";
449 string sqlPrimItems =
@"DELETE FROM PRIMITEMS WHERE ""primID"" in (SELECT ""UUID"" FROM PRIMS WHERE ""SceneGroupID"" = :objectID)";
450 string sqlPrimShapes =
@"DELETE FROM PRIMSHAPES WHERE ""UUID"" in (SELECT ""UUID"" FROM PRIMS WHERE ""SceneGroupID"" = :objectID)";
455 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
456 using (NpgsqlCommand cmd =
new NpgsqlCommand())
458 cmd.Connection = conn;
459 cmd.CommandText = sqlPrimShapes;
461 cmd.Parameters.Add(_Database.CreateParameter(
"objectID", objectID));
462 cmd.ExecuteNonQuery();
464 cmd.CommandText = sqlPrimItems;
465 cmd.ExecuteNonQuery();
467 cmd.CommandText = sqlPrims;
468 cmd.ExecuteNonQuery();
489 string sql =
@"delete from primitems where ""primID"" = :primID";
490 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
491 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
493 cmd.Parameters.Add(_Database.CreateParameter(
"primID", primID));
495 cmd.ExecuteNonQuery();
499 @"INSERT INTO primitems (
500 ""itemID"",""primID"",""assetID"",""parentFolderID"",""invType"",""assetType"",""name"",""description"",""creationDate"",""creatorID"",""ownerID"",""lastOwnerID"",""groupID"",
501 ""nextPermissions"",""currentPermissions"",""basePermissions"",""everyonePermissions"",""groupPermissions"",""flags"")
502 VALUES (:itemID,:primID,:assetID,:parentFolderID,:invType,:assetType,:name,:description,:creationDate,:creatorID,:ownerID,
503 :lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)";
505 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
506 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
511 cmd.Parameters.AddRange(CreatePrimInventoryParameters(taskItem));
512 cmd.ExecuteNonQuery();
513 cmd.Parameters.Clear();
527 double[,] ret = null;
529 if (terrData != null)
530 ret = terrData.GetDoubles();
539 string sql =
@"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain
540 where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; ";
542 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
544 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
547 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", regionID));
549 using (NpgsqlDataReader reader = cmd.ExecuteReader())
554 rev = Convert.ToInt32(reader[
"Revision"]);
555 byte[] blob = (byte[])reader[
"Heightfield"];
556 terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
560 _Log.Info(
"[REGION DB]: No terrain found for region");
563 _Log.Info(
"[REGION DB]: Loaded terrain revision r" + rev);
585 string sql =
@"delete from terrain where ""RegionUUID""=:RegionUUID";
586 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
588 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
590 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", regionID));
592 cmd.ExecuteNonQuery();
594 _Log.InfoFormat(
"{0} Deleted terrain revision id = {1}", LogHeader, regionID);
598 int terrainDBRevision;
600 terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
602 sql =
@"insert into terrain(""RegionUUID"", ""Revision"", ""Heightfield"") values(:RegionUUID, :Revision, :Heightfield)";
604 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
606 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
608 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", regionID));
609 cmd.Parameters.Add(_Database.CreateParameter(
"Revision", terrainDBRevision));
610 cmd.Parameters.Add(_Database.CreateParameter(
"Heightfield", terrainDBblob));
612 cmd.ExecuteNonQuery();
614 _Log.InfoFormat(
"{0} Stored terrain id = {1}, terrainSize = <{2},{3}>",
615 LogHeader, regionID, terrData.SizeX, terrData.SizeY);
628 List<LandData> LandDataForRegion =
new List<LandData>();
630 string sql =
@"select * from land where ""RegionUUID"" = :RegionUUID";
633 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
634 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
636 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", regionUUID));
638 using (NpgsqlDataReader readerLandData = cmd.ExecuteReader())
640 while (readerLandData.Read())
642 LandDataForRegion.Add(BuildLandData(readerLandData));
650 sql =
@"select * from landaccesslist where ""LandUUID"" = :LandUUID";
651 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
652 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
654 cmd.Parameters.Add(_Database.CreateParameter(
"LandUUID", LandData.GlobalID));
656 using (NpgsqlDataReader readerAccessList = cmd.ExecuteReader())
658 while (readerAccessList.Read())
660 LandData.ParcelAccessList.Add(BuildLandAccessData(readerAccessList));
667 return LandDataForRegion;
683 string sql =
@"INSERT INTO land
684 (""UUID"",""RegionUUID"",""LocalLandID"",""Bitmap"",""Name"",""Description"",""OwnerUUID"",""IsGroupOwned"",""Area"",""AuctionID"",""Category"",""ClaimDate"",""ClaimPrice"",
685 ""GroupUUID"",""SalePrice"",""LandStatus"",""LandFlags"",""LandingType"",""MediaAutoScale"",""MediaTextureUUID"",""MediaURL"",""MusicURL"",""PassHours"",""PassPrice"",
686 ""SnapshotUUID"",""UserLocationX"",""UserLocationY"",""UserLocationZ"",""UserLookAtX"",""UserLookAtY"",""UserLookAtZ"",""AuthbuyerID"",""OtherCleanTime"")
688 (:UUID,:RegionUUID,:LocalLandID,:Bitmap,:Name,:Description,:OwnerUUID,:IsGroupOwned,:Area,:AuctionID,:Category,:ClaimDate,:ClaimPrice,
689 :GroupUUID,:SalePrice,:LandStatus,:LandFlags,:LandingType,:MediaAutoScale,:MediaTextureUUID,:MediaURL,:MusicURL,:PassHours,:PassPrice,
690 :SnapshotUUID,:UserLocationX,:UserLocationY,:UserLocationZ,:UserLookAtX,:UserLookAtY,:UserLookAtZ,:AuthbuyerID,:OtherCleanTime)";
692 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
693 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
697 cmd.ExecuteNonQuery();
700 sql =
@"INSERT INTO landaccesslist (""LandUUID"",""AccessUUID"",""LandFlags"",""Expires"") VALUES (:LandUUID,:AccessUUID,:Flags,:Expires)";
702 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
703 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
708 cmd.Parameters.AddRange(CreateLandAccessParameters(parcelAccessEntry, parcel.
RegionUUID));
710 cmd.ExecuteNonQuery();
711 cmd.Parameters.Clear();
722 string sql =
@"delete from land where ""UUID""=:UUID";
723 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
724 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
726 cmd.Parameters.Add(_Database.CreateParameter(
"UUID", globalID));
728 cmd.ExecuteNonQuery();
730 sql =
@"delete from landaccesslist where ""LandUUID""=:UUID";
731 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
732 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
734 cmd.Parameters.Add(_Database.CreateParameter(
"UUID", globalID));
736 cmd.ExecuteNonQuery();
742 nWP.OnSave += StoreRegionWindlightSettings;
744 string sql =
@"select * from regionwindlight where ""region_id"" = :regionID";
746 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
747 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
749 cmd.Parameters.Add(_Database.CreateParameter(
"regionID", regionUUID.ToString() ));
751 using (NpgsqlDataReader result = cmd.ExecuteReader())
756 nWP.regionID = regionUUID;
757 StoreRegionWindlightSettings(nWP);
762 nWP.regionID = DBGuid.FromDB(result[
"region_id"]);
763 nWP.waterColor.X = Convert.ToSingle(result[
"water_color_r"]);
764 nWP.waterColor.Y = Convert.ToSingle(result[
"water_color_g"]);
765 nWP.waterColor.Z = Convert.ToSingle(result[
"water_color_b"]);
766 nWP.waterFogDensityExponent = Convert.ToSingle(result[
"water_fog_density_exponent"]);
767 nWP.underwaterFogModifier = Convert.ToSingle(result[
"underwater_fog_modifier"]);
768 nWP.reflectionWaveletScale.X = Convert.ToSingle(result[
"reflection_wavelet_scale_1"]);
769 nWP.reflectionWaveletScale.Y = Convert.ToSingle(result[
"reflection_wavelet_scale_2"]);
770 nWP.reflectionWaveletScale.Z = Convert.ToSingle(result[
"reflection_wavelet_scale_3"]);
771 nWP.fresnelScale = Convert.ToSingle(result[
"fresnel_scale"]);
772 nWP.fresnelOffset = Convert.ToSingle(result[
"fresnel_offset"]);
773 nWP.refractScaleAbove = Convert.ToSingle(result[
"refract_scale_above"]);
774 nWP.refractScaleBelow = Convert.ToSingle(result[
"refract_scale_below"]);
775 nWP.blurMultiplier = Convert.ToSingle(result[
"blur_multiplier"]);
776 nWP.bigWaveDirection.X = Convert.ToSingle(result[
"big_wave_direction_x"]);
777 nWP.bigWaveDirection.Y = Convert.ToSingle(result[
"big_wave_direction_y"]);
778 nWP.littleWaveDirection.X = Convert.ToSingle(result[
"little_wave_direction_x"]);
779 nWP.littleWaveDirection.Y = Convert.ToSingle(result[
"little_wave_direction_y"]);
780 UUID.TryParse(result[
"normal_map_texture"].ToString(), out nWP.
normalMapTexture);
781 nWP.horizon.X = Convert.ToSingle(result[
"horizon_r"]);
782 nWP.horizon.Y = Convert.ToSingle(result[
"horizon_g"]);
783 nWP.horizon.Z = Convert.ToSingle(result[
"horizon_b"]);
784 nWP.horizon.W = Convert.ToSingle(result[
"horizon_i"]);
785 nWP.hazeHorizon = Convert.ToSingle(result[
"haze_horizon"]);
786 nWP.blueDensity.X = Convert.ToSingle(result[
"blue_density_r"]);
787 nWP.blueDensity.Y = Convert.ToSingle(result[
"blue_density_g"]);
788 nWP.blueDensity.Z = Convert.ToSingle(result[
"blue_density_b"]);
789 nWP.blueDensity.W = Convert.ToSingle(result[
"blue_density_i"]);
790 nWP.hazeDensity = Convert.ToSingle(result[
"haze_density"]);
791 nWP.densityMultiplier = Convert.ToSingle(result[
"density_multiplier"]);
792 nWP.distanceMultiplier = Convert.ToSingle(result[
"distance_multiplier"]);
793 nWP.maxAltitude = Convert.ToUInt16(result[
"max_altitude"]);
794 nWP.sunMoonColor.X = Convert.ToSingle(result[
"sun_moon_color_r"]);
795 nWP.sunMoonColor.Y = Convert.ToSingle(result[
"sun_moon_color_g"]);
796 nWP.sunMoonColor.Z = Convert.ToSingle(result[
"sun_moon_color_b"]);
797 nWP.sunMoonColor.W = Convert.ToSingle(result[
"sun_moon_color_i"]);
798 nWP.sunMoonPosition = Convert.ToSingle(result[
"sun_moon_position"]);
799 nWP.ambient.X = Convert.ToSingle(result[
"ambient_r"]);
800 nWP.ambient.Y = Convert.ToSingle(result[
"ambient_g"]);
801 nWP.ambient.Z = Convert.ToSingle(result[
"ambient_b"]);
802 nWP.ambient.W = Convert.ToSingle(result[
"ambient_i"]);
803 nWP.eastAngle = Convert.ToSingle(result[
"east_angle"]);
804 nWP.sunGlowFocus = Convert.ToSingle(result[
"sun_glow_focus"]);
805 nWP.sunGlowSize = Convert.ToSingle(result[
"sun_glow_size"]);
806 nWP.sceneGamma = Convert.ToSingle(result[
"scene_gamma"]);
807 nWP.starBrightness = Convert.ToSingle(result[
"star_brightness"]);
808 nWP.cloudColor.X = Convert.ToSingle(result[
"cloud_color_r"]);
809 nWP.cloudColor.Y = Convert.ToSingle(result[
"cloud_color_g"]);
810 nWP.cloudColor.Z = Convert.ToSingle(result[
"cloud_color_b"]);
811 nWP.cloudColor.W = Convert.ToSingle(result[
"cloud_color_i"]);
812 nWP.cloudXYDensity.X = Convert.ToSingle(result[
"cloud_x"]);
813 nWP.cloudXYDensity.Y = Convert.ToSingle(result[
"cloud_y"]);
814 nWP.cloudXYDensity.Z = Convert.ToSingle(result[
"cloud_density"]);
815 nWP.cloudCoverage = Convert.ToSingle(result[
"cloud_coverage"]);
816 nWP.cloudScale = Convert.ToSingle(result[
"cloud_scale"]);
817 nWP.cloudDetailXYDensity.X = Convert.ToSingle(result[
"cloud_detail_x"]);
818 nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result[
"cloud_detail_y"]);
819 nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result[
"cloud_detail_density"]);
820 nWP.cloudScrollX = Convert.ToSingle(result[
"cloud_scroll_x"]);
821 nWP.cloudScrollXLock = Convert.ToBoolean(result[
"cloud_scroll_x_lock"]);
822 nWP.cloudScrollY = Convert.ToSingle(result[
"cloud_scroll_y"]);
823 nWP.cloudScrollYLock = Convert.ToBoolean(result[
"cloud_scroll_y_lock"]);
824 nWP.drawClassicClouds = Convert.ToBoolean(result[
"draw_classic_clouds"]);
834 string sql =
@"delete from regionwindlight where ""region_id"" = :region_id";
835 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
836 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
839 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", regionID.ToString()));
840 cmd.ExecuteNonQuery();
846 string sql =
@"select region_id from regionwindlight where ""region_id"" = :region_id limit 1;";
848 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
851 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
853 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", wl.regionID.ToString() ));
854 NpgsqlDataReader dr = cmd.ExecuteReader();
860 RemoveRegionWindlightSettings(wl.
regionID);
864 sql =
@"INSERT INTO regionwindlight
869 ,water_fog_density_exponent
870 ,underwater_fog_modifier
871 ,reflection_wavelet_scale_1
872 ,reflection_wavelet_scale_2
873 ,reflection_wavelet_scale_3
879 ,big_wave_direction_x
880 ,big_wave_direction_y
881 ,little_wave_direction_x
882 ,little_wave_direction_y
922 ,cloud_detail_density
927 ,draw_classic_clouds)
933 ,:water_fog_density_exponent
934 ,:underwater_fog_modifier
935 ,:reflection_wavelet_scale_1
936 ,:reflection_wavelet_scale_2
937 ,:reflection_wavelet_scale_3
940 ,:refract_scale_above
941 ,:refract_scale_below
943 ,:big_wave_direction_x
944 ,:big_wave_direction_y
945 ,:little_wave_direction_x
946 ,:little_wave_direction_y
959 ,:distance_multiplier
986 ,:cloud_detail_density
988 ,:cloud_scroll_x_lock
990 ,:cloud_scroll_y_lock
991 ,:draw_classic_clouds);";
993 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
996 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
998 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", wl.regionID.ToString()));
999 cmd.Parameters.Add(_Database.CreateParameter(
"water_color_r", wl.waterColor.X));
1000 cmd.Parameters.Add(_Database.CreateParameter(
"water_color_g", wl.waterColor.Y));
1001 cmd.Parameters.Add(_Database.CreateParameter(
"water_color_b", wl.waterColor.Z));
1002 cmd.Parameters.Add(_Database.CreateParameter(
"water_fog_density_exponent", wl.waterFogDensityExponent));
1003 cmd.Parameters.Add(_Database.CreateParameter(
"underwater_fog_modifier", wl.underwaterFogModifier));
1004 cmd.Parameters.Add(_Database.CreateParameter(
"reflection_wavelet_scale_1", wl.reflectionWaveletScale.X));
1005 cmd.Parameters.Add(_Database.CreateParameter(
"reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y));
1006 cmd.Parameters.Add(_Database.CreateParameter(
"reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z));
1007 cmd.Parameters.Add(_Database.CreateParameter(
"fresnel_scale", wl.fresnelScale));
1008 cmd.Parameters.Add(_Database.CreateParameter(
"fresnel_offset", wl.fresnelOffset));
1009 cmd.Parameters.Add(_Database.CreateParameter(
"refract_scale_above", wl.refractScaleAbove));
1010 cmd.Parameters.Add(_Database.CreateParameter(
"refract_scale_below", wl.refractScaleBelow));
1011 cmd.Parameters.Add(_Database.CreateParameter(
"blur_multiplier", wl.blurMultiplier));
1012 cmd.Parameters.Add(_Database.CreateParameter(
"big_wave_direction_x", wl.bigWaveDirection.X));
1013 cmd.Parameters.Add(_Database.CreateParameter(
"big_wave_direction_y", wl.bigWaveDirection.Y));
1014 cmd.Parameters.Add(_Database.CreateParameter(
"little_wave_direction_x", wl.littleWaveDirection.X));
1015 cmd.Parameters.Add(_Database.CreateParameter(
"little_wave_direction_y", wl.littleWaveDirection.Y));
1016 cmd.Parameters.Add(_Database.CreateParameter(
"normal_map_texture", wl.normalMapTexture.ToString()));
1017 cmd.Parameters.Add(_Database.CreateParameter(
"horizon_r", wl.horizon.X));
1018 cmd.Parameters.Add(_Database.CreateParameter(
"horizon_g", wl.horizon.Y));
1019 cmd.Parameters.Add(_Database.CreateParameter(
"horizon_b", wl.horizon.Z));
1020 cmd.Parameters.Add(_Database.CreateParameter(
"horizon_i", wl.horizon.W));
1021 cmd.Parameters.Add(_Database.CreateParameter(
"haze_horizon", wl.hazeHorizon));
1022 cmd.Parameters.Add(_Database.CreateParameter(
"blue_density_r", wl.blueDensity.X));
1023 cmd.Parameters.Add(_Database.CreateParameter(
"blue_density_g", wl.blueDensity.Y));
1024 cmd.Parameters.Add(_Database.CreateParameter(
"blue_density_b", wl.blueDensity.Z));
1025 cmd.Parameters.Add(_Database.CreateParameter(
"blue_density_i", wl.blueDensity.W));
1026 cmd.Parameters.Add(_Database.CreateParameter(
"haze_density", wl.hazeDensity));
1027 cmd.Parameters.Add(_Database.CreateParameter(
"density_multiplier", wl.densityMultiplier));
1028 cmd.Parameters.Add(_Database.CreateParameter(
"distance_multiplier", wl.distanceMultiplier));
1029 cmd.Parameters.Add(_Database.CreateParameter(
"max_altitude", wl.maxAltitude));
1030 cmd.Parameters.Add(_Database.CreateParameter(
"sun_moon_color_r", wl.sunMoonColor.X));
1031 cmd.Parameters.Add(_Database.CreateParameter(
"sun_moon_color_g", wl.sunMoonColor.Y));
1032 cmd.Parameters.Add(_Database.CreateParameter(
"sun_moon_color_b", wl.sunMoonColor.Z));
1033 cmd.Parameters.Add(_Database.CreateParameter(
"sun_moon_color_i", wl.sunMoonColor.W));
1034 cmd.Parameters.Add(_Database.CreateParameter(
"sun_moon_position", wl.sunMoonPosition));
1035 cmd.Parameters.Add(_Database.CreateParameter(
"ambient_r", wl.ambient.X));
1036 cmd.Parameters.Add(_Database.CreateParameter(
"ambient_g", wl.ambient.Y));
1037 cmd.Parameters.Add(_Database.CreateParameter(
"ambient_b", wl.ambient.Z));
1038 cmd.Parameters.Add(_Database.CreateParameter(
"ambient_i", wl.ambient.W));
1039 cmd.Parameters.Add(_Database.CreateParameter(
"east_angle", wl.eastAngle));
1040 cmd.Parameters.Add(_Database.CreateParameter(
"sun_glow_focus", wl.sunGlowFocus));
1041 cmd.Parameters.Add(_Database.CreateParameter(
"sun_glow_size", wl.sunGlowSize));
1042 cmd.Parameters.Add(_Database.CreateParameter(
"scene_gamma", wl.sceneGamma));
1043 cmd.Parameters.Add(_Database.CreateParameter(
"star_brightness", wl.starBrightness));
1044 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_color_r", wl.cloudColor.X));
1045 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_color_g", wl.cloudColor.Y));
1046 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_color_b", wl.cloudColor.Z));
1047 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_color_i", wl.cloudColor.W));
1048 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_x", wl.cloudXYDensity.X));
1049 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_y", wl.cloudXYDensity.Y));
1050 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_density", wl.cloudXYDensity.Z));
1051 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_coverage", wl.cloudCoverage));
1052 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_scale", wl.cloudScale));
1053 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_detail_x", wl.cloudDetailXYDensity.X));
1054 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_detail_y", wl.cloudDetailXYDensity.Y));
1055 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_detail_density", wl.cloudDetailXYDensity.Z));
1056 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_scroll_x", wl.cloudScrollX));
1057 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_scroll_x_lock", wl.cloudScrollXLock));
1058 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_scroll_y", wl.cloudScrollY));
1059 cmd.Parameters.Add(_Database.CreateParameter(
"cloud_scroll_y_lock", wl.cloudScrollYLock));
1060 cmd.Parameters.Add(_Database.CreateParameter(
"draw_classic_clouds", wl.drawClassicClouds));
1062 cmd.ExecuteNonQuery();
1211 #region Environment Settings
1214 string sql =
"select * from regionenvironment where region_id = :region_id";
1215 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1216 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1218 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", regionUUID));
1220 using (NpgsqlDataReader result = cmd.ExecuteReader())
1224 return String.Empty;
1228 return Convert.ToString(result[
"llsd_settings"]);
1237 string sql =
"DELETE FROM regionenvironment WHERE region_id = :region_id ;";
1239 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1240 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1242 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", regionUUID));
1244 cmd.ExecuteNonQuery();
1247 sql =
"INSERT INTO regionenvironment (region_id, llsd_settings) VALUES (:region_id, :llsd_settings) ;";
1249 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1250 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1252 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", regionUUID));
1253 cmd.Parameters.Add(_Database.CreateParameter(
"llsd_settings", settings));
1256 cmd.ExecuteNonQuery();
1263 string sql =
"delete from regionenvironment where region_id = :region_id ;";
1264 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1265 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1267 cmd.Parameters.Add(_Database.CreateParameter(
"region_id", regionUUID));
1270 cmd.ExecuteNonQuery();
1282 string sql =
@"select * from regionsettings where ""regionUUID"" = :regionUUID";
1284 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1285 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1287 cmd.Parameters.Add(_Database.CreateParameter(
"regionUUID", regionUUID));
1289 using (NpgsqlDataReader reader = cmd.ExecuteReader())
1293 regionSettings = BuildRegionSettings(reader);
1294 regionSettings.OnSave += StoreRegionSettings;
1296 return regionSettings;
1303 regionSettings.RegionUUID = regionUUID;
1304 regionSettings.OnSave += StoreRegionSettings;
1307 StoreNewRegionSettings(regionSettings);
1309 LoadSpawnPoints(regionSettings);
1311 return regionSettings;
1322 string sql =
@"SELECT ""regionUUID"" FROM regionsettings WHERE ""regionUUID"" = :regionUUID";
1323 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1324 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1326 cmd.Parameters.Add(_Database.CreateParameter(
"regionUUID", regionSettings.RegionUUID));
1328 regionUUID = cmd.ExecuteScalar().ToString();
1331 if (
string.IsNullOrEmpty(regionUUID))
1333 StoreNewRegionSettings(regionSettings);
1339 @"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage
1340 ,restrict_pushing = :restrict_pushing ,allow_land_resell = :allow_land_resell ,allow_land_join_divide = :allow_land_join_divide
1341 ,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity
1342 ,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics
1343 ,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3
1344 ,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw
1345 ,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se
1346 ,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit
1347 ,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position
1348 ,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz,
1349 ""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID,
1350 ""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID
1351 WHERE ""regionUUID"" = :regionUUID";
1353 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1354 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1356 cmd.Parameters.AddRange(CreateRegionSettingParameters(regionSettings));
1358 cmd.ExecuteNonQuery();
1361 SaveSpawnPoints(regionSettings);
1369 #region Private Methods
1375 private void StoreNewRegionSettings(
RegionSettings regionSettings)
1377 string sql =
@"INSERT INTO regionsettings
1378 (""regionUUID"",block_terraform,block_fly,allow_damage,restrict_pushing,allow_land_resell,allow_land_join_divide,
1379 block_show_in_search,agent_limit,object_bonus,maturity,disable_scripts,disable_collisions,disable_physics,
1380 terrain_texture_1,terrain_texture_2,terrain_texture_3,terrain_texture_4,elevation_1_nw,elevation_2_nw,elevation_1_ne,
1381 elevation_2_ne,elevation_1_se,elevation_2_se,elevation_1_sw,elevation_2_sw,water_height,terrain_raise_limit,
1382 terrain_lower_limit,use_estate_sun,fixed_sun,sun_position,covenant,covenant_datetime,sunvectorx, sunvectory, sunvectorz,
1383 ""Sandbox"", loaded_creation_datetime, loaded_creation_id
1386 (:regionUUID,:block_terraform,:block_fly,:allow_damage,:restrict_pushing,:allow_land_resell,:allow_land_join_divide,
1387 :block_show_in_search,:agent_limit,:object_bonus,:maturity,:disable_scripts,:disable_collisions,:disable_physics,
1388 :terrain_texture_1,:terrain_texture_2,:terrain_texture_3,:terrain_texture_4,:elevation_1_nw,:elevation_2_nw,:elevation_1_ne,
1389 :elevation_2_ne,:elevation_1_se,:elevation_2_se,:elevation_1_sw,:elevation_2_sw,:water_height,:terrain_raise_limit,
1390 :terrain_lower_limit,:use_estate_sun,:fixed_sun,:sun_position,:covenant, :covenant_datetime, :sunvectorx,:sunvectory,
1391 :sunvectorz, :Sandbox, :loaded_creation_datetime, :loaded_creation_id )";
1393 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
1394 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
1396 cmd.Parameters.AddRange(CreateRegionSettingParameters(regionSettings));
1398 cmd.ExecuteNonQuery();
1402 #region Private DataRecord conversion methods
1409 private static RegionSettings BuildRegionSettings(IDataRecord row)
1414 newSettings.RegionUUID =
new UUID((Guid)row[
"regionUUID"]);
1415 newSettings.BlockTerraform = Convert.ToBoolean(row[
"block_terraform"]);
1416 newSettings.AllowDamage = Convert.ToBoolean(row[
"allow_damage"]);
1417 newSettings.BlockFly = Convert.ToBoolean(row[
"block_fly"]);
1418 newSettings.RestrictPushing = Convert.ToBoolean(row[
"restrict_pushing"]);
1419 newSettings.AllowLandResell = Convert.ToBoolean(row[
"allow_land_resell"]);
1420 newSettings.AllowLandJoinDivide = Convert.ToBoolean(row[
"allow_land_join_divide"]);
1421 newSettings.BlockShowInSearch = Convert.ToBoolean(row[
"block_show_in_search"]);
1422 newSettings.AgentLimit = Convert.ToInt32(row[
"agent_limit"]);
1423 newSettings.ObjectBonus = Convert.ToDouble(row[
"object_bonus"]);
1424 newSettings.Maturity = Convert.ToInt32(row[
"maturity"]);
1425 newSettings.DisableScripts = Convert.ToBoolean(row[
"disable_scripts"]);
1426 newSettings.DisableCollisions = Convert.ToBoolean(row[
"disable_collisions"]);
1427 newSettings.DisablePhysics = Convert.ToBoolean(row[
"disable_physics"]);
1428 newSettings.TerrainTexture1 =
new UUID((Guid)row[
"terrain_texture_1"]);
1429 newSettings.TerrainTexture2 =
new UUID((Guid)row[
"terrain_texture_2"]);
1430 newSettings.TerrainTexture3 =
new UUID((Guid)row[
"terrain_texture_3"]);
1431 newSettings.TerrainTexture4 =
new UUID((Guid)row[
"terrain_texture_4"]);
1432 newSettings.Elevation1NW = Convert.ToDouble(row[
"elevation_1_nw"]);
1433 newSettings.Elevation2NW = Convert.ToDouble(row[
"elevation_2_nw"]);
1434 newSettings.Elevation1NE = Convert.ToDouble(row[
"elevation_1_ne"]);
1435 newSettings.Elevation2NE = Convert.ToDouble(row[
"elevation_2_ne"]);
1436 newSettings.Elevation1SE = Convert.ToDouble(row[
"elevation_1_se"]);
1437 newSettings.Elevation2SE = Convert.ToDouble(row[
"elevation_2_se"]);
1438 newSettings.Elevation1SW = Convert.ToDouble(row[
"elevation_1_sw"]);
1439 newSettings.Elevation2SW = Convert.ToDouble(row[
"elevation_2_sw"]);
1440 newSettings.WaterHeight = Convert.ToDouble(row[
"water_height"]);
1441 newSettings.TerrainRaiseLimit = Convert.ToDouble(row[
"terrain_raise_limit"]);
1442 newSettings.TerrainLowerLimit = Convert.ToDouble(row[
"terrain_lower_limit"]);
1443 newSettings.UseEstateSun = Convert.ToBoolean(row[
"use_estate_sun"]);
1444 newSettings.Sandbox = Convert.ToBoolean(row[
"Sandbox"]);
1445 newSettings.FixedSun = Convert.ToBoolean(row[
"fixed_sun"]);
1446 newSettings.SunPosition = Convert.ToDouble(row[
"sun_position"]);
1447 newSettings.SunVector =
new Vector3(
1448 Convert.ToSingle(row[
"sunvectorx"]),
1449 Convert.ToSingle(row[
"sunvectory"]),
1450 Convert.ToSingle(row[
"sunvectorz"])
1452 newSettings.Covenant =
new UUID((Guid)row[
"covenant"]);
1453 newSettings.CovenantChangedDateTime = Convert.ToInt32(row[
"covenant_datetime"]);
1454 newSettings.LoadedCreationDateTime = Convert.ToInt32(row[
"loaded_creation_datetime"]);
1456 if (row[
"loaded_creation_id"] is DBNull)
1457 newSettings.LoadedCreationID =
"";
1459 newSettings.LoadedCreationID = (
String)row[
"loaded_creation_id"];
1461 newSettings.TerrainImageID =
new UUID((
string)row[
"map_tile_ID"]);
1462 newSettings.ParcelImageID =
new UUID((Guid)row[
"parcel_tile_ID"]);
1463 newSettings.TelehubObject =
new UUID((Guid)row[
"TelehubObject"]);
1473 private static LandData BuildLandData(IDataRecord row)
1475 LandData newData =
new LandData();
1477 newData.GlobalID =
new UUID((Guid)row[
"UUID"]);
1478 newData.LocalID = Convert.ToInt32(row[
"LocalLandID"]);
1481 newData.Bitmap = (Byte[])row[
"Bitmap"];
1483 newData.Name = (string)row[
"Name"];
1484 newData.Description = (string)row[
"Description"];
1485 newData.OwnerID =
new UUID((Guid)row[
"OwnerUUID"]);
1486 newData.IsGroupOwned = Convert.ToBoolean(row[
"IsGroupOwned"]);
1487 newData.Area = Convert.ToInt32(row[
"Area"]);
1488 newData.AuctionID = Convert.ToUInt32(row[
"AuctionID"]);
1489 newData.Category = (ParcelCategory)Convert.ToInt32(row[
"Category"]);
1491 newData.ClaimDate = Convert.ToInt32(row[
"ClaimDate"]);
1492 newData.ClaimPrice = Convert.ToInt32(row[
"ClaimPrice"]);
1493 newData.GroupID =
new UUID((Guid)row[
"GroupUUID"]);
1494 newData.SalePrice = Convert.ToInt32(row[
"SalePrice"]);
1495 newData.Status = (ParcelStatus)Convert.ToInt32(row[
"LandStatus"]);
1497 newData.Flags = Convert.ToUInt32(row[
"LandFlags"]);
1498 newData.LandingType = Convert.ToByte(row[
"LandingType"]);
1499 newData.MediaAutoScale = Convert.ToByte(row[
"MediaAutoScale"]);
1500 newData.MediaID =
new UUID((Guid)row[
"MediaTextureUUID"]);
1501 newData.MediaURL = (string)row[
"MediaURL"];
1502 newData.MusicURL = (string)row[
"MusicURL"];
1503 newData.PassHours = Convert.ToSingle(row[
"PassHours"]);
1504 newData.PassPrice = Convert.ToInt32(row[
"PassPrice"]);
1514 newData.AuthBuyerID =
new UUID((Guid)row[
"AuthBuyerID"]);
1515 newData.SnapshotID =
new UUID((Guid)row[
"SnapshotUUID"]);
1517 newData.OtherCleanTime = Convert.ToInt32(row[
"OtherCleanTime"]);
1521 newData.UserLocation =
1522 new Vector3(Convert.ToSingle(row[
"UserLocationX"]), Convert.ToSingle(row[
"UserLocationY"]),
1523 Convert.ToSingle(row[
"UserLocationZ"]));
1524 newData.UserLookAt =
1525 new Vector3(Convert.ToSingle(row[
"UserLookAtX"]), Convert.ToSingle(row[
"UserLookAtY"]),
1526 Convert.ToSingle(row[
"UserLookAtZ"]));
1528 catch (InvalidCastException)
1530 newData.UserLocation = Vector3.Zero;
1531 newData.UserLookAt = Vector3.Zero;
1532 _Log.ErrorFormat(
"[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
1535 newData.ParcelAccessList =
new List<LandAccessEntry>();
1536 newData.MediaDescription = (string)row[
"MediaDescription"];
1537 newData.MediaType = (string)row[
"MediaType"];
1538 newData.MediaWidth = Convert.ToInt32((((string)row[
"MediaSize"]).Split(
','))[0]);
1539 newData.MediaHeight = Convert.ToInt32((((string)row[
"MediaSize"]).Split(
','))[1]);
1540 newData.MediaLoop = Convert.ToBoolean(row[
"MediaLoop"]);
1541 newData.ObscureMusic = Convert.ToBoolean(row[
"ObscureMusic"]);
1542 newData.ObscureMedia = Convert.ToBoolean(row[
"ObscureMedia"]);
1555 entry.AgentID =
new UUID((Guid)row[
"AccessUUID"]);
1556 entry.Flags = (AccessList)Convert.ToInt32(row[
"Flags"]);
1557 entry.Expires = Convert.ToInt32(row[
"Expires"]);
1570 prim.UUID =
new UUID((Guid)primRow[
"UUID"]);
1573 prim.CreationDate = Convert.ToInt32(primRow[
"CreationDate"]);
1574 prim.Name = (string)primRow[
"Name"];
1576 prim.Text = (string)primRow[
"Text"];
1577 prim.Color = Color.FromArgb(Convert.ToInt32(primRow[
"ColorA"]),
1578 Convert.ToInt32(primRow[
"ColorR"]),
1579 Convert.ToInt32(primRow[
"ColorG"]),
1580 Convert.ToInt32(primRow[
"ColorB"]));
1581 prim.Description = (string)primRow[
"Description"];
1582 prim.SitName = (string)primRow[
"SitName"];
1583 prim.TouchName = (string)primRow[
"TouchName"];
1585 prim.Flags = (
PrimFlags)Convert.ToUInt32(primRow[
"ObjectFlags"]);
1587 prim.CreatorIdentification = (string)primRow[
"CreatorID"].ToString();
1588 prim.OwnerID =
new UUID((Guid)primRow[
"OwnerID"]);
1589 prim.GroupID =
new UUID((Guid)primRow[
"GroupID"]);
1590 prim.LastOwnerID =
new UUID((Guid)primRow[
"LastOwnerID"]);
1591 prim.OwnerMask = Convert.ToUInt32(primRow[
"OwnerMask"]);
1592 prim.NextOwnerMask = Convert.ToUInt32(primRow[
"NextOwnerMask"]);
1593 prim.GroupMask = Convert.ToUInt32(primRow[
"GroupMask"]);
1594 prim.EveryoneMask = Convert.ToUInt32(primRow[
"EveryoneMask"]);
1595 prim.BaseMask = Convert.ToUInt32(primRow[
"BaseMask"]);
1597 prim.OffsetPosition =
new Vector3(
1598 Convert.ToSingle(primRow[
"PositionX"]),
1599 Convert.ToSingle(primRow[
"PositionY"]),
1600 Convert.ToSingle(primRow[
"PositionZ"]));
1602 prim.GroupPosition =
new Vector3(
1603 Convert.ToSingle(primRow[
"GroupPositionX"]),
1604 Convert.ToSingle(primRow[
"GroupPositionY"]),
1605 Convert.ToSingle(primRow[
"GroupPositionZ"]));
1607 prim.Velocity =
new Vector3(
1608 Convert.ToSingle(primRow[
"VelocityX"]),
1609 Convert.ToSingle(primRow[
"VelocityY"]),
1610 Convert.ToSingle(primRow[
"VelocityZ"]));
1612 prim.AngularVelocity =
new Vector3(
1613 Convert.ToSingle(primRow[
"AngularVelocityX"]),
1614 Convert.ToSingle(primRow[
"AngularVelocityY"]),
1615 Convert.ToSingle(primRow[
"AngularVelocityZ"]));
1617 prim.Acceleration =
new Vector3(
1618 Convert.ToSingle(primRow[
"AccelerationX"]),
1619 Convert.ToSingle(primRow[
"AccelerationY"]),
1620 Convert.ToSingle(primRow[
"AccelerationZ"]));
1623 prim.RotationOffset =
new Quaternion(
1624 Convert.ToSingle(primRow[
"RotationX"]),
1625 Convert.ToSingle(primRow[
"RotationY"]),
1626 Convert.ToSingle(primRow[
"RotationZ"]),
1627 Convert.ToSingle(primRow[
"RotationW"]));
1629 prim.SitTargetPositionLL =
new Vector3(
1630 Convert.ToSingle(primRow[
"SitTargetOffsetX"]),
1631 Convert.ToSingle(primRow[
"SitTargetOffsetY"]),
1632 Convert.ToSingle(primRow[
"SitTargetOffsetZ"]));
1634 prim.SitTargetOrientationLL =
new Quaternion(
1635 Convert.ToSingle(primRow[
"SitTargetOrientX"]),
1636 Convert.ToSingle(primRow[
"SitTargetOrientY"]),
1637 Convert.ToSingle(primRow[
"SitTargetOrientZ"]),
1638 Convert.ToSingle(primRow[
"SitTargetOrientW"]));
1640 prim.PayPrice[0] = Convert.ToInt32(primRow[
"PayPrice"]);
1641 prim.PayPrice[1] = Convert.ToInt32(primRow[
"PayButton1"]);
1642 prim.PayPrice[2] = Convert.ToInt32(primRow[
"PayButton2"]);
1643 prim.PayPrice[3] = Convert.ToInt32(primRow[
"PayButton3"]);
1644 prim.PayPrice[4] = Convert.ToInt32(primRow[
"PayButton4"]);
1646 prim.Sound =
new UUID((Guid)primRow[
"LoopedSound"]);
1647 prim.SoundGain = Convert.ToSingle(primRow[
"LoopedSoundGain"]);
1648 prim.SoundFlags = 1;
1650 if (!(primRow[
"TextureAnimation"] is DBNull))
1652 if (!(primRow[
"ParticleSystem"] is DBNull))
1655 prim.AngularVelocity =
new Vector3(
1656 Convert.ToSingle(primRow[
"OmegaX"]),
1657 Convert.ToSingle(primRow[
"OmegaY"]),
1658 Convert.ToSingle(primRow[
"OmegaZ"]));
1660 prim.SetCameraEyeOffset(
new Vector3(
1661 Convert.ToSingle(primRow[
"CameraEyeOffsetX"]),
1662 Convert.ToSingle(primRow[
"CameraEyeOffsetY"]),
1663 Convert.ToSingle(primRow[
"CameraEyeOffsetZ"])
1666 prim.SetCameraAtOffset(
new Vector3(
1667 Convert.ToSingle(primRow[
"CameraAtOffsetX"]),
1668 Convert.ToSingle(primRow[
"CameraAtOffsetY"]),
1669 Convert.ToSingle(primRow[
"CameraAtOffsetZ"])
1672 if (Convert.ToInt16(primRow[
"ForceMouselook"]) != 0)
1675 prim.ScriptAccessPin = Convert.ToInt32(primRow[
"ScriptAccessPin"]);
1677 if (Convert.ToInt16(primRow[
"AllowedDrop"]) != 0)
1680 if (Convert.ToInt16(primRow[
"DieAtEdge"]) != 0)
1683 prim.
SalePrice = Convert.ToInt32(primRow[
"SalePrice"]);
1684 prim.ObjectSaleType = Convert.ToByte(primRow[
"SaleType"]);
1686 prim.Material = Convert.ToByte(primRow[
"Material"]);
1688 if (!(primRow[
"ClickAction"] is DBNull))
1689 prim.
ClickAction = Convert.ToByte(primRow[
"ClickAction"]);
1691 prim.CollisionSound =
new UUID((Guid)primRow[
"CollisionSound"]);
1692 prim.CollisionSoundVolume = Convert.ToSingle(primRow[
"CollisionSoundVolume"]);
1694 prim.PassTouches = (bool)primRow[
"PassTouches"];
1696 if (!(primRow[
"MediaURL"] is System.DBNull))
1697 prim.
MediaUrl = (
string)primRow[
"MediaURL"];
1699 if (!(primRow[
"DynAttrs"] is System.DBNull) && (string)primRow[
"DynAttrs"] !=
"")
1700 prim.DynAttrs = DAMap.FromXml((string)primRow[
"DynAttrs"]);
1702 prim.DynAttrs =
new DAMap();
1704 prim.PhysicsShapeType = Convert.ToByte(primRow[
"PhysicsShapeType"]);
1705 prim.Density = Convert.ToSingle(primRow[
"Density"]);
1706 prim.GravityModifier = Convert.ToSingle(primRow[
"GravityModifier"]);
1707 prim.Friction = Convert.ToSingle(primRow[
"Friction"]);
1708 prim.Restitution = Convert.ToSingle(primRow[
"Restitution"]);
1722 baseShape.Scale =
new Vector3(
1723 (
float)Convert.ToDouble(shapeRow[
"ScaleX"]),
1724 (float)Convert.ToDouble(shapeRow[
"ScaleY"]),
1725 (float)Convert.ToDouble(shapeRow[
"ScaleZ"]));
1728 baseShape.PCode = Convert.ToByte(shapeRow[
"PCode"]);
1729 baseShape.PathBegin = Convert.ToUInt16(shapeRow[
"PathBegin"]);
1730 baseShape.PathEnd = Convert.ToUInt16(shapeRow[
"PathEnd"]);
1731 baseShape.PathScaleX = Convert.ToByte(shapeRow[
"PathScaleX"]);
1732 baseShape.PathScaleY = Convert.ToByte(shapeRow[
"PathScaleY"]);
1733 baseShape.PathShearX = Convert.ToByte(shapeRow[
"PathShearX"]);
1734 baseShape.PathShearY = Convert.ToByte(shapeRow[
"PathShearY"]);
1735 baseShape.PathSkew = Convert.ToSByte(shapeRow[
"PathSkew"]);
1736 baseShape.PathCurve = Convert.ToByte(shapeRow[
"PathCurve"]);
1737 baseShape.PathRadiusOffset = Convert.ToSByte(shapeRow[
"PathRadiusOffset"]);
1738 baseShape.PathRevolutions = Convert.ToByte(shapeRow[
"PathRevolutions"]);
1739 baseShape.PathTaperX = Convert.ToSByte(shapeRow[
"PathTaperX"]);
1740 baseShape.PathTaperY = Convert.ToSByte(shapeRow[
"PathTaperY"]);
1741 baseShape.PathTwist = Convert.ToSByte(shapeRow[
"PathTwist"]);
1742 baseShape.PathTwistBegin = Convert.ToSByte(shapeRow[
"PathTwistBegin"]);
1744 baseShape.ProfileBegin = Convert.ToUInt16(shapeRow[
"ProfileBegin"]);
1745 baseShape.ProfileEnd = Convert.ToUInt16(shapeRow[
"ProfileEnd"]);
1746 baseShape.ProfileCurve = Convert.ToByte(shapeRow[
"ProfileCurve"]);
1747 baseShape.ProfileHollow = Convert.ToUInt16(shapeRow[
"ProfileHollow"]);
1749 byte[] textureEntry = (byte[])shapeRow[
"Texture"];
1750 baseShape.TextureEntry = textureEntry;
1752 baseShape.ExtraParams = (byte[])shapeRow[
"ExtraParams"];
1756 baseShape.State = Convert.ToByte(shapeRow[
"State"]);
1758 catch (InvalidCastException)
1762 if (!(shapeRow[
"Media"] is System.DBNull))
1764 baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow[
"Media"]);
1779 taskItem.ItemID =
new UUID((Guid)inventoryRow[
"itemID"]);
1780 taskItem.ParentPartID =
new UUID((Guid)inventoryRow[
"primID"]);
1781 taskItem.AssetID =
new UUID((Guid)inventoryRow[
"assetID"]);
1782 taskItem.ParentID =
new UUID((Guid)inventoryRow[
"parentFolderID"]);
1784 taskItem.InvType = Convert.ToInt32(inventoryRow[
"invType"]);
1785 taskItem.Type = Convert.ToInt32(inventoryRow[
"assetType"]);
1787 taskItem.Name = (string)inventoryRow[
"name"];
1788 taskItem.Description = (string)inventoryRow[
"description"];
1789 taskItem.CreationDate = Convert.ToUInt32(inventoryRow[
"creationDate"]);
1791 taskItem.CreatorIdentification = (string)inventoryRow[
"creatorID"].ToString();
1792 taskItem.OwnerID =
new UUID((Guid)inventoryRow[
"ownerID"]);
1793 taskItem.LastOwnerID =
new UUID((Guid)inventoryRow[
"lastOwnerID"]);
1794 taskItem.GroupID =
new UUID((Guid)inventoryRow[
"groupID"]);
1796 taskItem.NextPermissions = Convert.ToUInt32(inventoryRow[
"nextPermissions"]);
1797 taskItem.CurrentPermissions = Convert.ToUInt32(inventoryRow[
"currentPermissions"]);
1798 taskItem.BasePermissions = Convert.ToUInt32(inventoryRow[
"basePermissions"]);
1799 taskItem.EveryonePermissions = Convert.ToUInt32(inventoryRow[
"everyonePermissions"]);
1800 taskItem.GroupPermissions = Convert.ToUInt32(inventoryRow[
"groupPermissions"]);
1801 taskItem.Flags = Convert.ToUInt32(inventoryRow[
"flags"]);
1808 #region Create parameters methods
1815 private NpgsqlParameter[] CreatePrimInventoryParameters(
TaskInventoryItem taskItem)
1817 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
1819 parameters.Add(_Database.CreateParameter(
"itemID", taskItem.ItemID));
1820 parameters.Add(_Database.CreateParameter(
"primID", taskItem.ParentPartID));
1821 parameters.Add(_Database.CreateParameter(
"assetID", taskItem.AssetID));
1822 parameters.Add(_Database.CreateParameter(
"parentFolderID", taskItem.ParentID));
1823 parameters.Add(_Database.CreateParameter(
"invType", taskItem.InvType));
1824 parameters.Add(_Database.CreateParameter(
"assetType", taskItem.Type));
1826 parameters.Add(_Database.CreateParameter(
"name", taskItem.Name));
1827 parameters.Add(_Database.CreateParameter(
"description", taskItem.Description));
1828 parameters.Add(_Database.CreateParameter(
"creationDate", taskItem.CreationDate));
1829 parameters.Add(_Database.CreateParameter(
"creatorID", taskItem.CreatorID));
1830 parameters.Add(_Database.CreateParameter(
"ownerID", taskItem.OwnerID));
1831 parameters.Add(_Database.CreateParameter(
"lastOwnerID", taskItem.LastOwnerID));
1832 parameters.Add(_Database.CreateParameter(
"groupID", taskItem.GroupID));
1833 parameters.Add(_Database.CreateParameter(
"nextPermissions", taskItem.NextPermissions));
1834 parameters.Add(_Database.CreateParameter(
"currentPermissions", taskItem.CurrentPermissions));
1835 parameters.Add(_Database.CreateParameter(
"basePermissions", taskItem.BasePermissions));
1836 parameters.Add(_Database.CreateParameter(
"everyonePermissions", taskItem.EveryonePermissions));
1837 parameters.Add(_Database.CreateParameter(
"groupPermissions", taskItem.GroupPermissions));
1838 parameters.Add(_Database.CreateParameter(
"flags", taskItem.Flags));
1840 return parameters.ToArray();
1848 private NpgsqlParameter[] CreateRegionSettingParameters(
RegionSettings settings)
1850 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
1852 parameters.Add(_Database.CreateParameter(
"regionUUID", settings.RegionUUID));
1853 parameters.Add(_Database.CreateParameter(
"block_terraform", settings.BlockTerraform));
1854 parameters.Add(_Database.CreateParameter(
"block_fly", settings.BlockFly));
1855 parameters.Add(_Database.CreateParameter(
"allow_damage", settings.AllowDamage));
1856 parameters.Add(_Database.CreateParameter(
"restrict_pushing", settings.RestrictPushing));
1857 parameters.Add(_Database.CreateParameter(
"allow_land_resell", settings.AllowLandResell));
1858 parameters.Add(_Database.CreateParameter(
"allow_land_join_divide", settings.AllowLandJoinDivide));
1859 parameters.Add(_Database.CreateParameter(
"block_show_in_search", settings.BlockShowInSearch));
1860 parameters.Add(_Database.CreateParameter(
"agent_limit", settings.AgentLimit));
1861 parameters.Add(_Database.CreateParameter(
"object_bonus", settings.ObjectBonus));
1862 parameters.Add(_Database.CreateParameter(
"maturity", settings.Maturity));
1863 parameters.Add(_Database.CreateParameter(
"disable_scripts", settings.DisableScripts));
1864 parameters.Add(_Database.CreateParameter(
"disable_collisions", settings.DisableCollisions));
1865 parameters.Add(_Database.CreateParameter(
"disable_physics", settings.DisablePhysics));
1866 parameters.Add(_Database.CreateParameter(
"terrain_texture_1", settings.TerrainTexture1));
1867 parameters.Add(_Database.CreateParameter(
"terrain_texture_2", settings.TerrainTexture2));
1868 parameters.Add(_Database.CreateParameter(
"terrain_texture_3", settings.TerrainTexture3));
1869 parameters.Add(_Database.CreateParameter(
"terrain_texture_4", settings.TerrainTexture4));
1870 parameters.Add(_Database.CreateParameter(
"elevation_1_nw", settings.Elevation1NW));
1871 parameters.Add(_Database.CreateParameter(
"elevation_2_nw", settings.Elevation2NW));
1872 parameters.Add(_Database.CreateParameter(
"elevation_1_ne", settings.Elevation1NE));
1873 parameters.Add(_Database.CreateParameter(
"elevation_2_ne", settings.Elevation2NE));
1874 parameters.Add(_Database.CreateParameter(
"elevation_1_se", settings.Elevation1SE));
1875 parameters.Add(_Database.CreateParameter(
"elevation_2_se", settings.Elevation2SE));
1876 parameters.Add(_Database.CreateParameter(
"elevation_1_sw", settings.Elevation1SW));
1877 parameters.Add(_Database.CreateParameter(
"elevation_2_sw", settings.Elevation2SW));
1878 parameters.Add(_Database.CreateParameter(
"water_height", settings.WaterHeight));
1879 parameters.Add(_Database.CreateParameter(
"terrain_raise_limit", settings.TerrainRaiseLimit));
1880 parameters.Add(_Database.CreateParameter(
"terrain_lower_limit", settings.TerrainLowerLimit));
1881 parameters.Add(_Database.CreateParameter(
"use_estate_sun", settings.UseEstateSun));
1882 parameters.Add(_Database.CreateParameter(
"Sandbox", settings.Sandbox));
1883 parameters.Add(_Database.CreateParameter(
"fixed_sun", settings.FixedSun));
1884 parameters.Add(_Database.CreateParameter(
"sun_position", settings.SunPosition));
1885 parameters.Add(_Database.CreateParameter(
"sunvectorx", settings.SunVector.X));
1886 parameters.Add(_Database.CreateParameter(
"sunvectory", settings.SunVector.Y));
1887 parameters.Add(_Database.CreateParameter(
"sunvectorz", settings.SunVector.Z));
1888 parameters.Add(_Database.CreateParameter(
"covenant", settings.Covenant));
1889 parameters.Add(_Database.CreateParameter(
"covenant_datetime", settings.CovenantChangedDateTime));
1890 parameters.Add(_Database.CreateParameter(
"Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
1891 parameters.Add(_Database.CreateParameter(
"Loaded_Creation_ID", settings.LoadedCreationID));
1892 parameters.Add(_Database.CreateParameter(
"TerrainImageID", settings.TerrainImageID));
1893 parameters.Add(_Database.CreateParameter(
"ParcelImageID", settings.ParcelImageID));
1894 parameters.Add(_Database.CreateParameter(
"TelehubObject", settings.TelehubObject));
1896 return parameters.ToArray();
1905 private NpgsqlParameter[] CreateLandParameters(
LandData land, UUID regionUUID)
1907 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
1909 parameters.Add(_Database.CreateParameter(
"UUID", land.GlobalID));
1910 parameters.Add(_Database.CreateParameter(
"RegionUUID", regionUUID));
1911 parameters.Add(_Database.CreateParameter(
"LocalLandID", land.LocalID));
1914 parameters.Add(_Database.CreateParameter(
"Bitmap", land.Bitmap));
1916 parameters.Add(_Database.CreateParameter(
"Name", land.Name));
1917 parameters.Add(_Database.CreateParameter(
"Description", land.Description));
1918 parameters.Add(_Database.CreateParameter(
"OwnerUUID", land.OwnerID));
1919 parameters.Add(_Database.CreateParameter(
"IsGroupOwned", land.IsGroupOwned));
1920 parameters.Add(_Database.CreateParameter(
"Area", land.Area));
1921 parameters.Add(_Database.CreateParameter(
"AuctionID", land.AuctionID));
1922 parameters.Add(_Database.CreateParameter(
"Category", (int)
land.Category));
1923 parameters.Add(_Database.CreateParameter(
"ClaimDate", land.ClaimDate));
1924 parameters.Add(_Database.CreateParameter(
"ClaimPrice", land.ClaimPrice));
1925 parameters.Add(_Database.CreateParameter(
"GroupUUID", land.GroupID));
1926 parameters.Add(_Database.CreateParameter(
"SalePrice", land.SalePrice));
1927 parameters.Add(_Database.CreateParameter(
"LandStatus", (int)
land.Status));
1928 parameters.Add(_Database.CreateParameter(
"LandFlags", land.Flags));
1929 parameters.Add(_Database.CreateParameter(
"LandingType", Convert.ToInt32( land.LandingType) ));
1930 parameters.Add(_Database.CreateParameter(
"MediaAutoScale", Convert.ToInt32( land.MediaAutoScale )));
1931 parameters.Add(_Database.CreateParameter(
"MediaTextureUUID", land.MediaID));
1932 parameters.Add(_Database.CreateParameter(
"MediaURL", land.MediaURL));
1933 parameters.Add(_Database.CreateParameter(
"MusicURL", land.MusicURL));
1934 parameters.Add(_Database.CreateParameter(
"PassHours", land.PassHours));
1935 parameters.Add(_Database.CreateParameter(
"PassPrice", land.PassPrice));
1936 parameters.Add(_Database.CreateParameter(
"SnapshotUUID", land.SnapshotID));
1937 parameters.Add(_Database.CreateParameter(
"UserLocationX", land.UserLocation.X));
1938 parameters.Add(_Database.CreateParameter(
"UserLocationY", land.UserLocation.Y));
1939 parameters.Add(_Database.CreateParameter(
"UserLocationZ", land.UserLocation.Z));
1940 parameters.Add(_Database.CreateParameter(
"UserLookAtX", land.UserLookAt.X));
1941 parameters.Add(_Database.CreateParameter(
"UserLookAtY", land.UserLookAt.Y));
1942 parameters.Add(_Database.CreateParameter(
"UserLookAtZ", land.UserLookAt.Z));
1943 parameters.Add(_Database.CreateParameter(
"AuthBuyerID", land.AuthBuyerID));
1944 parameters.Add(_Database.CreateParameter(
"OtherCleanTime", land.OtherCleanTime));
1946 return parameters.ToArray();
1955 private NpgsqlParameter[] CreateLandAccessParameters(
LandAccessEntry parcelAccessEntry, UUID parcelID)
1957 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
1959 parameters.Add(_Database.CreateParameter(
"LandUUID", parcelID));
1960 parameters.Add(_Database.CreateParameter(
"AccessUUID", parcelAccessEntry.AgentID));
1961 parameters.Add(_Database.CreateParameter(
"Flags", parcelAccessEntry.Flags));
1962 parameters.Add(_Database.CreateParameter(
"Expires", parcelAccessEntry.Expires));
1964 return parameters.ToArray();
1974 private NpgsqlParameter[] CreatePrimParameters(
SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
1976 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
1978 parameters.Add(_Database.CreateParameter(
"UUID", prim.UUID));
1979 parameters.Add(_Database.CreateParameter(
"RegionUUID", regionUUID));
1980 parameters.Add(_Database.CreateParameter(
"CreationDate", prim.CreationDate));
1981 parameters.Add(_Database.CreateParameter(
"Name", prim.Name));
1982 parameters.Add(_Database.CreateParameter(
"SceneGroupID", sceneGroupID));
1985 parameters.Add(_Database.CreateParameter(
"Text", prim.Text));
1986 parameters.Add(_Database.CreateParameter(
"ColorR", prim.Color.R));
1987 parameters.Add(_Database.CreateParameter(
"ColorG", prim.Color.G));
1988 parameters.Add(_Database.CreateParameter(
"ColorB", prim.Color.B));
1989 parameters.Add(_Database.CreateParameter(
"ColorA", prim.Color.A));
1990 parameters.Add(_Database.CreateParameter(
"Description", prim.Description));
1991 parameters.Add(_Database.CreateParameter(
"SitName", prim.SitName));
1992 parameters.Add(_Database.CreateParameter(
"TouchName", prim.TouchName));
1994 parameters.Add(_Database.CreateParameter(
"ObjectFlags", (uint)
prim.Flags));
1995 parameters.Add(_Database.CreateParameter(
"CreatorID", prim.CreatorID));
1996 parameters.Add(_Database.CreateParameter(
"OwnerID", prim.OwnerID));
1997 parameters.Add(_Database.CreateParameter(
"GroupID", prim.GroupID));
1998 parameters.Add(_Database.CreateParameter(
"LastOwnerID", prim.LastOwnerID));
1999 parameters.Add(_Database.CreateParameter(
"OwnerMask", prim.OwnerMask));
2000 parameters.Add(_Database.CreateParameter(
"NextOwnerMask", prim.NextOwnerMask));
2001 parameters.Add(_Database.CreateParameter(
"GroupMask", prim.GroupMask));
2002 parameters.Add(_Database.CreateParameter(
"EveryoneMask", prim.EveryoneMask));
2003 parameters.Add(_Database.CreateParameter(
"BaseMask", prim.BaseMask));
2005 parameters.Add(_Database.CreateParameter(
"PositionX", prim.OffsetPosition.X));
2006 parameters.Add(_Database.CreateParameter(
"PositionY", prim.OffsetPosition.Y));
2007 parameters.Add(_Database.CreateParameter(
"PositionZ", prim.OffsetPosition.Z));
2008 parameters.Add(_Database.CreateParameter(
"GroupPositionX", prim.GroupPosition.X));
2009 parameters.Add(_Database.CreateParameter(
"GroupPositionY", prim.GroupPosition.Y));
2010 parameters.Add(_Database.CreateParameter(
"GroupPositionZ", prim.GroupPosition.Z));
2011 parameters.Add(_Database.CreateParameter(
"VelocityX", prim.Velocity.X));
2012 parameters.Add(_Database.CreateParameter(
"VelocityY", prim.Velocity.Y));
2013 parameters.Add(_Database.CreateParameter(
"VelocityZ", prim.Velocity.Z));
2014 parameters.Add(_Database.CreateParameter(
"AngularVelocityX", prim.AngularVelocity.X));
2015 parameters.Add(_Database.CreateParameter(
"AngularVelocityY", prim.AngularVelocity.Y));
2016 parameters.Add(_Database.CreateParameter(
"AngularVelocityZ", prim.AngularVelocity.Z));
2017 parameters.Add(_Database.CreateParameter(
"AccelerationX", prim.Acceleration.X));
2018 parameters.Add(_Database.CreateParameter(
"AccelerationY", prim.Acceleration.Y));
2019 parameters.Add(_Database.CreateParameter(
"AccelerationZ", prim.Acceleration.Z));
2021 parameters.Add(_Database.CreateParameter(
"RotationX", prim.RotationOffset.X));
2022 parameters.Add(_Database.CreateParameter(
"RotationY", prim.RotationOffset.Y));
2023 parameters.Add(_Database.CreateParameter(
"RotationZ", prim.RotationOffset.Z));
2024 parameters.Add(_Database.CreateParameter(
"RotationW", prim.RotationOffset.W));
2027 Vector3 sitTargetPos = prim.SitTargetPositionLL;
2028 parameters.Add(_Database.CreateParameter(
"SitTargetOffsetX", sitTargetPos.X));
2029 parameters.Add(_Database.CreateParameter(
"SitTargetOffsetY", sitTargetPos.Y));
2030 parameters.Add(_Database.CreateParameter(
"SitTargetOffsetZ", sitTargetPos.Z));
2032 Quaternion sitTargetOrient = prim.SitTargetOrientationLL;
2033 parameters.Add(_Database.CreateParameter(
"SitTargetOrientW", sitTargetOrient.W));
2034 parameters.Add(_Database.CreateParameter(
"SitTargetOrientX", sitTargetOrient.X));
2035 parameters.Add(_Database.CreateParameter(
"SitTargetOrientY", sitTargetOrient.Y));
2036 parameters.Add(_Database.CreateParameter(
"SitTargetOrientZ", sitTargetOrient.Z));
2038 parameters.Add(_Database.CreateParameter(
"PayPrice", prim.PayPrice[0]));
2039 parameters.Add(_Database.CreateParameter(
"PayButton1", prim.PayPrice[1]));
2040 parameters.Add(_Database.CreateParameter(
"PayButton2", prim.PayPrice[2]));
2041 parameters.Add(_Database.CreateParameter(
"PayButton3", prim.PayPrice[3]));
2042 parameters.Add(_Database.CreateParameter(
"PayButton4", prim.PayPrice[4]));
2044 if ((
prim.SoundFlags & 1) != 0)
2046 parameters.Add(_Database.CreateParameter(
"LoopedSound", prim.Sound));
2047 parameters.Add(_Database.CreateParameter(
"LoopedSoundGain", prim.SoundGain));
2051 parameters.Add(_Database.CreateParameter(
"LoopedSound", UUID.Zero));
2052 parameters.Add(_Database.CreateParameter(
"LoopedSoundGain", 0.0f));
2055 parameters.Add(_Database.CreateParameter(
"TextureAnimation", prim.TextureAnimation));
2056 parameters.Add(_Database.CreateParameter(
"ParticleSystem", prim.ParticleSystem));
2058 parameters.Add(_Database.CreateParameter(
"OmegaX", prim.AngularVelocity.X));
2059 parameters.Add(_Database.CreateParameter(
"OmegaY", prim.AngularVelocity.Y));
2060 parameters.Add(_Database.CreateParameter(
"OmegaZ", prim.AngularVelocity.Z));
2062 parameters.Add(_Database.CreateParameter(
"CameraEyeOffsetX", prim.GetCameraEyeOffset().X));
2063 parameters.Add(_Database.CreateParameter(
"CameraEyeOffsetY", prim.GetCameraEyeOffset().Y));
2064 parameters.Add(_Database.CreateParameter(
"CameraEyeOffsetZ", prim.GetCameraEyeOffset().Z));
2066 parameters.Add(_Database.CreateParameter(
"CameraAtOffsetX", prim.GetCameraAtOffset().X));
2067 parameters.Add(_Database.CreateParameter(
"CameraAtOffsetY", prim.GetCameraAtOffset().Y));
2068 parameters.Add(_Database.CreateParameter(
"CameraAtOffsetZ", prim.GetCameraAtOffset().Z));
2070 if (
prim.GetForceMouselook())
2071 parameters.Add(_Database.CreateParameter(
"ForceMouselook", 1));
2073 parameters.Add(_Database.CreateParameter(
"ForceMouselook", 0));
2075 parameters.Add(_Database.CreateParameter(
"ScriptAccessPin", prim.ScriptAccessPin));
2077 if (
prim.AllowedDrop)
2078 parameters.Add(_Database.CreateParameter(
"AllowedDrop", 1));
2080 parameters.Add(_Database.CreateParameter(
"AllowedDrop", 0));
2082 if (
prim.DIE_AT_EDGE)
2083 parameters.Add(_Database.CreateParameter(
"DieAtEdge", 1));
2085 parameters.Add(_Database.CreateParameter(
"DieAtEdge", 0));
2087 parameters.Add(_Database.CreateParameter(
"SalePrice", prim.SalePrice));
2088 parameters.Add(_Database.CreateParameter(
"SaleType", prim.ObjectSaleType));
2090 byte clickAction = prim.ClickAction;
2091 parameters.Add(_Database.CreateParameter(
"ClickAction", clickAction));
2093 parameters.Add(_Database.CreateParameter(
"Material",
prim.Material));
2095 parameters.Add(_Database.CreateParameter(
"CollisionSound", prim.CollisionSound));
2096 parameters.Add(_Database.CreateParameter(
"CollisionSoundVolume", prim.CollisionSoundVolume));
2098 parameters.Add(_Database.CreateParameter(
"PassTouches", prim.PassTouches));
2100 parameters.Add(_Database.CreateParameter(
"LinkNumber", prim.LinkNum));
2101 parameters.Add(_Database.CreateParameter(
"MediaURL", prim.MediaUrl));
2103 if (
prim.DynAttrs.CountNamespaces > 0)
2104 parameters.Add(_Database.CreateParameter(
"DynAttrs", prim.DynAttrs.ToXml()));
2106 parameters.Add(_Database.CreateParameter(
"DynAttrs", null));
2108 parameters.Add(_Database.CreateParameter(
"PhysicsShapeType", prim.PhysicsShapeType));
2109 parameters.Add(_Database.CreateParameter(
"Density", (double)
prim.Density));
2110 parameters.Add(_Database.CreateParameter(
"GravityModifier", (double)
prim.GravityModifier));
2111 parameters.Add(_Database.CreateParameter(
"Friction", (double)
prim.Friction));
2112 parameters.Add(_Database.CreateParameter(
"Restitution", (double)
prim.Restitution));
2114 return parameters.ToArray();
2124 private NpgsqlParameter[] CreatePrimShapeParameters(
SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
2126 List<NpgsqlParameter> parameters =
new List<NpgsqlParameter>();
2129 parameters.Add(_Database.CreateParameter(
"UUID", prim.UUID));
2131 parameters.Add(_Database.CreateParameter(
"Shape", 0));
2133 parameters.Add(_Database.CreateParameter(
"ScaleX", s.Scale.X));
2134 parameters.Add(_Database.CreateParameter(
"ScaleY", s.Scale.Y));
2135 parameters.Add(_Database.CreateParameter(
"ScaleZ", s.Scale.Z));
2137 parameters.Add(_Database.CreateParameter(
"PCode", s.PCode));
2138 parameters.Add(_Database.CreateParameter(
"PathBegin", s.PathBegin));
2139 parameters.Add(_Database.CreateParameter(
"PathEnd", s.PathEnd));
2140 parameters.Add(_Database.CreateParameter(
"PathScaleX", s.PathScaleX));
2141 parameters.Add(_Database.CreateParameter(
"PathScaleY", s.PathScaleY));
2142 parameters.Add(_Database.CreateParameter(
"PathShearX", s.PathShearX));
2143 parameters.Add(_Database.CreateParameter(
"PathShearY", s.PathShearY));
2144 parameters.Add(_Database.CreateParameter(
"PathSkew", s.PathSkew));
2145 parameters.Add(_Database.CreateParameter(
"PathCurve", s.PathCurve));
2146 parameters.Add(_Database.CreateParameter(
"PathRadiusOffset", s.PathRadiusOffset));
2147 parameters.Add(_Database.CreateParameter(
"PathRevolutions", s.PathRevolutions));
2148 parameters.Add(_Database.CreateParameter(
"PathTaperX", s.PathTaperX));
2149 parameters.Add(_Database.CreateParameter(
"PathTaperY", s.PathTaperY));
2150 parameters.Add(_Database.CreateParameter(
"PathTwist", s.PathTwist));
2151 parameters.Add(_Database.CreateParameter(
"PathTwistBegin", s.PathTwistBegin));
2153 parameters.Add(_Database.CreateParameter(
"ProfileBegin", s.ProfileBegin));
2154 parameters.Add(_Database.CreateParameter(
"ProfileEnd", s.ProfileEnd));
2155 parameters.Add(_Database.CreateParameter(
"ProfileCurve", s.ProfileCurve));
2156 parameters.Add(_Database.CreateParameter(
"ProfileHollow", s.ProfileHollow));
2157 parameters.Add(_Database.CreateParameter(
"Texture", s.TextureEntry));
2158 parameters.Add(_Database.CreateParameter(
"ExtraParams", s.ExtraParams));
2159 parameters.Add(_Database.CreateParameter(
"State", s.State));
2161 if (null == s.Media)
2163 parameters.Add(_Database.CreateParameter(
"Media", DBNull.Value));
2167 parameters.Add(_Database.CreateParameter(
"Media", s.Media.ToXml()));
2170 return parameters.ToArray();
2179 rs.ClearSpawnPoints();
2181 string sql =
@"SELECT ""Yaw"", ""Pitch"", ""Distance"" FROM spawn_points WHERE ""RegionUUID"" = :RegionUUID";
2183 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
2184 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
2186 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", rs.RegionUUID));
2188 using (NpgsqlDataReader reader = cmd.ExecuteReader())
2194 sp.Yaw = (float)reader[
"Yaw"];
2195 sp.Pitch = (float)reader[
"Pitch"];
2196 sp.Distance = (float)reader[
"Distance"];
2198 rs.AddSpawnPoint(sp);
2206 string sql =
@"DELETE FROM spawn_points WHERE ""RegionUUID"" = :RegionUUID";
2207 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
2208 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
2210 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", rs.RegionUUID));
2212 cmd.ExecuteNonQuery();
2216 sql =
@"INSERT INTO spawn_points (""RegionUUID"", ""Yaw"", ""Pitch"", ""Distance"") VALUES (:RegionUUID, :Yaw, :Pitch, :Distance)";
2217 using (NpgsqlConnection conn =
new NpgsqlConnection(m_connectionString))
2218 using (NpgsqlCommand cmd =
new NpgsqlCommand(sql, conn))
2220 cmd.Parameters.Add(_Database.CreateParameter(
"RegionUUID", rs.RegionUUID));
2221 cmd.Parameters.Add(_Database.CreateParameter(
"Yaw", p.Yaw));
2222 cmd.Parameters.Add(_Database.CreateParameter(
"Pitch", p.Pitch));
2223 cmd.Parameters.Add(_Database.CreateParameter(
"Distance", p.Distance));
2225 cmd.ExecuteNonQuery();
2235 public void SaveExtra(UUID regionID,
string name,
string value)
2243 public Dictionary<string, string>
GetExtra(UUID regionID)
void StorePrimInventory(UUID primID, ICollection< TaskInventoryItem > items)
Store the inventory of a prim. Warning deletes everything first and then adds all again...
void Dispose()
Dispose the database
RegionSettings LoadRegionSettings(UUID regionUUID)
Loads the settings of a region.
void StoreRegionWindlightSettings(RegionLightShareData wl)
List< LandAccessEntry > ParcelAccessList
List of access data for the parcel. User data, some bitflags, and a time
void StoreObject(SceneObjectGroup obj, UUID regionUUID)
Stores all object's details apart from inventory
void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
Store Environment settings into region storage
PGSQLSimulationData(string connectionString)
void RemoveRegionEnvironmentSettings(UUID regionUUID)
Delete Environment settings from region storage
Dictionary< string, string > GetExtra(UUID regionID)
OpenSim.Framework.RegionSettings RegionSettings
void SaveExtra(UUID regionID, string name, string value)
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Represents an item in a task inventory
void StoreTerrain(TerrainData terrData, UUID regionID)
Stores the terrain map to DB.
string MediaUrl
Used for media on a prim.
UUID GlobalID
Global ID for the parcel. (3rd Party Integration)
List< SceneObjectGroup > LoadObjects(UUID regionUUID)
Loads the objects present in the region.
A management class for the MS SQL Storage Engine
void StoreLandObject(ILandObject parcel)
Stores land object with landaccess list.
void RemoveRegionWindlightSettings(UUID regionID)
List< LandData > LoadLandObjects(UUID regionUUID)
Loads all the land objects of a region.
TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
Load the latest terrain revision from region storage
void Initialise(string connectionString)
Initialises the region datastore
This class stores and retrieves dynamic attributes.
void StoreRegionSettings(RegionSettings regionSettings)
Store region settings, need to check if the check is really necesary. If we can make something for cr...
Details of a Parcel of land
void SetForceMouselook(bool force)
RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
void RemoveExtra(UUID regionID, string name)
UUID[] GetObjectIDs(UUID regionID)
void RemoveObject(UUID objectID, UUID regionUUID)
Removes a object from the database. Meaning removing it from tables Prims, PrimShapes and PrimItems ...
void StoreTerrain(double[,] terrain, UUID regionID)
Material
Material type for a primitive
List< SpawnPoint > SpawnPoints()
void RemoveLandObject(UUID globalID)
Removes a land object from DB.
A PGSQL Interface for the Region Server.
string LoadRegionEnvironmentSettings(UUID regionUUID)
Load Environment settings from region storage
double[,] LoadTerrain(UUID regionID)
Loads the terrain map.