From 71ca162821ac0e5aae5f91c433b91549ae6d5419 Mon Sep 17 00:00:00 2001
From: mingchen
Date: Sat, 22 Mar 2008 23:10:22 +0000
Subject: *Moved LandManagement into its own region module (spiffy!)
---
.../Environment/Scenes/Scene.PacketHandlers.cs | 4 +-
OpenSim/Region/Environment/Scenes/Scene.cs | 88 +++++++---------------
OpenSim/Region/Environment/Scenes/SceneBase.cs | 3 +
OpenSim/Region/Environment/Scenes/SceneEvents.cs | 11 ++-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 4 +-
5 files changed, 39 insertions(+), 71 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index e4ba7ef..869c936 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Scenes
{
((SceneObjectGroup) ent).GetProperties(remoteClient);
((SceneObjectGroup) ent).IsSelected = true;
- LandManager.setPrimsTainted();
+ LandChannel.setPrimsTainted();
}
break;
}
@@ -115,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes
if (m_permissionManager.CanEditObjectPosition(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID) || m_permissionManager.CanEditObject(remoteClient.AgentId, ((SceneObjectGroup)ent).UUID))
{
((SceneObjectGroup) ent).IsSelected = false;
- LandManager.setPrimsTainted();
+ LandChannel.setPrimsTainted();
break;
}
}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 94a4e31..8f3495c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -40,7 +40,6 @@ using OpenSim.Framework.Communications;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Servers;
using OpenSim.Region.Environment.Interfaces;
-using OpenSim.Region.Environment.LandManagement;
using OpenSim.Region.Environment.Modules;
using OpenSim.Region.Environment.Scenes.Scripting;
using OpenSim.Region.Physics.Manager;
@@ -154,13 +153,6 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_authenticateHandler; }
}
- protected readonly LandManager m_LandManager;
- // LandManager object instance that manages land related things. Parcel, primcounts etc..
- public LandManager LandManager
- {
- get { return m_LandManager; }
- }
-
protected readonly EstateManager m_estateManager;
// an instance to the physics plugin's Scene object.
public PhysicsScene PhysicsScene
@@ -256,8 +248,6 @@ namespace OpenSim.Region.Environment.Scenes
m_eventManager = new EventManager();
- m_LandManager = new LandManager(this, m_regInfo);
-
//Bind Storage Manager functions to some land manager functions for this scene
EventManager.OnLandObjectAdded +=
new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject);
@@ -335,8 +325,6 @@ namespace OpenSim.Region.Environment.Scenes
protected virtual void RegisterDefaultSceneEvents()
{
- m_eventManager.OnParcelPrimCountAdd += m_LandManager.addPrimToLandPrimCounts;
- m_eventManager.OnParcelPrimCountUpdate += addPrimsToParcelCounts;
m_eventManager.OnPermissionError += SendPermissionAlert;
}
@@ -837,10 +825,12 @@ namespace OpenSim.Region.Environment.Scenes
private void UpdateLand()
{
- if (m_LandManager.landPrimCountTainted)
+ if (LandChannel != null)
{
- //Perform land update of prim count
- performParcelPrimCountUpdate();
+ if (LandChannel.isLandPrimCountTainted())
+ {
+ LandChannel.performParcelPrimCountUpdate();
+ }
}
}
@@ -974,12 +964,12 @@ namespace OpenSim.Region.Environment.Scenes
if (dGridSettings["allow_forceful_banlines"] != "TRUE")
{
m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
- m_LandManager.allowedForcefulBans = false;
+ LandChannel.allowedForcefulBans = false;
}
else
{
m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
- m_LandManager.allowedForcefulBans = true;
+ LandChannel.allowedForcefulBans = true;
}
}
}
@@ -1016,11 +1006,11 @@ namespace OpenSim.Region.Environment.Scenes
if (landData.Count == 0)
{
- m_LandManager.NoLandDataFromStorage();
+ LandChannel.NoLandDataFromStorage();
}
else
{
- m_LandManager.IncomingLandObjectsFromStorage(landData);
+ LandChannel.IncomingLandObjectsFromStorage(landData);
}
}
@@ -1196,9 +1186,9 @@ namespace OpenSim.Region.Environment.Scenes
{
if (Entities.ContainsKey(sceneObject.UUID))
{
- m_LandManager.removePrimFromLandPrimCounts(sceneObject);
+ LandChannel.removePrimFromLandPrimCounts(sceneObject);
Entities.Remove(sceneObject.UUID);
- m_LandManager.setPrimsTainted();
+ LandChannel.setPrimsTainted();
m_innerScene.RemoveAPrimCount();
}
}
@@ -1209,7 +1199,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void AcknowledgeNewPrim(SceneObjectGroup prim)
{
- prim.OnPrimCountTainted += m_LandManager.setPrimsTainted;
+ prim.OnPrimCountTainted += LandChannel.setPrimsTainted;
}
public void LoadPrimsFromXml(string fileName, bool newIdsFlag, LLVector3 loadOffset)
@@ -1350,7 +1340,7 @@ namespace OpenSim.Region.Environment.Scenes
CreateAndAddScenePresence(client, child);
- m_LandManager.sendParcelOverlay(client);
+ LandChannel.sendParcelOverlay(client);
CommsManager.UserProfileCacheService.AddNewUser(client.AgentId);
}
}
@@ -1387,17 +1377,17 @@ namespace OpenSim.Region.Environment.Scenes
client.OnObjectDuplicate += m_innerScene.DuplicateObject;
client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily;
- client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest);
- client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest);
- client.OnParcelJoinRequest += new ParcelJoinRequest(m_LandManager.handleParcelJoinRequest);
+ client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(LandChannel.handleParcelPropertiesRequest);
+ client.OnParcelDivideRequest += new ParcelDivideRequest(LandChannel.handleParcelDivideRequest);
+ client.OnParcelJoinRequest += new ParcelJoinRequest(LandChannel.handleParcelJoinRequest);
client.OnParcelPropertiesUpdateRequest +=
- new ParcelPropertiesUpdateRequest(m_LandManager.handleParcelPropertiesUpdateRequest);
- client.OnParcelSelectObjects += new ParcelSelectObjects(m_LandManager.handleParcelSelectObjectsRequest);
+ new ParcelPropertiesUpdateRequest(LandChannel.handleParcelPropertiesUpdateRequest);
+ client.OnParcelSelectObjects += new ParcelSelectObjects(LandChannel.handleParcelSelectObjectsRequest);
client.OnParcelObjectOwnerRequest +=
- new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
- client.OnParcelAccessListRequest += new ParcelAccessListRequest(m_LandManager.handleParcelAccessRequest);
+ new ParcelObjectOwnerRequest(LandChannel.handleParcelObjectOwnersRequest);
+ client.OnParcelAccessListRequest += new ParcelAccessListRequest(LandChannel.handleParcelAccessRequest);
client.OnParcelAccessListUpdateRequest +=
- new ParcelAccessListUpdateRequest(m_LandManager.handleParcelAccessUpdateRequest);
+ new ParcelAccessListUpdateRequest(LandChannel.handleParcelAccessUpdateRequest);
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
client.OnRegionInfoRequest += m_estateManager.HandleRegionInfoRequest;
@@ -1445,7 +1435,7 @@ namespace OpenSim.Region.Environment.Scenes
if (avatar.IsChildAgent)
{
- avatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement;
+ avatar.OnSignificantClientMovement += LandChannel.handleSignificantClientMovement;
}
return avatar;
@@ -2021,31 +2011,7 @@ namespace OpenSim.Region.Environment.Scenes
}
return LLUUID.Zero;
}
-
- ///
- ///
- ///
- public void performParcelPrimCountUpdate()
- {
- m_LandManager.resetAllLandPrimCounts();
- m_eventManager.TriggerParcelPrimCountUpdate();
- m_LandManager.finalizeLandPrimCountUpdate();
- m_LandManager.landPrimCountTainted = false;
- }
-
- ///
- ///
- ///
- public void addPrimsToParcelCounts()
- {
- foreach (EntityBase obj in Entities.Values)
- {
- if (obj is SceneObjectGroup)
- {
- m_eventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
- }
- }
- }
+
///
/// This method is a way for the Friends Module to create an instant
@@ -2455,7 +2421,7 @@ namespace OpenSim.Region.Environment.Scenes
public LLUUID GetLandOwner(float x, float y)
{
- Land land = LandManager.getLandObject(x, y);
+ ILandObject land = LandChannel.getLandObject(x, y);
if (land == null)
{
return LLUUID.Zero;
@@ -2468,12 +2434,12 @@ namespace OpenSim.Region.Environment.Scenes
public LandData GetLandData(float x, float y)
{
- return LandManager.getLandObject(x, y).landData;
+ return LandChannel.getLandObject(x, y).landData;
}
public void SetLandMusicURL(float x, float y, string url)
{
- Land land = LandManager.getLandObject(x, y);
+ ILandObject land = LandChannel.getLandObject(x, y);
if (land == null)
{
return;
@@ -2487,7 +2453,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetLandMediaURL(float x, float y, string url)
{
- Land land = LandManager.getLandObject(x, y);
+ ILandObject land = LandChannel.getLandObject(x, y);
if (land == null)
{
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 4002aaf..5551173 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -62,6 +62,8 @@ namespace OpenSim.Region.Environment.Scenes
//public TerrainEngine Terrain;
public ITerrainChannel Heightmap;
+ public ILandChannel LandChannel;
+
protected EventManager m_eventManager;
public EventManager EventManager
@@ -69,6 +71,7 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_eventManager; }
}
+
protected string m_datastore;
private uint m_nextLocalId = 8880000;
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index 4df5b10..809507c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -29,7 +29,6 @@ using libsecondlife;
using System;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
-using OpenSim.Region.Environment.LandManagement;
namespace OpenSim.Region.Environment.Scenes
{
@@ -106,7 +105,7 @@ namespace OpenSim.Region.Environment.Scenes
public event SceneGroupGrabed OnSceneGroupGrab;
- public delegate void LandObjectAdded(Land newParcel, LLUUID regionUUID);
+ public delegate void LandObjectAdded(ILandObject newParcel);
public event LandObjectAdded OnLandObjectAdded;
@@ -352,13 +351,13 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- public void TriggerLandObjectAdded(Land newParcel, LLUUID regionID)
+ public void TriggerLandObjectAdded(ILandObject newParcel)
{
handlerLandObjectAdded = OnLandObjectAdded;
if (handlerLandObjectAdded != null)
{
- handlerLandObjectAdded(newParcel, regionID);
+ handlerLandObjectAdded(newParcel);
}
}
@@ -371,11 +370,11 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- public void TriggerLandObjectUpdated(uint localParcelID, Land newParcel)
+ public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel)
{
//triggerLandObjectRemoved(localParcelID);
- TriggerLandObjectAdded(newParcel, newParcel.m_scene.RegionInfo.RegionID);
+ TriggerLandObjectAdded(newParcel);
}
public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 67a4b97..f58109d 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -371,7 +371,7 @@ namespace OpenSim.Region.Environment.Scenes
RegisterToEvents();
SetDirectionVectors();
- m_scene.LandManager.sendLandUpdate(this, true);
+ m_scene.LandChannel.sendLandUpdate(this, true);
}
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
@@ -549,7 +549,7 @@ namespace OpenSim.Region.Environment.Scenes
//if (!m_gotAllObjectsInScene)
//{
m_scene.SendAllSceneObjectsToClient(this);
- m_scene.LandManager.sendLandUpdate(this, true);
+ m_scene.LandChannel.sendLandUpdate(this, true);
//m_gotAllObjectsInScene = true;
//}
--
cgit v1.1