aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs1
-rw-r--r--OpenSim/Region/Framework/Properties/AssemblyInfo.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs56
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs126
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs10
7 files changed, 201 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
index da39e95..0bb4567 100644
--- a/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IJsonStoreModule.cs
@@ -37,6 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces
37 { 37 {
38 bool CreateStore(string value, ref UUID result); 38 bool CreateStore(string value, ref UUID result);
39 bool DestroyStore(UUID storeID); 39 bool DestroyStore(UUID storeID);
40 bool TestStore(UUID storeID);
40 bool TestPath(UUID storeID, string path, bool useJson); 41 bool TestPath(UUID storeID, string path, bool useJson);
41 bool SetValue(UUID storeID, string path, string value, bool useJson); 42 bool SetValue(UUID storeID, string path, string value, bool useJson);
42 bool RemoveValue(UUID storeID, string path); 43 bool RemoveValue(UUID storeID, string path);
diff --git a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs
index 9b504c0..2a5828e 100644
--- a/OpenSim/Region/Framework/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Framework/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.7.5.*")] 32[assembly: AssemblyVersion("0.7.6.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")] 33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 902ded1..9ee1520 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -549,6 +549,20 @@ namespace OpenSim.Region.Framework.Scenes
549 /// </remarks> 549 /// </remarks>
550 public event ScriptControlEvent OnScriptControlEvent; 550 public event ScriptControlEvent OnScriptControlEvent;
551 551
552 public delegate void ScriptMovingStartEvent(uint localID);
553
554 /// <summary>
555 /// TODO: Should be triggered when a physics object starts moving.
556 /// </summary>
557 public event ScriptMovingStartEvent OnScriptMovingStartEvent;
558
559 public delegate void ScriptMovingEndEvent(uint localID);
560
561 /// <summary>
562 /// TODO: Should be triggered when a physics object stops moving.
563 /// </summary>
564 public event ScriptMovingEndEvent OnScriptMovingEndEvent;
565
552 public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); 566 public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos);
553 567
554 /// <summary> 568 /// <summary>
@@ -2212,6 +2226,48 @@ namespace OpenSim.Region.Framework.Scenes
2212 } 2226 }
2213 } 2227 }
2214 2228
2229 public void TriggerMovingStartEvent(uint localID)
2230 {
2231 ScriptMovingStartEvent handlerScriptMovingStartEvent = OnScriptMovingStartEvent;
2232 if (handlerScriptMovingStartEvent != null)
2233 {
2234 foreach (ScriptMovingStartEvent d in handlerScriptMovingStartEvent.GetInvocationList())
2235 {
2236 try
2237 {
2238 d(localID);
2239 }
2240 catch (Exception e)
2241 {
2242 m_log.ErrorFormat(
2243 "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}",
2244 e.Message, e.StackTrace);
2245 }
2246 }
2247 }
2248 }
2249
2250 public void TriggerMovingEndEvent(uint localID)
2251 {
2252 ScriptMovingEndEvent handlerScriptMovingEndEvent = OnScriptMovingEndEvent;
2253 if (handlerScriptMovingEndEvent != null)
2254 {
2255 foreach (ScriptMovingEndEvent d in handlerScriptMovingEndEvent.GetInvocationList())
2256 {
2257 try
2258 {
2259 d(localID);
2260 }
2261 catch (Exception e)
2262 {
2263 m_log.ErrorFormat(
2264 "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}",
2265 e.Message, e.StackTrace);
2266 }
2267 }
2268 }
2269 }
2270
2215 public void TriggerRequestChangeWaterHeight(float height) 2271 public void TriggerRequestChangeWaterHeight(float height)
2216 { 2272 {
2217 if (height < 0) 2273 if (height < 0)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 92bf85a..6808017 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -407,16 +407,16 @@ namespace OpenSim.Region.Framework.Scenes
407 if (item.Owner != remoteClient.AgentId) 407 if (item.Owner != remoteClient.AgentId)
408 return; 408 return;
409 409
410 if (UUID.Zero == transactionID) 410 item.Name = itemUpd.Name;
411 { 411 item.Description = itemUpd.Description;
412 item.Name = itemUpd.Name;
413 item.Description = itemUpd.Description;
414 412
415// m_log.DebugFormat( 413// m_log.DebugFormat(
416// "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}", 414// "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}",
417// itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags, 415// itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags,
418// item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions); 416// item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions);
419 417
418 if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid
419 {
420 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) 420 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
421 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; 421 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
422 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; 422 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
@@ -451,7 +451,8 @@ namespace OpenSim.Region.Framework.Scenes
451 451
452 InventoryService.UpdateItem(item); 452 InventoryService.UpdateItem(item);
453 } 453 }
454 else 454
455 if (UUID.Zero != transactionID)
455 { 456 {
456 if (AgentTransactionsModule != null) 457 if (AgentTransactionsModule != null)
457 { 458 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f2cb117..f8d84e3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -917,10 +917,15 @@ namespace OpenSim.Region.Framework.Scenes
917 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); 917 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
918 UUID tileID; 918 UUID tileID;
919 919
920 if (UUID.TryParse(tile, out tileID)) 920 if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID))
921 { 921 {
922 RegionInfo.RegionSettings.TerrainImageID = tileID; 922 RegionInfo.RegionSettings.TerrainImageID = tileID;
923 } 923 }
924 else
925 {
926 RegionInfo.RegionSettings.TerrainImageID = RegionInfo.MaptileStaticUUID;
927 m_log.InfoFormat("[SCENE]: Region {0}, maptile set to {1}", RegionInfo.RegionName, RegionInfo.MaptileStaticUUID.ToString());
928 }
924 } 929 }
925 930
926 string grant = startupConfig.GetString("AllowedClients", String.Empty); 931 string grant = startupConfig.GetString("AllowedClients", String.Empty);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a90872e..6e41774 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -200,6 +200,11 @@ namespace OpenSim.Region.Framework.Scenes
200 200
201 private const int LAND_VELOCITYMAG_MAX = 12; 201 private const int LAND_VELOCITYMAG_MAX = 12;
202 202
203 private const float FLY_ROLL_MAX_RADIANS = 1.1f;
204
205 private const float FLY_ROLL_RADIANS_PER_UPDATE = 0.06f;
206 private const float FLY_ROLL_RESET_RADIANS_PER_UPDATE = 0.02f;
207
203 private float m_health = 100f; 208 private float m_health = 100f;
204 209
205 protected ulong crossingFromRegion; 210 protected ulong crossingFromRegion;
@@ -568,6 +573,14 @@ namespace OpenSim.Region.Framework.Scenes
568 } 573 }
569 } 574 }
570 575
576 // Used for limited viewer 'fake' user rotations.
577 private Vector3 m_AngularVelocity = Vector3.Zero;
578
579 public Vector3 AngularVelocity
580 {
581 get { return m_AngularVelocity; }
582 }
583
571 public bool IsChildAgent { get; set; } 584 public bool IsChildAgent { get; set; }
572 585
573 /// <summary> 586 /// <summary>
@@ -690,6 +703,8 @@ namespace OpenSim.Region.Framework.Scenes
690 703
691 #endregion 704 #endregion
692 705
706
707
693 #region Constructor(s) 708 #region Constructor(s)
694 709
695 public ScenePresence( 710 public ScenePresence(
@@ -1033,6 +1048,85 @@ namespace OpenSim.Region.Framework.Scenes
1033 ControllingClient.StopFlying(this); 1048 ControllingClient.StopFlying(this);
1034 } 1049 }
1035 1050
1051 /// <summary>
1052 /// Applies a roll accumulator to the avatar's angular velocity for the avatar fly roll effect.
1053 /// </summary>
1054 /// <param name="amount">Postive or negative roll amount in radians</param>
1055 private void ApplyFlyingRoll(float amount, bool PressingUp, bool PressingDown)
1056 {
1057
1058 float rollAmount = Util.Clamp(m_AngularVelocity.Z + amount, -FLY_ROLL_MAX_RADIANS, FLY_ROLL_MAX_RADIANS);
1059 m_AngularVelocity.Z = rollAmount;
1060
1061 // APPLY EXTRA consideration for flying up and flying down during this time.
1062 // if we're turning left
1063 if (amount > 0)
1064 {
1065
1066 // If we're at the max roll and pressing up, we want to swing BACK a bit
1067 // Automatically adds noise
1068 if (PressingUp)
1069 {
1070 if (m_AngularVelocity.Z >= FLY_ROLL_MAX_RADIANS - 0.04f)
1071 m_AngularVelocity.Z -= 0.9f;
1072 }
1073 // If we're at the max roll and pressing down, we want to swing MORE a bit
1074 if (PressingDown)
1075 {
1076 if (m_AngularVelocity.Z >= FLY_ROLL_MAX_RADIANS && m_AngularVelocity.Z < FLY_ROLL_MAX_RADIANS + 0.6f)
1077 m_AngularVelocity.Z += 0.6f;
1078 }
1079 }
1080 else // we're turning right.
1081 {
1082 // If we're at the max roll and pressing up, we want to swing BACK a bit
1083 // Automatically adds noise
1084 if (PressingUp)
1085 {
1086 if (m_AngularVelocity.Z <= (-FLY_ROLL_MAX_RADIANS))
1087 m_AngularVelocity.Z += 0.6f;
1088 }
1089 // If we're at the max roll and pressing down, we want to swing MORE a bit
1090 if (PressingDown)
1091 {
1092 if (m_AngularVelocity.Z >= -FLY_ROLL_MAX_RADIANS - 0.6f)
1093 m_AngularVelocity.Z -= 0.6f;
1094 }
1095 }
1096 }
1097
1098 /// <summary>
1099 /// incrementally sets roll amount to zero
1100 /// </summary>
1101 /// <param name="amount">Positive roll amount in radians</param>
1102 /// <returns></returns>
1103 private float CalculateFlyingRollResetToZero(float amount)
1104 {
1105 const float rollMinRadians = 0f;
1106
1107 if (m_AngularVelocity.Z > 0)
1108 {
1109
1110 float leftOverToMin = m_AngularVelocity.Z - rollMinRadians;
1111 if (amount > leftOverToMin)
1112 return -leftOverToMin;
1113 else
1114 return -amount;
1115
1116 }
1117 else
1118 {
1119
1120 float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians;
1121 if (amount > leftOverToMin)
1122 return leftOverToMin;
1123 else
1124 return amount;
1125 }
1126 }
1127
1128
1129
1036 // neighbouring regions we have enabled a child agent in 1130 // neighbouring regions we have enabled a child agent in
1037 // holds the seed cap for the child agent in that region 1131 // holds the seed cap for the child agent in that region
1038 private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); 1132 private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>();
@@ -1513,6 +1607,33 @@ namespace OpenSim.Region.Framework.Scenes
1513 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || 1607 bool controlland = (((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) ||
1514 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0)); 1608 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
1515 1609
1610
1611 //m_log.Debug("[CONTROL]: " +flags);
1612 // Applies a satisfying roll effect to the avatar when flying.
1613 if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) != 0) && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0))
1614 {
1615
1616 ApplyFlyingRoll(FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0));
1617
1618
1619 }
1620 else if (((flags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) != 0) &&
1621 ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0))
1622 {
1623 ApplyFlyingRoll(-FLY_ROLL_RADIANS_PER_UPDATE, ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0), ((flags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0));
1624
1625
1626 }
1627 else
1628 {
1629 if (m_AngularVelocity.Z != 0)
1630 m_AngularVelocity.Z += CalculateFlyingRollResetToZero(FLY_ROLL_RESET_RADIANS_PER_UPDATE);
1631
1632 }
1633
1634
1635
1636
1516 if (Flying && IsColliding && controlland) 1637 if (Flying && IsColliding && controlland)
1517 { 1638 {
1518 // nesting this check because LengthSquared() is expensive and we don't 1639 // nesting this check because LengthSquared() is expensive and we don't
@@ -2221,7 +2342,7 @@ namespace OpenSim.Region.Framework.Scenes
2221 2342
2222 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2343 ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2223 ParentID = m_requestedSitTargetID; 2344 ParentID = m_requestedSitTargetID;
2224 2345 m_AngularVelocity = Vector3.Zero;
2225 Velocity = Vector3.Zero; 2346 Velocity = Vector3.Zero;
2226 RemoveFromPhysicalScene(); 2347 RemoveFromPhysicalScene();
2227 2348
@@ -2237,7 +2358,8 @@ namespace OpenSim.Region.Framework.Scenes
2237 2358
2238 public void HandleAgentSitOnGround() 2359 public void HandleAgentSitOnGround()
2239 { 2360 {
2240// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. 2361// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick..
2362 m_AngularVelocity = Vector3.Zero;
2241 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); 2363 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
2242 SitGround = true; 2364 SitGround = true;
2243 RemoveFromPhysicalScene(); 2365 RemoveFromPhysicalScene();
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index e238d01..ad33607 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -131,7 +131,10 @@ namespace OpenSim.Region.Framework.Scenes
131 /// within this object). 131 /// within this object).
132 /// </remarks> 132 /// </remarks>
133 /// <param name="sceneObject">The scene object for which to gather assets</param> 133 /// <param name="sceneObject">The scene object for which to gather assets</param>
134 /// <param name="assetUuids">The assets gathered</param> 134 /// <param name="assetUuids">
135 /// A dictionary which is populated with the asset UUIDs gathered and the type of that asset.
136 /// For assets where the type is not clear (e.g. UUIDs extracted from LSL and notecards), the type is Unknown.
137 /// </param>
135 public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids) 138 public void GatherAssetUuids(SceneObjectGroup sceneObject, IDictionary<UUID, AssetType> assetUuids)
136 { 139 {
137// m_log.DebugFormat( 140// m_log.DebugFormat(
@@ -261,8 +264,9 @@ namespace OpenSim.Region.Framework.Scenes
261 UUID uuid = new UUID(uuidMatch.Value); 264 UUID uuid = new UUID(uuidMatch.Value);
262// m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid); 265// m_log.DebugFormat("[ARCHIVER]: Recording {0} in text", uuid);
263 266
264 // Assume AssetIDs embedded are textures. 267 // Embedded asset references (if not false positives) could be for many types of asset, so we will
265 assetUuids[uuid] = AssetType.Texture; 268 // label these as unknown.
269 assetUuids[uuid] = AssetType.Unknown;
266 } 270 }
267 } 271 }
268 } 272 }