* Reformatted EstateManagementModule

0.6.0-stable
Adam Frisby 2008-05-04 19:30:26 +00:00
parent 07098978b9
commit 9752669011
1 changed files with 48 additions and 61 deletions

View File

@ -25,16 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using libsecondlife; using libsecondlife;
using log4net;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Framework;
using Nini.Config;
using log4net;
namespace OpenSim.Region.Environment.Modules.World.Estate namespace OpenSim.Region.Environment.Modules.World.Estate
{ {
@ -44,21 +42,17 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
private Scene m_scene; private Scene m_scene;
#region Packet Data Responders #region Packet Data Responders
private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
{
private static void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
{
remote_client.sendDetailedEstateData(invoice); remote_client.sendDetailedEstateData(invoice);
remote_client.sendEstateManagersList(invoice); remote_client.sendEstateManagersList(invoice);
} }
private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges) private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
int matureLevel, bool restrictPushObject, bool allowParcelChanges)
{ {
m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None; m_scene.RegionInfo.EstateSettings.regionFlags = Simulator.RegionFlags.None;
if (blockTerraform) if (blockTerraform)
@ -105,7 +99,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
} }
sendRegionInfoPacketToAll(); sendRegionInfoPacketToAll();
} }
public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, LLUUID texture) public void setEstateTerrainBaseTexture(IClientAPI remoteClient, int corner, LLUUID texture)
@ -198,10 +191,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID) private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID)
{ {
m_scene.RegionInfo.CovenantID = estateCovenantID; m_scene.RegionInfo.CovenantID = estateCovenantID;
m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID); m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID);
} }
private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user) private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user)
@ -249,8 +240,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message)
{ {
m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message); m_scene.SendRegionMessageFromEstateTools(senderID, sessionID, senderName, message);
} }
private void SendEstateBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message) private void SendEstateBlueBoxMessage(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message)
{ {
m_scene.SendEstateMessageFromEstateTools(senderID, sessionID, senderName, message); m_scene.SendEstateMessageFromEstateTools(senderID, sessionID, senderName, message);
@ -258,8 +249,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics) private void handleEstateDebugRegionRequest(IClientAPI remote_client, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics)
{ {
if (physics) if (physics)
{ {
m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics; m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics;
@ -284,7 +273,6 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, LLUUID invoice, LLUUID senderID, LLUUID prey) private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, LLUUID invoice, LLUUID senderID, LLUUID prey)
{ {
if (prey != LLUUID.Zero) if (prey != LLUUID.Zero)
{ {
ScenePresence s = m_scene.GetScenePresence(prey); ScenePresence s = m_scene.GetScenePresence(prey);
@ -295,20 +283,18 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
} }
} }
private void HandleRegionInfoRequest(IClientAPI remote_client) private static void HandleRegionInfoRequest(IClientAPI remote_client)
{ {
remote_client.sendRegionInfoToEstateMenu(); remote_client.sendRegionInfoToEstateMenu();
} }
private void HandleEstateCovenantRequest(IClientAPI remote_client) private static void HandleEstateCovenantRequest(IClientAPI remote_client)
{ {
remote_client.sendEstateCovenantInformation(); remote_client.sendEstateCovenantInformation();
} }
#endregion #endregion
#region Outgoing Packets #region Outgoing Packets
public void sendRegionInfoPacketToAll() public void sendRegionInfoPacketToAll()
@ -320,6 +306,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
avatars[i].ControllingClient.sendRegionInfoToEstateMenu(); avatars[i].ControllingClient.sendRegionInfoToEstateMenu();
} }
} }
public void sendRegionHandshake(IClientAPI remoteClient) public void sendRegionHandshake(IClientAPI remoteClient)
{ {
remoteClient.SendRegionHandshake(m_scene.RegionInfo); remoteClient.SendRegionHandshake(m_scene.RegionInfo);
@ -339,31 +326,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public void Initialise(Scene scene, IConfigSource source) public void Initialise(Scene scene, IConfigSource source)
{ {
m_scene = scene; m_scene = scene;
m_scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
}
void EventManager_OnNewClient(IClientAPI client)
{
client.OnDetailedEstateDataRequest += sendDetailedEstateData;
client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
client.OnSetEstateTerrainDetailTexture += setEstateTerrainDetailTexture;
client.OnSetEstateTerrainTextureHeights += setEstateTerrainTextureHeights;
client.OnCommitEstateTerrainTextureRequest += handleCommitEstateTerrainTextureRequest;
client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest;
client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest;
client.OnRegionInfoRequest += HandleRegionInfoRequest;
client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
sendRegionHandshake(client);
} }
@ -391,10 +355,33 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
public void changeWaterHeight(float height) public void changeWaterHeight(float height)
{ {
setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit, m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour); setRegionTerrainSettings(height, m_scene.RegionInfo.EstateSettings.terrainRaiseLimit, m_scene.RegionInfo.EstateSettings.terrainLowerLimit,
m_scene.RegionInfo.EstateSettings.useFixedSun, m_scene.RegionInfo.EstateSettings.sunHour);
sendRegionInfoPacketToAll(); sendRegionInfoPacketToAll();
} }
#endregion #endregion
private void EventManager_OnNewClient(IClientAPI client)
{
client.OnDetailedEstateDataRequest += sendDetailedEstateData;
client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
client.OnSetEstateTerrainDetailTexture += setEstateTerrainDetailTexture;
client.OnSetEstateTerrainTextureHeights += setEstateTerrainTextureHeights;
client.OnCommitEstateTerrainTextureRequest += handleCommitEstateTerrainTextureRequest;
client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest;
client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest;
client.OnRegionInfoRequest += HandleRegionInfoRequest;
client.OnEstateCovenantRequest += HandleEstateCovenantRequest;
sendRegionHandshake(client);
}
} }
} }