diff options
author | Justin Clark-Casey (justincc) | 2012-02-24 23:35:47 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-24 23:35:59 +0000 |
commit | dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a (patch) | |
tree | 60020a679a229d078ce3be2f933025c81c677d74 /OpenSim/Region/Framework/Scenes | |
parent | Amend to last commit: synchronize access to queues. (diff) | |
parent | llGetLinkMedia, llSetLinkMedia, llClearLinkMedia implementation mantis: http:... (diff) | |
download | opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.zip opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.gz opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.bz2 opensim-SC_OLD-dafcb3bcd7eef4fbda8412cf6d16715fbb8dbd5a.tar.xz |
Merge branch 'master' into 0.7.3-post-fixes
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 82 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 91 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 |
6 files changed, 148 insertions, 64 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index d31d380..569c235 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -173,6 +173,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
173 | public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); | 173 | public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); |
174 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; | 174 | public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; |
175 | 175 | ||
176 | public delegate void AvatarAppearanceChange(ScenePresence avatar); | ||
177 | public event AvatarAppearanceChange OnAvatarAppearanceChange; | ||
178 | |||
176 | public event Action<ScenePresence> OnSignificantClientMovement; | 179 | public event Action<ScenePresence> OnSignificantClientMovement; |
177 | 180 | ||
178 | public delegate void IncomingInstantMessage(GridInstantMessage message); | 181 | public delegate void IncomingInstantMessage(GridInstantMessage message); |
@@ -184,10 +187,62 @@ namespace OpenSim.Region.Framework.Scenes | |||
184 | 187 | ||
185 | public event ClientClosed OnClientClosed; | 188 | public event ClientClosed OnClientClosed; |
186 | 189 | ||
190 | // Fired when a script is created | ||
191 | // The indication that a new script exists in this region. | ||
192 | public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); | ||
193 | public event NewScript OnNewScript; | ||
194 | public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) | ||
195 | { | ||
196 | NewScript handlerNewScript = OnNewScript; | ||
197 | if (handlerNewScript != null) | ||
198 | { | ||
199 | foreach (NewScript d in handlerNewScript.GetInvocationList()) | ||
200 | { | ||
201 | try | ||
202 | { | ||
203 | d(clientID, part, itemID); | ||
204 | } | ||
205 | catch (Exception e) | ||
206 | { | ||
207 | m_log.ErrorFormat( | ||
208 | "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}", | ||
209 | e.Message, e.StackTrace); | ||
210 | } | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset | ||
216 | // An indication that the script has changed. | ||
217 | public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); | ||
218 | public event UpdateScript OnUpdateScript; | ||
219 | public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) | ||
220 | { | ||
221 | UpdateScript handlerUpdateScript = OnUpdateScript; | ||
222 | if (handlerUpdateScript != null) | ||
223 | { | ||
224 | foreach (UpdateScript d in handlerUpdateScript.GetInvocationList()) | ||
225 | { | ||
226 | try | ||
227 | { | ||
228 | d(clientId, itemId, primId, isScriptRunning, newAssetID); | ||
229 | } | ||
230 | catch (Exception e) | ||
231 | { | ||
232 | m_log.ErrorFormat( | ||
233 | "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}", | ||
234 | e.Message, e.StackTrace); | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | |||
187 | /// <summary> | 240 | /// <summary> |
188 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | 241 | /// ScriptChangedEvent is fired when a scene object property that a script might be interested |
189 | /// inventory) changes. Only enough information is sent for the LSL changed event | 242 | /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event. |
190 | /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) | 243 | /// This is not an indication that the script has changed (see OnUpdateScript for that). |
244 | /// This event is sent to a script to tell it that some property changed on | ||
245 | /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed . | ||
191 | /// </summary> | 246 | /// </summary> |
192 | public event ScriptChangedEvent OnScriptChangedEvent; | 247 | public event ScriptChangedEvent OnScriptChangedEvent; |
193 | public delegate void ScriptChangedEvent(uint localID, uint change); | 248 | public delegate void ScriptChangedEvent(uint localID, uint change); |
@@ -1238,6 +1293,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1238 | } | 1293 | } |
1239 | } | 1294 | } |
1240 | 1295 | ||
1296 | public void TriggerAvatarAppearanceChanged(ScenePresence avatar) | ||
1297 | { | ||
1298 | AvatarAppearanceChange handler = OnAvatarAppearanceChange; | ||
1299 | if (handler != null) | ||
1300 | { | ||
1301 | foreach (AvatarAppearanceChange d in handler.GetInvocationList()) | ||
1302 | { | ||
1303 | try | ||
1304 | { | ||
1305 | d(avatar); | ||
1306 | } | ||
1307 | catch (Exception e) | ||
1308 | { | ||
1309 | m_log.ErrorFormat( | ||
1310 | "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}", | ||
1311 | e.Message, e.StackTrace); | ||
1312 | } | ||
1313 | } | ||
1314 | } | ||
1315 | } | ||
1316 | |||
1241 | public void TriggerIncomingInstantMessage(GridInstantMessage message) | 1317 | public void TriggerIncomingInstantMessage(GridInstantMessage message) |
1242 | { | 1318 | { |
1243 | IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; | 1319 | IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9d9729e..23f39a8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -283,6 +283,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
283 | { | 283 | { |
284 | remoteClient.SendAgentAlertMessage("Script saved", false); | 284 | remoteClient.SendAgentAlertMessage("Script saved", false); |
285 | } | 285 | } |
286 | |||
287 | // Tell anyone managing scripts that a script has been reloaded/changed | ||
288 | EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID); | ||
289 | |||
286 | part.ParentGroup.ResumeScripts(); | 290 | part.ParentGroup.ResumeScripts(); |
287 | return errors; | 291 | return errors; |
288 | } | 292 | } |
@@ -1151,8 +1155,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1151 | return; | 1155 | return; |
1152 | } | 1156 | } |
1153 | 1157 | ||
1154 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); | 1158 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1155 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | ||
1156 | { | 1159 | { |
1157 | // If the item to be moved is no copy, we need to be able to | 1160 | // If the item to be moved is no copy, we need to be able to |
1158 | // edit the prim. | 1161 | // edit the prim. |
@@ -1624,9 +1627,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1624 | // have state in inventory | 1627 | // have state in inventory |
1625 | part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); | 1628 | part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); |
1626 | 1629 | ||
1630 | // tell anyone watching that there is a new script in town | ||
1631 | EventManager.TriggerNewScript(agentID, part, copyID); | ||
1632 | |||
1627 | // m_log.InfoFormat("[PRIMINVENTORY]: " + | 1633 | // m_log.InfoFormat("[PRIMINVENTORY]: " + |
1628 | // "Rezzed script {0} into prim local ID {1} for user {2}", | 1634 | // "Rezzed script {0} into prim local ID {1} for user {2}", |
1629 | // item.inventoryName, localID, remoteClient.Name); | 1635 | // item.inventoryName, localID, remoteClient.Name); |
1636 | |||
1630 | part.ParentGroup.ResumeScripts(); | 1637 | part.ParentGroup.ResumeScripts(); |
1631 | 1638 | ||
1632 | return part; | 1639 | return part; |
@@ -1707,6 +1714,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1707 | 1714 | ||
1708 | part.Inventory.AddInventoryItem(taskItem, false); | 1715 | part.Inventory.AddInventoryItem(taskItem, false); |
1709 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); | 1716 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); |
1717 | |||
1718 | // tell anyone managing scripts that a new script exists | ||
1719 | EventManager.TriggerNewScript(agentID, part, taskItem.ItemID); | ||
1720 | |||
1710 | part.ParentGroup.ResumeScripts(); | 1721 | part.ParentGroup.ResumeScripts(); |
1711 | 1722 | ||
1712 | return part; | 1723 | return part; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d2a8ad0..9bca654 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -864,16 +864,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
864 | try | 864 | try |
865 | { | 865 | { |
866 | ForEachRootScenePresence(delegate(ScenePresence agent) | 866 | ForEachRootScenePresence(delegate(ScenePresence agent) |
867 | { | 867 | { |
868 | //agent.ControllingClient.new | 868 | //agent.ControllingClient.new |
869 | //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); | 869 | //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); |
870 | 870 | ||
871 | List<ulong> old = new List<ulong>(); | 871 | List<ulong> old = new List<ulong>(); |
872 | old.Add(otherRegion.RegionHandle); | 872 | old.Add(otherRegion.RegionHandle); |
873 | agent.DropOldNeighbours(old); | 873 | agent.DropOldNeighbours(old); |
874 | if (m_teleportModule != null) | 874 | if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc) |
875 | m_teleportModule.EnableChildAgent(agent, otherRegion); | 875 | m_teleportModule.EnableChildAgent(agent, otherRegion); |
876 | }); | 876 | }); |
877 | } | 877 | } |
878 | catch (NullReferenceException) | 878 | catch (NullReferenceException) |
879 | { | 879 | { |
@@ -881,7 +881,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
881 | // This shouldn't happen too often anymore. | 881 | // This shouldn't happen too often anymore. |
882 | m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception"); | 882 | m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception"); |
883 | } | 883 | } |
884 | |||
885 | } | 884 | } |
886 | else | 885 | else |
887 | { | 886 | { |
@@ -1009,10 +1008,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1009 | try | 1008 | try |
1010 | { | 1009 | { |
1011 | ForEachRootScenePresence(delegate(ScenePresence agent) | 1010 | ForEachRootScenePresence(delegate(ScenePresence agent) |
1012 | { | 1011 | { |
1013 | if (m_teleportModule != null) | 1012 | if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc) |
1014 | m_teleportModule.EnableChildAgent(agent, r); | 1013 | m_teleportModule.EnableChildAgent(agent, r); |
1015 | }); | 1014 | }); |
1016 | } | 1015 | } |
1017 | catch (NullReferenceException) | 1016 | catch (NullReferenceException) |
1018 | { | 1017 | { |
@@ -1141,7 +1140,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1141 | 1140 | ||
1142 | HeartbeatThread | 1141 | HeartbeatThread |
1143 | = Watchdog.StartThread( | 1142 | = Watchdog.StartThread( |
1144 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false); | 1143 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); |
1145 | } | 1144 | } |
1146 | 1145 | ||
1147 | /// <summary> | 1146 | /// <summary> |
@@ -1179,6 +1178,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1179 | try | 1178 | try |
1180 | { | 1179 | { |
1181 | m_eventManager.TriggerOnRegionStarted(this); | 1180 | m_eventManager.TriggerOnRegionStarted(this); |
1181 | |||
1182 | // The first frame can take a very long time due to physics actors being added on startup. Therefore, | ||
1183 | // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false | ||
1184 | // alarms for scenes with many objects. | ||
1185 | Update(); | ||
1186 | Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; | ||
1187 | |||
1182 | while (!shuttingdown) | 1188 | while (!shuttingdown) |
1183 | Update(); | 1189 | Update(); |
1184 | 1190 | ||
@@ -1207,7 +1213,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1207 | 1213 | ||
1208 | ++Frame; | 1214 | ++Frame; |
1209 | 1215 | ||
1210 | // m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame); | 1216 | // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); |
1211 | 1217 | ||
1212 | try | 1218 | try |
1213 | { | 1219 | { |
@@ -1362,26 +1368,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1362 | { | 1368 | { |
1363 | throw; | 1369 | throw; |
1364 | } | 1370 | } |
1365 | catch (AccessViolationException e) | ||
1366 | { | ||
1367 | m_log.ErrorFormat( | ||
1368 | "[REGION]: Failed on region {0} with exception {1}{2}", | ||
1369 | RegionInfo.RegionName, e.Message, e.StackTrace); | ||
1370 | } | ||
1371 | //catch (NullReferenceException e) | ||
1372 | //{ | ||
1373 | // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | ||
1374 | //} | ||
1375 | catch (InvalidOperationException e) | ||
1376 | { | ||
1377 | m_log.ErrorFormat( | ||
1378 | "[REGION]: Failed on region {0} with exception {1}{2}", | ||
1379 | RegionInfo.RegionName, e.Message, e.StackTrace); | ||
1380 | } | ||
1381 | catch (Exception e) | 1371 | catch (Exception e) |
1382 | { | 1372 | { |
1383 | m_log.ErrorFormat( | 1373 | m_log.ErrorFormat( |
1384 | "[REGION]: Failed on region {0} with exception {1}{2}", | 1374 | "[SCENE]: Failed on region {0} with exception {1}{2}", |
1385 | RegionInfo.RegionName, e.Message, e.StackTrace); | 1375 | RegionInfo.RegionName, e.Message, e.StackTrace); |
1386 | } | 1376 | } |
1387 | 1377 | ||
@@ -1419,7 +1409,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1419 | entry.checkAtTargets(); | 1409 | entry.checkAtTargets(); |
1420 | } | 1410 | } |
1421 | 1411 | ||
1422 | |||
1423 | /// <summary> | 1412 | /// <summary> |
1424 | /// Send out simstats data to all clients | 1413 | /// Send out simstats data to all clients |
1425 | /// </summary> | 1414 | /// </summary> |
@@ -2318,7 +2307,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2318 | /// </summary> | 2307 | /// </summary> |
2319 | /// <param name="sog"></param> | 2308 | /// <param name="sog"></param> |
2320 | /// <returns></returns> | 2309 | /// <returns></returns> |
2321 | public bool IncomingCreateObject(ISceneObject sog) | 2310 | public bool IncomingCreateObject(Vector3 newPosition, ISceneObject sog) |
2322 | { | 2311 | { |
2323 | //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition, | 2312 | //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition, |
2324 | // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment); | 2313 | // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment); |
@@ -2334,6 +2323,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2334 | return false; | 2323 | return false; |
2335 | } | 2324 | } |
2336 | 2325 | ||
2326 | if (newPosition != Vector3.Zero) | ||
2327 | newObject.RootPart.GroupPosition = newPosition; | ||
2328 | |||
2337 | if (!AddSceneObject(newObject)) | 2329 | if (!AddSceneObject(newObject)) |
2338 | { | 2330 | { |
2339 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); | 2331 | m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); |
@@ -4258,10 +4250,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4258 | /// <param name="action"></param> | 4250 | /// <param name="action"></param> |
4259 | public void ForEachRootScenePresence(Action<ScenePresence> action) | 4251 | public void ForEachRootScenePresence(Action<ScenePresence> action) |
4260 | { | 4252 | { |
4261 | if (m_sceneGraph != null) | 4253 | m_sceneGraph.ForEachAvatar(action); |
4262 | { | ||
4263 | m_sceneGraph.ForEachAvatar(action); | ||
4264 | } | ||
4265 | } | 4254 | } |
4266 | 4255 | ||
4267 | /// <summary> | 4256 | /// <summary> |
@@ -4270,10 +4259,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4270 | /// <param name="action"></param> | 4259 | /// <param name="action"></param> |
4271 | public void ForEachScenePresence(Action<ScenePresence> action) | 4260 | public void ForEachScenePresence(Action<ScenePresence> action) |
4272 | { | 4261 | { |
4273 | if (m_sceneGraph != null) | 4262 | m_sceneGraph.ForEachScenePresence(action); |
4274 | { | ||
4275 | m_sceneGraph.ForEachScenePresence(action); | ||
4276 | } | ||
4277 | } | 4263 | } |
4278 | 4264 | ||
4279 | /// <summary> | 4265 | /// <summary> |
@@ -4703,7 +4689,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4703 | Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | 4689 | Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); |
4704 | if (nearestPoint != null) | 4690 | if (nearestPoint != null) |
4705 | { | 4691 | { |
4706 | Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); | 4692 | // m_log.DebugFormat( |
4693 | // "[SCENE]: Found a sane previous position based on velocity for {0}, sending them to {1} in {2}", | ||
4694 | // avatar.Name, nearestPoint, nearestParcel.LandData.Name); | ||
4695 | |||
4707 | return nearestPoint.Value; | 4696 | return nearestPoint.Value; |
4708 | } | 4697 | } |
4709 | 4698 | ||
@@ -4713,12 +4702,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
4713 | nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | 4702 | nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); |
4714 | if (nearestPoint != null) | 4703 | if (nearestPoint != null) |
4715 | { | 4704 | { |
4716 | Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString()); | 4705 | // m_log.DebugFormat( |
4706 | // "[SCENE]: {0} had a zero velocity, sending them to {1}", avatar.Name, nearestPoint); | ||
4707 | |||
4717 | return nearestPoint.Value; | 4708 | return nearestPoint.Value; |
4718 | } | 4709 | } |
4719 | 4710 | ||
4720 | //Ultimate backup if we have no idea where they are | 4711 | //Ultimate backup if we have no idea where they are |
4721 | Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); | 4712 | // m_log.DebugFormat( |
4713 | // "[SCENE]: No idea where {0} is, sending them to {1}", avatar.Name, avatar.lastKnownAllowedPosition); | ||
4714 | |||
4722 | return avatar.lastKnownAllowedPosition; | 4715 | return avatar.lastKnownAllowedPosition; |
4723 | } | 4716 | } |
4724 | 4717 | ||
@@ -5124,7 +5117,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5124 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); | 5117 | // presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); |
5125 | 5118 | ||
5126 | Vector3 agent_control_v3 = new Vector3(); | 5119 | Vector3 agent_control_v3 = new Vector3(); |
5127 | presence.HandleMoveToTargetUpdate(ref agent_control_v3); | 5120 | presence.HandleMoveToTargetUpdate(1, ref agent_control_v3); |
5128 | presence.AddNewMovement(agent_control_v3); | 5121 | presence.AddNewMovement(agent_control_v3); |
5129 | } | 5122 | } |
5130 | } | 5123 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 19c9745..b5007cd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -156,8 +156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | // that the region position is cached or performance will degrade | 156 | // that the region position is cached or performance will degrade |
157 | Utils.LongToUInts(regionHandle, out x, out y); | 157 | Utils.LongToUInts(regionHandle, out x, out y); |
158 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 158 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); |
159 | bool v = true; | 159 | |
160 | if (! simulatorList.Contains(dest.ServerURI)) | 160 | // bool v = true; |
161 | if (!simulatorList.Contains(dest.ServerURI)) | ||
161 | { | 162 | { |
162 | // we havent seen this simulator before, add it to the list | 163 | // we havent seen this simulator before, add it to the list |
163 | // and send it an update | 164 | // and send it an update |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index e66678a..66fb493 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1592,7 +1592,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1592 | 1592 | ||
1593 | if (group != null) | 1593 | if (group != null) |
1594 | { | 1594 | { |
1595 | if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID)) | 1595 | if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID)) |
1596 | { | 1596 | { |
1597 | group.UpdateExtraParam(primLocalID, type, inUse, data); | 1597 | group.UpdateExtraParam(primLocalID, type, inUse, data); |
1598 | } | 1598 | } |
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1609 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 1609 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
1610 | if (group != null) | 1610 | if (group != null) |
1611 | { | 1611 | { |
1612 | if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID)) | 1612 | if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID)) |
1613 | { | 1613 | { |
1614 | ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock(); | 1614 | ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock(); |
1615 | shapeData.ObjectLocalID = shapeBlock.ObjectLocalID; | 1615 | shapeData.ObjectLocalID = shapeBlock.ObjectLocalID; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index daf711c..40c8d06 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | /// <summary> | 1050 | /// <summary> |
1051 | /// | 1051 | /// Do not call this directly. Call Scene.RequestTeleportLocation() instead. |
1052 | /// </summary> | 1052 | /// </summary> |
1053 | /// <param name="pos"></param> | 1053 | /// <param name="pos"></param> |
1054 | public void Teleport(Vector3 pos) | 1054 | public void Teleport(Vector3 pos) |
@@ -1522,7 +1522,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1522 | } | 1522 | } |
1523 | else if (bAllowUpdateMoveToPosition) | 1523 | else if (bAllowUpdateMoveToPosition) |
1524 | { | 1524 | { |
1525 | if (HandleMoveToTargetUpdate(ref agent_control_v3)) | 1525 | // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a |
1526 | // certain position. It's only check for tolerance on returning to that position is 0.2 | ||
1527 | // rather than 1, at which point it removes its force target. | ||
1528 | if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3)) | ||
1526 | update_movementflag = true; | 1529 | update_movementflag = true; |
1527 | } | 1530 | } |
1528 | } | 1531 | } |
@@ -1584,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1584 | /// </remarks> | 1587 | /// </remarks> |
1585 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> | 1588 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> |
1586 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> | 1589 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> |
1587 | public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) | 1590 | public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3) |
1588 | { | 1591 | { |
1589 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); | 1592 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); |
1590 | 1593 | ||
@@ -1601,7 +1604,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1601 | // Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); | 1604 | // Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); |
1602 | 1605 | ||
1603 | // Check the error term of the current position in relation to the target position | 1606 | // Check the error term of the current position in relation to the target position |
1604 | if (distanceToTarget <= 1) | 1607 | if (distanceToTarget <= tolerance) |
1605 | { | 1608 | { |
1606 | // We are close enough to the target | 1609 | // We are close enough to the target |
1607 | AbsolutePosition = MoveToPositionTarget; | 1610 | AbsolutePosition = MoveToPositionTarget; |
@@ -1777,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1777 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); | 1780 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); |
1778 | 1781 | ||
1779 | Vector3 agent_control_v3 = new Vector3(); | 1782 | Vector3 agent_control_v3 = new Vector3(); |
1780 | HandleMoveToTargetUpdate(ref agent_control_v3); | 1783 | HandleMoveToTargetUpdate(1, ref agent_control_v3); |
1781 | AddNewMovement(agent_control_v3); | 1784 | AddNewMovement(agent_control_v3); |
1782 | } | 1785 | } |
1783 | 1786 | ||
@@ -3223,7 +3226,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3223 | ((SceneObjectGroup)so).LocalId = 0; | 3226 | ((SceneObjectGroup)so).LocalId = 0; |
3224 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); | 3227 | ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); |
3225 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); | 3228 | so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); |
3226 | m_scene.IncomingCreateObject(so); | 3229 | m_scene.IncomingCreateObject(Vector3.Zero, so); |
3227 | } | 3230 | } |
3228 | } | 3231 | } |
3229 | } | 3232 | } |