aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorAdam Frisby2009-04-06 07:17:23 +0000
committerAdam Frisby2009-04-06 07:17:23 +0000
commit9e51c2db95fd43aa18e66d359c15349bdc9ad8f0 (patch)
tree995f875adb3967687fa8cebf8efabee303a7e6f3 /OpenSim
parent* Adds AutoOAR module, this will automatically OAR your regions every 20 minu... (diff)
downloadopensim-SC_OLD-9e51c2db95fd43aa18e66d359c15349bdc9ad8f0.zip
opensim-SC_OLD-9e51c2db95fd43aa18e66d359c15349bdc9ad8f0.tar.gz
opensim-SC_OLD-9e51c2db95fd43aa18e66d359c15349bdc9ad8f0.tar.bz2
opensim-SC_OLD-9e51c2db95fd43aa18e66d359c15349bdc9ad8f0.tar.xz
* Implements World.Parcels[] array for MRM scripting.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandChannel.cs9
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandChannel.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/IParcel.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ISocialEntity.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/IWorld.cs1
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs45
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs18
-rw-r--r--OpenSim/Tests/Common/Mock/TestLandChannel.cs3
8 files changed, 81 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
index 9822af7..f0ab955 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs
@@ -86,6 +86,15 @@ namespace OpenSim.Region.CoreModules.World.Land
86 return obj; 86 return obj;
87 } 87 }
88 88
89 public ILandObject GetLandObject(int localID)
90 {
91 if (m_landManagementModule != null)
92 {
93 return m_landManagementModule.GetLandObject(localID);
94 }
95 return null;
96 }
97
89 public ILandObject GetLandObject(int x, int y) 98 public ILandObject GetLandObject(int x, int y)
90 { 99 {
91 if (m_landManagementModule != null) 100 if (m_landManagementModule != null)
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
index 0249025..eb9eb65 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
@@ -43,7 +43,9 @@ namespace OpenSim.Region.Framework.Interfaces
43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
44 /// <returns>Land object at the point supplied</returns> 44 /// <returns>Land object at the point supplied</returns>
45 ILandObject GetLandObject(int x, int y); 45 ILandObject GetLandObject(int x, int y);
46 46
47 ILandObject GetLandObject(int localID);
48
47 /// <summary> 49 /// <summary>
48 /// Get the land object at the specified point 50 /// Get the land object at the specified point
49 /// </summary> 51 /// </summary>
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IParcel.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IParcel.cs
index 7c3fe86..2a973a9 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IParcel.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IParcel.cs
@@ -5,11 +5,11 @@ using OpenMetaverse;
5 5
6namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 6namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
7{ 7{
8 interface IParcel 8 public interface IParcel
9 { 9 {
10 string Name { get; set; } 10 string Name { get; set; }
11 string Description { get; set; } 11 string Description { get; set; }
12 ISocialEntity Owner { get; set; } 12 ISocialEntity Owner { get; set; }
13 bool[,] Bitmap { get; set; } 13 bool[,] Bitmap { get; }
14 } 14 }
15} 15}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISocialEntity.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISocialEntity.cs
index fe4826a..0833ffd 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISocialEntity.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISocialEntity.cs
@@ -5,7 +5,7 @@ using OpenMetaverse;
5 5
6namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 6namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
7{ 7{
8 interface ISocialEntity 8 public interface ISocialEntity
9 { 9 {
10 UUID GlobalID { get; } 10 UUID GlobalID { get; }
11 string Name { get; } 11 string Name { get; }
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IWorld.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IWorld.cs
index f06f57a..b35b57d 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IWorld.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IWorld.cs
@@ -31,6 +31,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
31 { 31 {
32 IObjectAccessor Objects { get; } 32 IObjectAccessor Objects { get; }
33 IAvatar[] Avatars { get; } 33 IAvatar[] Avatars { get; }
34 IParcel[] Parcels { get; }
34 IHeightmap Terrain { get; } 35 IHeightmap Terrain { get; }
35 } 36 }
36} 37}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs
new file mode 100644
index 0000000..aceeacc
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs
@@ -0,0 +1,45 @@
1using OpenSim.Region.Framework.Interfaces;
2using OpenSim.Region.Framework.Scenes;
3
4namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
5{
6 class LOParcel : IParcel
7 {
8 private readonly Scene m_scene;
9 private readonly int m_parcelID;
10
11 public LOParcel(Scene m_scene, int m_parcelID)
12 {
13 this.m_scene = m_scene;
14 this.m_parcelID = m_parcelID;
15 }
16
17 private ILandObject GetLO()
18 {
19 return m_scene.LandChannel.GetLandObject(m_parcelID);
20 }
21
22 public string Name
23 {
24 get { return GetLO().landData.Name; }
25 set { GetLO().landData.Name = value; }
26 }
27
28 public string Description
29 {
30 get { return GetLO().landData.Description; }
31 set { GetLO().landData.Description = value; }
32 }
33
34 public ISocialEntity Owner
35 {
36 get { throw new System.NotImplementedException(); }
37 set { throw new System.NotImplementedException(); }
38 }
39
40 public bool[,] Bitmap
41 {
42 get { return GetLO().landBitmap; }
43 }
44 }
45}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
index c798cc8..05a6a84 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using OpenSim.Region.Framework.Interfaces;
29using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
30 31
31namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 32namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
@@ -49,6 +50,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
49 get { return m_objs; } 50 get { return m_objs; }
50 } 51 }
51 52
53 public IParcel[] Parcels
54 {
55 get
56 {
57 List<ILandObject> m_los = m_internalScene.LandChannel.AllParcels();
58 List<IParcel> m_parcels = new List<IParcel>(m_los.Count);
59
60 foreach (ILandObject landObject in m_los)
61 {
62 m_parcels.Add(new LOParcel(m_internalScene, landObject.landData.LocalID));
63 }
64
65 return m_parcels.ToArray();
66 }
67 }
68
69
52 public IAvatar[] Avatars 70 public IAvatar[] Avatars
53 { 71 {
54 get 72 get
diff --git a/OpenSim/Tests/Common/Mock/TestLandChannel.cs b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
index 761ef44..4165641 100644
--- a/OpenSim/Tests/Common/Mock/TestLandChannel.cs
+++ b/OpenSim/Tests/Common/Mock/TestLandChannel.cs
@@ -39,7 +39,8 @@ namespace OpenSim.Tests.Common.Mock
39 { 39 {
40 public List<ILandObject> ParcelsNearPoint(Vector3 position) { return null; } 40 public List<ILandObject> ParcelsNearPoint(Vector3 position) { return null; }
41 public List<ILandObject> AllParcels() { return null; } 41 public List<ILandObject> AllParcels() { return null; }
42 public ILandObject GetLandObject(int x, int y) { return null; } 42 public ILandObject GetLandObject(int x, int y) { return null; }
43 public ILandObject GetLandObject(int localID) { return null; }
43 public ILandObject GetLandObject(float x, float y) { return null; } 44 public ILandObject GetLandObject(float x, float y) { return null; }
44 public bool IsLandPrimCountTainted() { return false; } 45 public bool IsLandPrimCountTainted() { return false; }
45 public bool IsForcefulBansAllowed() { return false; } 46 public bool IsForcefulBansAllowed() { return false; }