diff options
Diffstat (limited to 'OpenSim/Region')
7 files changed, 140 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 1fbc733..1ad4db2 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -154,6 +154,22 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
154 | m_landManagementModule.UpdateLandObject(localID, data); | 154 | m_landManagementModule.UpdateLandObject(localID, data); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | |||
158 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
159 | { | ||
160 | if (m_landManagementModule != null) | ||
161 | { | ||
162 | m_landManagementModule.Join(start_x, start_y, end_x, end_y, attempting_user_id); | ||
163 | } | ||
164 | } | ||
165 | |||
166 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
167 | { | ||
168 | if (m_landManagementModule != null) | ||
169 | { | ||
170 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); | ||
171 | } | ||
172 | } | ||
157 | 173 | ||
158 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 174 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
159 | { | 175 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 139e6ff..4ccd0f0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -948,6 +948,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
948 | masterLandObject.SendLandUpdateToAvatarsOverMe(); | 948 | masterLandObject.SendLandUpdateToAvatarsOverMe(); |
949 | } | 949 | } |
950 | 950 | ||
951 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
952 | { | ||
953 | join(start_x, start_y, end_x, end_y, attempting_user_id); | ||
954 | } | ||
955 | |||
956 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
957 | { | ||
958 | subdivide(start_x, start_y, end_x, end_y, attempting_user_id); | ||
959 | } | ||
960 | |||
951 | #endregion | 961 | #endregion |
952 | 962 | ||
953 | #region Parcel Updating | 963 | #region Parcel Updating |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs index f71e31d..20b8ab6 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs | |||
@@ -76,5 +76,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
76 | void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); | 76 | void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); |
77 | void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); | 77 | void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); |
78 | void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime); | 78 | void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime); |
79 | |||
80 | void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); | ||
81 | void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id); | ||
79 | } | 82 | } |
80 | } | 83 | } |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index 9da818a..33ff707 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
@@ -140,6 +140,16 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
140 | RootRegionLandChannel.UpdateLandObject(localID, data); | 140 | RootRegionLandChannel.UpdateLandObject(localID, data); |
141 | } | 141 | } |
142 | 142 | ||
143 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
144 | { | ||
145 | RootRegionLandChannel.Join(start_x, start_y, end_x, end_y, attempting_user_id); | ||
146 | } | ||
147 | |||
148 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) | ||
149 | { | ||
150 | RootRegionLandChannel.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); | ||
151 | } | ||
152 | |||
143 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 153 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
144 | { | 154 | { |
145 | RootRegionLandChannel.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); | 155 | RootRegionLandChannel.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7e68cc7..15469db 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1129,7 +1129,89 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1129 | return 0.0f; | 1129 | return 0.0f; |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | // Routines for creating and managing parcels programmatically | ||
1133 | public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2) | ||
1134 | { | ||
1135 | CheckThreatLevel(ThreatLevel.High, "osParcelJoin"); | ||
1136 | m_host.AddScriptLPS(1); | ||
1137 | |||
1138 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); | ||
1139 | int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); | ||
1140 | int endx = (int)(pos1.x > pos2.x ? pos1.x : pos2.x); | ||
1141 | int endy = (int)(pos1.y > pos2.y ? pos1.y : pos2.y); | ||
1142 | |||
1143 | World.LandChannel.Join(startx,starty,endx,endy,m_host.OwnerID); | ||
1144 | } | ||
1145 | |||
1146 | public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) | ||
1147 | { | ||
1148 | CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide"); | ||
1149 | m_host.AddScriptLPS(1); | ||
1150 | |||
1151 | int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x); | ||
1152 | int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y); | ||
1153 | int endx = (int)(pos1.x > pos2.x ? pos1.x : pos2.x); | ||
1154 | int endy = (int)(pos1.y > pos2.y ? pos1.y : pos2.y); | ||
1132 | 1155 | ||
1156 | World.LandChannel.Subdivide(startx,starty,endx,endy,m_host.OwnerID); | ||
1157 | } | ||
1158 | |||
1159 | public void osParcelSetDetails(LSL_Vector pos, LSL_List rules) | ||
1160 | { | ||
1161 | CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails"); | ||
1162 | m_host.AddScriptLPS(1); | ||
1163 | |||
1164 | // Get a reference to the land data and make sure the owner of the script | ||
1165 | // can modify it | ||
1166 | |||
1167 | ILandObject startLandObject = World.LandChannel.GetLandObject((int)pos.x, (int)pos.y); | ||
1168 | if (startLandObject == null) | ||
1169 | { | ||
1170 | OSSLShoutError("There is no land at that location"); | ||
1171 | return; | ||
1172 | } | ||
1173 | |||
1174 | if (! World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject)) | ||
1175 | { | ||
1176 | OSSLShoutError("You do not have permission to modify the parcel"); | ||
1177 | return; | ||
1178 | } | ||
1179 | |||
1180 | // Create a new land data object we can modify | ||
1181 | LandData newLand = startLandObject.LandData.Copy(); | ||
1182 | UUID uuid; | ||
1183 | |||
1184 | // Process the rules, not sure what the impact would be of changing owner or group | ||
1185 | for (int idx = 0; idx < rules.Length; ) | ||
1186 | { | ||
1187 | int code = rules.GetLSLIntegerItem(idx++); | ||
1188 | string arg = rules.GetLSLStringItem(idx++); | ||
1189 | switch (code) | ||
1190 | { | ||
1191 | case 0: | ||
1192 | newLand.Name = arg; | ||
1193 | break; | ||
1194 | |||
1195 | case 1: | ||
1196 | newLand.Description = arg; | ||
1197 | break; | ||
1198 | |||
1199 | case 2: | ||
1200 | CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); | ||
1201 | if (UUID.TryParse(arg , out uuid)) | ||
1202 | newLand.OwnerID = uuid; | ||
1203 | break; | ||
1204 | |||
1205 | case 3: | ||
1206 | CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); | ||
1207 | if (UUID.TryParse(arg , out uuid)) | ||
1208 | newLand.GroupID = uuid; | ||
1209 | break; | ||
1210 | } | ||
1211 | } | ||
1212 | |||
1213 | World.LandChannel.UpdateLandObject(newLand.LocalID,newLand); | ||
1214 | } | ||
1133 | 1215 | ||
1134 | public double osList2Double(LSL_Types.list src, int index) | 1216 | public double osList2Double(LSL_Types.list src, int index) |
1135 | { | 1217 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 60b8050..7a8f469 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -123,6 +123,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
123 | void osWindParamSet(string plugin, string param, float value); | 123 | void osWindParamSet(string plugin, string param, float value); |
124 | float osWindParamGet(string plugin, string param); | 124 | float osWindParamGet(string plugin, string param); |
125 | 125 | ||
126 | // Parcel commands | ||
127 | void osParcelJoin(vector pos1, vector pos2); | ||
128 | void osParcelSubdivide(vector pos1, vector pos2); | ||
129 | void osParcelSetDetails(vector pos, LSL_List rules); | ||
126 | 130 | ||
127 | string osGetScriptEngineName(); | 131 | string osGetScriptEngineName(); |
128 | string osGetSimulatorVersion(); | 132 | string osGetSimulatorVersion(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 3870af3..fd9309a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -106,6 +106,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
106 | // return m_OSSL_Functions.osWindParamGet(plugin, param); | 106 | // return m_OSSL_Functions.osWindParamGet(plugin, param); |
107 | // } | 107 | // } |
108 | 108 | ||
109 | public void osParcelJoin(vector pos1, vector pos2) | ||
110 | { | ||
111 | m_OSSL_Functions.osParcelJoin(pos1,pos2); | ||
112 | } | ||
113 | |||
114 | public void osParcelSubdivide(vector pos1, vector pos2) | ||
115 | { | ||
116 | m_OSSL_Functions.osParcelSubdivide(pos1, pos2); | ||
117 | } | ||
118 | |||
119 | public void osParcelSetDetails(vector pos, LSL_List rules) | ||
120 | { | ||
121 | m_OSSL_Functions.osParcelSetDetails(pos,rules); | ||
122 | } | ||
123 | |||
109 | public double osList2Double(LSL_Types.list src, int index) | 124 | public double osList2Double(LSL_Types.list src, int index) |
110 | { | 125 | { |
111 | return m_OSSL_Functions.osList2Double(src, index); | 126 | return m_OSSL_Functions.osList2Double(src, index); |