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 | |
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')
-rw-r--r-- | OpenSim/Region/Environment/Regions/Region.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/RegionPresence.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/RegionSubscription.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs (renamed from OpenSim/Region/Environment/Regions/RegionManager.cs) | 4 |
4 files changed, 53 insertions, 19 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 | } |
diff --git a/OpenSim/Region/Environment/Regions/RegionPresence.cs b/OpenSim/Region/Environment/Regions/RegionPresence.cs deleted file mode 100644 index 9720bb3..0000000 --- a/OpenSim/Region/Environment/Regions/RegionPresence.cs +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | using OpenSim.Framework.Interfaces; | ||
2 | |||
3 | namespace OpenSim.Region.Environment.Regions | ||
4 | { | ||
5 | public class RegionPresence | ||
6 | { | ||
7 | private IClientAPI m_client; | ||
8 | |||
9 | public RegionPresence(IClientAPI client ) | ||
10 | { | ||
11 | m_client = client; | ||
12 | } | ||
13 | } | ||
14 | } | ||
diff --git a/OpenSim/Region/Environment/Regions/RegionSubscription.cs b/OpenSim/Region/Environment/Regions/RegionSubscription.cs new file mode 100644 index 0000000..13cd0d5 --- /dev/null +++ b/OpenSim/Region/Environment/Regions/RegionSubscription.cs | |||
@@ -0,0 +1,19 @@ | |||
1 | using OpenSim.Framework.Interfaces; | ||
2 | |||
3 | namespace 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/RegionManager.cs b/OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs index ab5b97c..97d2591 100644 --- a/OpenSim/Region/Environment/Regions/RegionManager.cs +++ b/OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs | |||
@@ -4,11 +4,11 @@ using System.Text; | |||
4 | 4 | ||
5 | namespace OpenSim.Region.Environment.Regions | 5 | namespace OpenSim.Region.Environment.Regions |
6 | { | 6 | { |
7 | public class RegionManager | 7 | public class RegionSubscriptionManager |
8 | { | 8 | { |
9 | private Dictionary<uint, Region> m_regions; | 9 | private Dictionary<uint, Region> m_regions; |
10 | 10 | ||
11 | public RegionManager( ) | 11 | public RegionSubscriptionManager( ) |
12 | { | 12 | { |
13 | m_regions = new Dictionary<uint, Region>( ); | 13 | m_regions = new Dictionary<uint, Region>( ); |
14 | } | 14 | } |