Add events to the estate interface to let interested modules know of

changes to estate settings
avinationmerge
Melanie Thielker 2010-05-04 20:57:31 +02:00
parent ce86d39c70
commit 97bbce92a8
2 changed files with 41 additions and 0 deletions

View File

@ -48,6 +48,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
private EstateTerrainXferHandler TerrainUploader;
public event ChangeDelegate OnRegionInfoChange;
public event ChangeDelegate OnEstateInfoChange;
#region Packet Data Responders
private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
@ -137,6 +140,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide = false;
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
sendRegionInfoPacketToAll();
}
@ -162,6 +166,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
break;
}
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
sendRegionInfoPacketToAll();
}
@ -187,6 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
break;
}
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
sendRegionInfoPacketToAll();
}
@ -219,6 +225,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
sendRegionInfoPacketToAll();
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
}
private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds)
@ -230,6 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
}
private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user)
@ -245,6 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.AddEstateUser(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID);
}
else
@ -259,6 +268,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID);
}
@ -273,6 +283,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.AddEstateGroup(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID);
}
else
@ -286,6 +297,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID);
}
@ -323,6 +335,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.EstateSettings.AddBan(item);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
ScenePresence s = m_scene.GetScenePresence(user);
if (s != null)
@ -370,6 +383,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
}
else
{
@ -389,6 +403,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
}
else
@ -402,6 +417,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
}
@ -449,6 +465,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
}
@ -860,6 +877,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.EstateSettings.DenyMinors = false;
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateInfoChange();
m_scene.TriggerEstateSunUpdate();
@ -927,6 +945,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
break;
}
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
sendRegionInfoPacketToAll();
}
@ -972,6 +991,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
break;
}
m_scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
sendRegionHandshakeToAll();
}
}
@ -1141,5 +1161,21 @@ namespace OpenSim.Region.CoreModules.World.Estate
return false;
}
protected void TriggerRegionInfoChange()
{
ChangeDelegate change = OnRegionInfoChange;
if (change != null)
change();
}
protected void TriggerEstateInfoChange()
{
ChangeDelegate change = OnEstateInfoChange;
if (change != null)
change();
}
}
}

View File

@ -29,8 +29,13 @@ using OpenMetaverse;
namespace OpenSim.Region.Framework.Interfaces
{
public delegate void ChangeDelegate();
public interface IEstateModule : IRegionModule
{
event ChangeDelegate OnRegionInfoChange;
event ChangeDelegate OnEstateInfoChange;
uint GetRegionFlags();
bool IsManager(UUID avatarID);