diff options
Diffstat (limited to 'OpenSim/Region')
23 files changed, 362 insertions, 145 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7633b7b..12c2d86 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -197,6 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
197 | private ObjectExtraParams handlerUpdateExtraParams; //OnUpdateExtraParams; | 197 | private ObjectExtraParams handlerUpdateExtraParams; //OnUpdateExtraParams; |
198 | private ObjectDuplicate handlerObjectDuplicate; | 198 | private ObjectDuplicate handlerObjectDuplicate; |
199 | private ObjectDuplicateOnRay handlerObjectDuplicateOnRay; | 199 | private ObjectDuplicateOnRay handlerObjectDuplicateOnRay; |
200 | private ObjectRequest handlerObjectRequest; | ||
200 | private ObjectSelect handlerObjectSelect; | 201 | private ObjectSelect handlerObjectSelect; |
201 | private ObjectDeselect handlerObjectDeselect; | 202 | private ObjectDeselect handlerObjectDeselect; |
202 | private ObjectIncludeInSearch handlerObjectIncludeInSearch; | 203 | private ObjectIncludeInSearch handlerObjectIncludeInSearch; |
@@ -1083,6 +1084,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1083 | public event GodKickUser OnGodKickUser; | 1084 | public event GodKickUser OnGodKickUser; |
1084 | public event ObjectExtraParams OnUpdateExtraParams; | 1085 | public event ObjectExtraParams OnUpdateExtraParams; |
1085 | public event UpdateShape OnUpdatePrimShape; | 1086 | public event UpdateShape OnUpdatePrimShape; |
1087 | public event ObjectRequest OnObjectRequest; | ||
1086 | public event ObjectSelect OnObjectSelect; | 1088 | public event ObjectSelect OnObjectSelect; |
1087 | public event ObjectDeselect OnObjectDeselect; | 1089 | public event ObjectDeselect OnObjectDeselect; |
1088 | public event GenericCall7 OnObjectDescription; | 1090 | public event GenericCall7 OnObjectDescription; |
@@ -5937,6 +5939,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5937 | 5939 | ||
5938 | break; | 5940 | break; |
5939 | 5941 | ||
5942 | case PacketType.RequestMultipleObjects: | ||
5943 | RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack; | ||
5944 | |||
5945 | #region Packet Session and User Check | ||
5946 | if (m_checkPackets) | ||
5947 | { | ||
5948 | if (incomingRequest.AgentData.SessionID != SessionId || | ||
5949 | incomingRequest.AgentData.AgentID != AgentId) | ||
5950 | break; | ||
5951 | } | ||
5952 | #endregion | ||
5953 | |||
5954 | handlerObjectRequest = null; | ||
5955 | |||
5956 | for (int i = 0; i < incomingRequest.ObjectData.Length; i++) | ||
5957 | { | ||
5958 | handlerObjectRequest = OnObjectRequest; | ||
5959 | if (handlerObjectRequest != null) | ||
5960 | { | ||
5961 | handlerObjectRequest(incomingRequest.ObjectData[i].ID, this); | ||
5962 | } | ||
5963 | } | ||
5964 | break; | ||
5940 | case PacketType.ObjectSelect: | 5965 | case PacketType.ObjectSelect: |
5941 | ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; | 5966 | ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; |
5942 | 5967 | ||
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index bcf20be..e9c1e9d 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -450,7 +450,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
450 | 450 | ||
451 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName); | 451 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName); |
452 | 452 | ||
453 | // DEPRECIATED | 453 | // DEPRECATED |
454 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); | 454 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); |
455 | 455 | ||
456 | responseMap["connect"] = OSD.FromBoolean(true); | 456 | responseMap["connect"] = OSD.FromBoolean(true); |
@@ -591,7 +591,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
591 | httpaddr = httpsCN; | 591 | httpaddr = httpsCN; |
592 | } | 592 | } |
593 | 593 | ||
594 | // DEPRECIATED | 594 | // DEPRECATED |
595 | responseMap["seed_capability"] | 595 | responseMap["seed_capability"] |
596 | = OSD.FromString( | 596 | = OSD.FromString( |
597 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | 597 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); |
@@ -764,7 +764,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
764 | responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); | 764 | responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); |
765 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); | 765 | responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); |
766 | 766 | ||
767 | // DEPRECIATED | 767 | // DEPRECATED |
768 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); | 768 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); |
769 | 769 | ||
770 | responseMap["session_id"] = OSD.FromUUID(SessionID); | 770 | responseMap["session_id"] = OSD.FromUUID(SessionID); |
@@ -851,7 +851,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
851 | 851 | ||
852 | string rezRespSeedCap = ""; | 852 | string rezRespSeedCap = ""; |
853 | 853 | ||
854 | // DEPRECIATED | 854 | // DEPRECATED |
855 | if (rezResponseMap.ContainsKey("seed_capability")) | 855 | if (rezResponseMap.ContainsKey("seed_capability")) |
856 | rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); | 856 | rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); |
857 | 857 | ||
@@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
863 | if (rezResponseMap.ContainsKey("rez_avatar/rez")) | 863 | if (rezResponseMap.ContainsKey("rez_avatar/rez")) |
864 | rezRespSeedCap = rezResponseMap["rez_avatar/rez"].AsString(); | 864 | rezRespSeedCap = rezResponseMap["rez_avatar/rez"].AsString(); |
865 | 865 | ||
866 | // DEPRECIATED | 866 | // DEPRECATED |
867 | string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); | 867 | string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); |
868 | 868 | ||
869 | string rezRespSim_host = rezResponseMap["sim_host"].AsString(); | 869 | string rezRespSim_host = rezResponseMap["sim_host"].AsString(); |
@@ -879,13 +879,13 @@ namespace OpenSim.Region.CoreModules.InterGrid | |||
879 | { | 879 | { |
880 | RezResponsePositionArray = (OSDArray)rezResponseMap["position"]; | 880 | RezResponsePositionArray = (OSDArray)rezResponseMap["position"]; |
881 | } | 881 | } |
882 | // DEPRECIATED | 882 | // DEPRECATED |
883 | responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap); | 883 | responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap); |
884 | 884 | ||
885 | // REPLACEMENT r3 | 885 | // REPLACEMENT r3 |
886 | responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap); | 886 | responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap); |
887 | 887 | ||
888 | // DEPRECIATED | 888 | // DEPRECATED |
889 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); | 889 | responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); |
890 | 890 | ||
891 | responseMap["sim_host"] = OSD.FromString(rezRespSim_host); | 891 | responseMap["sim_host"] = OSD.FromString(rezRespSim_host); |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 62779e7..e9c35e9 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -107,6 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
107 | public event UpdateShape OnUpdatePrimShape; | 107 | public event UpdateShape OnUpdatePrimShape; |
108 | public event ObjectExtraParams OnUpdateExtraParams; | 108 | public event ObjectExtraParams OnUpdateExtraParams; |
109 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | 109 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; |
110 | public event ObjectRequest OnObjectRequest; | ||
110 | public event ObjectSelect OnObjectSelect; | 111 | public event ObjectSelect OnObjectSelect; |
111 | public event GenericCall7 OnObjectDescription; | 112 | public event GenericCall7 OnObjectDescription; |
112 | public event GenericCall7 OnObjectName; | 113 | public event GenericCall7 OnObjectName; |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 7bbe045..287d8d9 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
63 | public delegate void OnNewClientDelegate(IClientAPI client); | 63 | public delegate void OnNewClientDelegate(IClientAPI client); |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Depreciated in favour of OnClientConnect. | 66 | /// Deprecated in favour of OnClientConnect. |
67 | /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces. | 67 | /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces. |
68 | /// </summary> | 68 | /// </summary> |
69 | public event OnNewClientDelegate OnNewClient; | 69 | public event OnNewClientDelegate OnNewClient; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 113918d..1a7f8f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -109,6 +109,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Invoked when the client requests a prim. | ||
113 | /// </summary> | ||
114 | /// <param name="primLocalID"></param> | ||
115 | /// <param name="remoteClient"></param> | ||
116 | public void RequestPrim(uint primLocalID, IClientAPI remoteClient) | ||
117 | { | ||
118 | PacketType i = PacketType.ObjectUpdate; | ||
119 | List<EntityBase> EntityList = GetEntities(); | ||
120 | |||
121 | foreach (EntityBase ent in EntityList) | ||
122 | { | ||
123 | if (ent is SceneObjectGroup) | ||
124 | { | ||
125 | if (((SceneObjectGroup)ent).LocalId == primLocalID) | ||
126 | { | ||
127 | ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); | ||
128 | return; | ||
129 | } | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
134 | /// <summary> | ||
112 | /// Invoked when the client selects a prim. | 135 | /// Invoked when the client selects a prim. |
113 | /// </summary> | 136 | /// </summary> |
114 | /// <param name="primLocalID"></param> | 137 | /// <param name="primLocalID"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 18d7bad..a2275f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2076,6 +2076,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2076 | client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; | 2076 | client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; |
2077 | client.OnTeleportLocationRequest += RequestTeleportLocation; | 2077 | client.OnTeleportLocationRequest += RequestTeleportLocation; |
2078 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 2078 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
2079 | client.OnObjectRequest += RequestPrim; | ||
2079 | client.OnObjectSelect += SelectPrim; | 2080 | client.OnObjectSelect += SelectPrim; |
2080 | client.OnObjectDeselect += DeselectPrim; | 2081 | client.OnObjectDeselect += DeselectPrim; |
2081 | client.OnGrabUpdate += m_sceneGraph.MoveObject; | 2082 | client.OnGrabUpdate += m_sceneGraph.MoveObject; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 0e0999a..7771831 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -928,25 +928,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
928 | { | 928 | { |
929 | // Primitive Ray Tracing | 929 | // Primitive Ray Tracing |
930 | float closestDistance = 280f; | 930 | float closestDistance = 280f; |
931 | EntityIntersection returnResult = new EntityIntersection(); | 931 | EntityIntersection result = new EntityIntersection(); |
932 | List<EntityBase> EntityList = GetEntities(); | 932 | List<EntityBase> EntityList = GetEntities(); |
933 | foreach (EntityBase ent in EntityList) | 933 | foreach (EntityBase ent in EntityList) |
934 | { | 934 | { |
935 | if (ent is SceneObjectGroup) | 935 | if (ent is SceneObjectGroup) |
936 | { | 936 | { |
937 | SceneObjectGroup reportingG = (SceneObjectGroup)ent; | 937 | SceneObjectGroup reportingG = (SceneObjectGroup)ent; |
938 | EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); | 938 | EntityIntersection inter = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); |
939 | if (result.HitTF) | 939 | if (inter.HitTF && inter.distance < closestDistance) |
940 | { | 940 | { |
941 | if (result.distance < closestDistance) | 941 | closestDistance = inter.distance; |
942 | { | 942 | result = inter; |
943 | closestDistance = result.distance; | ||
944 | returnResult = result; | ||
945 | } | ||
946 | } | 943 | } |
947 | } | 944 | } |
948 | } | 945 | } |
949 | return returnResult; | 946 | return result; |
950 | } | 947 | } |
951 | 948 | ||
952 | /// <summary> | 949 | /// <summary> |
@@ -979,7 +976,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
979 | { | 976 | { |
980 | foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) | 977 | foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) |
981 | { | 978 | { |
982 | if (p.Name==name) | 979 | if (p.Name == name) |
983 | { | 980 | { |
984 | return p; | 981 | return p; |
985 | } | 982 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index c86e4a1..bc3d5c0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
555 | // If we get a result, we're going to find the closest result to the origin of the ray | 555 | // If we get a result, we're going to find the closest result to the origin of the ray |
556 | // and send back the intersection information back to the innerscene. | 556 | // and send back the intersection information back to the innerscene. |
557 | 557 | ||
558 | EntityIntersection returnresult = new EntityIntersection(); | 558 | EntityIntersection result = new EntityIntersection(); |
559 | 559 | ||
560 | lock (m_parts) | 560 | lock (m_parts) |
561 | { | 561 | { |
@@ -576,26 +576,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
576 | // when the camera crosses the border. | 576 | // when the camera crosses the border. |
577 | float idist = Constants.RegionSize; | 577 | float idist = Constants.RegionSize; |
578 | 578 | ||
579 | |||
580 | if (inter.HitTF) | 579 | if (inter.HitTF) |
581 | { | 580 | { |
582 | // We need to find the closest prim to return to the testcaller along the ray | 581 | // We need to find the closest prim to return to the testcaller along the ray |
583 | if (inter.distance < idist) | 582 | if (inter.distance < idist) |
584 | { | 583 | { |
585 | returnresult.HitTF = true; | 584 | result.HitTF = true; |
586 | returnresult.ipoint = inter.ipoint; | 585 | result.ipoint = inter.ipoint; |
587 | returnresult.obj = part; | 586 | result.obj = part; |
588 | returnresult.normal = inter.normal; | 587 | result.normal = inter.normal; |
589 | returnresult.distance = inter.distance; | 588 | result.distance = inter.distance; |
590 | } | 589 | } |
591 | } | 590 | } |
592 | } | 591 | } |
593 | } | 592 | } |
594 | return returnresult; | 593 | return result; |
595 | } | 594 | } |
596 | 595 | ||
597 | |||
598 | |||
599 | /// <summary> | 596 | /// <summary> |
600 | /// Gets a vector representing the size of the bounding box containing all the prims in the group | 597 | /// Gets a vector representing the size of the bounding box containing all the prims in the group |
601 | /// Treats all prims as rectangular, so no shape (cut etc) is taken into account | 598 | /// Treats all prims as rectangular, so no shape (cut etc) is taken into account |
@@ -652,7 +649,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
652 | frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); | 649 | frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); |
653 | frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); | 650 | frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); |
654 | 651 | ||
655 | |||
656 | backTopLeft.X = orig.X + (part.Scale.X / 2); | 652 | backTopLeft.X = orig.X + (part.Scale.X / 2); |
657 | backTopLeft.Y = orig.Y - (part.Scale.Y / 2); | 653 | backTopLeft.Y = orig.Y - (part.Scale.Y / 2); |
658 | backTopLeft.Z = orig.Z + (part.Scale.Z / 2); | 654 | backTopLeft.Z = orig.Z + (part.Scale.Z / 2); |
@@ -839,7 +835,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
839 | if (backBottomLeft.Z < minZ) | 835 | if (backBottomLeft.Z < minZ) |
840 | minZ = backBottomLeft.Z; | 836 | minZ = backBottomLeft.Z; |
841 | } | 837 | } |
842 | |||
843 | } | 838 | } |
844 | 839 | ||
845 | Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ); | 840 | Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ); |
@@ -860,6 +855,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
860 | // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); | 855 | // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); |
861 | return boundingBox; | 856 | return boundingBox; |
862 | } | 857 | } |
858 | |||
863 | #endregion | 859 | #endregion |
864 | 860 | ||
865 | public void SaveScriptedState(XmlTextWriter writer) | 861 | public void SaveScriptedState(XmlTextWriter writer) |
@@ -1029,8 +1025,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1029 | //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); | 1025 | //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); |
1030 | //AttachToBackup(); | 1026 | //AttachToBackup(); |
1031 | //m_rootPart.ScheduleFullUpdate(); | 1027 | //m_rootPart.ScheduleFullUpdate(); |
1032 | |||
1033 | } | 1028 | } |
1029 | |||
1034 | /// <summary> | 1030 | /// <summary> |
1035 | /// | 1031 | /// |
1036 | /// </summary> | 1032 | /// </summary> |
@@ -1130,6 +1126,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1130 | } | 1126 | } |
1131 | } | 1127 | } |
1132 | } | 1128 | } |
1129 | |||
1133 | // helper provided for parts. | 1130 | // helper provided for parts. |
1134 | public int GetSceneMaxUndo() | 1131 | public int GetSceneMaxUndo() |
1135 | { | 1132 | { |
@@ -1183,7 +1180,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1183 | { | 1180 | { |
1184 | SceneObjectPart part = GetChildPart(localId); | 1181 | SceneObjectPart part = GetChildPart(localId); |
1185 | OnGrabPart(part, offsetPos, remoteClient); | 1182 | OnGrabPart(part, offsetPos, remoteClient); |
1186 | |||
1187 | } | 1183 | } |
1188 | } | 1184 | } |
1189 | 1185 | ||
@@ -1267,28 +1263,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1267 | } | 1263 | } |
1268 | } | 1264 | } |
1269 | 1265 | ||
1270 | if ((aggregateScriptEvents & scriptEvents.at_target) != 0) | 1266 | m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0); |
1271 | { | 1267 | m_scriptListens_notAtTarget = ((aggregateScriptEvents & scriptEvents.not_at_target) != 0); |
1272 | m_scriptListens_atTarget = true; | ||
1273 | } | ||
1274 | else | ||
1275 | { | ||
1276 | m_scriptListens_atTarget = false; | ||
1277 | } | ||
1278 | |||
1279 | if ((aggregateScriptEvents & scriptEvents.not_at_target) != 0) | ||
1280 | { | ||
1281 | m_scriptListens_notAtTarget = true; | ||
1282 | } | ||
1283 | else | ||
1284 | { | ||
1285 | m_scriptListens_notAtTarget = false; | ||
1286 | } | ||
1287 | 1268 | ||
1288 | if (m_scriptListens_atTarget || m_scriptListens_notAtTarget) | 1269 | if (!m_scriptListens_atTarget && !m_scriptListens_notAtTarget) |
1289 | { | ||
1290 | } | ||
1291 | else | ||
1292 | { | 1270 | { |
1293 | lock (m_targets) | 1271 | lock (m_targets) |
1294 | m_targets.Clear(); | 1272 | m_targets.Clear(); |
@@ -1787,9 +1765,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1787 | } | 1765 | } |
1788 | } | 1766 | } |
1789 | 1767 | ||
1790 | |||
1791 | |||
1792 | |||
1793 | /// <summary> | 1768 | /// <summary> |
1794 | /// Set the owner of the root part. | 1769 | /// Set the owner of the root part. |
1795 | /// </summary> | 1770 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3646811..5a74bad 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2710,11 +2710,10 @@ if (m_shape != null) { | |||
2710 | 2710 | ||
2711 | public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot) | 2711 | public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot) |
2712 | { | 2712 | { |
2713 | // In this case we're using a sphere with a radius of the largest dimention of the prim | 2713 | // In this case we're using a sphere with a radius of the largest dimension of the prim |
2714 | // TODO: Change to take shape into account | 2714 | // TODO: Change to take shape into account |
2715 | 2715 | ||
2716 | 2716 | EntityIntersection result = new EntityIntersection(); | |
2717 | EntityIntersection returnresult = new EntityIntersection(); | ||
2718 | Vector3 vAbsolutePosition = AbsolutePosition; | 2717 | Vector3 vAbsolutePosition = AbsolutePosition; |
2719 | Vector3 vScale = Scale; | 2718 | Vector3 vScale = Scale; |
2720 | Vector3 rOrigin = iray.Origin; | 2719 | Vector3 rOrigin = iray.Origin; |
@@ -2738,8 +2737,7 @@ if (m_shape != null) { | |||
2738 | 2737 | ||
2739 | Vector3 tmVal6 = vAbsolutePosition*rOrigin; | 2738 | Vector3 tmVal6 = vAbsolutePosition*rOrigin; |
2740 | 2739 | ||
2741 | 2740 | // Set Radius to the largest dimension of the prim | |
2742 | // Set Radius to the largest dimention of the prim | ||
2743 | float radius = 0f; | 2741 | float radius = 0f; |
2744 | if (vScale.X > radius) | 2742 | if (vScale.X > radius) |
2745 | radius = vScale.X; | 2743 | radius = vScale.X; |
@@ -2765,7 +2763,7 @@ if (m_shape != null) { | |||
2765 | if (rootsqr < 0.0f) | 2763 | if (rootsqr < 0.0f) |
2766 | { | 2764 | { |
2767 | // No intersection | 2765 | // No intersection |
2768 | return returnresult; | 2766 | return result; |
2769 | } | 2767 | } |
2770 | float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f); | 2768 | float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f); |
2771 | 2769 | ||
@@ -2778,7 +2776,7 @@ if (m_shape != null) { | |||
2778 | if (root < 0.0f) | 2776 | if (root < 0.0f) |
2779 | { | 2777 | { |
2780 | // nope, no intersection | 2778 | // nope, no intersection |
2781 | return returnresult; | 2779 | return result; |
2782 | } | 2780 | } |
2783 | } | 2781 | } |
2784 | 2782 | ||
@@ -2788,12 +2786,12 @@ if (m_shape != null) { | |||
2788 | new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root), | 2786 | new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root), |
2789 | iray.Origin.Z + (iray.Direction.Z*root)); | 2787 | iray.Origin.Z + (iray.Direction.Z*root)); |
2790 | 2788 | ||
2791 | returnresult.HitTF = true; | 2789 | result.HitTF = true; |
2792 | returnresult.ipoint = ipoint; | 2790 | result.ipoint = ipoint; |
2793 | 2791 | ||
2794 | // Normal is calculated by the difference and then normalizing the result | 2792 | // Normal is calculated by the difference and then normalizing the result |
2795 | Vector3 normalpart = ipoint - vAbsolutePosition; | 2793 | Vector3 normalpart = ipoint - vAbsolutePosition; |
2796 | returnresult.normal = normalpart / normalpart.Length(); | 2794 | result.normal = normalpart / normalpart.Length(); |
2797 | 2795 | ||
2798 | // It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't. | 2796 | // It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't. |
2799 | // I can write a function to do it.. but I like the fact that this one is Static. | 2797 | // I can write a function to do it.. but I like the fact that this one is Static. |
@@ -2802,9 +2800,9 @@ if (m_shape != null) { | |||
2802 | Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z); | 2800 | Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z); |
2803 | float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2); | 2801 | float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2); |
2804 | 2802 | ||
2805 | returnresult.distance = distance; | 2803 | result.distance = distance; |
2806 | 2804 | ||
2807 | return returnresult; | 2805 | return result; |
2808 | } | 2806 | } |
2809 | 2807 | ||
2810 | public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters) | 2808 | public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters) |
@@ -3008,9 +3006,9 @@ if (m_shape != null) { | |||
3008 | //distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1; | 3006 | //distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1; |
3009 | } | 3007 | } |
3010 | 3008 | ||
3011 | EntityIntersection returnresult = new EntityIntersection(); | 3009 | EntityIntersection result = new EntityIntersection(); |
3012 | 3010 | ||
3013 | returnresult.distance = 1024; | 3011 | result.distance = 1024; |
3014 | float c = 0; | 3012 | float c = 0; |
3015 | float a = 0; | 3013 | float a = 0; |
3016 | float d = 0; | 3014 | float d = 0; |
@@ -3030,7 +3028,7 @@ if (m_shape != null) { | |||
3030 | //{ | 3028 | //{ |
3031 | //if (iray.Origin.Dot(normals[i]) > d) | 3029 | //if (iray.Origin.Dot(normals[i]) > d) |
3032 | //{ | 3030 | //{ |
3033 | //return returnresult; | 3031 | //return result; |
3034 | //} | 3032 | //} |
3035 | // else | 3033 | // else |
3036 | //{ | 3034 | //{ |
@@ -3044,7 +3042,7 @@ if (m_shape != null) { | |||
3044 | //{ | 3042 | //{ |
3045 | //if (a > fmin) | 3043 | //if (a > fmin) |
3046 | //{ | 3044 | //{ |
3047 | //return returnresult; | 3045 | //return result; |
3048 | //} | 3046 | //} |
3049 | //fmax = a; | 3047 | //fmax = a; |
3050 | //} | 3048 | //} |
@@ -3056,7 +3054,7 @@ if (m_shape != null) { | |||
3056 | //{ | 3054 | //{ |
3057 | //if (a < 0 || a < fmax) | 3055 | //if (a < 0 || a < fmax) |
3058 | //{ | 3056 | //{ |
3059 | //return returnresult; | 3057 | //return result; |
3060 | //} | 3058 | //} |
3061 | //fmin = a; | 3059 | //fmin = a; |
3062 | //} | 3060 | //} |
@@ -3112,17 +3110,17 @@ if (m_shape != null) { | |||
3112 | // distance2 = (float)GetDistanceTo(q, iray.Origin); | 3110 | // distance2 = (float)GetDistanceTo(q, iray.Origin); |
3113 | //} | 3111 | //} |
3114 | 3112 | ||
3115 | if (distance2 < returnresult.distance) | 3113 | if (distance2 < result.distance) |
3116 | { | 3114 | { |
3117 | returnresult.distance = distance2; | 3115 | result.distance = distance2; |
3118 | returnresult.HitTF = true; | 3116 | result.HitTF = true; |
3119 | returnresult.ipoint = q; | 3117 | result.ipoint = q; |
3120 | //m_log.Info("[FACE]:" + i.ToString()); | 3118 | //m_log.Info("[FACE]:" + i.ToString()); |
3121 | //m_log.Info("[POINT]: " + q.ToString()); | 3119 | //m_log.Info("[POINT]: " + q.ToString()); |
3122 | //m_log.Info("[DIST]: " + distance2.ToString()); | 3120 | //m_log.Info("[DIST]: " + distance2.ToString()); |
3123 | if (faceCenters) | 3121 | if (faceCenters) |
3124 | { | 3122 | { |
3125 | returnresult.normal = AAfacenormals[i] * AXrot; | 3123 | result.normal = AAfacenormals[i] * AXrot; |
3126 | 3124 | ||
3127 | Vector3 scaleComponent = AAfacenormals[i]; | 3125 | Vector3 scaleComponent = AAfacenormals[i]; |
3128 | float ScaleOffset = 0.5f; | 3126 | float ScaleOffset = 0.5f; |
@@ -3130,20 +3128,20 @@ if (m_shape != null) { | |||
3130 | if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y; | 3128 | if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y; |
3131 | if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z; | 3129 | if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z; |
3132 | ScaleOffset = Math.Abs(ScaleOffset); | 3130 | ScaleOffset = Math.Abs(ScaleOffset); |
3133 | Vector3 offset = returnresult.normal * ScaleOffset; | 3131 | Vector3 offset = result.normal * ScaleOffset; |
3134 | returnresult.ipoint = AXpos + offset; | 3132 | result.ipoint = AXpos + offset; |
3135 | 3133 | ||
3136 | ///pos = (intersectionpoint + offset); | 3134 | ///pos = (intersectionpoint + offset); |
3137 | } | 3135 | } |
3138 | else | 3136 | else |
3139 | { | 3137 | { |
3140 | returnresult.normal = normals[i]; | 3138 | result.normal = normals[i]; |
3141 | } | 3139 | } |
3142 | returnresult.AAfaceNormal = AAfacenormals[i]; | 3140 | result.AAfaceNormal = AAfacenormals[i]; |
3143 | } | 3141 | } |
3144 | } | 3142 | } |
3145 | } | 3143 | } |
3146 | return returnresult; | 3144 | return result; |
3147 | } | 3145 | } |
3148 | 3146 | ||
3149 | /// <summary> | 3147 | /// <summary> |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 08fc61f..4a2d7b5 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -634,7 +634,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
634 | { | 634 | { |
635 | get { return (uint)Util.RandomClass.Next(0,int.MaxValue); } | 635 | get { return (uint)Util.RandomClass.Next(0,int.MaxValue); } |
636 | } | 636 | } |
637 | 637 | #pragma warning disable 67 | |
638 | public event GenericMessage OnGenericMessage; | 638 | public event GenericMessage OnGenericMessage; |
639 | public event ImprovedInstantMessage OnInstantMessage; | 639 | public event ImprovedInstantMessage OnInstantMessage; |
640 | public event ChatMessage OnChatFromClient; | 640 | public event ChatMessage OnChatFromClient; |
@@ -686,6 +686,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
686 | public event SpinStop OnSpinStop; | 686 | public event SpinStop OnSpinStop; |
687 | public event UpdateShape OnUpdatePrimShape; | 687 | public event UpdateShape OnUpdatePrimShape; |
688 | public event ObjectExtraParams OnUpdateExtraParams; | 688 | public event ObjectExtraParams OnUpdateExtraParams; |
689 | public event ObjectRequest OnObjectRequest; | ||
689 | public event ObjectSelect OnObjectSelect; | 690 | public event ObjectSelect OnObjectSelect; |
690 | public event ObjectDeselect OnObjectDeselect; | 691 | public event ObjectDeselect OnObjectDeselect; |
691 | public event GenericCall7 OnObjectDescription; | 692 | public event GenericCall7 OnObjectDescription; |
@@ -825,6 +826,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
825 | public event AvatarNotesUpdate OnAvatarNotesUpdate; | 826 | public event AvatarNotesUpdate OnAvatarNotesUpdate; |
826 | public event MuteListRequest OnMuteListRequest; | 827 | public event MuteListRequest OnMuteListRequest; |
827 | public event PlacesQuery OnPlacesQuery; | 828 | public event PlacesQuery OnPlacesQuery; |
829 | #pragma warning restore 67 | ||
828 | 830 | ||
829 | public void SetDebugPacketLevel(int newDebug) | 831 | public void SetDebugPacketLevel(int newDebug) |
830 | { | 832 | { |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs new file mode 100644 index 0000000..533d176 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs | |||
@@ -0,0 +1,36 @@ | |||
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 OpenSimulator 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 | |||
28 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | ||
29 | { | ||
30 | public interface ISecurityCredential | ||
31 | { | ||
32 | ISocialEntity owner { get; } | ||
33 | bool CanEditObject(IObject target); | ||
34 | bool CanEditTerrain(int x, int y); | ||
35 | } | ||
36 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs index 849e3ca..03c1e95 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs | |||
@@ -32,19 +32,6 @@ using OpenMetaverse; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 33 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
34 | { | 34 | { |
35 | public interface IAvatarAttachment | ||
36 | { | ||
37 | //// <value> | ||
38 | /// Describes where on the avatar the attachment is located | ||
39 | /// </value> | ||
40 | int Location { get ; } | ||
41 | |||
42 | //// <value> | ||
43 | /// Accessor to the rez'ed asset, representing the attachment | ||
44 | /// </value> | ||
45 | IObject Asset { get; } | ||
46 | } | ||
47 | |||
48 | public interface IAvatar : IEntity | 35 | public interface IAvatar : IEntity |
49 | { | 36 | { |
50 | //// <value> | 37 | //// <value> |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs new file mode 100644 index 0000000..22b4605 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs | |||
@@ -0,0 +1,15 @@ | |||
1 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | ||
2 | { | ||
3 | public interface IAvatarAttachment | ||
4 | { | ||
5 | //// <value> | ||
6 | /// Describes where on the avatar the attachment is located | ||
7 | /// </value> | ||
8 | int Location { get ; } | ||
9 | |||
10 | //// <value> | ||
11 | /// Accessor to the rez'ed asset, representing the attachment | ||
12 | /// </value> | ||
13 | IObject Asset { get; } | ||
14 | } | ||
15 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 6415250..19f7210 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | |||
@@ -212,6 +212,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
212 | bool Bright { get; set; } // SetPrimParms(FULLBRIGHT) | 212 | bool Bright { get; set; } // SetPrimParms(FULLBRIGHT) |
213 | double Bloom { get; set; } // SetPrimParms(GLOW) | 213 | double Bloom { get; set; } // SetPrimParms(GLOW) |
214 | bool Shiny { get; set; } // SetPrimParms(SHINY) | 214 | bool Shiny { get; set; } // SetPrimParms(SHINY) |
215 | bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECIATE IN FAVOUR OF UUID?] | 215 | bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECATE IN FAVOUR OF UUID?] |
216 | } | 216 | } |
217 | } | 217 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 5ed9af3..6daae29 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs | |||
@@ -166,8 +166,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
166 | 166 | ||
167 | public void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host) | 167 | public void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host) |
168 | { | 168 | { |
169 | world = new World(m_scene); | 169 | // UUID should be changed to object owner. |
170 | host = new Host(new SOPObject(m_scene, localID), m_scene, new ExtensionHandler(m_extensions), m_microthreads); | 170 | UUID owner = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
171 | SEUser securityUser = new SEUser(owner, "Name Unassigned"); | ||
172 | SecurityCredential creds = new SecurityCredential(securityUser, m_scene); | ||
173 | |||
174 | world = new World(m_scene, creds); | ||
175 | host = new Host(new SOPObject(m_scene, localID, creds), m_scene, new ExtensionHandler(m_extensions), | ||
176 | m_microthreads); | ||
171 | } | 177 | } |
172 | 178 | ||
173 | public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID) | 179 | public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID) |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs index 4638ad0..6ba5ccf 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs | |||
@@ -40,10 +40,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
40 | { | 40 | { |
41 | private readonly Scene m_scene; | 41 | private readonly Scene m_scene; |
42 | private readonly IEnumerator<EntityBase> m_sogEnum; | 42 | private readonly IEnumerator<EntityBase> m_sogEnum; |
43 | private readonly ISecurityCredential m_security; | ||
43 | 44 | ||
44 | public IObjEnum(Scene scene) | 45 | public IObjEnum(Scene scene, ISecurityCredential security) |
45 | { | 46 | { |
46 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_security = security; | ||
47 | m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator(); | 49 | m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator(); |
48 | } | 50 | } |
49 | 51 | ||
@@ -66,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
66 | { | 68 | { |
67 | get | 69 | get |
68 | { | 70 | { |
69 | return new SOPObject(m_scene, m_sogEnum.Current.LocalId); | 71 | return new SOPObject(m_scene, m_sogEnum.Current.LocalId, m_security); |
70 | } | 72 | } |
71 | } | 73 | } |
72 | 74 | ||
@@ -79,17 +81,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
79 | public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor | 81 | public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor |
80 | { | 82 | { |
81 | private readonly Scene m_scene; | 83 | private readonly Scene m_scene; |
84 | private readonly ISecurityCredential m_security; | ||
82 | 85 | ||
83 | public ObjectAccessor(Scene scene) | 86 | public ObjectAccessor(Scene scene, ISecurityCredential security) |
84 | { | 87 | { |
85 | m_scene = scene; | 88 | m_scene = scene; |
89 | m_security = security; | ||
86 | } | 90 | } |
87 | 91 | ||
88 | public IObject this[int index] | 92 | public IObject this[int index] |
89 | { | 93 | { |
90 | get | 94 | get |
91 | { | 95 | { |
92 | return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId); | 96 | return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId, m_security); |
93 | } | 97 | } |
94 | } | 98 | } |
95 | 99 | ||
@@ -97,7 +101,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
97 | { | 101 | { |
98 | get | 102 | get |
99 | { | 103 | { |
100 | return new SOPObject(m_scene, m_scene.Entities[index].LocalId); | 104 | return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security); |
101 | } | 105 | } |
102 | } | 106 | } |
103 | 107 | ||
@@ -105,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
105 | { | 109 | { |
106 | get | 110 | get |
107 | { | 111 | { |
108 | return new SOPObject(m_scene, m_scene.Entities[index].LocalId); | 112 | return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security); |
109 | } | 113 | } |
110 | } | 114 | } |
111 | 115 | ||
@@ -117,20 +121,20 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
117 | public IObject Create(Vector3 position, Quaternion rotation) | 121 | public IObject Create(Vector3 position, Quaternion rotation) |
118 | { | 122 | { |
119 | 123 | ||
120 | SceneObjectGroup sog = m_scene.AddNewPrim(m_scene.RegionInfo.MasterAvatarAssignedUUID, | 124 | SceneObjectGroup sog = m_scene.AddNewPrim(m_security.owner.GlobalID, |
121 | UUID.Zero, | 125 | UUID.Zero, |
122 | position, | 126 | position, |
123 | rotation, | 127 | rotation, |
124 | PrimitiveBaseShape.CreateBox()); | 128 | PrimitiveBaseShape.CreateBox()); |
125 | 129 | ||
126 | IObject ret = new SOPObject(m_scene, sog.LocalId); | 130 | IObject ret = new SOPObject(m_scene, sog.LocalId, m_security); |
127 | 131 | ||
128 | return ret; | 132 | return ret; |
129 | } | 133 | } |
130 | 134 | ||
131 | public IEnumerator<IObject> GetEnumerator() | 135 | public IEnumerator<IObject> GetEnumerator() |
132 | { | 136 | { |
133 | return new IObjEnum(m_scene); | 137 | return new IObjEnum(m_scene, m_security); |
134 | } | 138 | } |
135 | 139 | ||
136 | IEnumerator IEnumerable.GetEnumerator() | 140 | IEnumerator IEnumerable.GetEnumerator() |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index bc26389..35b0a0f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Security; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
@@ -42,13 +43,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
42 | { | 43 | { |
43 | private readonly Scene m_rootScene; | 44 | private readonly Scene m_rootScene; |
44 | private readonly uint m_localID; | 45 | private readonly uint m_localID; |
46 | private readonly ISecurityCredential m_security; | ||
45 | 47 | ||
48 | [Obsolete("Replace with 'credential' constructor [security]")] | ||
46 | public SOPObject(Scene rootScene, uint localID) | 49 | public SOPObject(Scene rootScene, uint localID) |
47 | { | 50 | { |
48 | m_rootScene = rootScene; | 51 | m_rootScene = rootScene; |
49 | m_localID = localID; | 52 | m_localID = localID; |
50 | } | 53 | } |
51 | 54 | ||
55 | public SOPObject(Scene rootScene, uint localID, ISecurityCredential credential) | ||
56 | { | ||
57 | m_rootScene = rootScene; | ||
58 | m_localID = localID; | ||
59 | m_security = credential; | ||
60 | } | ||
61 | |||
52 | /// <summary> | 62 | /// <summary> |
53 | /// This needs to run very, very quickly. | 63 | /// This needs to run very, very quickly. |
54 | /// It is utilized in nearly every property and method. | 64 | /// It is utilized in nearly every property and method. |
@@ -59,6 +69,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
59 | return m_rootScene.GetSceneObjectPart(m_localID); | 69 | return m_rootScene.GetSceneObjectPart(m_localID); |
60 | } | 70 | } |
61 | 71 | ||
72 | private bool CanEdit() | ||
73 | { | ||
74 | if(!m_security.CanEditObject(this)) | ||
75 | { | ||
76 | throw new SecurityException("Insufficient Permission to edit object with UUID [" + GetSOP().UUID + "]"); | ||
77 | } | ||
78 | return true; | ||
79 | } | ||
80 | |||
62 | #region OnTouch | 81 | #region OnTouch |
63 | 82 | ||
64 | private event OnTouchDelegate _OnTouch; | 83 | private event OnTouchDelegate _OnTouch; |
@@ -68,14 +87,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
68 | { | 87 | { |
69 | add | 88 | add |
70 | { | 89 | { |
71 | if (!_OnTouchActive) | 90 | if (CanEdit()) |
72 | { | 91 | { |
73 | GetSOP().Flags |= PrimFlags.Touch; | 92 | if (!_OnTouchActive) |
74 | _OnTouchActive = true; | 93 | { |
75 | m_rootScene.EventManager.OnObjectGrab += EventManager_OnObjectGrab; | 94 | GetSOP().Flags |= PrimFlags.Touch; |
95 | _OnTouchActive = true; | ||
96 | m_rootScene.EventManager.OnObjectGrab += EventManager_OnObjectGrab; | ||
97 | } | ||
98 | |||
99 | _OnTouch += value; | ||
76 | } | 100 | } |
77 | |||
78 | _OnTouch += value; | ||
79 | } | 101 | } |
80 | remove | 102 | remove |
81 | { | 103 | { |
@@ -95,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
95 | if (_OnTouchActive && m_localID == localID) | 117 | if (_OnTouchActive && m_localID == localID) |
96 | { | 118 | { |
97 | TouchEventArgs e = new TouchEventArgs(); | 119 | TouchEventArgs e = new TouchEventArgs(); |
98 | e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId); | 120 | e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId, m_security); |
99 | e.TouchBiNormal = surfaceArgs.Binormal; | 121 | e.TouchBiNormal = surfaceArgs.Binormal; |
100 | e.TouchMaterialIndex = surfaceArgs.FaceIndex; | 122 | e.TouchMaterialIndex = surfaceArgs.FaceIndex; |
101 | e.TouchNormal = surfaceArgs.Normal; | 123 | e.TouchNormal = surfaceArgs.Normal; |
@@ -130,13 +152,21 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
130 | public string Name | 152 | public string Name |
131 | { | 153 | { |
132 | get { return GetSOP().Name; } | 154 | get { return GetSOP().Name; } |
133 | set { GetSOP().Name = value; } | 155 | set |
156 | { | ||
157 | if (CanEdit()) | ||
158 | GetSOP().Name = value; | ||
159 | } | ||
134 | } | 160 | } |
135 | 161 | ||
136 | public string Description | 162 | public string Description |
137 | { | 163 | { |
138 | get { return GetSOP().Description; } | 164 | get { return GetSOP().Description; } |
139 | set { GetSOP().Description = value; } | 165 | set |
166 | { | ||
167 | if (CanEdit()) | ||
168 | GetSOP().Description = value; | ||
169 | } | ||
140 | } | 170 | } |
141 | 171 | ||
142 | public IObject[] Children | 172 | public IObject[] Children |
@@ -151,7 +181,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
151 | int i = 0; | 181 | int i = 0; |
152 | foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children) | 182 | foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children) |
153 | { | 183 | { |
154 | rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId); | 184 | rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security); |
155 | } | 185 | } |
156 | 186 | ||
157 | return rets; | 187 | return rets; |
@@ -160,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
160 | 190 | ||
161 | public IObject Root | 191 | public IObject Root |
162 | { | 192 | { |
163 | get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId); } | 193 | get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId, m_security); } |
164 | } | 194 | } |
165 | 195 | ||
166 | public IObjectMaterial[] Materials | 196 | public IObjectMaterial[] Materials |
@@ -182,7 +212,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
182 | public Vector3 Scale | 212 | public Vector3 Scale |
183 | { | 213 | { |
184 | get { return GetSOP().Scale; } | 214 | get { return GetSOP().Scale; } |
185 | set { GetSOP().Scale = value; } | 215 | set |
216 | { | ||
217 | if (CanEdit()) | ||
218 | GetSOP().Scale = value; | ||
219 | } | ||
186 | } | 220 | } |
187 | 221 | ||
188 | public Quaternion WorldRotation | 222 | public Quaternion WorldRotation |
@@ -202,15 +236,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
202 | get { return GetSOP().AbsolutePosition; } | 236 | get { return GetSOP().AbsolutePosition; } |
203 | set | 237 | set |
204 | { | 238 | { |
205 | SceneObjectPart pos = GetSOP(); | 239 | if (CanEdit()) |
206 | pos.UpdateOffSet(value - pos.AbsolutePosition); | 240 | { |
241 | SceneObjectPart pos = GetSOP(); | ||
242 | pos.UpdateOffSet(value - pos.AbsolutePosition); | ||
243 | } | ||
207 | } | 244 | } |
208 | } | 245 | } |
209 | 246 | ||
210 | public Vector3 OffsetPosition | 247 | public Vector3 OffsetPosition |
211 | { | 248 | { |
212 | get { return GetSOP().OffsetPosition; } | 249 | get { return GetSOP().OffsetPosition; } |
213 | set { GetSOP().OffsetPosition = value; } | 250 | set |
251 | { | ||
252 | if (CanEdit()) | ||
253 | { | ||
254 | GetSOP().OffsetPosition = value; | ||
255 | } | ||
256 | } | ||
214 | } | 257 | } |
215 | 258 | ||
216 | public Vector3 SitTarget | 259 | public Vector3 SitTarget |
@@ -310,8 +353,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
310 | 353 | ||
311 | public void Say(string msg) | 354 | public void Say(string msg) |
312 | { | 355 | { |
313 | SceneObjectPart sop = GetSOP(); | 356 | if (!CanEdit()) |
357 | return; | ||
314 | 358 | ||
359 | SceneObjectPart sop = GetSOP(); | ||
315 | m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false); | 360 | m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false); |
316 | } | 361 | } |
317 | 362 | ||
@@ -503,6 +548,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
503 | } | 548 | } |
504 | set | 549 | set |
505 | { | 550 | { |
551 | if (!CanEdit()) | ||
552 | return; | ||
553 | |||
506 | GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z); | 554 | GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z); |
507 | } | 555 | } |
508 | } | 556 | } |
@@ -516,6 +564,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
516 | } | 564 | } |
517 | set | 565 | set |
518 | { | 566 | { |
567 | if (!CanEdit()) | ||
568 | return; | ||
569 | |||
519 | GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); | 570 | GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); |
520 | } | 571 | } |
521 | } | 572 | } |
@@ -529,6 +580,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
529 | } | 580 | } |
530 | set | 581 | set |
531 | { | 582 | { |
583 | if (!CanEdit()) | ||
584 | return; | ||
585 | |||
532 | GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z); | 586 | GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z); |
533 | } | 587 | } |
534 | } | 588 | } |
@@ -551,27 +605,44 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
551 | } | 605 | } |
552 | set | 606 | set |
553 | { | 607 | { |
608 | if (!CanEdit()) | ||
609 | return; | ||
610 | |||
554 | GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z); | 611 | GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z); |
555 | } | 612 | } |
556 | } | 613 | } |
557 | 614 | ||
558 | public bool FloatOnWater | 615 | public bool FloatOnWater |
559 | { | 616 | { |
560 | set { GetSOP().PhysActor.FloatOnWater = value; } | 617 | set |
618 | { | ||
619 | if (!CanEdit()) | ||
620 | return; | ||
621 | GetSOP().PhysActor.FloatOnWater = value; | ||
622 | } | ||
561 | } | 623 | } |
562 | 624 | ||
563 | public void AddForce(Vector3 force, bool pushforce) | 625 | public void AddForce(Vector3 force, bool pushforce) |
564 | { | 626 | { |
627 | if (!CanEdit()) | ||
628 | return; | ||
629 | |||
565 | GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); | 630 | GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); |
566 | } | 631 | } |
567 | 632 | ||
568 | public void AddAngularForce(Vector3 force, bool pushforce) | 633 | public void AddAngularForce(Vector3 force, bool pushforce) |
569 | { | 634 | { |
635 | if (!CanEdit()) | ||
636 | return; | ||
637 | |||
570 | GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); | 638 | GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce); |
571 | } | 639 | } |
572 | 640 | ||
573 | public void SetMomentum(Vector3 momentum) | 641 | public void SetMomentum(Vector3 momentum) |
574 | { | 642 | { |
643 | if (!CanEdit()) | ||
644 | return; | ||
645 | |||
575 | GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z)); | 646 | GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z)); |
576 | } | 647 | } |
577 | 648 | ||
@@ -586,6 +657,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
586 | get { return m_sculptMap; } | 657 | get { return m_sculptMap; } |
587 | set | 658 | set |
588 | { | 659 | { |
660 | if (!CanEdit()) | ||
661 | return; | ||
662 | |||
589 | m_sculptMap = value; | 663 | m_sculptMap = value; |
590 | SetPrimitiveSculpted(SculptMap, (byte) SculptType); | 664 | SetPrimitiveSculpted(SculptMap, (byte) SculptType); |
591 | } | 665 | } |
@@ -598,6 +672,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
598 | get { return m_sculptType; } | 672 | get { return m_sculptType; } |
599 | set | 673 | set |
600 | { | 674 | { |
675 | if(!CanEdit()) | ||
676 | return; | ||
677 | |||
601 | m_sculptType = value; | 678 | m_sculptType = value; |
602 | SetPrimitiveSculpted(SculptMap, (byte) SculptType); | 679 | SetPrimitiveSculpted(SculptMap, (byte) SculptType); |
603 | } | 680 | } |
@@ -654,6 +731,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
654 | 731 | ||
655 | public void Play(UUID asset, double volume) | 732 | public void Play(UUID asset, double volume) |
656 | { | 733 | { |
734 | if (!CanEdit()) | ||
735 | return; | ||
736 | |||
657 | GetSOP().SendSound(asset.ToString(), volume, true, 0); | 737 | GetSOP().SendSound(asset.ToString(), volume, true, 0); |
658 | } | 738 | } |
659 | 739 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index ce2d339..4600836 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -42,11 +42,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
42 | { | 42 | { |
43 | private readonly Scene m_rootScene; | 43 | private readonly Scene m_rootScene; |
44 | private readonly UUID m_ID; | 44 | private readonly UUID m_ID; |
45 | private readonly ISecurityCredential m_security; | ||
45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 47 | ||
47 | public SPAvatar(Scene scene, UUID ID) | 48 | public SPAvatar(Scene scene, UUID ID, ISecurityCredential security) |
48 | { | 49 | { |
49 | m_rootScene = scene; | 50 | m_rootScene = scene; |
51 | m_security = security; | ||
50 | m_ID = ID; | 52 | m_ID = ID; |
51 | } | 53 | } |
52 | 54 | ||
@@ -84,7 +86,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
84 | foreach (DictionaryEntry element in internalAttachments) | 86 | foreach (DictionaryEntry element in internalAttachments) |
85 | { | 87 | { |
86 | Hashtable attachInfo = (Hashtable)element.Value; | 88 | Hashtable attachInfo = (Hashtable)element.Value; |
87 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"]))); | 89 | attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int) element.Key, |
90 | new UUID((string) attachInfo["item"]), | ||
91 | new UUID((string) attachInfo["asset"]), m_security)); | ||
88 | } | 92 | } |
89 | } | 93 | } |
90 | 94 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs index 9b684fe..570459a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs | |||
@@ -39,10 +39,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
39 | private readonly int m_location; | 39 | private readonly int m_location; |
40 | //private readonly UUID m_itemId; | 40 | //private readonly UUID m_itemId; |
41 | private readonly UUID m_assetId; | 41 | private readonly UUID m_assetId; |
42 | |||
43 | private readonly ISecurityCredential m_security; | ||
42 | 44 | ||
43 | public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId) | 45 | public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId, ISecurityCredential security) |
44 | { | 46 | { |
45 | m_rootScene = rootScene; | 47 | m_rootScene = rootScene; |
48 | m_security = security; | ||
46 | //m_parent = self; | 49 | //m_parent = self; |
47 | m_location = location; | 50 | m_location = location; |
48 | //m_itemId = itemId; | 51 | //m_itemId = itemId; |
@@ -55,7 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
55 | { | 58 | { |
56 | get | 59 | get |
57 | { | 60 | { |
58 | return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId); | 61 | return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId, m_security); |
59 | } | 62 | } |
60 | } | 63 | } |
61 | } | 64 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs new file mode 100644 index 0000000..bc7f6cb --- /dev/null +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs | |||
@@ -0,0 +1,62 @@ | |||
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 OpenSimulator 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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Region.Framework.Scenes; | ||
33 | |||
34 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | ||
35 | { | ||
36 | class SecurityCredential : ISecurityCredential | ||
37 | { | ||
38 | private readonly ISocialEntity m_owner; | ||
39 | private readonly Scene m_scene; | ||
40 | |||
41 | public SecurityCredential(ISocialEntity m_owner, Scene m_scene) | ||
42 | { | ||
43 | this.m_owner = m_owner; | ||
44 | this.m_scene = m_scene; | ||
45 | } | ||
46 | |||
47 | public ISocialEntity owner | ||
48 | { | ||
49 | get { return m_owner; } | ||
50 | } | ||
51 | |||
52 | public bool CanEditObject(IObject target) | ||
53 | { | ||
54 | return m_scene.Permissions.CanEditObject(target.GlobalID, m_owner.GlobalID); | ||
55 | } | ||
56 | |||
57 | public bool CanEditTerrain(int x, int y) | ||
58 | { | ||
59 | return m_scene.Permissions.CanTerraformLand(m_owner.GlobalID, new Vector3(x, y, 0)); | ||
60 | } | ||
61 | } | ||
62 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 1ec4a33..da5ea0d 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |||
@@ -37,15 +37,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
37 | public class World : System.MarshalByRefObject, IWorld, IWorldAudio | 37 | public class World : System.MarshalByRefObject, IWorld, IWorldAudio |
38 | { | 38 | { |
39 | private readonly Scene m_internalScene; | 39 | private readonly Scene m_internalScene; |
40 | private readonly ISecurityCredential m_security; | ||
40 | private readonly Heightmap m_heights; | 41 | private readonly Heightmap m_heights; |
41 | 42 | ||
42 | private readonly ObjectAccessor m_objs; | 43 | private readonly ObjectAccessor m_objs; |
43 | 44 | ||
44 | public World(Scene internalScene) | 45 | public World(Scene internalScene, ISecurityCredential securityCredential) |
45 | { | 46 | { |
47 | m_security = securityCredential; | ||
46 | m_internalScene = internalScene; | 48 | m_internalScene = internalScene; |
47 | m_heights = new Heightmap(m_internalScene); | 49 | m_heights = new Heightmap(m_internalScene); |
48 | m_objs = new ObjectAccessor(m_internalScene); | 50 | m_objs = new ObjectAccessor(m_internalScene, securityCredential); |
49 | } | 51 | } |
50 | 52 | ||
51 | #region Events | 53 | #region Events |
@@ -84,7 +86,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
84 | if (_OnNewUser != null) | 86 | if (_OnNewUser != null) |
85 | { | 87 | { |
86 | NewUserEventArgs e = new NewUserEventArgs(); | 88 | NewUserEventArgs e = new NewUserEventArgs(); |
87 | e.Avatar = new SPAvatar(m_internalScene, presence.UUID); | 89 | e.Avatar = new SPAvatar(m_internalScene, presence.UUID, m_security); |
88 | _OnNewUser(this, e); | 90 | _OnNewUser(this, e); |
89 | } | 91 | } |
90 | } | 92 | } |
@@ -144,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
144 | if (chat.Sender == null && chat.SenderObject != null) | 146 | if (chat.Sender == null && chat.SenderObject != null) |
145 | { | 147 | { |
146 | ChatEventArgs e = new ChatEventArgs(); | 148 | ChatEventArgs e = new ChatEventArgs(); |
147 | e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId); | 149 | e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security); |
148 | e.Text = chat.Message; | 150 | e.Text = chat.Message; |
149 | 151 | ||
150 | _OnChat(this, e); | 152 | _OnChat(this, e); |
@@ -154,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
154 | if (chat.Sender != null && chat.SenderObject == null) | 156 | if (chat.Sender != null && chat.SenderObject == null) |
155 | { | 157 | { |
156 | ChatEventArgs e = new ChatEventArgs(); | 158 | ChatEventArgs e = new ChatEventArgs(); |
157 | e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID); | 159 | e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security); |
158 | e.Text = chat.Message; | 160 | e.Text = chat.Message; |
159 | 161 | ||
160 | _OnChat(this, e); | 162 | _OnChat(this, e); |
@@ -207,7 +209,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
207 | for (int i = 0; i < ents.Count; i++) | 209 | for (int i = 0; i < ents.Count; i++) |
208 | { | 210 | { |
209 | EntityBase ent = ents[i]; | 211 | EntityBase ent = ents[i]; |
210 | rets[i] = new SPAvatar(m_internalScene, ent.UUID); | 212 | rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security); |
211 | } | 213 | } |
212 | 214 | ||
213 | return rets; | 215 | return rets; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 4a8ba8c..f0bdf3b 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -213,6 +213,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
213 | public event UpdateShape OnUpdatePrimShape; | 213 | public event UpdateShape OnUpdatePrimShape; |
214 | public event ObjectExtraParams OnUpdateExtraParams; | 214 | public event ObjectExtraParams OnUpdateExtraParams; |
215 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | 215 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; |
216 | public event ObjectRequest OnObjectRequest; | ||
216 | public event ObjectSelect OnObjectSelect; | 217 | public event ObjectSelect OnObjectSelect; |
217 | public event GenericCall7 OnObjectDescription; | 218 | public event GenericCall7 OnObjectDescription; |
218 | public event GenericCall7 OnObjectName; | 219 | public event GenericCall7 OnObjectName; |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 8fdc5a7..b7030f1 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -347,18 +347,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
347 | #endif | 347 | #endif |
348 | } | 348 | } |
349 | 349 | ||
350 | // zero out a heightmap array float array (single dimention [flattened])) | 350 | // zero out a heightmap array float array (single dimension [flattened])) |
351 | if ((int)Constants.RegionSize == 256) | 351 | if ((int)Constants.RegionSize == 256) |
352 | _heightmap = new float[514*514]; | 352 | _heightmap = new float[514*514]; |
353 | else | 353 | else |
354 | _heightmap = new float[(((int)Constants.RegionSize + 2) * ((int)Constants.RegionSize + 2))]; | 354 | _heightmap = new float[(((int)Constants.RegionSize + 2) * ((int)Constants.RegionSize + 2))]; |
355 | _watermap = new float[258 * 258]; | 355 | _watermap = new float[258 * 258]; |
356 | 356 | ||
357 | |||
358 | |||
359 | |||
360 | |||
361 | |||
362 | // Zero out the prim spaces array (we split our space into smaller spaces so | 357 | // Zero out the prim spaces array (we split our space into smaller spaces so |
363 | // we can hit test less. | 358 | // we can hit test less. |
364 | } | 359 | } |
@@ -2197,7 +2192,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2197 | } | 2192 | } |
2198 | 2193 | ||
2199 | /// <summary> | 2194 | /// <summary> |
2200 | /// Called when a static prim moves. Allocates a space for the prim based on it's position | 2195 | /// Called when a static prim moves. Allocates a space for the prim based on its position |
2201 | /// </summary> | 2196 | /// </summary> |
2202 | /// <param name="geom">the pointer to the geom that moved</param> | 2197 | /// <param name="geom">the pointer to the geom that moved</param> |
2203 | /// <param name="pos">the position that the geom moved to</param> | 2198 | /// <param name="pos">the position that the geom moved to</param> |
@@ -3013,7 +3008,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3013 | float[] returnarr = new float[262144]; | 3008 | float[] returnarr = new float[262144]; |
3014 | float[,] resultarr = new float[m_regionWidth, m_regionHeight]; | 3009 | float[,] resultarr = new float[m_regionWidth, m_regionHeight]; |
3015 | 3010 | ||
3016 | // Filling out the array into it's multi-dimentional components | 3011 | // Filling out the array into its multi-dimensional components |
3017 | for (int y = 0; y < m_regionHeight; y++) | 3012 | for (int y = 0; y < m_regionHeight; y++) |
3018 | { | 3013 | { |
3019 | for (int x = 0; x < m_regionWidth; x++) | 3014 | for (int x = 0; x < m_regionWidth; x++) |
@@ -3126,7 +3121,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3126 | float[] returnarr = new float[262144]; | 3121 | float[] returnarr = new float[262144]; |
3127 | float[,] resultarr = new float[m_regionWidth,m_regionHeight]; | 3122 | float[,] resultarr = new float[m_regionWidth,m_regionHeight]; |
3128 | 3123 | ||
3129 | // Filling out the array into it's multi-dimentional components | 3124 | // Filling out the array into its multi-dimensional components |
3130 | for (int y = 0; y < m_regionHeight; y++) | 3125 | for (int y = 0; y < m_regionHeight; y++) |
3131 | { | 3126 | { |
3132 | for (int x = 0; x < m_regionWidth; x++) | 3127 | for (int x = 0; x < m_regionWidth; x++) |