aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorBlueWall2011-02-09 14:45:40 -0500
committerBlueWall2011-02-09 14:45:40 -0500
commit0f736e5601a738b4da435b392774ba211647da9c (patch)
treeedb1f9d90c01841eea86b2ce0b2fbf410dc416ee /OpenSim/Region/Framework
parentMerge branch 'master' of /home/opensim/src/OpenSim/Core (diff)
parentFlash out the prim count module (diff)
downloadopensim-SC_OLD-0f736e5601a738b4da435b392774ba211647da9c.zip
opensim-SC_OLD-0f736e5601a738b4da435b392774ba211647da9c.tar.gz
opensim-SC_OLD-0f736e5601a738b4da435b392774ba211647da9c.tar.bz2
opensim-SC_OLD-0f736e5601a738b4da435b392774ba211647da9c.tar.xz
Merge branch 'master' of /home/opensim/src/OpenSim/Core
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandChannel.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandObject.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs55
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs49
6 files changed, 108 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index e8738c4..8b96de4 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Interfaces
42 42
43 void TeleportHome(UUID id, IClientAPI client); 43 void TeleportHome(UUID id, IClientAPI client);
44 44
45 void Cross(ScenePresence agent, bool isFlying); 45 bool Cross(ScenePresence agent, bool isFlying);
46 46
47 void AgentArrivedAtDestination(UUID agent); 47 void AgentArrivedAtDestination(UUID agent);
48 48
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
index 20b8ab6..30bae16 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
@@ -69,6 +69,14 @@ namespace OpenSim.Region.Framework.Interfaces
69 /// <returns></returns> 69 /// <returns></returns>
70 ILandObject GetLandObject(int localID); 70 ILandObject GetLandObject(int localID);
71 71
72 /// <summary>
73 /// Clear the land channel of all parcels.
74 /// </summary>
75 /// <param name="setupDefaultParcel">
76 /// If true, set up a default parcel covering the whole region owned by the estate owner.
77 /// </param>
78 void Clear(bool setupDefaultParcel);
79
72 bool IsLandPrimCountTainted(); 80 bool IsLandPrimCountTainted();
73 bool IsForcefulBansAllowed(); 81 bool IsForcefulBansAllowed();
74 void UpdateLandObject(int localID, LandData data); 82 void UpdateLandObject(int localID, LandData data);
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index 576b645..eeb9d3a 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -39,6 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces
39 { 39 {
40 int GetParcelMaxPrimCount(ILandObject thisObject); 40 int GetParcelMaxPrimCount(ILandObject thisObject);
41 int GetSimulatorMaxPrimCount(ILandObject thisObject); 41 int GetSimulatorMaxPrimCount(ILandObject thisObject);
42 int GetPrimsFree();
42 43
43 LandData LandData { get; set; } 44 LandData LandData { get; set; }
44 bool[,] LandBitmap { get; set; } 45 bool[,] LandBitmap { get; set; }
diff --git a/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
new file mode 100644
index 0000000..65158e1
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IPrimCountModule.cs
@@ -0,0 +1,55 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29using OpenSim.Framework;
30
31namespace OpenSim.Region.Framework.Interfaces
32{
33 public interface IPrimCountModule
34 {
35 void TaintPrimCount(ILandObject land);
36 void TaintPrimCount(int x, int y);
37 void TaintPrimCount();
38
39 IPrimCounts GetPrimCounts(UUID parcelID);
40 }
41
42 public interface IPrimCounts
43 {
44 int Owner { get; }
45 int Group { get; }
46 int Others { get; }
47 int Simulator { get; }
48 IUserPrimCounts Users { get; }
49 }
50
51 public interface IUserPrimCounts
52 {
53 int this[UUID agentID] { get; }
54 }
55}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index dc08b49..4fca261 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3861,14 +3861,16 @@ namespace OpenSim.Region.Framework.Scenes
3861 RequestTeleportLocation(remoteClient, info.RegionHandle, position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark)); 3861 RequestTeleportLocation(remoteClient, info.RegionHandle, position, Vector3.Zero, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaLandmark));
3862 } 3862 }
3863 3863
3864 public void CrossAgentToNewRegion(ScenePresence agent, bool isFlying) 3864 public bool CrossAgentToNewRegion(ScenePresence agent, bool isFlying)
3865 { 3865 {
3866 if (m_teleportModule != null) 3866 if (m_teleportModule != null)
3867 m_teleportModule.Cross(agent, isFlying); 3867 return m_teleportModule.Cross(agent, isFlying);
3868 else 3868 else
3869 { 3869 {
3870 m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule"); 3870 m_log.DebugFormat("[SCENE]: Unable to cross agent to neighbouring region, because there is no AgentTransferModule");
3871 } 3871 }
3872
3873 return false;
3872 } 3874 }
3873 3875
3874 public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence) 3876 public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence)
@@ -4919,7 +4921,7 @@ namespace OpenSim.Region.Framework.Scenes
4919 // from logging into the region, teleporting into the region 4921 // from logging into the region, teleporting into the region
4920 // or corssing the broder walking, but will NOT prevent 4922 // or corssing the broder walking, but will NOT prevent
4921 // child agent creation, thereby emulating the SL behavior. 4923 // child agent creation, thereby emulating the SL behavior.
4922 public bool QueryAccess(UUID agentID) 4924 public bool QueryAccess(UUID agentID, Vector3 position)
4923 { 4925 {
4924 return true; 4926 return true;
4925 } 4927 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1c276fa..cd70de8 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2725,29 +2725,57 @@ namespace OpenSim.Region.Framework.Scenes
2725 // Makes sure avatar does not end up outside region 2725 // Makes sure avatar does not end up outside region
2726 if (neighbor <= 0) 2726 if (neighbor <= 0)
2727 { 2727 {
2728 if (!needsTransit) 2728 if (needsTransit)
2729 { 2729 {
2730 if (m_requestedSitTargetUUID == UUID.Zero) 2730 if (m_requestedSitTargetUUID == UUID.Zero)
2731 { 2731 {
2732 bool isFlying = m_physicsActor.Flying;
2733 RemoveFromPhysicalScene();
2734
2732 Vector3 pos = AbsolutePosition; 2735 Vector3 pos = AbsolutePosition;
2733 if (AbsolutePosition.X < 0) 2736 if (AbsolutePosition.X < 0)
2734 pos.X += Velocity.X; 2737 pos.X += Velocity.X * 2;
2735 else if (AbsolutePosition.X > Constants.RegionSize) 2738 else if (AbsolutePosition.X > Constants.RegionSize)
2736 pos.X -= Velocity.X; 2739 pos.X -= Velocity.X * 2;
2737 if (AbsolutePosition.Y < 0) 2740 if (AbsolutePosition.Y < 0)
2738 pos.Y += Velocity.Y; 2741 pos.Y += Velocity.Y * 2;
2739 else if (AbsolutePosition.Y > Constants.RegionSize) 2742 else if (AbsolutePosition.Y > Constants.RegionSize)
2740 pos.Y -= Velocity.Y; 2743 pos.Y -= Velocity.Y * 2;
2744 Velocity = Vector3.Zero;
2741 AbsolutePosition = pos; 2745 AbsolutePosition = pos;
2746
2747 AddToPhysicalScene(isFlying);
2742 } 2748 }
2743 } 2749 }
2744 } 2750 }
2745 else if (neighbor > 0) 2751 else if (neighbor > 0)
2746 CrossToNewRegion(); 2752 {
2753 if (!CrossToNewRegion())
2754 {
2755 if (m_requestedSitTargetUUID == UUID.Zero)
2756 {
2757 bool isFlying = m_physicsActor.Flying;
2758 RemoveFromPhysicalScene();
2759
2760 Vector3 pos = AbsolutePosition;
2761 if (AbsolutePosition.X < 0)
2762 pos.X += Velocity.X * 2;
2763 else if (AbsolutePosition.X > Constants.RegionSize)
2764 pos.X -= Velocity.X * 2;
2765 if (AbsolutePosition.Y < 0)
2766 pos.Y += Velocity.Y * 2;
2767 else if (AbsolutePosition.Y > Constants.RegionSize)
2768 pos.Y -= Velocity.Y * 2;
2769 Velocity = Vector3.Zero;
2770 AbsolutePosition = pos;
2771
2772 AddToPhysicalScene(isFlying);
2773 }
2774 }
2775 }
2747 } 2776 }
2748 else 2777 else
2749 { 2778 {
2750 RemoveFromPhysicalScene();
2751 // This constant has been inferred from experimentation 2779 // This constant has been inferred from experimentation
2752 // I'm not sure what this value should be, so I tried a few values. 2780 // I'm not sure what this value should be, so I tried a few values.
2753 timeStep = 0.04f; 2781 timeStep = 0.04f;
@@ -2796,16 +2824,15 @@ namespace OpenSim.Region.Framework.Scenes
2796 /// If the neighbor accepts, remove the agent's viewable avatar from this scene 2824 /// If the neighbor accepts, remove the agent's viewable avatar from this scene
2797 /// set them to a child agent. 2825 /// set them to a child agent.
2798 /// </summary> 2826 /// </summary>
2799 protected void CrossToNewRegion() 2827 protected bool CrossToNewRegion()
2800 { 2828 {
2801 InTransit();
2802 try 2829 try
2803 { 2830 {
2804 m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); 2831 return m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying);
2805 } 2832 }
2806 catch 2833 catch
2807 { 2834 {
2808 m_scene.CrossAgentToNewRegion(this, false); 2835 return m_scene.CrossAgentToNewRegion(this, false);
2809 } 2836 }
2810 } 2837 }
2811 2838