aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs82
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs15
3 files changed, 101 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9474bab..942e4ef 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1127,7 +1127,89 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1127 return 0.0f; 1127 return 0.0f;
1128 } 1128 }
1129 1129
1130 // Routines for creating and managing parcels programmatically
1131 public void osParcelJoin(LSL_Vector pos1, LSL_Vector pos2)
1132 {
1133 CheckThreatLevel(ThreatLevel.High, "osParcelJoin");
1134 m_host.AddScriptLPS(1);
1135
1136 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x);
1137 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y);
1138 int endx = (int)(pos1.x > pos2.x ? pos1.x : pos2.x);
1139 int endy = (int)(pos1.y > pos2.y ? pos1.y : pos2.y);
1140
1141 World.LandChannel.Join(startx,starty,endx,endy,m_host.OwnerID);
1142 }
1143
1144 public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2)
1145 {
1146 CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide");
1147 m_host.AddScriptLPS(1);
1148
1149 int startx = (int)(pos1.x < pos2.x ? pos1.x : pos2.x);
1150 int starty = (int)(pos1.y < pos2.y ? pos1.y : pos2.y);
1151 int endx = (int)(pos1.x > pos2.x ? pos1.x : pos2.x);
1152 int endy = (int)(pos1.y > pos2.y ? pos1.y : pos2.y);
1130 1153
1154 World.LandChannel.Subdivide(startx,starty,endx,endy,m_host.OwnerID);
1155 }
1156
1157 public void osParcelSetDetails(LSL_Vector pos, LSL_List rules)
1158 {
1159 CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails");
1160 m_host.AddScriptLPS(1);
1161
1162 // Get a reference to the land data and make sure the owner of the script
1163 // can modify it
1164
1165 ILandObject startLandObject = World.LandChannel.GetLandObject((int)pos.x, (int)pos.y);
1166 if (startLandObject == null)
1167 {
1168 OSSLShoutError("There is no land at that location");
1169 return;
1170 }
1171
1172 if (! World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject))
1173 {
1174 OSSLShoutError("You do not have permission to modify the parcel");
1175 return;
1176 }
1177
1178 // Create a new land data object we can modify
1179 LandData newLand = startLandObject.LandData.Copy();
1180 UUID uuid;
1181
1182 // Process the rules, not sure what the impact would be of changing owner or group
1183 for (int idx = 0; idx < rules.Length; )
1184 {
1185 int code = rules.GetLSLIntegerItem(idx++);
1186 string arg = rules.GetLSLStringItem(idx++);
1187 switch (code)
1188 {
1189 case 0:
1190 newLand.Name = arg;
1191 break;
1192
1193 case 1:
1194 newLand.Description = arg;
1195 break;
1196
1197 case 2:
1198 CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
1199 if (UUID.TryParse(arg , out uuid))
1200 newLand.OwnerID = uuid;
1201 break;
1202
1203 case 3:
1204 CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
1205 if (UUID.TryParse(arg , out uuid))
1206 newLand.GroupID = uuid;
1207 break;
1208 }
1209 }
1210
1211 World.LandChannel.UpdateLandObject(newLand.LocalID,newLand);
1212 }
1131 1213
1132 public double osList2Double(LSL_Types.list src, int index) 1214 public double osList2Double(LSL_Types.list src, int index)
1133 { 1215 {
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index f5921e1..9dbd369 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);