diff options
author | UbitUmarov | 2017-01-27 12:32:01 +0000 |
---|---|---|
committer | UbitUmarov | 2017-01-27 12:32:01 +0000 |
commit | 56e3aaefde72bc8819dfb34b423f4ada65f1a195 (patch) | |
tree | f125f1f4f9fb38eb7a053078a7ed5a798c5be0db /OpenSim | |
parent | remove unused and wrong methods (diff) | |
download | opensim-SC_OLD-56e3aaefde72bc8819dfb34b423f4ada65f1a195.zip opensim-SC_OLD-56e3aaefde72bc8819dfb34b423f4ada65f1a195.tar.gz opensim-SC_OLD-56e3aaefde72bc8819dfb34b423f4ada65f1a195.tar.bz2 opensim-SC_OLD-56e3aaefde72bc8819dfb34b423f4ada65f1a195.tar.xz |
Permissions modules where made NONShared modules. Make them so, removing incoerences and their potencial bugs
Diffstat (limited to 'OpenSim')
4 files changed, 193 insertions, 121 deletions
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 504a584..142c8b7 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
98 | if (part.OwnerID == part.GroupID) // Group owned | 98 | if (part.OwnerID == part.GroupID) // Group owned |
99 | { | 99 | { |
100 | // Does the user have the power to put the object on sale? | 100 | // Does the user have the power to put the object on sale? |
101 | if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID, m_scene)) | 101 | if (!m_scene.Permissions.CanSellGroupObject(client.AgentId, part.GroupID)) |
102 | { | 102 | { |
103 | client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); | 103 | client.SendAgentAlertMessage("You don't have permission to set group-owned objects on sale", false); |
104 | return; | 104 | return; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index bbebce1..a369c30 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -349,7 +349,77 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
349 | if (!m_Enabled) | 349 | if (!m_Enabled) |
350 | return; | 350 | return; |
351 | 351 | ||
352 | if(scene != m_scene) | ||
353 | return; | ||
354 | |||
352 | m_scene.UnregisterModuleInterface<IPermissionsModule>(this); | 355 | m_scene.UnregisterModuleInterface<IPermissionsModule>(this); |
356 | |||
357 | scenePermissions.OnBypassPermissions -= BypassPermissions; | ||
358 | scenePermissions.OnSetBypassPermissions -= SetBypassPermissions; | ||
359 | scenePermissions.OnPropagatePermissions -= PropagatePermissions; | ||
360 | |||
361 | scenePermissions.OnIsGridGod -= IsGridAdministrator; | ||
362 | scenePermissions.OnIsAdministrator -= IsAdministrator; | ||
363 | scenePermissions.OnIsEstateManager -= IsEstateManager; | ||
364 | |||
365 | scenePermissions.OnGenerateClientFlags -= GenerateClientFlags; | ||
366 | |||
367 | scenePermissions.OnIssueEstateCommand -= CanIssueEstateCommand; | ||
368 | scenePermissions.OnRunConsoleCommand -= CanRunConsoleCommand; | ||
369 | |||
370 | scenePermissions.OnTeleport -= CanTeleport; | ||
371 | |||
372 | scenePermissions.OnInstantMessage -= CanInstantMessage; | ||
373 | |||
374 | scenePermissions.OnAbandonParcel -= CanAbandonParcel; | ||
375 | scenePermissions.OnReclaimParcel -= CanReclaimParcel; | ||
376 | scenePermissions.OnDeedParcel -= CanDeedParcel; | ||
377 | scenePermissions.OnSellParcel -= CanSellParcel; | ||
378 | scenePermissions.OnEditParcelProperties -= CanEditParcelProperties; | ||
379 | scenePermissions.OnTerraformLand -= CanTerraformLand; | ||
380 | scenePermissions.OnBuyLand -= CanBuyLand; | ||
381 | |||
382 | scenePermissions.OnRezObject -= CanRezObject; | ||
383 | scenePermissions.OnObjectEntry -= CanObjectEntry; | ||
384 | scenePermissions.OnReturnObjects -= CanReturnObjects; | ||
385 | |||
386 | scenePermissions.OnDuplicateObject -= CanDuplicateObject; | ||
387 | scenePermissions.OnDeleteObjectByIDs -= CanDeleteObjectByIDs; | ||
388 | scenePermissions.OnDeleteObject -= CanDeleteObject; | ||
389 | scenePermissions.OnEditObjectByIDs -= CanEditObjectByIDs; | ||
390 | scenePermissions.OnEditObject -= CanEditObject; | ||
391 | scenePermissions.OnInventoryTransfer -= CanInventoryTransfer; | ||
392 | scenePermissions.OnMoveObject -= CanMoveObject; | ||
393 | scenePermissions.OnTakeObject -= CanTakeObject; | ||
394 | scenePermissions.OnTakeCopyObject -= CanTakeCopyObject; | ||
395 | scenePermissions.OnLinkObject -= CanLinkObject; | ||
396 | scenePermissions.OnDelinkObject -= CanDelinkObject; | ||
397 | scenePermissions.OnDeedObject -= CanDeedObject; | ||
398 | scenePermissions.OnSellGroupObject -= CanSellGroupObject; | ||
399 | |||
400 | scenePermissions.OnCreateObjectInventory -= CanCreateObjectInventory; | ||
401 | scenePermissions.OnEditObjectInventory -= CanEditObjectInventory; | ||
402 | scenePermissions.OnCopyObjectInventory -= CanCopyObjectInventory; | ||
403 | scenePermissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; | ||
404 | scenePermissions.OnDoObjectInvToObjectInv -= CanDoObjectInvToObjectInv; | ||
405 | scenePermissions.OnDropInObjectInv -= CanDropInObjectInv; | ||
406 | |||
407 | scenePermissions.OnViewNotecard -= CanViewNotecard; | ||
408 | scenePermissions.OnViewScript -= CanViewScript; | ||
409 | scenePermissions.OnEditNotecard -= CanEditNotecard; | ||
410 | scenePermissions.OnEditScript -= CanEditScript; | ||
411 | scenePermissions.OnResetScript -= CanResetScript; | ||
412 | scenePermissions.OnRunScript -= CanRunScript; | ||
413 | scenePermissions.OnCompileScript -= CanCompileScript; | ||
414 | |||
415 | scenePermissions.OnCreateUserInventory -= CanCreateUserInventory; | ||
416 | scenePermissions.OnCopyUserInventory -= CanCopyUserInventory; | ||
417 | scenePermissions.OnEditUserInventory -= CanEditUserInventory; | ||
418 | scenePermissions.OnDeleteUserInventory -= CanDeleteUserInventory; | ||
419 | |||
420 | scenePermissions.OnControlPrimMedia -= CanControlPrimMedia; | ||
421 | scenePermissions.OnInteractWithPrimMedia -= CanInteractWithPrimMedia; | ||
422 | |||
353 | } | 423 | } |
354 | 424 | ||
355 | public void Close() | 425 | public void Close() |
@@ -1099,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1099 | #endregion | 1169 | #endregion |
1100 | 1170 | ||
1101 | #region Permission Checks | 1171 | #region Permission Checks |
1102 | private bool CanAbandonParcel(UUID user, ILandObject parcel, Scene scene) | 1172 | private bool CanAbandonParcel(UUID user, ILandObject parcel) |
1103 | { | 1173 | { |
1104 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1174 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1105 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1175 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1107,7 +1177,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1107 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); | 1177 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); |
1108 | } | 1178 | } |
1109 | 1179 | ||
1110 | private bool CanReclaimParcel(UUID user, ILandObject parcel, Scene scene) | 1180 | private bool CanReclaimParcel(UUID user, ILandObject parcel) |
1111 | { | 1181 | { |
1112 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1182 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1113 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1183 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1115,7 +1185,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1115 | return GenericParcelOwnerPermission(user, parcel, 0,true); | 1185 | return GenericParcelOwnerPermission(user, parcel, 0,true); |
1116 | } | 1186 | } |
1117 | 1187 | ||
1118 | private bool CanDeedParcel(UUID user, ILandObject parcel, Scene scene) | 1188 | private bool CanDeedParcel(UUID user, ILandObject parcel) |
1119 | { | 1189 | { |
1120 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1190 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1121 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1191 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1129,7 +1199,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1129 | if (parcel.LandData.OwnerID != user) // Only the owner can deed! | 1199 | if (parcel.LandData.OwnerID != user) // Only the owner can deed! |
1130 | return false; | 1200 | return false; |
1131 | 1201 | ||
1132 | ScenePresence sp = scene.GetScenePresence(user); | 1202 | ScenePresence sp = m_scene.GetScenePresence(user); |
1133 | if(sp == null) | 1203 | if(sp == null) |
1134 | return false; | 1204 | return false; |
1135 | 1205 | ||
@@ -1179,7 +1249,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1179 | return true; | 1249 | return true; |
1180 | } | 1250 | } |
1181 | 1251 | ||
1182 | private bool CanDuplicateObject(SceneObjectGroup sog, ScenePresence sp, Scene scene) | 1252 | private bool CanDuplicateObject(SceneObjectGroup sog, ScenePresence sp) |
1183 | { | 1253 | { |
1184 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1254 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1185 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1255 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1195,7 +1265,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1195 | return false; | 1265 | return false; |
1196 | 1266 | ||
1197 | //If they can rez, they can duplicate | 1267 | //If they can rez, they can duplicate |
1198 | return CanRezObject(0, sp.UUID, sog.AbsolutePosition, scene); | 1268 | return CanRezObject(0, sp.UUID, sog.AbsolutePosition); |
1199 | } | 1269 | } |
1200 | 1270 | ||
1201 | private bool CanDeleteObject(SceneObjectGroup sog, ScenePresence sp) | 1271 | private bool CanDeleteObject(SceneObjectGroup sog, ScenePresence sp) |
@@ -1240,14 +1310,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1240 | return false; | 1310 | return false; |
1241 | } | 1311 | } |
1242 | 1312 | ||
1243 | private bool CanDeleteObjectByIDs(UUID objectID, UUID userID, Scene scene) | 1313 | private bool CanDeleteObjectByIDs(UUID objectID, UUID userID) |
1244 | { | 1314 | { |
1245 | // ignoring locked. viewers should warn and ask for confirmation | 1315 | // ignoring locked. viewers should warn and ask for confirmation |
1246 | 1316 | ||
1247 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1317 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1248 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1318 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1249 | 1319 | ||
1250 | SceneObjectGroup sog = scene.GetGroupByPrim(objectID); | 1320 | SceneObjectGroup sog = m_scene.GetGroupByPrim(objectID); |
1251 | if (sog == null) | 1321 | if (sog == null) |
1252 | return false; | 1322 | return false; |
1253 | 1323 | ||
@@ -1282,12 +1352,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1282 | return false; | 1352 | return false; |
1283 | } | 1353 | } |
1284 | 1354 | ||
1285 | private bool CanEditObjectByIDs(UUID objectID, UUID userID, Scene scene) | 1355 | private bool CanEditObjectByIDs(UUID objectID, UUID userID) |
1286 | { | 1356 | { |
1287 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1357 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1288 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1358 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1289 | 1359 | ||
1290 | SceneObjectGroup sog = scene.GetGroupByPrim(objectID); | 1360 | SceneObjectGroup sog = m_scene.GetGroupByPrim(objectID); |
1291 | if (sog == null) | 1361 | if (sog == null) |
1292 | return false; | 1362 | return false; |
1293 | 1363 | ||
@@ -1311,12 +1381,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1311 | return true; | 1381 | return true; |
1312 | } | 1382 | } |
1313 | 1383 | ||
1314 | private bool CanEditObjectInventory(UUID objectID, UUID userID, Scene scene) | 1384 | private bool CanEditObjectInventory(UUID objectID, UUID userID) |
1315 | { | 1385 | { |
1316 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1386 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1317 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1387 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1318 | 1388 | ||
1319 | SceneObjectGroup sog = scene.GetGroupByPrim(objectID); | 1389 | SceneObjectGroup sog = m_scene.GetGroupByPrim(objectID); |
1320 | if (sog == null) | 1390 | if (sog == null) |
1321 | return false; | 1391 | return false; |
1322 | 1392 | ||
@@ -1326,7 +1396,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1326 | return true; | 1396 | return true; |
1327 | } | 1397 | } |
1328 | 1398 | ||
1329 | private bool CanEditParcelProperties(UUID userID, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager) | 1399 | private bool CanEditParcelProperties(UUID userID, ILandObject parcel, GroupPowers p, bool allowManager) |
1330 | { | 1400 | { |
1331 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1401 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1332 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1402 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1342,7 +1412,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1342 | /// <param name="user"></param> | 1412 | /// <param name="user"></param> |
1343 | /// <param name="scene"></param> | 1413 | /// <param name="scene"></param> |
1344 | /// <returns></returns> | 1414 | /// <returns></returns> |
1345 | private bool CanEditScript(UUID script, UUID objectID, UUID userID, Scene scene) | 1415 | private bool CanEditScript(UUID script, UUID objectID, UUID userID) |
1346 | { | 1416 | { |
1347 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1417 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1348 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1418 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1353,7 +1423,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1353 | // Ordinarily, if you can view it, you can edit it | 1423 | // Ordinarily, if you can view it, you can edit it |
1354 | // There is no viewing a no mod script | 1424 | // There is no viewing a no mod script |
1355 | // | 1425 | // |
1356 | return CanViewScript(script, objectID, userID, scene); | 1426 | return CanViewScript(script, objectID, userID); |
1357 | } | 1427 | } |
1358 | 1428 | ||
1359 | /// <summary> | 1429 | /// <summary> |
@@ -1364,7 +1434,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1364 | /// <param name="user"></param> | 1434 | /// <param name="user"></param> |
1365 | /// <param name="scene"></param> | 1435 | /// <param name="scene"></param> |
1366 | /// <returns></returns> | 1436 | /// <returns></returns> |
1367 | private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user, Scene scene) | 1437 | private bool CanEditNotecard(UUID notecard, UUID objectID, UUID user) |
1368 | { | 1438 | { |
1369 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1439 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1370 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1440 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1395,7 +1465,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1395 | } | 1465 | } |
1396 | else // Prim inventory | 1466 | else // Prim inventory |
1397 | { | 1467 | { |
1398 | SceneObjectPart part = scene.GetSceneObjectPart(objectID); | 1468 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); |
1399 | if (part == null) | 1469 | if (part == null) |
1400 | return false; | 1470 | return false; |
1401 | 1471 | ||
@@ -1442,21 +1512,21 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1442 | return true; | 1512 | return true; |
1443 | } | 1513 | } |
1444 | 1514 | ||
1445 | private bool CanInstantMessage(UUID user, UUID target, Scene startScene) | 1515 | private bool CanInstantMessage(UUID user, UUID target) |
1446 | { | 1516 | { |
1447 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1517 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1448 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1518 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1449 | 1519 | ||
1450 | // If the sender is an object, check owner instead | 1520 | // If the sender is an object, check owner instead |
1451 | // | 1521 | // |
1452 | SceneObjectPart part = startScene.GetSceneObjectPart(user); | 1522 | SceneObjectPart part = m_scene.GetSceneObjectPart(user); |
1453 | if (part != null) | 1523 | if (part != null) |
1454 | user = part.OwnerID; | 1524 | user = part.OwnerID; |
1455 | 1525 | ||
1456 | return GenericCommunicationPermission(user, target); | 1526 | return GenericCommunicationPermission(user, target); |
1457 | } | 1527 | } |
1458 | 1528 | ||
1459 | private bool CanInventoryTransfer(UUID user, UUID target, Scene startScene) | 1529 | private bool CanInventoryTransfer(UUID user, UUID target) |
1460 | { | 1530 | { |
1461 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1531 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1462 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1532 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1464,7 +1534,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1464 | return GenericCommunicationPermission(user, target); | 1534 | return GenericCommunicationPermission(user, target); |
1465 | } | 1535 | } |
1466 | 1536 | ||
1467 | private bool CanIssueEstateCommand(UUID user, Scene requestFromScene, bool ownerCommand) | 1537 | private bool CanIssueEstateCommand(UUID user, bool ownerCommand) |
1468 | { | 1538 | { |
1469 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1539 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1470 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1540 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1498,7 +1568,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1498 | return true; | 1568 | return true; |
1499 | } | 1569 | } |
1500 | 1570 | ||
1501 | private bool CanObjectEntry(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint, Scene scene) | 1571 | private bool CanObjectEntry(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint) |
1502 | { | 1572 | { |
1503 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1573 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1504 | 1574 | ||
@@ -1506,8 +1576,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1506 | float newY = newPoint.Y; | 1576 | float newY = newPoint.Y; |
1507 | 1577 | ||
1508 | // allow outside region this is needed for crossings | 1578 | // allow outside region this is needed for crossings |
1509 | if (newX < -1f || newX > (scene.RegionInfo.RegionSizeX + 1.0f) || | 1579 | if (newX < -1f || newX > (m_scene.RegionInfo.RegionSizeX + 1.0f) || |
1510 | newY < -1f || newY > (scene.RegionInfo.RegionSizeY + 1.0f) ) | 1580 | newY < -1f || newY > (m_scene.RegionInfo.RegionSizeY + 1.0f) ) |
1511 | return true; | 1581 | return true; |
1512 | 1582 | ||
1513 | if(sog == null || sog.IsDeleted) | 1583 | if(sog == null || sog.IsDeleted) |
@@ -1516,7 +1586,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1516 | if (m_bypassPermissions) | 1586 | if (m_bypassPermissions) |
1517 | return m_bypassPermissionsValue; | 1587 | return m_bypassPermissionsValue; |
1518 | 1588 | ||
1519 | ILandObject parcel = scene.LandChannel.GetLandObject(newX, newY); | 1589 | ILandObject parcel = m_scene.LandChannel.GetLandObject(newX, newY); |
1520 | if (parcel == null) | 1590 | if (parcel == null) |
1521 | return false; | 1591 | return false; |
1522 | 1592 | ||
@@ -1554,12 +1624,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1554 | return false; | 1624 | return false; |
1555 | } | 1625 | } |
1556 | 1626 | ||
1557 | private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene) | 1627 | private bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) |
1558 | { | 1628 | { |
1559 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1629 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1560 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1630 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
1561 | 1631 | ||
1562 | ScenePresence sp = scene.GetScenePresence(user); | 1632 | ScenePresence sp = m_scene.GetScenePresence(user); |
1563 | if (sp == null) | 1633 | if (sp == null) |
1564 | return false; | 1634 | return false; |
1565 | 1635 | ||
@@ -1591,7 +1661,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1591 | else | 1661 | else |
1592 | { | 1662 | { |
1593 | Vector3 pos = g.AbsolutePosition; | 1663 | Vector3 pos = g.AbsolutePosition; |
1594 | l = scene.LandChannel.GetLandObject(pos.X, pos.Y); | 1664 | l = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); |
1595 | } | 1665 | } |
1596 | 1666 | ||
1597 | // If it's not over any land, then we can't do a thing | 1667 | // If it's not over any land, then we can't do a thing |
@@ -1662,7 +1732,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1662 | return true; | 1732 | return true; |
1663 | } | 1733 | } |
1664 | 1734 | ||
1665 | private bool CanRezObject(int objectCount, UUID userID, Vector3 objectPosition, Scene scene) | 1735 | private bool CanRezObject(int objectCount, UUID userID, Vector3 objectPosition) |
1666 | { | 1736 | { |
1667 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1737 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1668 | if (m_bypassPermissions) | 1738 | if (m_bypassPermissions) |
@@ -1670,7 +1740,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1670 | 1740 | ||
1671 | // m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name); | 1741 | // m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name); |
1672 | 1742 | ||
1673 | ILandObject parcel = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 1743 | ILandObject parcel = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
1674 | if (parcel == null || parcel.LandData == null) | 1744 | if (parcel == null || parcel.LandData == null) |
1675 | return false; | 1745 | return false; |
1676 | 1746 | ||
@@ -1696,7 +1766,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1696 | return false; | 1766 | return false; |
1697 | } | 1767 | } |
1698 | 1768 | ||
1699 | private bool CanRunConsoleCommand(UUID user, Scene requestFromScene) | 1769 | private bool CanRunConsoleCommand(UUID user) |
1700 | { | 1770 | { |
1701 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1771 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1702 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1772 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1741,7 +1811,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1741 | return GenericEstatePermission(part.OwnerID); | 1811 | return GenericEstatePermission(part.OwnerID); |
1742 | } | 1812 | } |
1743 | 1813 | ||
1744 | private bool CanSellParcel(UUID user, ILandObject parcel, Scene scene) | 1814 | private bool CanSellParcel(UUID user, ILandObject parcel) |
1745 | { | 1815 | { |
1746 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1816 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1747 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1817 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1749,7 +1819,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1749 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true); | 1819 | return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandSetSale, true); |
1750 | } | 1820 | } |
1751 | 1821 | ||
1752 | private bool CanSellGroupObject(UUID userID, UUID groupID, Scene scene) | 1822 | private bool CanSellGroupObject(UUID userID, UUID groupID) |
1753 | { | 1823 | { |
1754 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1824 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1755 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1825 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1823,7 +1893,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1823 | return true; | 1893 | return true; |
1824 | } | 1894 | } |
1825 | 1895 | ||
1826 | private bool CanTerraformLand(UUID userID, Vector3 position, Scene requestFromScene) | 1896 | private bool CanTerraformLand(UUID userID, Vector3 position) |
1827 | { | 1897 | { |
1828 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1898 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1829 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1899 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1873,7 +1943,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1873 | /// <param name="user"></param> | 1943 | /// <param name="user"></param> |
1874 | /// <param name="scene"></param> | 1944 | /// <param name="scene"></param> |
1875 | /// <returns></returns> | 1945 | /// <returns></returns> |
1876 | private bool CanViewScript(UUID script, UUID objectID, UUID userID, Scene scene) | 1946 | private bool CanViewScript(UUID script, UUID objectID, UUID userID) |
1877 | { | 1947 | { |
1878 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 1948 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1879 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 1949 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1915,7 +1985,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1915 | } | 1985 | } |
1916 | else // Prim inventory | 1986 | else // Prim inventory |
1917 | { | 1987 | { |
1918 | SceneObjectPart part = scene.GetSceneObjectPart(objectID); | 1988 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); |
1919 | if (part == null) | 1989 | if (part == null) |
1920 | return false; | 1990 | return false; |
1921 | 1991 | ||
@@ -1962,7 +2032,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1962 | /// <param name="user"></param> | 2032 | /// <param name="user"></param> |
1963 | /// <param name="scene"></param> | 2033 | /// <param name="scene"></param> |
1964 | /// <returns></returns> | 2034 | /// <returns></returns> |
1965 | private bool CanViewNotecard(UUID notecard, UUID objectID, UUID userID, Scene scene) | 2035 | private bool CanViewNotecard(UUID notecard, UUID objectID, UUID userID) |
1966 | { | 2036 | { |
1967 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2037 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
1968 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 2038 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -1988,7 +2058,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1988 | } | 2058 | } |
1989 | else // Prim inventory | 2059 | else // Prim inventory |
1990 | { | 2060 | { |
1991 | SceneObjectPart part = scene.GetSceneObjectPart(objectID); | 2061 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); |
1992 | if (part == null) | 2062 | if (part == null) |
1993 | return false; | 2063 | return false; |
1994 | 2064 | ||
@@ -2051,7 +2121,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2051 | return true; | 2121 | return true; |
2052 | } | 2122 | } |
2053 | 2123 | ||
2054 | private bool CanBuyLand(UUID userID, ILandObject parcel, Scene scene) | 2124 | private bool CanBuyLand(UUID userID, ILandObject parcel) |
2055 | { | 2125 | { |
2056 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2126 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
2057 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 2127 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -2319,7 +2389,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2319 | return true; | 2389 | return true; |
2320 | } | 2390 | } |
2321 | 2391 | ||
2322 | private bool CanResetScript(UUID primID, UUID script, UUID agentID, Scene scene) | 2392 | private bool CanResetScript(UUID primID, UUID script, UUID agentID) |
2323 | { | 2393 | { |
2324 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 2394 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
2325 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 2395 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
@@ -2334,7 +2404,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
2334 | return true; | 2404 | return true; |
2335 | } | 2405 | } |
2336 | 2406 | ||
2337 | private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) | 2407 | private bool CanCompileScript(UUID ownerUUID, int scriptType) |
2338 | { | 2408 | { |
2339 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); | 2409 | //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); |
2340 | switch (scriptType) { | 2410 | switch (scriptType) { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 4630497..45d710a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -41,47 +41,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
41 | public delegate void SetBypassPermissionsHandler(bool value); | 41 | public delegate void SetBypassPermissionsHandler(bool value); |
42 | public delegate bool BypassPermissionsHandler(); | 42 | public delegate bool BypassPermissionsHandler(); |
43 | public delegate bool PropagatePermissionsHandler(); | 43 | public delegate bool PropagatePermissionsHandler(); |
44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); | 44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition); |
45 | public delegate bool DeleteObjectHandlerByIDs(UUID objectID, UUID deleter, Scene scene); | 45 | public delegate bool DeleteObjectHandlerByIDs(UUID objectID, UUID deleter); |
46 | public delegate bool DeleteObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 46 | public delegate bool DeleteObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
47 | public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene); | 47 | public delegate bool TransferObjectHandler(UUID objectID, UUID recipient); |
48 | public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 48 | public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
49 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); | 49 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID); |
50 | public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 50 | public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
51 | public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp, Scene scenen); | 51 | public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
52 | public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID, Scene scene); | 52 | public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID); |
53 | public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 53 | public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
54 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | 54 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID); |
55 | public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 55 | public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
56 | public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint, Scene scene); | 56 | public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint); |
57 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); | 57 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects); |
58 | public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene); | 58 | public delegate bool InstantMessageHandler(UUID user, UUID target); |
59 | public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene); | 59 | public delegate bool InventoryTransferHandler(UUID user, UUID target); |
60 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 60 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user); |
61 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene); | 61 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user); |
62 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 62 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user); |
63 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene); | 63 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user); |
64 | public delegate bool RunScriptHandlerByIDs(UUID script, UUID objectID, UUID user, Scene scene); | 64 | public delegate bool RunScriptHandlerByIDs(UUID script, UUID objectID, UUID user); |
65 | public delegate bool RunScriptHandler(TaskInventoryItem item, SceneObjectPart part); | 65 | public delegate bool RunScriptHandler(TaskInventoryItem item, SceneObjectPart part); |
66 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene); | 66 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType); |
67 | public delegate bool StartScriptHandler(UUID script, UUID user, Scene scene); | 67 | public delegate bool StartScriptHandler(UUID script, UUID user); |
68 | public delegate bool StopScriptHandler(UUID script, UUID user, Scene scene); | 68 | public delegate bool StopScriptHandler(UUID script, UUID user); |
69 | public delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user, Scene scene); | 69 | public delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user); |
70 | public delegate bool TerraformLandHandler(UUID user, Vector3 position, Scene requestFromScene); | 70 | public delegate bool TerraformLandHandler(UUID user, Vector3 position); |
71 | public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); | 71 | public delegate bool RunConsoleCommandHandler(UUID user); |
72 | public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); | 72 | public delegate bool IssueEstateCommandHandler(UUID user, bool ownerCommand); |
73 | public delegate bool IsGodHandler(UUID user); | 73 | public delegate bool IsGodHandler(UUID user); |
74 | public delegate bool IsGridGodHandler(UUID user); | 74 | public delegate bool IsGridGodHandler(UUID user); |
75 | public delegate bool IsAdministratorHandler(UUID user); | 75 | public delegate bool IsAdministratorHandler(UUID user); |
76 | public delegate bool IsEstateManagerHandler(UUID user); | 76 | public delegate bool IsEstateManagerHandler(UUID user); |
77 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); | 77 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel); |
78 | public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager); | 78 | public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, bool allowManager); |
79 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); | 79 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel); |
80 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); | 80 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel); |
81 | public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); | 81 | public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel); |
82 | public delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene); | 82 | public delegate bool DeedParcelHandler(UUID user, ILandObject parcel); |
83 | public delegate bool DeedObjectHandler(ScenePresence sp, SceneObjectGroup sog, UUID targetGroupID); | 83 | public delegate bool DeedObjectHandler(ScenePresence sp, SceneObjectGroup sog, UUID targetGroupID); |
84 | public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene); | 84 | public delegate bool BuyLandHandler(UUID user, ILandObject parcel); |
85 | public delegate bool LinkObjectHandler(UUID user, UUID objectID); | 85 | public delegate bool LinkObjectHandler(UUID user, UUID objectID); |
86 | public delegate bool DelinkObjectHandler(UUID user, UUID objectID); | 86 | public delegate bool DelinkObjectHandler(UUID user, UUID objectID); |
87 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); | 87 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); |
@@ -254,7 +254,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
254 | Delegate[] list = handler.GetInvocationList(); | 254 | Delegate[] list = handler.GetInvocationList(); |
255 | foreach (RezObjectHandler h in list) | 255 | foreach (RezObjectHandler h in list) |
256 | { | 256 | { |
257 | if (h(objectCount, owner,objectPosition, m_scene) == false) | 257 | if (h(objectCount, owner,objectPosition) == false) |
258 | return false; | 258 | return false; |
259 | } | 259 | } |
260 | } | 260 | } |
@@ -274,7 +274,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
274 | Delegate[] list = handler.GetInvocationList(); | 274 | Delegate[] list = handler.GetInvocationList(); |
275 | foreach (DeleteObjectHandlerByIDs h in list) | 275 | foreach (DeleteObjectHandlerByIDs h in list) |
276 | { | 276 | { |
277 | if (h(objectID, deleter, m_scene) == false) | 277 | if (h(objectID, deleter) == false) |
278 | { | 278 | { |
279 | result = false; | 279 | result = false; |
280 | break; | 280 | break; |
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
321 | Delegate[] list = handler.GetInvocationList(); | 321 | Delegate[] list = handler.GetInvocationList(); |
322 | foreach (TransferObjectHandler h in list) | 322 | foreach (TransferObjectHandler h in list) |
323 | { | 323 | { |
324 | if (h(objectID, recipient, m_scene) == false) | 324 | if (h(objectID, recipient) == false) |
325 | { | 325 | { |
326 | result = false; | 326 | result = false; |
327 | break; | 327 | break; |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
366 | #endregion | 366 | #endregion |
367 | 367 | ||
368 | #region SELL GROUP OBJECT | 368 | #region SELL GROUP OBJECT |
369 | public bool CanSellGroupObject(UUID userID, UUID groupID, Scene scene) | 369 | public bool CanSellGroupObject(UUID userID, UUID groupID) |
370 | { | 370 | { |
371 | bool result = true; | 371 | bool result = true; |
372 | 372 | ||
@@ -376,7 +376,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
376 | Delegate[] list = handler.GetInvocationList(); | 376 | Delegate[] list = handler.GetInvocationList(); |
377 | foreach (SellGroupObjectHandler h in list) | 377 | foreach (SellGroupObjectHandler h in list) |
378 | { | 378 | { |
379 | if (h(userID, groupID, scene) == false) | 379 | if (h(userID, groupID) == false) |
380 | { | 380 | { |
381 | result = false; | 381 | result = false; |
382 | break; | 382 | break; |
@@ -438,7 +438,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
438 | Delegate[] list = handler.GetInvocationList(); | 438 | Delegate[] list = handler.GetInvocationList(); |
439 | foreach (DuplicateObjectHandler h in list) | 439 | foreach (DuplicateObjectHandler h in list) |
440 | { | 440 | { |
441 | if (h(sog, sp, m_scene) == false) | 441 | if (h(sog, sp) == false) |
442 | return false; | 442 | return false; |
443 | } | 443 | } |
444 | } | 444 | } |
@@ -470,7 +470,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
470 | Delegate[] list = handler.GetInvocationList(); | 470 | Delegate[] list = handler.GetInvocationList(); |
471 | foreach (EditObjectByIDsHandler h in list) | 471 | foreach (EditObjectByIDsHandler h in list) |
472 | { | 472 | { |
473 | if (h(objectID, editorID, m_scene) == false) | 473 | if (h(objectID, editorID) == false) |
474 | return false; | 474 | return false; |
475 | } | 475 | } |
476 | } | 476 | } |
@@ -505,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
505 | Delegate[] list = handler.GetInvocationList(); | 505 | Delegate[] list = handler.GetInvocationList(); |
506 | foreach (EditObjectInventoryHandler h in list) | 506 | foreach (EditObjectInventoryHandler h in list) |
507 | { | 507 | { |
508 | if (h(objectID, editorID, m_scene) == false) | 508 | if (h(objectID, editorID) == false) |
509 | return false; | 509 | return false; |
510 | } | 510 | } |
511 | } | 511 | } |
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
546 | Delegate[] list = handler.GetInvocationList(); | 546 | Delegate[] list = handler.GetInvocationList(); |
547 | foreach (ObjectEntryHandler h in list) | 547 | foreach (ObjectEntryHandler h in list) |
548 | { | 548 | { |
549 | if (h(sog, enteringRegion, newPoint, m_scene) == false) | 549 | if (h(sog, enteringRegion, newPoint) == false) |
550 | return false; | 550 | return false; |
551 | } | 551 | } |
552 | } | 552 | } |
@@ -566,7 +566,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
566 | Delegate[] list = handler.GetInvocationList(); | 566 | Delegate[] list = handler.GetInvocationList(); |
567 | foreach (ReturnObjectsHandler h in list) | 567 | foreach (ReturnObjectsHandler h in list) |
568 | { | 568 | { |
569 | if (h(land, user, objects, m_scene) == false) | 569 | if (h(land, user, objects) == false) |
570 | { | 570 | { |
571 | result = false; | 571 | result = false; |
572 | break; | 572 | break; |
@@ -592,7 +592,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
592 | Delegate[] list = handler.GetInvocationList(); | 592 | Delegate[] list = handler.GetInvocationList(); |
593 | foreach (InstantMessageHandler h in list) | 593 | foreach (InstantMessageHandler h in list) |
594 | { | 594 | { |
595 | if (h(user, target, m_scene) == false) | 595 | if (h(user, target) == false) |
596 | return false; | 596 | return false; |
597 | } | 597 | } |
598 | } | 598 | } |
@@ -610,7 +610,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
610 | Delegate[] list = handler.GetInvocationList(); | 610 | Delegate[] list = handler.GetInvocationList(); |
611 | foreach (InventoryTransferHandler h in list) | 611 | foreach (InventoryTransferHandler h in list) |
612 | { | 612 | { |
613 | if (h(user, target, m_scene) == false) | 613 | if (h(user, target) == false) |
614 | return false; | 614 | return false; |
615 | } | 615 | } |
616 | } | 616 | } |
@@ -628,7 +628,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
628 | Delegate[] list = handler.GetInvocationList(); | 628 | Delegate[] list = handler.GetInvocationList(); |
629 | foreach (ViewScriptHandler h in list) | 629 | foreach (ViewScriptHandler h in list) |
630 | { | 630 | { |
631 | if (h(script, objectID, user, m_scene) == false) | 631 | if (h(script, objectID, user) == false) |
632 | return false; | 632 | return false; |
633 | } | 633 | } |
634 | } | 634 | } |
@@ -643,7 +643,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
643 | Delegate[] list = handler.GetInvocationList(); | 643 | Delegate[] list = handler.GetInvocationList(); |
644 | foreach (ViewNotecardHandler h in list) | 644 | foreach (ViewNotecardHandler h in list) |
645 | { | 645 | { |
646 | if (h(script, objectID, user, m_scene) == false) | 646 | if (h(script, objectID, user) == false) |
647 | return false; | 647 | return false; |
648 | } | 648 | } |
649 | } | 649 | } |
@@ -661,7 +661,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
661 | Delegate[] list = handler.GetInvocationList(); | 661 | Delegate[] list = handler.GetInvocationList(); |
662 | foreach (EditScriptHandler h in list) | 662 | foreach (EditScriptHandler h in list) |
663 | { | 663 | { |
664 | if (h(script, objectID, user, m_scene) == false) | 664 | if (h(script, objectID, user) == false) |
665 | return false; | 665 | return false; |
666 | } | 666 | } |
667 | } | 667 | } |
@@ -676,7 +676,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
676 | Delegate[] list = handler.GetInvocationList(); | 676 | Delegate[] list = handler.GetInvocationList(); |
677 | foreach (EditNotecardHandler h in list) | 677 | foreach (EditNotecardHandler h in list) |
678 | { | 678 | { |
679 | if (h(script, objectID, user, m_scene) == false) | 679 | if (h(script, objectID, user) == false) |
680 | return false; | 680 | return false; |
681 | } | 681 | } |
682 | } | 682 | } |
@@ -694,7 +694,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
694 | Delegate[] list = handler.GetInvocationList(); | 694 | Delegate[] list = handler.GetInvocationList(); |
695 | foreach (RunScriptHandlerByIDs h in list) | 695 | foreach (RunScriptHandlerByIDs h in list) |
696 | { | 696 | { |
697 | if (h(script, objectID, user, m_scene) == false) | 697 | if (h(script, objectID, user) == false) |
698 | return false; | 698 | return false; |
699 | } | 699 | } |
700 | } | 700 | } |
@@ -730,7 +730,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
730 | Delegate[] list = handler.GetInvocationList(); | 730 | Delegate[] list = handler.GetInvocationList(); |
731 | foreach (CompileScriptHandler h in list) | 731 | foreach (CompileScriptHandler h in list) |
732 | { | 732 | { |
733 | if (h(ownerUUID, scriptType, m_scene) == false) | 733 | if (h(ownerUUID, scriptType) == false) |
734 | return false; | 734 | return false; |
735 | } | 735 | } |
736 | } | 736 | } |
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
748 | Delegate[] list = handler.GetInvocationList(); | 748 | Delegate[] list = handler.GetInvocationList(); |
749 | foreach (StartScriptHandler h in list) | 749 | foreach (StartScriptHandler h in list) |
750 | { | 750 | { |
751 | if (h(script, user, m_scene) == false) | 751 | if (h(script, user) == false) |
752 | return false; | 752 | return false; |
753 | } | 753 | } |
754 | } | 754 | } |
@@ -766,7 +766,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
766 | Delegate[] list = handler.GetInvocationList(); | 766 | Delegate[] list = handler.GetInvocationList(); |
767 | foreach (StopScriptHandler h in list) | 767 | foreach (StopScriptHandler h in list) |
768 | { | 768 | { |
769 | if (h(script, user, m_scene) == false) | 769 | if (h(script, user) == false) |
770 | return false; | 770 | return false; |
771 | } | 771 | } |
772 | } | 772 | } |
@@ -784,7 +784,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
784 | Delegate[] list = handler.GetInvocationList(); | 784 | Delegate[] list = handler.GetInvocationList(); |
785 | foreach (ResetScriptHandler h in list) | 785 | foreach (ResetScriptHandler h in list) |
786 | { | 786 | { |
787 | if (h(prim, script, user, m_scene) == false) | 787 | if (h(prim, script, user) == false) |
788 | return false; | 788 | return false; |
789 | } | 789 | } |
790 | } | 790 | } |
@@ -802,7 +802,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
802 | Delegate[] list = handler.GetInvocationList(); | 802 | Delegate[] list = handler.GetInvocationList(); |
803 | foreach (TerraformLandHandler h in list) | 803 | foreach (TerraformLandHandler h in list) |
804 | { | 804 | { |
805 | if (h(user, pos, m_scene) == false) | 805 | if (h(user, pos) == false) |
806 | return false; | 806 | return false; |
807 | } | 807 | } |
808 | } | 808 | } |
@@ -820,7 +820,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
820 | Delegate[] list = handler.GetInvocationList(); | 820 | Delegate[] list = handler.GetInvocationList(); |
821 | foreach (RunConsoleCommandHandler h in list) | 821 | foreach (RunConsoleCommandHandler h in list) |
822 | { | 822 | { |
823 | if (h(user, m_scene) == false) | 823 | if (h(user) == false) |
824 | return false; | 824 | return false; |
825 | } | 825 | } |
826 | } | 826 | } |
@@ -838,7 +838,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
838 | Delegate[] list = handler.GetInvocationList(); | 838 | Delegate[] list = handler.GetInvocationList(); |
839 | foreach (IssueEstateCommandHandler h in list) | 839 | foreach (IssueEstateCommandHandler h in list) |
840 | { | 840 | { |
841 | if (h(user, m_scene, ownerCommand) == false) | 841 | if (h(user, ownerCommand) == false) |
842 | return false; | 842 | return false; |
843 | } | 843 | } |
844 | } | 844 | } |
@@ -918,7 +918,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
918 | Delegate[] list = handler.GetInvocationList(); | 918 | Delegate[] list = handler.GetInvocationList(); |
919 | foreach (EditParcelPropertiesHandler h in list) | 919 | foreach (EditParcelPropertiesHandler h in list) |
920 | { | 920 | { |
921 | if (h(user, parcel, p, m_scene, allowManager) == false) | 921 | if (h(user, parcel, p, allowManager) == false) |
922 | return false; | 922 | return false; |
923 | } | 923 | } |
924 | } | 924 | } |
@@ -935,7 +935,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | Delegate[] list = handler.GetInvocationList(); | 935 | Delegate[] list = handler.GetInvocationList(); |
936 | foreach (SellParcelHandler h in list) | 936 | foreach (SellParcelHandler h in list) |
937 | { | 937 | { |
938 | if (h(user, parcel, m_scene) == false) | 938 | if (h(user, parcel) == false) |
939 | return false; | 939 | return false; |
940 | } | 940 | } |
941 | } | 941 | } |
@@ -952,7 +952,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
952 | Delegate[] list = handler.GetInvocationList(); | 952 | Delegate[] list = handler.GetInvocationList(); |
953 | foreach (AbandonParcelHandler h in list) | 953 | foreach (AbandonParcelHandler h in list) |
954 | { | 954 | { |
955 | if (h(user, parcel, m_scene) == false) | 955 | if (h(user, parcel) == false) |
956 | return false; | 956 | return false; |
957 | } | 957 | } |
958 | } | 958 | } |
@@ -968,7 +968,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
968 | Delegate[] list = handler.GetInvocationList(); | 968 | Delegate[] list = handler.GetInvocationList(); |
969 | foreach (ReclaimParcelHandler h in list) | 969 | foreach (ReclaimParcelHandler h in list) |
970 | { | 970 | { |
971 | if (h(user, parcel, m_scene) == false) | 971 | if (h(user, parcel) == false) |
972 | return false; | 972 | return false; |
973 | } | 973 | } |
974 | } | 974 | } |
@@ -983,7 +983,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
983 | Delegate[] list = handler.GetInvocationList(); | 983 | Delegate[] list = handler.GetInvocationList(); |
984 | foreach (DeedParcelHandler h in list) | 984 | foreach (DeedParcelHandler h in list) |
985 | { | 985 | { |
986 | if (h(user, parcel, m_scene) == false) | 986 | if (h(user, parcel) == false) |
987 | return false; | 987 | return false; |
988 | } | 988 | } |
989 | } | 989 | } |
@@ -1018,7 +1018,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1018 | Delegate[] list = handler.GetInvocationList(); | 1018 | Delegate[] list = handler.GetInvocationList(); |
1019 | foreach (BuyLandHandler h in list) | 1019 | foreach (BuyLandHandler h in list) |
1020 | { | 1020 | { |
1021 | if (h(user, parcel, m_scene) == false) | 1021 | if (h(user, parcel) == false) |
1022 | return false; | 1022 | return false; |
1023 | } | 1023 | } |
1024 | } | 1024 | } |
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 635df96..6f2eedc 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.OptionalModules | |||
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | private bool m_enabled; | 53 | private bool m_enabled; |
54 | 54 | ||
55 | private Scene m_scene; | ||
55 | public string Name { get { return "PrimLimitsModule"; } } | 56 | public string Name { get { return "PrimLimitsModule"; } } |
56 | 57 | ||
57 | public Type ReplaceableInterface { get { return null; } } | 58 | public Type ReplaceableInterface { get { return null; } } |
@@ -80,6 +81,7 @@ namespace OpenSim.Region.OptionalModules | |||
80 | { | 81 | { |
81 | return; | 82 | return; |
82 | } | 83 | } |
84 | m_scene = scene; | ||
83 | scene.Permissions.OnRezObject += CanRezObject; | 85 | scene.Permissions.OnRezObject += CanRezObject; |
84 | scene.Permissions.OnObjectEntry += CanObjectEnter; | 86 | scene.Permissions.OnObjectEntry += CanObjectEnter; |
85 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 87 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
@@ -94,9 +96,9 @@ namespace OpenSim.Region.OptionalModules | |||
94 | return; | 96 | return; |
95 | } | 97 | } |
96 | 98 | ||
97 | scene.Permissions.OnRezObject -= CanRezObject; | 99 | m_scene.Permissions.OnRezObject -= CanRezObject; |
98 | scene.Permissions.OnObjectEntry -= CanObjectEnter; | 100 | m_scene.Permissions.OnObjectEntry -= CanObjectEnter; |
99 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; | 101 | m_scene.Permissions.OnDuplicateObject -= CanDuplicateObject; |
100 | } | 102 | } |
101 | 103 | ||
102 | public void RegionLoaded(Scene scene) | 104 | public void RegionLoaded(Scene scene) |
@@ -104,12 +106,12 @@ namespace OpenSim.Region.OptionalModules | |||
104 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); | 106 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); |
105 | } | 107 | } |
106 | 108 | ||
107 | private bool CanRezObject(int objectCount, UUID ownerID, Vector3 objectPosition, Scene scene) | 109 | private bool CanRezObject(int objectCount, UUID ownerID, Vector3 objectPosition) |
108 | { | 110 | { |
109 | 111 | ||
110 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 112 | ILandObject lo = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
111 | 113 | ||
112 | string response = DoCommonChecks(objectCount, ownerID, lo, scene); | 114 | string response = DoCommonChecks(objectCount, ownerID, lo); |
113 | 115 | ||
114 | if (response != null) | 116 | if (response != null) |
115 | { | 117 | { |
@@ -120,12 +122,12 @@ namespace OpenSim.Region.OptionalModules | |||
120 | } | 122 | } |
121 | 123 | ||
122 | //OnDuplicateObject | 124 | //OnDuplicateObject |
123 | private bool CanDuplicateObject(SceneObjectGroup sog, ScenePresence sp, Scene scene) | 125 | private bool CanDuplicateObject(SceneObjectGroup sog, ScenePresence sp) |
124 | { | 126 | { |
125 | Vector3 objectPosition = sog.AbsolutePosition; | 127 | Vector3 objectPosition = sog.AbsolutePosition; |
126 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 128 | ILandObject lo = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); |
127 | 129 | ||
128 | string response = DoCommonChecks(sog.PrimCount, sp.UUID, lo, scene); | 130 | string response = DoCommonChecks(sog.PrimCount, sp.UUID, lo); |
129 | 131 | ||
130 | if (response != null) | 132 | if (response != null) |
131 | { | 133 | { |
@@ -135,18 +137,18 @@ namespace OpenSim.Region.OptionalModules | |||
135 | return true; | 137 | return true; |
136 | } | 138 | } |
137 | 139 | ||
138 | private bool CanObjectEnter(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint, Scene scene) | 140 | private bool CanObjectEnter(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint) |
139 | { | 141 | { |
140 | float newX = newPoint.X; | 142 | float newX = newPoint.X; |
141 | float newY = newPoint.Y; | 143 | float newY = newPoint.Y; |
142 | if (newX < -1.0f || newX > (scene.RegionInfo.RegionSizeX + 1.0f) || | 144 | if (newX < -1.0f || newX > (m_scene.RegionInfo.RegionSizeX + 1.0f) || |
143 | newY < -1.0f || newY > (scene.RegionInfo.RegionSizeY + 1.0f) ) | 145 | newY < -1.0f || newY > (m_scene.RegionInfo.RegionSizeY + 1.0f) ) |
144 | return true; | 146 | return true; |
145 | 147 | ||
146 | if (sog == null) | 148 | if (sog == null) |
147 | return false; | 149 | return false; |
148 | 150 | ||
149 | ILandObject newParcel = scene.LandChannel.GetLandObject(newX, newY); | 151 | ILandObject newParcel = m_scene.LandChannel.GetLandObject(newX, newY); |
150 | 152 | ||
151 | if (newParcel == null) | 153 | if (newParcel == null) |
152 | return true; | 154 | return true; |
@@ -154,7 +156,7 @@ namespace OpenSim.Region.OptionalModules | |||
154 | if(!enteringRegion) | 156 | if(!enteringRegion) |
155 | { | 157 | { |
156 | Vector3 oldPoint = sog.AbsolutePosition; | 158 | Vector3 oldPoint = sog.AbsolutePosition; |
157 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | 159 | ILandObject oldParcel = m_scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); |
158 | if(oldParcel != null && oldParcel.Equals(newParcel)) | 160 | if(oldParcel != null && oldParcel.Equals(newParcel)) |
159 | return true; | 161 | return true; |
160 | } | 162 | } |
@@ -163,7 +165,7 @@ namespace OpenSim.Region.OptionalModules | |||
163 | 165 | ||
164 | // TODO: Add Special Case here for temporary prims | 166 | // TODO: Add Special Case here for temporary prims |
165 | 167 | ||
166 | string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel, scene); | 168 | string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel); |
167 | 169 | ||
168 | if (response != null) | 170 | if (response != null) |
169 | { | 171 | { |
@@ -174,25 +176,25 @@ namespace OpenSim.Region.OptionalModules | |||
174 | return true; | 176 | return true; |
175 | } | 177 | } |
176 | 178 | ||
177 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene) | 179 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo) |
178 | { | 180 | { |
179 | string response = null; | 181 | string response = null; |
180 | 182 | ||
181 | int OwnedParcelsCapacity = lo.GetSimulatorMaxPrimCount(); | 183 | int OwnedParcelsCapacity = lo.GetSimulatorMaxPrimCount(); |
182 | if ((objectCount + lo.PrimCounts.Total) > OwnedParcelsCapacity) | 184 | if ((objectCount + lo.PrimCounts.Total) > OwnedParcelsCapacity) |
183 | { | 185 | { |
184 | response = "Unable to rez object because the region is too full"; | 186 | response = "Unable to rez object because the parcel is full"; |
185 | } | 187 | } |
186 | else | 188 | else |
187 | { | 189 | { |
188 | int maxPrimsPerUser = scene.RegionInfo.MaxPrimsPerUser; | 190 | int maxPrimsPerUser = m_scene.RegionInfo.MaxPrimsPerUser; |
189 | if (maxPrimsPerUser >= 0) | 191 | if (maxPrimsPerUser >= 0) |
190 | { | 192 | { |
191 | // per-user prim limit is set | 193 | // per-user prim limit is set |
192 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) | 194 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) |
193 | { | 195 | { |
194 | // caller is not the sole Parcel owner | 196 | // caller is not the sole Parcel owner |
195 | EstateSettings estateSettings = scene.RegionInfo.EstateSettings; | 197 | EstateSettings estateSettings = m_scene.RegionInfo.EstateSettings; |
196 | if (ownerID != estateSettings.EstateOwner) | 198 | if (ownerID != estateSettings.EstateOwner) |
197 | { | 199 | { |
198 | // caller is NOT the Estate owner | 200 | // caller is NOT the Estate owner |