diff options
author | lbsa71 | 2007-09-21 04:58:40 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-21 04:58:40 +0000 |
commit | b9808f831428876ec9ede8ce87a159566b97a850 (patch) | |
tree | 749ef670d6c4e6051a844d4c9c12073bebfe1e59 /OpenSim/Region/Environment/Regions/Region.cs | |
parent | * Continuing refactoring of presence (diff) | |
download | opensim-SC_OLD-b9808f831428876ec9ede8ce87a159566b97a850.zip opensim-SC_OLD-b9808f831428876ec9ede8ce87a159566b97a850.tar.gz opensim-SC_OLD-b9808f831428876ec9ede8ce87a159566b97a850.tar.bz2 opensim-SC_OLD-b9808f831428876ec9ede8ce87a159566b97a850.tar.xz |
* First example of moving stuff to a Region layer
* Also, changed RegionPresence to 'RegionSubscription' - let's just see where we land with this...
Diffstat (limited to 'OpenSim/Region/Environment/Regions/Region.cs')
-rw-r--r-- | OpenSim/Region/Environment/Regions/Region.cs | 35 |
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 @@ | |||
1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
2 | using libsecondlife; | 2 | using libsecondlife; |
3 | using OpenSim.Region.Environment.Scenes; | ||
4 | using OpenSim.Region.Terrain; | ||
5 | using OpenSim.Framework.Interfaces; | ||
6 | using System; | ||
3 | 7 | ||
4 | namespace OpenSim.Region.Environment.Regions | 8 | namespace 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 | } |