aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Regions/Region.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Regions/Region.cs')
-rw-r--r--OpenSim/Region/Environment/Regions/Region.cs35
1 files changed, 32 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Regions/Region.cs b/OpenSim/Region/Environment/Regions/Region.cs
index f7669a9..e95d9dc 100644
--- a/OpenSim/Region/Environment/Regions/Region.cs
+++ b/OpenSim/Region/Environment/Regions/Region.cs
@@ -1,15 +1,44 @@
1using System.Collections.Generic; 1using System.Collections.Generic;
2using libsecondlife; 2using libsecondlife;
3using OpenSim.Region.Environment.Scenes;
4using OpenSim.Region.Terrain;
5using OpenSim.Framework.Interfaces;
6using System;
3 7
4namespace OpenSim.Region.Environment.Regions 8namespace OpenSim.Region.Environment.Regions
5{ 9{
6 public class Region 10 public class Region
7 { 11 {
8 private Dictionary<LLUUID, RegionPresence> m_regionPresences; 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.
9 14
10 public Region() 15 private readonly Scene m_scene;
16 private Dictionary<LLUUID, RegionSubscription> m_regionSubscriptions
11 { 17 {
12 m_regionPresences = new Dictionary<LLUUID, RegionPresence>( ); 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 }
13 } 42 }
14 } 43 }
15} 44}