aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-18 02:40:47 +0000
committerMelanie Thielker2008-07-18 02:40:47 +0000
commit263633e274082135b21b8183b92280b768d18883 (patch)
treef6104eef3633a8b454a4e8ac09d15182970c6bae /OpenSim/Region
parentadded region port number to output of "show regions" command (diff)
downloadopensim-SC-263633e274082135b21b8183b92280b768d18883.zip
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.gz
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.bz2
opensim-SC-263633e274082135b21b8183b92280b768d18883.tar.xz
Patch #9151
Makes the estate dialog fully functional. Implements all client facing functionality. Moves estate data from estate_settings.xml, which is used to provide defaults, to the region data store. Creates one estate for each region, and places the region in it. Converts all region bans to estate bans.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs64
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs41
-rw-r--r--OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs234
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandObject.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs7
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs25
-rw-r--r--OpenSim/Region/Environment/StorageManager.cs18
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs7
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs17
13 files changed, 295 insertions, 145 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index c9cc062..380df73 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -520,7 +520,6 @@ namespace OpenSim
520 //moved these here as the terrain texture has to be created after the modules are initialized 520 //moved these here as the terrain texture has to be created after the modules are initialized
521 // and has to happen before the region is registered with the grid. 521 // and has to happen before the region is registered with the grid.
522 scene.CreateTerrainTexture(false); 522 scene.CreateTerrainTexture(false);
523 scene.LoadRegionBanlist();
524 523
525 try 524 try
526 { 525 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index b170f28..2c05097 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -166,6 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
166 private GenericCall4 handlerDeRezObject = null; //OnDeRezObject; 166 private GenericCall4 handlerDeRezObject = null; //OnDeRezObject;
167 private ModifyTerrain handlerModifyTerrain = null; 167 private ModifyTerrain handlerModifyTerrain = null;
168 private BakeTerrain handlerBakeTerrain = null; 168 private BakeTerrain handlerBakeTerrain = null;
169 private EstateChangeInfo handlerEstateChangeInfo = null;
169 private Action<IClientAPI> handlerRegionHandShakeReply = null; //OnRegionHandShakeReply; 170 private Action<IClientAPI> handlerRegionHandShakeReply = null; //OnRegionHandShakeReply;
170 private GenericCall2 handlerRequestWearables = null; //OnRequestWearables; 171 private GenericCall2 handlerRequestWearables = null; //OnRequestWearables;
171 private Action<IClientAPI> handlerRequestAvatarsData = null; //OnRequestAvatarsData; 172 private Action<IClientAPI> handlerRequestAvatarsData = null; //OnRequestAvatarsData;
@@ -920,6 +921,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
920 public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest; 921 public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest;
921 public event SetRegionTerrainSettings OnSetRegionTerrainSettings; 922 public event SetRegionTerrainSettings OnSetRegionTerrainSettings;
922 public event BakeTerrain OnBakeTerrain; 923 public event BakeTerrain OnBakeTerrain;
924 public event EstateChangeInfo OnEstateChangeInfo;
923 public event EstateRestartSimRequest OnEstateRestartSimRequest; 925 public event EstateRestartSimRequest OnEstateRestartSimRequest;
924 public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; 926 public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
925 public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; 927 public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
@@ -2614,18 +2616,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2614 this.OutPacket(packet, ThrottleOutPacketType.Task); 2616 this.OutPacket(packet, ThrottleOutPacketType.Task);
2615 } 2617 }
2616 2618
2617 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 2619 public void SendBannedUserList(LLUUID invoice, EstateBan[] bl, uint estateID)
2618 { 2620 {
2619 RegionBanListItem[] bl = banlist.ToArray(); 2621 List<LLUUID>BannedUsers = new List<LLUUID>();
2620
2621 LLUUID[] BannedUsers = new LLUUID[bl.Length];
2622
2623 2622
2624 for (int i = 0; i < bl.Length; i++) 2623 for (int i = 0; i < bl.Length; i++)
2625 { 2624 {
2626 if (bl[i] == null) 2625 if (bl[i] == null)
2627 continue; 2626 continue;
2628 BannedUsers[i] = bl[i].bannedUUID; 2627 if (bl[i].bannedUUID == LLUUID.Zero)
2628 continue;
2629 BannedUsers.Add(bl[i].bannedUUID);
2629 } 2630 }
2630 2631
2631 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 2632 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
@@ -2635,9 +2636,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2635 packet.MethodData.Invoice = invoice; 2636 packet.MethodData.Invoice = invoice;
2636 packet.MethodData.Method = Helpers.StringToField("setaccess"); 2637 packet.MethodData.Method = Helpers.StringToField("setaccess");
2637 2638
2638 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Length]; 2639 EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
2639 2640
2640 for (int i = 0; i < (6 + BannedUsers.Length); i++) 2641 for (int i = 0; i < (6 + BannedUsers.Count); i++)
2641 { 2642 {
2642 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); 2643 returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
2643 } 2644 }
@@ -2647,12 +2648,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2647 returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++; 2648 returnblock[j].Parameter = Helpers.StringToField(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
2648 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2649 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2649 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2650 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2650 returnblock[j].Parameter = Helpers.StringToField(BannedUsers.Length.ToString()); j++; 2651 returnblock[j].Parameter = Helpers.StringToField(BannedUsers.Count.ToString()); j++;
2651 returnblock[j].Parameter = Helpers.StringToField("0"); j++; 2652 returnblock[j].Parameter = Helpers.StringToField("0"); j++;
2652 2653
2653 for (int i = 0; i < BannedUsers.Length; i++) 2654 foreach (LLUUID banned in BannedUsers)
2654 { 2655 {
2655 returnblock[j].Parameter = BannedUsers[i].GetBytes(); j++; 2656 returnblock[j].Parameter = banned.GetBytes(); j++;
2656 } 2657 }
2657 packet.ParamList = returnblock; 2658 packet.ParamList = returnblock;
2658 packet.Header.Reliable = false; 2659 packet.Header.Reliable = false;
@@ -2687,11 +2688,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2687 this.OutPacket(rinfopack, ThrottleOutPacketType.Task); 2688 this.OutPacket(rinfopack, ThrottleOutPacketType.Task);
2688 } 2689 }
2689 2690
2690 public void SendEstateCovenantInformation() 2691 public void SendEstateCovenantInformation(LLUUID covenant)
2691 { 2692 {
2692 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); 2693 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
2693 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); 2694 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
2694 edata.CovenantID = m_scene.RegionInfo.CovenantID; 2695 edata.CovenantID = covenant;
2695 edata.CovenantTimestamp = 0; 2696 edata.CovenantTimestamp = 0;
2696 edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 2697 edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
2697 edata.EstateName = 2698 edata.EstateName =
@@ -2700,7 +2701,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2700 this.OutPacket(einfopack, ThrottleOutPacketType.Task); 2701 this.OutPacket(einfopack, ThrottleOutPacketType.Task);
2701 } 2702 }
2702 2703
2703 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 2704 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
2704 { 2705 {
2705 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 2706 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
2706 packet.MethodData.Invoice = invoice; 2707 packet.MethodData.Invoice = invoice;
@@ -2718,13 +2719,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2718 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString()); 2719 returnblock[1].Parameter = Helpers.StringToField(m_scene.RegionInfo.MasterAvatarAssignedUUID.ToString());
2719 returnblock[2].Parameter = Helpers.StringToField(estateID.ToString()); 2720 returnblock[2].Parameter = Helpers.StringToField(estateID.ToString());
2720 2721
2721 // TODO: Resolve Magic numbers here 2722 returnblock[3].Parameter = Helpers.StringToField(estateFlags.ToString());
2722 returnblock[3].Parameter = Helpers.StringToField("269516800"); 2723 returnblock[4].Parameter = Helpers.StringToField(sunPosition.ToString());
2723 returnblock[4].Parameter = Helpers.StringToField("0"); 2724 returnblock[5].Parameter = Helpers.StringToField(parentEstate.ToString());
2724 returnblock[5].Parameter = Helpers.StringToField("1"); 2725 returnblock[6].Parameter = Helpers.StringToField(covenant.ToString());
2725 returnblock[6].Parameter = Helpers.StringToField(m_scene.RegionInfo.RegionID.ToString()); 2726 returnblock[7].Parameter = Helpers.StringToField("1160895077"); // what is this?
2726 returnblock[7].Parameter = Helpers.StringToField("1160895077"); 2727 returnblock[8].Parameter = Helpers.StringToField("1"); // what is this?
2727 returnblock[8].Parameter = Helpers.StringToField("1");
2728 2728
2729 packet.ParamList = returnblock; 2729 packet.ParamList = returnblock;
2730 packet.Header.Reliable = false; 2730 packet.Header.Reliable = false;
@@ -5959,10 +5959,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5959 tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter); 5959 tmp = Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter);
5960 if (!tmp.Contains(".")) tmp += ".00"; 5960 if (!tmp.Contains(".")) tmp += ".00";
5961 float TerrainLowerLimit = (float)Convert.ToDecimal(tmp); 5961 float TerrainLowerLimit = (float)Convert.ToDecimal(tmp);
5962 bool UseEstateSun = convertParamStringToBool(messagePacket.ParamList[3].Parameter);
5962 bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter); 5963 bool UseFixedSun = convertParamStringToBool(messagePacket.ParamList[4].Parameter);
5963 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter)); 5964 float SunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[5].Parameter));
5965 bool UseGlobal = convertParamStringToBool(messagePacket.ParamList[6].Parameter);
5966 bool EstateFixedSun = convertParamStringToBool(messagePacket.ParamList[7].Parameter);
5967 float EstateSunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(messagePacket.ParamList[8].Parameter));
5964 5968
5965 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour); 5969 OnSetRegionTerrainSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseEstateSun, UseFixedSun, SunHour, UseGlobal, EstateFixedSun, EstateSunHour);
5966 5970
5967 } 5971 }
5968 catch (Exception ex) 5972 catch (Exception ex)
@@ -6076,6 +6080,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6076 } 6080 }
6077 break; 6081 break;
6078 6082
6083 case "estatechangeinfo":
6084 if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId))
6085 {
6086 LLUUID invoice = messagePacket.MethodData.Invoice;
6087 LLUUID SenderID = messagePacket.AgentData.AgentID;
6088 UInt32 param1 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[1].Parameter));
6089 UInt32 param2 = Convert.ToUInt32(Helpers.FieldToUTF8String(messagePacket.ParamList[2].Parameter));
6090
6091 handlerEstateChangeInfo = OnEstateChangeInfo;
6092 if (handlerEstateChangeInfo != null)
6093 {
6094 handlerEstateChangeInfo(this, invoice, SenderID, param1, param2);
6095 }
6096 }
6097 break;
6098
6079 default: 6099 default:
6080 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString()); 6100 m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket.ToString());
6081 break; 6101 break;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 6f4a563..d8a6daf 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -623,7 +623,7 @@ namespace OpenSim.Region.Communications.OGS1
623 { 623 {
624 if (regions[i].RegionHandle == regionHandle) 624 if (regions[i].RegionHandle == regionHandle)
625 { 625 {
626 if (regions[i].CheckIfUserBanned(agentData.AgentID)) 626 if (regions[i].EstateSettings.IsBanned(agentData.AgentID))
627 { 627 {
628 banned = true; 628 banned = true;
629 break; 629 break;
@@ -1158,7 +1158,7 @@ namespace OpenSim.Region.Communications.OGS1
1158 { 1158 {
1159 if (regions[i].RegionHandle == regionHandle) 1159 if (regions[i].RegionHandle == regionHandle)
1160 { 1160 {
1161 if (regions[i].CheckIfUserBanned(agentID)) 1161 if (regions[i].EstateSettings.IsBanned(agentID))
1162 { 1162 {
1163 banned = true; 1163 banned = true;
1164 break; 1164 break;
diff --git a/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs
new file mode 100644
index 0000000..ecac2ca
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IEstateDataStore.cs
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenSim.Framework;
30using libsecondlife;
31
32namespace OpenSim.Region.Environment.Interfaces
33{
34 public interface IEstateDataStore
35 {
36 void Initialise(string connectstring);
37
38 EstateSettings LoadEstateSettings(LLUUID regionID);
39 void StoreEstateSettings(EstateSettings es);
40 }
41}
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
index c189f95..0316f20 100644
--- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs
@@ -72,10 +72,6 @@ namespace OpenSim.Region.Environment.Interfaces
72 void RemoveLandObject(LLUUID globalID); 72 void RemoveLandObject(LLUUID globalID);
73 List<LandData> LoadLandObjects(LLUUID regionUUID); 73 List<LandData> LoadLandObjects(LLUUID regionUUID);
74 74
75 List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID);
76 void AddToRegionBanlist(RegionBanListItem item);
77 void RemoveFromRegionBanlist(RegionBanListItem item);
78
79 void StoreRegionSettings(RegionSettings rs); 75 void StoreRegionSettings(RegionSettings rs);
80 RegionSettings LoadRegionSettings(LLUUID regionUUID); 76 RegionSettings LoadRegionSettings(LLUUID regionUUID);
81 77
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index ac6a075..c5c0370 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -49,9 +49,26 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
49 49
50 private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice) 50 private void sendDetailedEstateData(IClientAPI remote_client, LLUUID invoice)
51 { 51 {
52 remote_client.SendDetailedEstateData(invoice,m_scene.RegionInfo.EstateSettings.estateName,m_scene.RegionInfo.EstateSettings.estateID); 52 //SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
53 remote_client.SendEstateManagersList(invoice,m_scene.RegionInfo.EstateSettings.estateManagers,m_scene.RegionInfo.EstateSettings.estateID); 53
54 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 54 uint sun = 0;
55 if(!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
56 sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800;
57 remote_client.SendDetailedEstateData(invoice,
58 m_scene.RegionInfo.EstateSettings.EstateName,
59 m_scene.RegionInfo.EstateSettings.EstateID,
60 m_scene.RegionInfo.EstateSettings.ParentEstateID,
61 GetEstateFlags(),
62 sun,
63 m_scene.RegionInfo.RegionSettings.Covenant);
64
65 remote_client.SendEstateManagersList(invoice,
66 m_scene.RegionInfo.EstateSettings.EstateManagers,
67 m_scene.RegionInfo.EstateSettings.EstateID);
68
69 remote_client.SendBannedUserList(invoice,
70 m_scene.RegionInfo.EstateSettings.EstateBans,
71 m_scene.RegionInfo.EstateSettings.EstateID);
55 } 72 }
56 73
57 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, 74 private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor,
@@ -150,8 +167,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
150 sendRegionHandshakeToAll(); 167 sendRegionHandshakeToAll();
151 } 168 }
152 169
153 public void setRegionTerrainSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, 170 public void setRegionTerrainSettings(float WaterHeight,
154 bool UseFixedSun, float SunHour) 171 float TerrainRaiseLimit, float TerrainLowerLimit,
172 bool UseEstateSun, bool UseFixedSun, float SunHour,
173 bool UseGlobal, bool EstateFixedSun, float EstateSunHour)
155 { 174 {
156 // Water Height 175 // Water Height
157 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight; 176 m_scene.RegionInfo.RegionSettings.WaterHeight = WaterHeight;
@@ -161,10 +180,11 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
161 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit; 180 m_scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit;
162 181
163 // Time of day / fixed sun 182 // Time of day / fixed sun
183 m_scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun;
164 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun; 184 m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
165 m_scene.RegionInfo.RegionSettings.SunPosition = SunHour; 185 m_scene.RegionInfo.RegionSettings.SunPosition = SunHour;
166 186
167 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseFixedSun, SunHour); 187 m_scene.EventManager.TriggerEstateToolsTimeUpdate(m_scene.RegionInfo.RegionHandle, UseFixedSun, UseEstateSun, SunHour);
168 188
169 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString()); 189 //m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
170 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString()); 190 //m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
@@ -180,20 +200,23 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
180 200
181 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID) 201 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, LLUUID estateCovenantID)
182 { 202 {
183 m_scene.RegionInfo.CovenantID = estateCovenantID; 203 m_scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
184 m_scene.RegionInfo.SaveEstatecovenantUUID(estateCovenantID); 204 m_scene.RegionInfo.RegionSettings.Save();
185 } 205 }
186 206
187 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user) 207 private void handleEstateAccessDeltaRequest(IClientAPI remote_client, LLUUID invoice, int estateAccessType, LLUUID user)
188 { 208 {
189 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc. 209 // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups.. etc.
190 210
211 if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
212 return; // never process owner
213
191 switch (estateAccessType) 214 switch (estateAccessType)
192 { 215 {
193 case 64: 216 case 64:
194 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 217 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
195 { 218 {
196 RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); 219 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
197 220
198 bool alreadyInList = false; 221 bool alreadyInList = false;
199 222
@@ -209,15 +232,15 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
209 if (!alreadyInList) 232 if (!alreadyInList)
210 { 233 {
211 234
212 RegionBanListItem item = new RegionBanListItem(); 235 EstateBan item = new EstateBan();
213 236
214 item.bannedUUID = user; 237 item.bannedUUID = user;
215 item.regionUUID = m_scene.RegionInfo.RegionID; 238 item.estateID = m_scene.RegionInfo.EstateSettings.EstateID;
216 item.bannedIP = "0.0.0.0"; 239 item.bannedIP = "0.0.0.0";
217 item.bannedIPHostMask = "0.0.0.0"; 240 item.bannedIPHostMask = "0.0.0.0";
218 241
219 m_scene.RegionInfo.regionBanlist.Add(item); 242 m_scene.RegionInfo.EstateSettings.AddBan(item);
220 m_scene.AddToRegionBanlist(item); 243 m_scene.RegionInfo.EstateSettings.Save();
221 244
222 ScenePresence s = m_scene.GetScenePresence(user); 245 ScenePresence s = m_scene.GetScenePresence(user);
223 if (s != null) 246 if (s != null)
@@ -231,7 +254,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
231 remote_client.SendAlertMessage("User is already on the region ban list"); 254 remote_client.SendAlertMessage("User is already on the region ban list");
232 } 255 }
233 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 256 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
234 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 257 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
235 } 258 }
236 else 259 else
237 { 260 {
@@ -241,10 +264,10 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
241 case 128: 264 case 128:
242 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 265 if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
243 { 266 {
244 RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); 267 EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;
245 268
246 bool alreadyInList = false; 269 bool alreadyInList = false;
247 RegionBanListItem listitem = null; 270 EstateBan listitem = null;
248 271
249 for (int i = 0; i < banlistcheck.Length; i++) 272 for (int i = 0; i < banlistcheck.Length; i++)
250 { 273 {
@@ -258,15 +281,15 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
258 } 281 }
259 if (alreadyInList && listitem != null) 282 if (alreadyInList && listitem != null)
260 { 283 {
261 m_scene.RegionInfo.regionBanlist.Remove(listitem); 284 m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.bannedUUID);
262 m_scene.RemoveFromRegionBanlist(listitem); 285 m_scene.RegionInfo.EstateSettings.Save();
263 } 286 }
264 else 287 else
265 { 288 {
266 remote_client.SendAlertMessage("User is not on the region ban list"); 289 remote_client.SendAlertMessage("User is not on the region ban list");
267 } 290 }
268 //m_scene.RegionInfo.regionBanlist.Add(Manager(user); 291 //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
269 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); 292 remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
270 } 293 }
271 else 294 else
272 { 295 {
@@ -280,7 +303,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
280 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 303 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
281 { 304 {
282 m_scene.RegionInfo.EstateSettings.AddEstateManager(user); 305 m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
283 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); 306 m_scene.RegionInfo.EstateSettings.Save();
307 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
284 } 308 }
285 else 309 else
286 { 310 {
@@ -294,7 +318,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
294 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) 318 if (remote_client.AgentId == m_scene.RegionInfo.MasterAvatarAssignedUUID || m_scene.ExternalChecks.ExternalChecksBypassPermissions())
295 { 319 {
296 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); 320 m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
297 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.estateManagers, m_scene.RegionInfo.EstateSettings.estateID); 321 m_scene.RegionInfo.EstateSettings.Save();
322
323 remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
298 } 324 }
299 else 325 else
300 { 326 {
@@ -358,28 +384,24 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
358 { 384 {
359 385
360 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs(); 386 RegionInfoForEstateMenuArgs args = new RegionInfoForEstateMenuArgs();
361 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; 387 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor;
362 args.estateID = m_scene.RegionInfo.EstateSettings.estateID; 388 args.estateID = m_scene.RegionInfo.EstateSettings.EstateID;
363 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit; 389 args.maxAgents = (byte)m_scene.RegionInfo.RegionSettings.AgentLimit;
364 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus; 390 args.objectBonusFactor = (float)m_scene.RegionInfo.RegionSettings.ObjectBonus;
365 args.parentEstateID = m_scene.RegionInfo.EstateSettings.parentEstateID; 391 args.parentEstateID = m_scene.RegionInfo.EstateSettings.ParentEstateID;
366 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.pricePerMeter; 392 args.pricePerMeter = m_scene.RegionInfo.EstateSettings.PricePerMeter;
367 args.redirectGridX = m_scene.RegionInfo.EstateSettings.redirectGridX; 393 args.redirectGridX = m_scene.RegionInfo.EstateSettings.RedirectGridX;
368 args.redirectGridY = m_scene.RegionInfo.EstateSettings.redirectGridY; 394 args.redirectGridY = m_scene.RegionInfo.EstateSettings.RedirectGridY;
369 args.regionFlags = GetRegionFlags(); 395 args.regionFlags = GetRegionFlags();
370 byte mature = 13; 396 byte mature = 13;
371 if(m_scene.RegionInfo.RegionSettings.Maturity == 1) 397 if(m_scene.RegionInfo.RegionSettings.Maturity == 1)
372 mature = 21; 398 mature = 21;
373 args.simAccess = mature; 399 args.simAccess = mature;
374 400
375 if (m_scene.RegionInfo.RegionSettings.FixedSun) 401 args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
376 args.sunHour = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
377 else
378 args.sunHour = m_scene.EventManager.GetSunLindenHour();
379
380 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit; 402 args.terrainLowerLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit;
381 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; 403 args.terrainRaiseLimit = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
382 args.useEstateSun = !m_scene.RegionInfo.RegionSettings.FixedSun; 404 args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun;
383 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 405 args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
384 args.simName = m_scene.RegionInfo.RegionName; 406 args.simName = m_scene.RegionInfo.RegionName;
385 407
@@ -387,9 +409,9 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
387 remote_client.SendRegionInfoToEstateMenu(args); 409 remote_client.SendRegionInfoToEstateMenu(args);
388 } 410 }
389 411
390 private static void HandleEstateCovenantRequest(IClientAPI remote_client) 412 private void HandleEstateCovenantRequest(IClientAPI remote_client)
391 { 413 {
392 remote_client.SendEstateCovenantInformation(); 414 remote_client.SendEstateCovenantInformation(m_scene.RegionInfo.RegionSettings.Covenant);
393 } 415 }
394 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) 416 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
395 { 417 {
@@ -508,7 +530,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
508 { 530 {
509 RegionHandshakeArgs args = new RegionHandshakeArgs(); 531 RegionHandshakeArgs args = new RegionHandshakeArgs();
510 bool estatemanager = false; 532 bool estatemanager = false;
511 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.estateManagers; 533 LLUUID[] EstateManagers = m_scene.RegionInfo.EstateSettings.EstateManagers;
512 for (int i = 0; i < EstateManagers.Length; i++) 534 for (int i = 0; i < EstateManagers.Length; i++)
513 { 535 {
514 if (EstateManagers[i] == remoteClient.AgentId) 536 if (EstateManagers[i] == remoteClient.AgentId)
@@ -517,7 +539,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
517 539
518 args.isEstateManager = estatemanager; 540 args.isEstateManager = estatemanager;
519 541
520 args.billableFactor = m_scene.RegionInfo.EstateSettings.billableFactor; 542 args.billableFactor = m_scene.RegionInfo.EstateSettings.BillableFactor;
521 args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW; 543 args.terrainStartHeight0 = (float)m_scene.RegionInfo.RegionSettings.Elevation1SW;
522 args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW; 544 args.terrainHeightRange0 = (float)m_scene.RegionInfo.RegionSettings.Elevation2SW;
523 args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW; 545 args.terrainStartHeight1 = (float)m_scene.RegionInfo.RegionSettings.Elevation1NW;
@@ -554,6 +576,73 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
554 ); 576 );
555 } 577 }
556 578
579 public void handleEstateChangeInfo(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, UInt32 parms1, UInt32 parms2)
580 {
581 if(parms2 == 0)
582 {
583 m_scene.RegionInfo.EstateSettings.UseGlobalTime = true;
584 m_scene.RegionInfo.EstateSettings.SunPosition = 0.0;
585 }
586 else
587 {
588 m_scene.RegionInfo.EstateSettings.UseGlobalTime = false;
589 m_scene.RegionInfo.EstateSettings.SunPosition = (double)(parms2 - 0x1800)/1024.0;
590 }
591
592 if((parms1 & 0x00000010) != 0)
593 m_scene.RegionInfo.EstateSettings.FixedSun = true;
594 else
595 m_scene.RegionInfo.EstateSettings.FixedSun = false;
596
597 if((parms1 & 0x00008000) != 0)
598 m_scene.RegionInfo.EstateSettings.PublicAccess = true;
599 else
600 m_scene.RegionInfo.EstateSettings.PublicAccess = false;
601
602 if((parms1 & 0x10000000) != 0)
603 m_scene.RegionInfo.EstateSettings.AllowVoice = true;
604 else
605 m_scene.RegionInfo.EstateSettings.AllowVoice = false;
606
607 if((parms1 & 0x00100000) != 0)
608 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = true;
609 else
610 m_scene.RegionInfo.EstateSettings.AllowDirectTeleport = false;
611
612 if((parms1 & 0x00800000) != 0)
613 m_scene.RegionInfo.EstateSettings.DenyAnonymous = true;
614 else
615 m_scene.RegionInfo.EstateSettings.DenyAnonymous = false;
616
617 if((parms1 & 0x01000000) != 0)
618 m_scene.RegionInfo.EstateSettings.DenyIdentified = true;
619 else
620 m_scene.RegionInfo.EstateSettings.DenyIdentified = false;
621
622 if((parms1 & 0x02000000) != 0)
623 m_scene.RegionInfo.EstateSettings.DenyTransacted = true;
624 else
625 m_scene.RegionInfo.EstateSettings.DenyTransacted = false;
626
627 m_scene.RegionInfo.EstateSettings.Save();
628
629 float sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition;
630 if(m_scene.RegionInfo.RegionSettings.UseEstateSun)
631 {
632 sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition;
633 if(m_scene.RegionInfo.EstateSettings.UseGlobalTime)
634 sun = m_scene.EventManager.GetSunLindenHour();
635 }
636
637 m_scene.EventManager.TriggerEstateToolsTimeUpdate(
638 m_scene.RegionInfo.RegionHandle,
639 m_scene.RegionInfo.EstateSettings.FixedSun ||
640 m_scene.RegionInfo.RegionSettings.FixedSun,
641 m_scene.RegionInfo.RegionSettings.UseEstateSun, sun);
642
643 sendDetailedEstateData(remoteClient, invoice);
644 }
645
557 #endregion 646 #endregion
558 647
559 #region IRegionModule Members 648 #region IRegionModule Members
@@ -594,8 +683,12 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
594 setRegionTerrainSettings(height, 683 setRegionTerrainSettings(height,
595 (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit, 684 (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit,
596 (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit, 685 (float)m_scene.RegionInfo.RegionSettings.TerrainLowerLimit,
686 m_scene.RegionInfo.RegionSettings.UseEstateSun,
597 m_scene.RegionInfo.RegionSettings.FixedSun, 687 m_scene.RegionInfo.RegionSettings.FixedSun,
598 (float)m_scene.RegionInfo.RegionSettings.SunPosition); 688 (float)m_scene.RegionInfo.RegionSettings.SunPosition,
689 m_scene.RegionInfo.EstateSettings.UseGlobalTime,
690 m_scene.RegionInfo.EstateSettings.FixedSun,
691 (float)m_scene.RegionInfo.EstateSettings.SunPosition);
599 692
600 sendRegionInfoPacketToAll(); 693 sendRegionInfoPacketToAll();
601 } 694 }
@@ -613,6 +706,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
613 client.OnSetRegionTerrainSettings += setRegionTerrainSettings; 706 client.OnSetRegionTerrainSettings += setRegionTerrainSettings;
614 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest; 707 client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
615 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest; 708 client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
709 client.OnEstateChangeInfo += handleEstateChangeInfo;
616 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest; 710 client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
617 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage; 711 client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
618 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; 712 client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
@@ -652,41 +746,53 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
652 if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch) 746 if(m_scene.RegionInfo.RegionSettings.BlockShowInSearch)
653 flags |= (Simulator.RegionFlags)(1 << 29); 747 flags |= (Simulator.RegionFlags)(1 << 29);
654 748
655 // Partially implemented
656 //
657 if(m_scene.RegionInfo.RegionSettings.FixedSun) 749 if(m_scene.RegionInfo.RegionSettings.FixedSun)
658 flags |= Simulator.RegionFlags.SunFixed; 750 flags |= Simulator.RegionFlags.SunFixed;
751 if(m_scene.RegionInfo.RegionSettings.Sandbox)
752 flags |= Simulator.RegionFlags.Sandbox;
753
754 // Handled in LandObject.cs: AllowLandmark
755 // Handled in LandObject.cs: AllowSetHome
659 756
660 // Not implemented
661 //
662 // TODO: ExternallyVisible
663 flags |= Simulator.RegionFlags.ExternallyVisible;
664 // TODO: PublicAllowed
665 flags |= Simulator.RegionFlags.PublicAllowed;
666 // TODO: AllowDirectTeleport
667 flags |= Simulator.RegionFlags.AllowDirectTeleport;
668 // TODO: AllowVoice
669 flags |= Simulator.RegionFlags.AllowVoice;
670
671 // TDOD: AllowLandmark
672 // TDOD: AllowSetHome
673 // TODO: ResetHomeOnTeleport
674 // TODO: TaxFree ? (Linden-ism)
675 // TODO: Sandbox ?
676 // TODO: SkipUpdateInterestList 757 // TODO: SkipUpdateInterestList
677 // TODO: ExternallyVisible
678 // TODO: DenyAnonymous
679 // TODO: DenyIdentified
680 // TODO: DenyTransacted
681 // TODO: AbuseEmailToEstateOwner
682 // TODO: BlockDwell
683 // TODO: EstateSkipScripts
684 758
685 // Omitted 759 // Omitted
686 // 760 //
687 // Omitted: NullLayer (what is that?) 761 // Omitted: NullLayer (what is that?)
688 // Omitted: SkipAgentAction (what does it do?) 762 // Omitted: SkipAgentAction (what does it do?)
689 // Omitted: MainlandVisible (Do we need it) 763
764 return (uint)flags;
765 }
766
767 public uint GetEstateFlags()
768 {
769 Simulator.RegionFlags flags = Simulator.RegionFlags.None;
770
771 if(m_scene.RegionInfo.EstateSettings.FixedSun)
772 flags |= Simulator.RegionFlags.SunFixed;
773 if(m_scene.RegionInfo.EstateSettings.PublicAccess)
774 flags |= (Simulator.RegionFlags.PublicAllowed |
775 Simulator.RegionFlags.ExternallyVisible);
776 if(m_scene.RegionInfo.EstateSettings.AllowVoice)
777 flags |= Simulator.RegionFlags.AllowVoice;
778 if(m_scene.RegionInfo.EstateSettings.AllowDirectTeleport)
779 flags |= Simulator.RegionFlags.AllowDirectTeleport;
780 if(m_scene.RegionInfo.EstateSettings.DenyAnonymous)
781 flags |= Simulator.RegionFlags.DenyAnonymous;
782 if(m_scene.RegionInfo.EstateSettings.DenyIdentified)
783 flags |= Simulator.RegionFlags.DenyIdentified;
784 if(m_scene.RegionInfo.EstateSettings.DenyTransacted)
785 flags |= Simulator.RegionFlags.DenyTransacted;
786 if(m_scene.RegionInfo.EstateSettings.AbuseEmailToEstateOwner)
787 flags |= Simulator.RegionFlags.AbuseEmailToEstateOwner;
788 if(m_scene.RegionInfo.EstateSettings.BlockDwell)
789 flags |= Simulator.RegionFlags.BlockDwell;
790 if(m_scene.RegionInfo.EstateSettings.EstateSkipScripts)
791 flags |= Simulator.RegionFlags.EstateSkipScripts;
792 if(m_scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
793 flags |= Simulator.RegionFlags.ResetHomeOnTeleport;
794 if(m_scene.RegionInfo.EstateSettings.TaxFree)
795 flags |= Simulator.RegionFlags.TaxFree;
690 796
691 return (uint)flags; 797 return (uint)flags;
692 } 798 }
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
index e52896a..5aed2a7 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs
@@ -162,9 +162,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client) 162 public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
163 { 163 {
164 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 164 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
165 uint regionFlags = 67108864; 165 uint regionFlags = 336723974 & ~((uint)(Simulator.RegionFlags.AllowLandmark | Simulator.RegionFlags.AllowSetHome));
166 if(estateModule != null) 166 if(estateModule != null)
167 regionFlags = estateModule.GetRegionFlags(); 167 regionFlags = estateModule.GetRegionFlags();
168 if((landData.landFlags & (uint)Parcel.ParcelFlags.AllowLandmark) != 0)
169 regionFlags |= (uint)Simulator.RegionFlags.AllowLandmark;
170 if(landData.ownerID == remote_client.AgentId)
171 regionFlags |= (uint)Simulator.RegionFlags.AllowSetHome;
168 remote_client.SendLandProperties(remote_client, sequence_id, 172 remote_client.SendLandProperties(remote_client, sequence_id,
169 snap_selection, request_result, landData, 173 snap_selection, request_result, landData,
170 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, 174 (float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 10971db..040b9b7 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -291,6 +291,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
291 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; 291 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
292 public event EstateDebugRegionRequest OnEstateDebugRegionRequest; 292 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
293 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; 293 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
294 public event EstateChangeInfo OnEstateChangeInfo;
294 public event ScriptReset OnScriptReset; 295 public event ScriptReset OnScriptReset;
295 public event GetScriptRunning OnGetScriptRunning; 296 public event GetScriptRunning OnGetScriptRunning;
296 public event SetScriptRunning OnSetScriptRunning; 297 public event SetScriptRunning OnSetScriptRunning;
@@ -752,17 +753,17 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
752 { 753 {
753 } 754 }
754 755
755 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 756 public void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID)
756 { 757 {
757 } 758 }
758 759
759 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) 760 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
760 { 761 {
761 } 762 }
762 public void SendEstateCovenantInformation() 763 public void SendEstateCovenantInformation(LLUUID covenant)
763 { 764 {
764 } 765 }
765 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 766 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
766 { 767 {
767 } 768 }
768 769
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index 41bb610..b0d9a26 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -246,17 +246,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
246 246
247 protected bool IsEstateManager(LLUUID user) 247 protected bool IsEstateManager(LLUUID user)
248 { 248 {
249 if (user != LLUUID.Zero) 249 return m_scene.RegionInfo.EstateSettings.IsEstateManager(user);
250 {
251 LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
252 foreach (LLUUID estatemanager in estatemanagers)
253 {
254 if (estatemanager == user)
255 return true;
256 }
257 }
258
259 return false;
260 } 250 }
261#endregion 251#endregion
262 252
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ad9646f..4aa9cf9 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -271,9 +271,14 @@ namespace OpenSim.Region.Environment.Scenes
271 // Load region settings 271 // Load region settings
272 // First try database 272 // First try database
273 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); 273 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
274
275 // Hook up save event 274 // Hook up save event
276 m_regInfo.RegionSettings.OnSave += m_storageManager.DataStore.StoreRegionSettings; 275 m_regInfo.RegionSettings.OnSave += m_storageManager.DataStore.StoreRegionSettings;
276 if(m_storageManager.EstateDataStore != null)
277 {
278 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
279 m_regInfo.EstateSettings.OnSave += m_storageManager.EstateDataStore.StoreEstateSettings;
280 }
281
277 282
278 283
279 //Bind Storage Manager functions to some land manager functions for this scene 284 //Bind Storage Manager functions to some land manager functions for this scene
@@ -1445,20 +1450,6 @@ namespace OpenSim.Region.Environment.Scenes
1445 } 1450 }
1446 } 1451 }
1447 1452
1448 public void LoadRegionBanlist()
1449 {
1450 List<RegionBanListItem> regionbanlist = m_storageManager.DataStore.LoadRegionBanList(m_regInfo.RegionID);
1451 m_regInfo.regionBanlist = regionbanlist;
1452 }
1453 public void AddToRegionBanlist(RegionBanListItem item)
1454 {
1455 m_storageManager.DataStore.AddToRegionBanlist(item);
1456 }
1457
1458 public void RemoveFromRegionBanlist(RegionBanListItem item)
1459 {
1460 m_storageManager.DataStore.RemoveFromRegionBanlist(item);
1461 }
1462 #endregion 1453 #endregion
1463 1454
1464 #region Primitives Methods 1455 #region Primitives Methods
@@ -1916,7 +1907,7 @@ namespace OpenSim.Region.Environment.Scenes
1916 SceneObjectPart RootPrim = GetSceneObjectPart(primID); 1907 SceneObjectPart RootPrim = GetSceneObjectPart(primID);
1917 if (RootPrim != null) 1908 if (RootPrim != null)
1918 { 1909 {
1919 if (m_regInfo.CheckIfUserBanned(RootPrim.OwnerID)) 1910 if (m_regInfo.EstateSettings.IsBanned(RootPrim.OwnerID))
1920 { 1911 {
1921 SceneObjectGroup grp = RootPrim.ParentGroup; 1912 SceneObjectGroup grp = RootPrim.ParentGroup;
1922 if (grp != null) 1913 if (grp != null)
@@ -2410,7 +2401,7 @@ namespace OpenSim.Region.Environment.Scenes
2410 { 2401 {
2411 if (regionHandle == m_regInfo.RegionHandle) 2402 if (regionHandle == m_regInfo.RegionHandle)
2412 { 2403 {
2413 if (m_regInfo.CheckIfUserBanned(agent.AgentID)) 2404 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2414 { 2405 {
2415 m_log.WarnFormat( 2406 m_log.WarnFormat(
2416 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist", 2407 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist",
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index b9a42a2..768e12c 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -43,6 +43,13 @@ namespace OpenSim.Region.Environment
43 get { return m_dataStore; } 43 get { return m_dataStore; }
44 } 44 }
45 45
46 private IEstateDataStore m_estateDataStore;
47
48 public IEstateDataStore EstateDataStore
49 {
50 get { return m_estateDataStore; }
51 }
52
46 public StorageManager(IRegionDataStore storage) 53 public StorageManager(IRegionDataStore storage)
47 { 54 {
48 m_dataStore = storage; 55 m_dataStore = storage;
@@ -69,6 +76,17 @@ namespace OpenSim.Region.Environment
69 76
70 m_log.Info("[DATASTORE]: Added IRegionDataStore Interface"); 77 m_log.Info("[DATASTORE]: Added IRegionDataStore Interface");
71 } 78 }
79
80 typeInterface = pluginType.GetInterface("IEstateDataStore", true);
81
82 if(typeInterface != null)
83 {
84 IEstateDataStore estPlug =
85 (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
86 estPlug.Initialise(connectionstring);
87
88 m_estateDataStore = estPlug;
89 }
72 } 90 }
73 } 91 }
74 92
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 94983ee..6179ccf 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -158,6 +158,7 @@ namespace OpenSim.Region.Examples.SimpleModule
158 public event ObjectDeselect OnObjectDeselect; 158 public event ObjectDeselect OnObjectDeselect;
159 public event RegionInfoRequest OnRegionInfoRequest; 159 public event RegionInfoRequest OnRegionInfoRequest;
160 public event EstateCovenantRequest OnEstateCovenantRequest; 160 public event EstateCovenantRequest OnEstateCovenantRequest;
161 public event EstateChangeInfo OnEstateChangeInfo;
161 162
162 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; 163 public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
163 164
@@ -741,17 +742,17 @@ namespace OpenSim.Region.Examples.SimpleModule
741 { 742 {
742 } 743 }
743 744
744 public void SendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) 745 public void SendBannedUserList(LLUUID invoice, EstateBan[] banlist, uint estateID)
745 { 746 {
746 } 747 }
747 748
748 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) 749 public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
749 { 750 {
750 } 751 }
751 public void SendEstateCovenantInformation() 752 public void SendEstateCovenantInformation(LLUUID covenant)
752 { 753 {
753 } 754 }
754 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID) 755 public void SendDetailedEstateData(LLUUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, LLUUID covenant)
755 { 756 {
756 } 757 }
757 758
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index 6dfcb3c..edbb1b7 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -322,23 +322,6 @@ namespace OpenSim.DataStore.MSSQL
322 return new List<LandData>(); 322 return new List<LandData>();
323 } 323 }
324 324
325 public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID)
326 {
327 List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>();
328 return regionbanlist;
329 }
330
331 public void AddToRegionBanlist(RegionBanListItem item)
332 {
333
334 }
335
336 public void RemoveFromRegionBanlist(RegionBanListItem item)
337 {
338
339 }
340
341
342 public void Commit() 325 public void Commit()
343 { 326 {
344 lock (ds) 327 lock (ds)