aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs25
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs14
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs51
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs52
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs29
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatar.cs13
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs15
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs105
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatarAttachment.cs7
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs45
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs8
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs1
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs13
22 files changed, 303 insertions, 135 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6dda5aa..06bea3d 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;
@@ -5936,6 +5938,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5936 5938
5937 break; 5939 break;
5938 5940
5941 case PacketType.RequestMultipleObjects:
5942 RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack;
5943
5944 #region Packet Session and User Check
5945 if (m_checkPackets)
5946 {
5947 if (incomingRequest.AgentData.SessionID != SessionId ||
5948 incomingRequest.AgentData.AgentID != AgentId)
5949 break;
5950 }
5951 #endregion
5952
5953 handlerObjectRequest = null;
5954
5955 for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
5956 {
5957 handlerObjectRequest = OnObjectRequest;
5958 if (handlerObjectRequest != null)
5959 {
5960 handlerObjectRequest(incomingRequest.ObjectData[i].ID, this);
5961 }
5962 }
5963 break;
5939 case PacketType.ObjectSelect: 5964 case PacketType.ObjectSelect:
5940 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; 5965 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
5941 5966
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 bcc9bcb..3dfe4fe 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 b9edd6e..33166df 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 7a45e3b..3bd079a 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 00c59ca..708c455 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 c95667a..cf716e8 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
index 464723e..533d176 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ISecurityCredential.cs
@@ -1,7 +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
1namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 28namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
2{ 29{
3 public interface ISecurityCredential 30 public interface ISecurityCredential
4 { 31 {
5 ISocialEntity owner { get; } 32 ISocialEntity owner { get; }
33 bool CanEditObject(IObject target);
34 bool CanEditTerrain(int x, int y);
6 } 35 }
7} \ No newline at end of file 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
33namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 33namespace 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 @@
1namespace 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 0cc7930..6daae29 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
169 // UUID should be changed to object owner. 169 // UUID should be changed to object owner.
170 UUID owner = m_scene.RegionInfo.MasterAvatarAssignedUUID; 170 UUID owner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
171 SEUser securityUser = new SEUser(owner, "Name Unassigned"); 171 SEUser securityUser = new SEUser(owner, "Name Unassigned");
172 SecurityCredential creds = new SecurityCredential(securityUser); 172 SecurityCredential creds = new SecurityCredential(securityUser, m_scene);
173 173
174 world = new World(m_scene, creds); 174 world = new World(m_scene, creds);
175 host = new Host(new SOPObject(m_scene, localID, creds), m_scene, new ExtensionHandler(m_extensions), 175 host = new Host(new SOPObject(m_scene, localID, creds), m_scene, new ExtensionHandler(m_extensions),
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index fa9ef53..35b0a0f 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Security;
30using OpenMetaverse; 31using OpenMetaverse;
31using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -68,6 +69,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
68 return m_rootScene.GetSceneObjectPart(m_localID); 69 return m_rootScene.GetSceneObjectPart(m_localID);
69 } 70 }
70 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
71 #region OnTouch 81 #region OnTouch
72 82
73 private event OnTouchDelegate _OnTouch; 83 private event OnTouchDelegate _OnTouch;
@@ -77,14 +87,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
77 { 87 {
78 add 88 add
79 { 89 {
80 if (!_OnTouchActive) 90 if (CanEdit())
81 { 91 {
82 GetSOP().Flags |= PrimFlags.Touch; 92 if (!_OnTouchActive)
83 _OnTouchActive = true; 93 {
84 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;
85 } 100 }
86
87 _OnTouch += value;
88 } 101 }
89 remove 102 remove
90 { 103 {
@@ -104,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
104 if (_OnTouchActive && m_localID == localID) 117 if (_OnTouchActive && m_localID == localID)
105 { 118 {
106 TouchEventArgs e = new TouchEventArgs(); 119 TouchEventArgs e = new TouchEventArgs();
107 e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId); 120 e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId, m_security);
108 e.TouchBiNormal = surfaceArgs.Binormal; 121 e.TouchBiNormal = surfaceArgs.Binormal;
109 e.TouchMaterialIndex = surfaceArgs.FaceIndex; 122 e.TouchMaterialIndex = surfaceArgs.FaceIndex;
110 e.TouchNormal = surfaceArgs.Normal; 123 e.TouchNormal = surfaceArgs.Normal;
@@ -139,13 +152,21 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
139 public string Name 152 public string Name
140 { 153 {
141 get { return GetSOP().Name; } 154 get { return GetSOP().Name; }
142 set { GetSOP().Name = value; } 155 set
156 {
157 if (CanEdit())
158 GetSOP().Name = value;
159 }
143 } 160 }
144 161
145 public string Description 162 public string Description
146 { 163 {
147 get { return GetSOP().Description; } 164 get { return GetSOP().Description; }
148 set { GetSOP().Description = value; } 165 set
166 {
167 if (CanEdit())
168 GetSOP().Description = value;
169 }
149 } 170 }
150 171
151 public IObject[] Children 172 public IObject[] Children
@@ -160,7 +181,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
160 int i = 0; 181 int i = 0;
161 foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children) 182 foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children)
162 { 183 {
163 rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId); 184 rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security);
164 } 185 }
165 186
166 return rets; 187 return rets;
@@ -169,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
169 190
170 public IObject Root 191 public IObject Root
171 { 192 {
172 get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId); } 193 get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId, m_security); }
173 } 194 }
174 195
175 public IObjectMaterial[] Materials 196 public IObjectMaterial[] Materials
@@ -191,7 +212,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
191 public Vector3 Scale 212 public Vector3 Scale
192 { 213 {
193 get { return GetSOP().Scale; } 214 get { return GetSOP().Scale; }
194 set { GetSOP().Scale = value; } 215 set
216 {
217 if (CanEdit())
218 GetSOP().Scale = value;
219 }
195 } 220 }
196 221
197 public Quaternion WorldRotation 222 public Quaternion WorldRotation
@@ -211,15 +236,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
211 get { return GetSOP().AbsolutePosition; } 236 get { return GetSOP().AbsolutePosition; }
212 set 237 set
213 { 238 {
214 SceneObjectPart pos = GetSOP(); 239 if (CanEdit())
215 pos.UpdateOffSet(value - pos.AbsolutePosition); 240 {
241 SceneObjectPart pos = GetSOP();
242 pos.UpdateOffSet(value - pos.AbsolutePosition);
243 }
216 } 244 }
217 } 245 }
218 246
219 public Vector3 OffsetPosition 247 public Vector3 OffsetPosition
220 { 248 {
221 get { return GetSOP().OffsetPosition; } 249 get { return GetSOP().OffsetPosition; }
222 set { GetSOP().OffsetPosition = value; } 250 set
251 {
252 if (CanEdit())
253 {
254 GetSOP().OffsetPosition = value;
255 }
256 }
223 } 257 }
224 258
225 public Vector3 SitTarget 259 public Vector3 SitTarget
@@ -319,8 +353,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
319 353
320 public void Say(string msg) 354 public void Say(string msg)
321 { 355 {
322 SceneObjectPart sop = GetSOP(); 356 if (!CanEdit())
357 return;
323 358
359 SceneObjectPart sop = GetSOP();
324 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);
325 } 361 }
326 362
@@ -512,6 +548,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
512 } 548 }
513 set 549 set
514 { 550 {
551 if (!CanEdit())
552 return;
553
515 GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z); 554 GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z);
516 } 555 }
517 } 556 }
@@ -525,6 +564,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
525 } 564 }
526 set 565 set
527 { 566 {
567 if (!CanEdit())
568 return;
569
528 GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); 570 GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
529 } 571 }
530 } 572 }
@@ -538,6 +580,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
538 } 580 }
539 set 581 set
540 { 582 {
583 if (!CanEdit())
584 return;
585
541 GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z); 586 GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z);
542 } 587 }
543 } 588 }
@@ -560,27 +605,44 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
560 } 605 }
561 set 606 set
562 { 607 {
608 if (!CanEdit())
609 return;
610
563 GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z); 611 GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z);
564 } 612 }
565 } 613 }
566 614
567 public bool FloatOnWater 615 public bool FloatOnWater
568 { 616 {
569 set { GetSOP().PhysActor.FloatOnWater = value; } 617 set
618 {
619 if (!CanEdit())
620 return;
621 GetSOP().PhysActor.FloatOnWater = value;
622 }
570 } 623 }
571 624
572 public void AddForce(Vector3 force, bool pushforce) 625 public void AddForce(Vector3 force, bool pushforce)
573 { 626 {
627 if (!CanEdit())
628 return;
629
574 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);
575 } 631 }
576 632
577 public void AddAngularForce(Vector3 force, bool pushforce) 633 public void AddAngularForce(Vector3 force, bool pushforce)
578 { 634 {
635 if (!CanEdit())
636 return;
637
579 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);
580 } 639 }
581 640
582 public void SetMomentum(Vector3 momentum) 641 public void SetMomentum(Vector3 momentum)
583 { 642 {
643 if (!CanEdit())
644 return;
645
584 GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z)); 646 GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z));
585 } 647 }
586 648
@@ -595,6 +657,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
595 get { return m_sculptMap; } 657 get { return m_sculptMap; }
596 set 658 set
597 { 659 {
660 if (!CanEdit())
661 return;
662
598 m_sculptMap = value; 663 m_sculptMap = value;
599 SetPrimitiveSculpted(SculptMap, (byte) SculptType); 664 SetPrimitiveSculpted(SculptMap, (byte) SculptType);
600 } 665 }
@@ -607,6 +672,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
607 get { return m_sculptType; } 672 get { return m_sculptType; }
608 set 673 set
609 { 674 {
675 if(!CanEdit())
676 return;
677
610 m_sculptType = value; 678 m_sculptType = value;
611 SetPrimitiveSculpted(SculptMap, (byte) SculptType); 679 SetPrimitiveSculpted(SculptMap, (byte) SculptType);
612 } 680 }
@@ -663,6 +731,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
663 731
664 public void Play(UUID asset, double volume) 732 public void Play(UUID asset, double volume)
665 { 733 {
734 if (!CanEdit())
735 return;
736
666 GetSOP().SendSound(asset.ToString(), volume, true, 0); 737 GetSOP().SendSound(asset.ToString(), volume, true, 0);
667 } 738 }
668 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
index bd4440c..bc7f6cb 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SecurityCredential.cs
@@ -1,21 +1,62 @@
1using System; 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
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Text; 30using System.Text;
31using OpenMetaverse;
32using OpenSim.Region.Framework.Scenes;
4 33
5namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 34namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
6{ 35{
7 class SecurityCredential : ISecurityCredential 36 class SecurityCredential : ISecurityCredential
8 { 37 {
9 private readonly ISocialEntity m_owner; 38 private readonly ISocialEntity m_owner;
39 private readonly Scene m_scene;
10 40
11 public SecurityCredential(ISocialEntity m_owner) 41 public SecurityCredential(ISocialEntity m_owner, Scene m_scene)
12 { 42 {
13 this.m_owner = m_owner; 43 this.m_owner = m_owner;
44 this.m_scene = m_scene;
14 } 45 }
15 46
16 public ISocialEntity owner 47 public ISocialEntity owner
17 { 48 {
18 get { return m_owner; } 49 get { return m_owner; }
19 } 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 }
20 } 61 }
21} 62}
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
index a34684f..da5ea0d 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
86 if (_OnNewUser != null) 86 if (_OnNewUser != null)
87 { 87 {
88 NewUserEventArgs e = new NewUserEventArgs(); 88 NewUserEventArgs e = new NewUserEventArgs();
89 e.Avatar = new SPAvatar(m_internalScene, presence.UUID); 89 e.Avatar = new SPAvatar(m_internalScene, presence.UUID, m_security);
90 _OnNewUser(this, e); 90 _OnNewUser(this, e);
91 } 91 }
92 } 92 }
@@ -146,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
146 if (chat.Sender == null && chat.SenderObject != null) 146 if (chat.Sender == null && chat.SenderObject != null)
147 { 147 {
148 ChatEventArgs e = new ChatEventArgs(); 148 ChatEventArgs e = new ChatEventArgs();
149 e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId); 149 e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security);
150 e.Text = chat.Message; 150 e.Text = chat.Message;
151 151
152 _OnChat(this, e); 152 _OnChat(this, e);
@@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
156 if (chat.Sender != null && chat.SenderObject == null) 156 if (chat.Sender != null && chat.SenderObject == null)
157 { 157 {
158 ChatEventArgs e = new ChatEventArgs(); 158 ChatEventArgs e = new ChatEventArgs();
159 e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID); 159 e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security);
160 e.Text = chat.Message; 160 e.Text = chat.Message;
161 161
162 _OnChat(this, e); 162 _OnChat(this, e);
@@ -209,7 +209,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
209 for (int i = 0; i < ents.Count; i++) 209 for (int i = 0; i < ents.Count; i++)
210 { 210 {
211 EntityBase ent = ents[i]; 211 EntityBase ent = ents[i];
212 rets[i] = new SPAvatar(m_internalScene, ent.UUID); 212 rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security);
213 } 213 }
214 214
215 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++)