aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs4
-rw-r--r--OpenSim/Region/Environment/Regions/Region.cs49
-rw-r--r--OpenSim/Region/Environment/Regions/RegionSubscription.cs19
-rw-r--r--OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs19
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs12
6 files changed, 9 insertions, 110 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index 731ce61..98b90b4 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -87,8 +87,8 @@ namespace OpenSim.Region.Environment.LandManagement
87 /// </summary> 87 /// </summary>
88 public bool landPrimCountTainted = false; 88 public bool landPrimCountTainted = false;
89 89
90 private Scene m_scene; 90 private readonly Scene m_scene;
91 private RegionInfo m_regInfo; 91 private readonly RegionInfo m_regInfo;
92 92
93 #endregion 93 #endregion
94 94
diff --git a/OpenSim/Region/Environment/Regions/Region.cs b/OpenSim/Region/Environment/Regions/Region.cs
deleted file mode 100644
index 536fed7..0000000
--- a/OpenSim/Region/Environment/Regions/Region.cs
+++ /dev/null
@@ -1,49 +0,0 @@
1using System.Collections.Generic;
2using libsecondlife;
3using OpenSim.Region.Environment.Scenes;
4using OpenSim.Region.Terrain;
5using OpenSim.Framework.Interfaces;
6using System;
7
8namespace OpenSim.Region.Environment.Regions
9{
10 public class Region
11 {
12 // This is a temporary (and real ugly) construct to emulate us really having a separate list
13 // of region subscribers. It should be removed ASAP, like.
14
15 private readonly Scene m_scene;
16 private Dictionary<LLUUID, RegionSubscription> m_regionSubscriptions
17 {
18 get
19 {
20 Dictionary<LLUUID, RegionSubscription> subscriptions = new Dictionary<LLUUID, RegionSubscription>( );
21
22 foreach( ScenePresence presence in m_scene.GetScenePresences() )
23 {
24 subscriptions.Add( presence.UUID, new RegionSubscription( presence.ControllingClient ));
25 }
26
27 return subscriptions;
28 }
29 }
30
31 public Region( Scene scene )
32 {
33 m_scene = scene; // The Scene reference should be removed.
34 }
35
36 internal void Broadcast( Action<IClientAPI> whatToDo )
37 {
38 foreach (RegionSubscription subscription in m_regionSubscriptions.Values )
39 {
40 whatToDo(subscription.Client);
41 }
42 }
43
44 internal void Remove(LLUUID agentID)
45 {
46 // TODO : Well, remove it!
47 }
48 }
49}
diff --git a/OpenSim/Region/Environment/Regions/RegionSubscription.cs b/OpenSim/Region/Environment/Regions/RegionSubscription.cs
deleted file mode 100644
index 13cd0d5..0000000
--- a/OpenSim/Region/Environment/Regions/RegionSubscription.cs
+++ /dev/null
@@ -1,19 +0,0 @@
1using OpenSim.Framework.Interfaces;
2
3namespace OpenSim.Region.Environment.Regions
4{
5 public class RegionSubscription
6 {
7 private readonly IClientAPI m_client;
8
9 public RegionSubscription(IClientAPI client )
10 {
11 m_client = client;
12 }
13
14 public IClientAPI Client
15 {
16 get { return m_client; }
17 }
18 }
19}
diff --git a/OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs b/OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs
deleted file mode 100644
index 97d2591..0000000
--- a/OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs
+++ /dev/null
@@ -1,16 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Region.Environment.Regions
6{
7 public class RegionSubscriptionManager
8 {
9 private Dictionary<uint, Region> m_regions;
10
11 public RegionSubscriptionManager( )
12 {
13 m_regions = new Dictionary<uint, Region>( );
14 }
15 }
16}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index adf501e..22f69a5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -49,7 +49,6 @@ using OpenSim.Region.Environment.Types;
49using OpenSim.Region.Physics.Manager; 49using OpenSim.Region.Physics.Manager;
50using OpenSim.Region.Terrain; 50using OpenSim.Region.Terrain;
51using Timer = System.Timers.Timer; 51using Timer = System.Timers.Timer;
52using OpenSim.Region.Environment.Regions;
53 52
54namespace OpenSim.Region.Environment.Scenes 53namespace OpenSim.Region.Environment.Scenes
55{ 54{
@@ -64,8 +63,6 @@ namespace OpenSim.Region.Environment.Scenes
64 /// publicized so it can be accessed from SceneObjectGroup. 63 /// publicized so it can be accessed from SceneObjectGroup.
65 protected float timeStep = 0.1f; 64 protected float timeStep = 0.1f;
66 65
67 private Regions.Region m_region;
68
69 private Random Rand = new Random(); 66 private Random Rand = new Random();
70 private uint _primCount = 702000; 67 private uint _primCount = 702000;
71 private readonly Mutex _primAllocateMutex = new Mutex(false); 68 private readonly Mutex _primAllocateMutex = new Mutex(false);
@@ -162,8 +159,6 @@ namespace OpenSim.Region.Environment.Scenes
162 { 159 {
163 updateLock = new Mutex(false); 160 updateLock = new Mutex(false);
164 161
165 m_region = new Regions.Region(this);
166
167 m_moduleLoader = moduleLoader; 162 m_moduleLoader = moduleLoader;
168 authenticateHandler = authen; 163 authenticateHandler = authen;
169 commsManager = commsMan; 164 commsManager = commsMan;
@@ -373,7 +368,10 @@ namespace OpenSim.Region.Environment.Scenes
373 /// <returns></returns> 368 /// <returns></returns>
374 internal void Broadcast(Action<IClientAPI> whatToDo) 369 internal void Broadcast(Action<IClientAPI> whatToDo)
375 { 370 {
376 m_region.Broadcast(whatToDo); 371 ForEachScenePresence( delegate( ScenePresence presence )
372 {
373 whatToDo(presence.ControllingClient);
374 });
377 } 375 }
378 /// <summary> 376 /// <summary>
379 /// 377 ///
@@ -458,7 +456,7 @@ namespace OpenSim.Region.Environment.Scenes
458 /// <summary> 456 /// <summary>
459 /// Loads the World's objects 457 /// Loads the World's objects
460 /// </summary> 458 /// </summary>
461 public void LoadPrimsFromStorage() 459 public virtual void LoadPrimsFromStorage()
462 { 460 {
463 MainLog.Instance.Verbose("Loading objects from datastore"); 461 MainLog.Instance.Verbose("Loading objects from datastore");
464 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID); 462 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID);
@@ -790,11 +788,6 @@ namespace OpenSim.Region.Environment.Scenes
790 m_scenePresences.Remove(agentID); 788 m_scenePresences.Remove(agentID);
791 } 789 }
792 790
793 lock (m_region)
794 {
795 m_region.Remove(agentID);
796 }
797
798 lock (Entities) 791 lock (Entities)
799 { 792 {
800 Entities.Remove(agentID); 793 Entities.Remove(agentID);
@@ -1135,7 +1128,7 @@ namespace OpenSim.Region.Environment.Scenes
1135 } 1128 }
1136 1129
1137 public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, 1130 public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned,
1138 string message, string url) 1131 string message, string url)
1139 { 1132 {
1140 if (m_scenePresences.ContainsKey(avatarID)) 1133 if (m_scenePresences.ContainsKey(avatarID))
1141 { 1134 {
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index fa37b9f..f594789 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -35,7 +35,6 @@ using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
38using OpenSim.Region.Environment.Regions;
39 38
40namespace OpenSim.Region.Environment.Scenes 39namespace OpenSim.Region.Environment.Scenes
41{ 40{
@@ -214,13 +213,6 @@ namespace OpenSim.Region.Environment.Scenes
214 set { m_isChildAgent = value; } 213 set { m_isChildAgent = value; }
215 } 214 }
216 215
217 private RegionSubscription m_regionSubscription;
218
219 public RegionSubscription RegionSubscription
220 {
221 get { return m_regionSubscription; }
222 }
223
224 #endregion 216 #endregion
225 217
226 #region Constructor(s) 218 #region Constructor(s)
@@ -234,8 +226,6 @@ namespace OpenSim.Region.Environment.Scenes
234 /// <param name="regionDat"></param> 226 /// <param name="regionDat"></param>
235 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) 227 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
236 { 228 {
237 m_regionSubscription = new RegionSubscription( client );
238
239 m_scene = world; 229 m_scene = world;
240 m_uuid = client.AgentId; 230 m_uuid = client.AgentId;
241 231
@@ -881,7 +871,7 @@ namespace OpenSim.Region.Environment.Scenes
881 } 871 }
882 } 872 }
883 873
884 public static void CreateDefaultTextureEntry() 874 static ScenePresence()
885 { 875 {
886 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); 876 LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
887 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); 877 textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");