diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Region/Framework/Scenes/SceneBase.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 78 |
1 files changed, 70 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index d3e968e..7ff3d40 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -44,6 +44,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | #pragma warning disable 414 | ||
48 | private static readonly string LogHeader = "[SCENE]"; | ||
49 | #pragma warning restore 414 | ||
50 | |||
47 | #region Events | 51 | #region Events |
48 | 52 | ||
49 | public event restart OnRestart; | 53 | public event restart OnRestart; |
@@ -78,6 +82,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
78 | /// </value> | 82 | /// </value> |
79 | protected Dictionary<Type, List<object>> ModuleInterfaces = new Dictionary<Type, List<object>>(); | 83 | protected Dictionary<Type, List<object>> ModuleInterfaces = new Dictionary<Type, List<object>>(); |
80 | 84 | ||
85 | /// <summary> | ||
86 | /// These two objects hold the information about any formats used | ||
87 | /// by modules that hold agent specific data. | ||
88 | /// </summary> | ||
89 | protected List<UUID> FormatsOffered = new List<UUID>(); | ||
90 | protected Dictionary<object, List<UUID>> FormatsWanted = new Dictionary<object, List<UUID>>(); | ||
91 | |||
81 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); | 92 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); |
82 | 93 | ||
83 | /// <value> | 94 | /// <value> |
@@ -141,10 +152,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
141 | get { return 1.0f; } | 152 | get { return 1.0f; } |
142 | } | 153 | } |
143 | 154 | ||
144 | protected ulong m_regionHandle; | ||
145 | protected string m_regionName; | ||
146 | protected RegionInfo m_regInfo; | ||
147 | |||
148 | public ITerrainChannel Heightmap; | 155 | public ITerrainChannel Heightmap; |
149 | 156 | ||
150 | /// <value> | 157 | /// <value> |
@@ -192,7 +199,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
192 | /// Number of frames to update. Exits on shutdown even if there are frames remaining. | 199 | /// Number of frames to update. Exits on shutdown even if there are frames remaining. |
193 | /// If -1 then updates until shutdown. | 200 | /// If -1 then updates until shutdown. |
194 | /// </param> | 201 | /// </param> |
195 | public abstract void Update(int frames); | 202 | /// <returns>true if update completed within minimum frame time, false otherwise.</returns> |
203 | public abstract bool Update(int frames); | ||
196 | 204 | ||
197 | #endregion | 205 | #endregion |
198 | 206 | ||
@@ -209,15 +217,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
209 | /// <param name="RemoteClient">Client to send to</param> | 217 | /// <param name="RemoteClient">Client to send to</param> |
210 | public virtual void SendLayerData(IClientAPI RemoteClient) | 218 | public virtual void SendLayerData(IClientAPI RemoteClient) |
211 | { | 219 | { |
212 | RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised()); | 220 | // RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised()); |
221 | ITerrainModule terrModule = RequestModuleInterface<ITerrainModule>(); | ||
222 | if (terrModule != null) | ||
223 | { | ||
224 | terrModule.PushTerrain(RemoteClient); | ||
225 | } | ||
213 | } | 226 | } |
214 | 227 | ||
215 | #endregion | 228 | #endregion |
216 | 229 | ||
217 | #region Add/Remove Agent/Avatar | 230 | #region Add/Remove Agent/Avatar |
218 | 231 | ||
219 | public abstract ISceneAgent AddNewClient(IClientAPI client, PresenceType type); | 232 | public abstract ISceneAgent AddNewAgent(IClientAPI client, PresenceType type); |
220 | public abstract void RemoveClient(UUID agentID, bool closeChildAgents); | 233 | |
234 | public abstract bool CloseAgent(UUID agentID, bool force); | ||
221 | 235 | ||
222 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) | 236 | public bool TryGetScenePresence(UUID agentID, out object scenePresence) |
223 | { | 237 | { |
@@ -360,6 +374,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
360 | return m_moduleCommanders; | 374 | return m_moduleCommanders; |
361 | } | 375 | } |
362 | 376 | ||
377 | public List<UUID> GetFormatsOffered() | ||
378 | { | ||
379 | List<UUID> ret = new List<UUID>(FormatsOffered); | ||
380 | |||
381 | return ret; | ||
382 | } | ||
383 | |||
384 | protected void CheckAndAddAgentDataFormats(object mod) | ||
385 | { | ||
386 | if (!(mod is IAgentStatefulModule)) | ||
387 | return; | ||
388 | |||
389 | IAgentStatefulModule m = (IAgentStatefulModule)mod; | ||
390 | |||
391 | List<UUID> renderFormats = m.GetRenderStateFormats(); | ||
392 | List<UUID> acceptFormats = m.GetAcceptStateFormats(); | ||
393 | |||
394 | foreach (UUID render in renderFormats) | ||
395 | { | ||
396 | if (!(FormatsOffered.Contains(render))) | ||
397 | FormatsOffered.Add(render); | ||
398 | } | ||
399 | |||
400 | if (acceptFormats.Count == 0) | ||
401 | return; | ||
402 | |||
403 | if (FormatsWanted.ContainsKey(mod)) | ||
404 | return; | ||
405 | |||
406 | FormatsWanted[mod] = acceptFormats; | ||
407 | } | ||
408 | |||
363 | /// <summary> | 409 | /// <summary> |
364 | /// Register an interface to a region module. This allows module methods to be called directly as | 410 | /// Register an interface to a region module. This allows module methods to be called directly as |
365 | /// well as via events. If there is already a module registered for this interface, it is not replaced | 411 | /// well as via events. If there is already a module registered for this interface, it is not replaced |
@@ -382,6 +428,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
382 | 428 | ||
383 | l.Add(mod); | 429 | l.Add(mod); |
384 | 430 | ||
431 | CheckAndAddAgentDataFormats(mod); | ||
432 | |||
385 | if (mod is IEntityCreator) | 433 | if (mod is IEntityCreator) |
386 | { | 434 | { |
387 | IEntityCreator entityCreator = (IEntityCreator)mod; | 435 | IEntityCreator entityCreator = (IEntityCreator)mod; |
@@ -394,6 +442,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
394 | 442 | ||
395 | public void UnregisterModuleInterface<M>(M mod) | 443 | public void UnregisterModuleInterface<M>(M mod) |
396 | { | 444 | { |
445 | // We can't unregister agent stateful modules because | ||
446 | // that would require much more data to be held about formats | ||
447 | // and would make that code slower and less efficient. | ||
448 | // No known modules are unregistered anyway, ever, unless | ||
449 | // the simulator shuts down anyway. | ||
450 | if (mod is IAgentStatefulModule) | ||
451 | return; | ||
452 | |||
397 | List<Object> l; | 453 | List<Object> l; |
398 | if (ModuleInterfaces.TryGetValue(typeof(M), out l)) | 454 | if (ModuleInterfaces.TryGetValue(typeof(M), out l)) |
399 | { | 455 | { |
@@ -424,6 +480,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
424 | 480 | ||
425 | l.Add(mod); | 481 | l.Add(mod); |
426 | 482 | ||
483 | CheckAndAddAgentDataFormats(mod); | ||
484 | |||
427 | if (mod is IEntityCreator) | 485 | if (mod is IEntityCreator) |
428 | { | 486 | { |
429 | IEntityCreator entityCreator = (IEntityCreator)mod; | 487 | IEntityCreator entityCreator = (IEntityCreator)mod; |
@@ -561,6 +619,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
561 | get { return false; } | 619 | get { return false; } |
562 | } | 620 | } |
563 | 621 | ||
622 | public virtual void Start() | ||
623 | { | ||
624 | } | ||
625 | |||
564 | public void Restart() | 626 | public void Restart() |
565 | { | 627 | { |
566 | // This has to be here to fire the event | 628 | // This has to be here to fire the event |