diff options
author | Teravus Ovares | 2007-12-05 06:44:32 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-05 06:44:32 +0000 |
commit | bb824eadeeb2b35025954d0c97f15123c6fd0cbe (patch) | |
tree | afca518b8e5b806cd2e7ab7965d34765d4b18bc4 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | fixed a few compiler warnings under mono (committed from a train, with adjohn... (diff) | |
download | opensim-SC-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.zip opensim-SC-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.gz opensim-SC-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.bz2 opensim-SC-bb824eadeeb2b35025954d0c97f15123c6fd0cbe.tar.xz |
* Refactored Permissions into ScenePresence as requested by MW
* Un-hackerized generating the client_flags
* Now handling the ObjectPermissions Update packet
* Warning: Backup your prim before updating. If you fail to do so and something goes wrong then, All Yr prim are belong to us!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f9cace2..1f43f53 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -733,20 +733,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
733 | { | 733 | { |
734 | AddEntityFromStorage(prim); | 734 | AddEntityFromStorage(prim); |
735 | SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); | 735 | SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); |
736 | if (m_permissions) | 736 | rootPart.ApplySanePermissions(); |
737 | { | 737 | |
738 | rootPart.EveryoneMask = rootPart.ObjectFlags; | ||
739 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectYouOwner; | ||
740 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectTransfer; | ||
741 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectModify; | ||
742 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectMove; | ||
743 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectAnyOwner; | ||
744 | rootPart.EveryoneMask &= ~(uint)LLObject.ObjectFlags.ObjectYouOfficer; | ||
745 | } | ||
746 | else | ||
747 | { | ||
748 | rootPart.EveryoneMask = rootPart.ObjectFlags; | ||
749 | } | ||
750 | bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); | 738 | bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); |
751 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) | 739 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) |
752 | rootPart.PhysActor = PhysicsScene.AddPrimShape( | 740 | rootPart.PhysActor = PhysicsScene.AddPrimShape( |
@@ -839,6 +827,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
839 | AddEntity(sceneOb); | 827 | AddEntity(sceneOb); |
840 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); | 828 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); |
841 | // if grass or tree, make phantom | 829 | // if grass or tree, make phantom |
830 | //rootPart.ApplySanePermissions(); | ||
842 | if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255)) | 831 | if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255)) |
843 | { | 832 | { |
844 | rootPart.AddFlag(LLObject.ObjectFlags.Phantom); | 833 | rootPart.AddFlag(LLObject.ObjectFlags.Phantom); |
@@ -983,6 +972,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
983 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); | 972 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); |
984 | client.OnRequestGodlikePowers += handleRequestGodlikePowers; | 973 | client.OnRequestGodlikePowers += handleRequestGodlikePowers; |
985 | client.OnGodKickUser += handleGodlikeKickUser; | 974 | client.OnGodKickUser += handleGodlikeKickUser; |
975 | client.OnObjectPermissions += HandleObjectPermissionsUpdate; | ||
986 | 976 | ||
987 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; | 977 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; |
988 | client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; | 978 | client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; |
@@ -1404,16 +1394,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1404 | { | 1394 | { |
1405 | if (godid == RegionInfo.MasterAvatarAssignedUUID) | 1395 | if (godid == RegionInfo.MasterAvatarAssignedUUID) |
1406 | { | 1396 | { |
1407 | if (agentid == new LLUUID("44e87126e7944ded05b37c42da3d5cdb")) | 1397 | if (agentid == new LLUUID("44e87126e7944ded05b37c42da3d5cdb")) |
1408 | { | 1398 | { |
1409 | 1399 | ||
1410 | ClientManager.ForEachClient(delegate (IClientAPI controller) | 1400 | ClientManager.ForEachClient(delegate(IClientAPI controller) |
1411 | { | 1401 | { |
1412 | ScenePresence p = GetScenePresence(controller.AgentId); | 1402 | ScenePresence p = GetScenePresence(controller.AgentId); |
1413 | bool childagent = false; | 1403 | bool childagent = false; |
1414 | if (!p.Equals(null)) | 1404 | if (!p.Equals(null)) |
1415 | if (p.IsChildAgent) | 1405 | if (p.IsChildAgent) |
1416 | childagent=true; | 1406 | childagent = true; |
1417 | if (controller.AgentId != godid && !childagent) // Do we really want to kick the initiator of this madness? | 1407 | if (controller.AgentId != godid && !childagent) // Do we really want to kick the initiator of this madness? |
1418 | { | 1408 | { |
1419 | controller.Kick(Helpers.FieldToUTF8String(reason)); | 1409 | controller.Kick(Helpers.FieldToUTF8String(reason)); |
@@ -1424,7 +1414,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1424 | // This is a bit crude. It seems the client will be null before it actually stops the thread | 1414 | // This is a bit crude. It seems the client will be null before it actually stops the thread |
1425 | // The thread will kill itself eventually :/ | 1415 | // The thread will kill itself eventually :/ |
1426 | // Is there another way to make sure *all* clients get this 'inter region' message? | 1416 | // Is there another way to make sure *all* clients get this 'inter region' message? |
1427 | ClientManager.ForEachClient(delegate (IClientAPI controller) | 1417 | ClientManager.ForEachClient(delegate(IClientAPI controller) |
1428 | { | 1418 | { |
1429 | ScenePresence p = GetScenePresence(controller.AgentId); | 1419 | ScenePresence p = GetScenePresence(controller.AgentId); |
1430 | bool childagent = false; | 1420 | bool childagent = false; |
@@ -1439,7 +1429,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1439 | } | 1429 | } |
1440 | ); | 1430 | ); |
1441 | } | 1431 | } |
1442 | else | 1432 | else |
1443 | { | 1433 | { |
1444 | m_scenePresences[agentid].ControllingClient.Kick(Helpers.FieldToUTF8String(reason)); | 1434 | m_scenePresences[agentid].ControllingClient.Kick(Helpers.FieldToUTF8String(reason)); |
1445 | m_scenePresences[agentid].ControllingClient.Close(); | 1435 | m_scenePresences[agentid].ControllingClient.Close(); |
@@ -1452,7 +1442,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
1452 | } | 1442 | } |
1453 | } | 1443 | } |
1454 | } | 1444 | } |
1445 | public void HandleObjectPermissionsUpdate (IClientAPI controller, LLUUID AgentID, LLUUID SessionID, List<libsecondlife.Packets.ObjectPermissionsPacket.ObjectDataBlock> permChanges) | ||
1446 | { | ||
1447 | // Check for spoofing.. since this is permissions we're talking about here! | ||
1448 | if ((controller.SessionId == SessionID) && (controller.AgentId == AgentID)) | ||
1449 | { | ||
1450 | for (int i = 0; i < permChanges.Count; i++) | ||
1451 | { | ||
1452 | |||
1453 | // Tell the object to do permission update | ||
1454 | byte field = permChanges[i].Field; | ||
1455 | uint localID = permChanges[i].ObjectLocalID; | ||
1456 | uint mask = permChanges[i].Mask; | ||
1457 | byte addRemTF = permChanges[i].Set; | ||
1458 | SceneObjectGroup chObjectGroup = GetGroupByPrim(localID); | ||
1459 | chObjectGroup.UpdatePermissions(AgentID, field, localID, mask, addRemTF); | ||
1455 | 1460 | ||
1461 | } | ||
1462 | } | ||
1463 | |||
1464 | } | ||
1456 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 1465 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
1457 | { | 1466 | { |
1458 | foreach (ScenePresence presence in m_scenePresences.Values) | 1467 | foreach (ScenePresence presence in m_scenePresences.Values) |