diff options
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/RegionApplicationBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/Region.cs | 49 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/RegionSubscription.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Regions/RegionSubscriptionManager.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/Program.cs | 15 |
9 files changed, 16 insertions, 125 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 8e067eb..161e73f 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim | |||
147 | Directory.CreateDirectory(Util.logDir()); | 147 | Directory.CreateDirectory(Util.logDir()); |
148 | } | 148 | } |
149 | 149 | ||
150 | m_log = new LogBase(Path.Combine(Util.logDir(), m_logFilename), "Region", this, m_silent); | 150 | m_log = CreateLog(); |
151 | MainLog.Instance = m_log; | 151 | MainLog.Instance = m_log; |
152 | 152 | ||
153 | base.StartUp(); | 153 | base.StartUp(); |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index df8d747..a1ec4e3 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -70,8 +70,6 @@ namespace OpenSim.Region.ClientStack | |||
70 | 70 | ||
71 | Initialize(); | 71 | Initialize(); |
72 | 72 | ||
73 | ScenePresence.CreateDefaultTextureEntry(); | ||
74 | |||
75 | m_httpServer = new BaseHttpServer(m_httpServerPort); | 73 | m_httpServer = new BaseHttpServer(m_httpServerPort); |
76 | 74 | ||
77 | m_log.Verbose("Starting HTTP server"); | 75 | m_log.Verbose("Starting HTTP server"); |
@@ -112,7 +110,6 @@ namespace OpenSim.Region.ClientStack | |||
112 | 110 | ||
113 | scene.PhysScene = GetPhysicsScene(); | 111 | scene.PhysScene = GetPhysicsScene(); |
114 | scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D()); | 112 | scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D()); |
115 | scene.LoadPrimsFromStorage(); | ||
116 | 113 | ||
117 | //Master Avatar Setup | 114 | //Master Avatar Setup |
118 | UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword); | 115 | UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword); |
@@ -128,7 +125,9 @@ namespace OpenSim.Region.ClientStack | |||
128 | scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; | 125 | scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; |
129 | //TODO: Load parcels from storageManager | 126 | //TODO: Load parcels from storageManager |
130 | } | 127 | } |
128 | |||
131 | scene.LandManager.resetSimLandObjects(); | 129 | scene.LandManager.resetSimLandObjects(); |
130 | scene.LoadPrimsFromStorage(); | ||
132 | 131 | ||
133 | scene.performParcelPrimCountUpdate(); | 132 | scene.performParcelPrimCountUpdate(); |
134 | scene.StartTimer(); | 133 | scene.StartTimer(); |
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 @@ | |||
1 | using System.Collections.Generic; | ||
2 | using libsecondlife; | ||
3 | using OpenSim.Region.Environment.Scenes; | ||
4 | using OpenSim.Region.Terrain; | ||
5 | using OpenSim.Framework.Interfaces; | ||
6 | using System; | ||
7 | |||
8 | namespace 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 @@ | |||
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/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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace 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; | |||
49 | using OpenSim.Region.Physics.Manager; | 49 | using OpenSim.Region.Physics.Manager; |
50 | using OpenSim.Region.Terrain; | 50 | using OpenSim.Region.Terrain; |
51 | using Timer = System.Timers.Timer; | 51 | using Timer = System.Timers.Timer; |
52 | using OpenSim.Region.Environment.Regions; | ||
53 | 52 | ||
54 | namespace OpenSim.Region.Environment.Scenes | 53 | namespace 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; | |||
35 | using OpenSim.Framework.Types; | 35 | using OpenSim.Framework.Types; |
36 | using OpenSim.Framework.Utilities; | 36 | using OpenSim.Framework.Utilities; |
37 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.Physics.Manager; |
38 | using OpenSim.Region.Environment.Regions; | ||
39 | 38 | ||
40 | namespace OpenSim.Region.Environment.Scenes | 39 | namespace 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"); |
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index a7b92f4..2ff9ff0 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs | |||
@@ -1,23 +1,16 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.IO; | ||
3 | using System.Net; | 4 | using System.Net; |
4 | using libsecondlife; | 5 | using libsecondlife; |
5 | using OpenSim.Framework; | 6 | using OpenSim.Framework.Communications.Caches; |
6 | using OpenSim.Framework.Console; | 7 | using OpenSim.Framework.Console; |
7 | using OpenSim.Framework.Interfaces; | ||
8 | using OpenSim.Framework.Servers; | ||
9 | using OpenSim.Framework.Types; | 8 | using OpenSim.Framework.Types; |
10 | using OpenSim.Region.Physics.Manager; | ||
11 | |||
12 | using OpenSim.Region.Capabilities; | ||
13 | using OpenSim.Region.ClientStack; | 9 | using OpenSim.Region.ClientStack; |
14 | using OpenSim.Region.Communications.Local; | 10 | using OpenSim.Region.Communications.Local; |
15 | using OpenSim.Framework.Communications.Caches; | ||
16 | using System.Timers; | ||
17 | using OpenSim.Region.Environment.Scenes; | ||
18 | using OpenSim.Framework.Data; | ||
19 | using OpenSim.Region.Environment; | 11 | using OpenSim.Region.Environment; |
20 | using System.IO; | 12 | using OpenSim.Region.Environment.Scenes; |
13 | using OpenSim.Region.Physics.Manager; | ||
21 | 14 | ||
22 | namespace SimpleApp | 15 | namespace SimpleApp |
23 | { | 16 | { |