aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-09-01 22:49:31 +0100
committerMelanie2013-09-01 22:49:31 +0100
commit008c98a9748ba7deadb80c435ddd372002b6c844 (patch)
tree9458b87c1d28d741ee6c2384eb1028375cb703ab /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentProfiles: Clean up some log entries caused when visiting HG avatar is using l... (diff)
downloadopensim-SC-008c98a9748ba7deadb80c435ddd372002b6c844.zip
opensim-SC-008c98a9748ba7deadb80c435ddd372002b6c844.tar.gz
opensim-SC-008c98a9748ba7deadb80c435ddd372002b6c844.tar.bz2
opensim-SC-008c98a9748ba7deadb80c435ddd372002b6c844.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/World/Region/RestartModule.cs OpenSim/Region/Framework/Scenes/SceneGraph.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs24
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RestartModule.cs30
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs11
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs220
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs46
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs4
13 files changed, 375 insertions, 75 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index 3e93638..bc7ecb7 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -201,11 +201,11 @@ namespace OpenSim
201 201
202 envConfigSource.LoadEnv(); 202 envConfigSource.LoadEnv();
203 m_config.Source.Merge(envConfigSource); 203 m_config.Source.Merge(envConfigSource);
204 m_config.Source.ExpandKeyValues();
205 } 204 }
206 205
207
208 ReadConfigSettings(); 206 ReadConfigSettings();
207
208 m_config.Source.ExpandKeyValues();
209 209
210 return m_config; 210 return m_config;
211 } 211 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 8cbbfd9..dc28be8 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -6777,6 +6777,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6777 } 6777 }
6778 #endregion 6778 #endregion
6779 6779
6780 if (SceneAgent.IsChildAgent)
6781 {
6782 SendCantSitBecauseChildAgentResponse();
6783 return true;
6784 }
6785
6780 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; 6786 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
6781 6787
6782 if (handlerAgentRequestSit != null) 6788 if (handlerAgentRequestSit != null)
@@ -6801,6 +6807,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6801 } 6807 }
6802 #endregion 6808 #endregion
6803 6809
6810 if (SceneAgent.IsChildAgent)
6811 {
6812 SendCantSitBecauseChildAgentResponse();
6813 return true;
6814 }
6815
6804 AgentSit handlerAgentSit = OnAgentSit; 6816 AgentSit handlerAgentSit = OnAgentSit;
6805 if (handlerAgentSit != null) 6817 if (handlerAgentSit != null)
6806 { 6818 {
@@ -6810,6 +6822,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6810 return true; 6822 return true;
6811 } 6823 }
6812 6824
6825 /// <summary>
6826 /// Used when a child agent gets a sit response which should not be fulfilled.
6827 /// </summary>
6828 private void SendCantSitBecauseChildAgentResponse()
6829 {
6830 SendAlertMessage("Try moving closer. Can't sit on object because it is not in the same region as you.");
6831 }
6832
6813 private bool HandleSoundTrigger(IClientAPI sender, Packet Pack) 6833 private bool HandleSoundTrigger(IClientAPI sender, Packet Pack)
6814 { 6834 {
6815 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack; 6835 SoundTriggerPacket soundTriggerPacket = (SoundTriggerPacket)Pack;
@@ -12934,7 +12954,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12934 { 12954 {
12935 if (p is ScenePresence) 12955 if (p is ScenePresence)
12936 { 12956 {
12937 ScenePresence presence = p as ScenePresence;
12938 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities 12957 // It turns out to get the agent to stop flying, you have to feed it stop flying velocities
12939 // There's no explicit message to send the client to tell it to stop flying.. it relies on the 12958 // There's no explicit message to send the client to tell it to stop flying.. it relies on the
12940 // velocity, collision plane and avatar height 12959 // velocity, collision plane and avatar height
@@ -12942,15 +12961,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12942 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air 12961 // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air
12943 // when the avatar stands up 12962 // when the avatar stands up
12944 12963
12945 Vector3 pos = presence.AbsolutePosition;
12946
12947 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = 12964 ImprovedTerseObjectUpdatePacket.ObjectDataBlock block =
12948 CreateImprovedTerseBlock(p, false); 12965 CreateImprovedTerseBlock(p, false);
12949 12966
12950 const float TIME_DILATION = 1.0f; 12967 const float TIME_DILATION = 1.0f;
12951 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); 12968 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
12952 12969
12953
12954 ImprovedTerseObjectUpdatePacket packet 12970 ImprovedTerseObjectUpdatePacket packet
12955 = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket( 12971 = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(
12956 PacketType.ImprovedTerseObjectUpdate); 12972 PacketType.ImprovedTerseObjectUpdate);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index cef6177..ea660bd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -538,7 +538,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
538 } 538 }
539 catch (Exception e) 539 catch (Exception e)
540 { 540 {
541 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e.Message); 541 m_log.ErrorFormat("[INVENTORY ARCHIVER]: Could not authenticate password, {0}", e);
542 return null; 542 return null;
543 } 543 }
544 */ 544 */
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 966a05c..bf1cffb 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -309,6 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
309 string serverURI = string.Empty; 309 string serverURI = string.Empty;
310 GetUserProfileServerURI(targetID, out serverURI); 310 GetUserProfileServerURI(targetID, out serverURI);
311 UUID creatorId = UUID.Zero; 311 UUID creatorId = UUID.Zero;
312 Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>();
312 313
313 OSDMap parameters= new OSDMap(); 314 OSDMap parameters= new OSDMap();
314 UUID.TryParse(args[0], out creatorId); 315 UUID.TryParse(args[0], out creatorId);
@@ -316,15 +317,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
316 OSD Params = (OSD)parameters; 317 OSD Params = (OSD)parameters;
317 if(!JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString())) 318 if(!JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
318 { 319 {
319 // Error Handling here! 320 remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds);
320 // if(parameters.ContainsKey("message") 321 return;
321 } 322 }
322 323
323 parameters = (OSDMap)Params; 324 parameters = (OSDMap)Params;
324 325
325 OSDArray list = (OSDArray)parameters["result"]; 326 OSDArray list = (OSDArray)parameters["result"];
326 327
327 Dictionary<UUID, string> classifieds = new Dictionary<UUID, string>();
328 328
329 foreach(OSD map in list) 329 foreach(OSD map in list)
330 { 330 {
@@ -441,7 +441,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
441 Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; 441 Vector3 pos = remoteClient.SceneAgent.AbsolutePosition;
442 ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); 442 ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y);
443 ScenePresence p = FindPresence(remoteClient.AgentId); 443 ScenePresence p = FindPresence(remoteClient.AgentId);
444// Vector3 avaPos = p.AbsolutePosition;
445 444
446 string serverURI = string.Empty; 445 string serverURI = string.Empty;
447 GetUserProfileServerURI(remoteClient.AgentId, out serverURI); 446 GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
@@ -542,14 +541,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
542 541
543 string serverURI = string.Empty; 542 string serverURI = string.Empty;
544 GetUserProfileServerURI(targetId, out serverURI); 543 GetUserProfileServerURI(targetId, out serverURI);
544
545 Dictionary<UUID, string> picks = new Dictionary<UUID, string>();
545 546
546 OSDMap parameters= new OSDMap(); 547 OSDMap parameters= new OSDMap();
547 parameters.Add("creatorId", OSD.FromUUID(targetId)); 548 parameters.Add("creatorId", OSD.FromUUID(targetId));
548 OSD Params = (OSD)parameters; 549 OSD Params = (OSD)parameters;
549 if(!JsonRpcRequest(ref Params, "avatarpicksrequest", serverURI, UUID.Random().ToString())) 550 if(!JsonRpcRequest(ref Params, "avatarpicksrequest", serverURI, UUID.Random().ToString()))
550 { 551 {
551 remoteClient.SendAgentAlertMessage( 552 remoteClient.SendAvatarPicksReply(new UUID(args[0]), picks);
552 "Error requesting picks", false);
553 return; 553 return;
554 } 554 }
555 555
@@ -557,8 +557,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
557 557
558 OSDArray list = (OSDArray)parameters["result"]; 558 OSDArray list = (OSDArray)parameters["result"];
559 559
560 Dictionary<UUID, string> picks = new Dictionary<UUID, string>();
561
562 foreach(OSD map in list) 560 foreach(OSD map in list)
563 { 561 {
564 OSDMap m = (OSDMap)map; 562 OSDMap m = (OSDMap)map;
@@ -762,8 +760,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
762 object Note = (object)note; 760 object Note = (object)note;
763 if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) 761 if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString()))
764 { 762 {
765 remoteClient.SendAgentAlertMessage( 763 remoteClient.SendAvatarNotesReply(note.TargetId, note.Notes);
766 "Error requesting note", false); 764 return;
767 } 765 }
768 note = (UserProfileNotes) Note; 766 note = (UserProfileNotes) Note;
769 767
@@ -796,8 +794,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
796 object Note = note; 794 object Note = note;
797 if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) 795 if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString()))
798 { 796 {
799 remoteClient.SendAgentAlertMessage( 797 return;
800 "Error updating note", false);
801 } 798 }
802 } 799 }
803 #endregion Notes 800 #endregion Notes
@@ -1033,8 +1030,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
1033 OSD Params = (OSD)parameters; 1030 OSD Params = (OSD)parameters;
1034 if(!JsonRpcRequest(ref Params, "image_assets_request", profileServerURI, UUID.Random().ToString())) 1031 if(!JsonRpcRequest(ref Params, "image_assets_request", profileServerURI, UUID.Random().ToString()))
1035 { 1032 {
1036 // Error Handling here!
1037 // if(parameters.ContainsKey("message")
1038 return false; 1033 return false;
1039 } 1034 }
1040 1035
@@ -1224,7 +1219,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
1224 byte[] content = Encoding.UTF8.GetBytes(jsonRequestData); 1219 byte[] content = Encoding.UTF8.GetBytes(jsonRequestData);
1225 1220
1226 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri); 1221 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);
1227 // webRequest.Credentials = new NetworkCredential(rpcUser, rpcPass); 1222
1228 webRequest.ContentType = "application/json-rpc"; 1223 webRequest.ContentType = "application/json-rpc";
1229 webRequest.Method = "POST"; 1224 webRequest.Method = "POST";
1230 1225
@@ -1245,7 +1240,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
1245 } 1240 }
1246 1241
1247 Stream rstream = webResponse.GetResponseStream(); 1242 Stream rstream = webResponse.GetResponseStream();
1248 OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); 1243 if (rstream.Length < 1)
1244 return false;
1245
1246 OSDMap mret = new OSDMap();
1247 try
1248 {
1249 mret = (OSDMap)OSDParser.DeserializeJson(rstream);
1250 }
1251 catch (Exception e)
1252 {
1253 m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message);
1254 return false;
1255 }
1256
1249 1257
1250 if (mret.ContainsKey("error")) 1258 if (mret.ContainsKey("error"))
1251 return false; 1259 return false;
@@ -1310,6 +1318,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
1310 } 1318 }
1311 1319
1312 Stream rstream = webResponse.GetResponseStream(); 1320 Stream rstream = webResponse.GetResponseStream();
1321 if (rstream.Length < 1)
1322 return false;
1313 1323
1314 OSDMap response = new OSDMap(); 1324 OSDMap response = new OSDMap();
1315 try 1325 try
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 6ff9988..1f3e7a1 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -837,8 +837,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
837 } 837 }
838 838
839 m_log.WarnFormat( 839 m_log.WarnFormat(
840 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Keeping avatar in source region.", 840 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Keeping avatar in {2}",
841 sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); 841 sp.Name, finalDestination.RegionName, sp.Scene.Name);
842 842
843 Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established."); 843 Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established.");
844 return; 844 return;
@@ -1058,8 +1058,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1058 } 1058 }
1059 1059
1060 m_log.WarnFormat( 1060 m_log.WarnFormat(
1061 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Keeping avatar in source region.", 1061 "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Keeping avatar in {2}",
1062 sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); 1062 sp.Name, finalDestination.RegionName, sp.Scene.Name);
1063 1063
1064 Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established."); 1064 Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Connection between viewer and destination region could not be established.");
1065 return; 1065 return;
diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
index 9c441ed..0c74b49 100644
--- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs
@@ -48,8 +48,8 @@ namespace OpenSim.Region.CoreModules.World.Region
48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RestartModule")] 48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RestartModule")]
49 public class RestartModule : INonSharedRegionModule, IRestartModule 49 public class RestartModule : INonSharedRegionModule, IRestartModule
50 { 50 {
51// private static readonly ILog m_log = 51 private static readonly ILog m_log =
52// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 protected Scene m_Scene; 54 protected Scene m_Scene;
55 protected Timer m_CountdownTimer = null; 55 protected Timer m_CountdownTimer = null;
@@ -223,11 +223,25 @@ namespace OpenSim.Region.CoreModules.World.Region
223 223
224 public void SetTimer(int intervalSeconds) 224 public void SetTimer(int intervalSeconds)
225 { 225 {
226 m_CountdownTimer = new Timer(); 226 if (intervalSeconds > 0)
227 m_CountdownTimer.AutoReset = false; 227 {
228 m_CountdownTimer.Interval = intervalSeconds * 1000; 228 m_CountdownTimer = new Timer();
229 m_CountdownTimer.Elapsed += OnTimer; 229 m_CountdownTimer.AutoReset = false;
230 m_CountdownTimer.Start(); 230 m_CountdownTimer.Interval = intervalSeconds * 1000;
231 m_CountdownTimer.Elapsed += OnTimer;
232 m_CountdownTimer.Start();
233 }
234 else if (m_CountdownTimer != null)
235 {
236 m_CountdownTimer.Stop();
237 m_CountdownTimer = null;
238 }
239 else
240 {
241 m_log.WarnFormat(
242 "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval",
243 intervalSeconds, m_Scene.Name);
244 }
231 } 245 }
232 246
233 private void OnTimer(object source, ElapsedEventArgs e) 247 private void OnTimer(object source, ElapsedEventArgs e)
@@ -332,4 +346,4 @@ namespace OpenSim.Region.CoreModules.World.Region
332 } 346 }
333 } 347 }
334 } 348 }
335} \ No newline at end of file 349}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 56bdc63..f864392 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3986,7 +3986,7 @@ namespace OpenSim.Region.Framework.Scenes
3986 3986
3987 try 3987 try
3988 { 3988 {
3989 if (!AuthorizeUser(acd, SeeIntoRegion, out reason)) 3989 if (!AuthorizeUser(acd, (vialogin ? false : SeeIntoRegion), out reason))
3990 { 3990 {
3991 m_authenticateHandler.RemoveCircuit(acd.circuitcode); 3991 m_authenticateHandler.RemoveCircuit(acd.circuitcode);
3992 return false; 3992 return false;
@@ -4596,10 +4596,27 @@ namespace OpenSim.Region.Framework.Scenes
4596 4596
4597 // Check that the auth_token is valid 4597 // Check that the auth_token is valid
4598 AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID); 4598 AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID);
4599 if (acd != null && acd.SessionID.ToString() == auth_token) 4599
4600 if (acd == null)
4601 {
4602 m_log.DebugFormat(
4603 "[SCENE]: Request to close agent {0} but no such agent in scene {1}. May have been closed previously.",
4604 agentID, Name);
4605
4606 return false;
4607 }
4608
4609 if (acd.SessionID.ToString() == auth_token)
4610 {
4600 return IncomingCloseAgent(agentID, force); 4611 return IncomingCloseAgent(agentID, force);
4612 }
4601 else 4613 else
4602 m_log.ErrorFormat("[SCENE]: Request to close agent {0} with invalid authorization token {1}", agentID, auth_token); 4614 {
4615 m_log.WarnFormat(
4616 "[SCENE]: Request to close agent {0} with invalid authorization token {1} in {2}",
4617 agentID, auth_token, Name);
4618 }
4619
4603 return false; 4620 return false;
4604 } 4621 }
4605 4622
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index e599e90..b0f8991 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -631,40 +631,16 @@ namespace OpenSim.Region.Framework.Scenes
631 protected internal ScenePresence CreateAndAddChildScenePresence( 631 protected internal ScenePresence CreateAndAddChildScenePresence(
632 IClientAPI client, AvatarAppearance appearance, PresenceType type) 632 IClientAPI client, AvatarAppearance appearance, PresenceType type)
633 { 633 {
634 ScenePresence newAvatar = null;
635
636 // ScenePresence always defaults to child agent 634 // ScenePresence always defaults to child agent
637 newAvatar = new ScenePresence(client, m_parentScene, appearance, type); 635 ScenePresence presence = new ScenePresence(client, m_parentScene, appearance, type);
638
639 AddScenePresence(newAvatar);
640
641 return newAvatar;
642 }
643
644 /// <summary>
645 /// Add a presence to the scene
646 /// </summary>
647 /// <param name="presence"></param>
648 protected internal void AddScenePresence(ScenePresence presence)
649 {
650 // Always a child when added to the scene
651 bool child = presence.IsChildAgent;
652
653 if (child)
654 {
655 m_numChildAgents++;
656 }
657 else
658 {
659 m_numRootAgents++;
660 presence.AddToPhysicalScene(false);
661 }
662 636
663 Entities[presence.UUID] = presence; 637 Entities[presence.UUID] = presence;
664 638
665 m_scenePresencesLock.EnterWriteLock(); 639 m_scenePresencesLock.EnterWriteLock();
666 try 640 try
667 { 641 {
642 m_numChildAgents++;
643
668 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap); 644 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
669 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray); 645 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
670 646
@@ -675,7 +651,7 @@ namespace OpenSim.Region.Framework.Scenes
675 } 651 }
676 else 652 else
677 { 653 {
678 // Remember the old presene reference from the dictionary 654 // Remember the old presence reference from the dictionary
679 ScenePresence oldref = newmap[presence.UUID]; 655 ScenePresence oldref = newmap[presence.UUID];
680 // Replace the presence reference in the dictionary with the new value 656 // Replace the presence reference in the dictionary with the new value
681 newmap[presence.UUID] = presence; 657 newmap[presence.UUID] = presence;
@@ -691,6 +667,8 @@ namespace OpenSim.Region.Framework.Scenes
691 { 667 {
692 m_scenePresencesLock.ExitWriteLock(); 668 m_scenePresencesLock.ExitWriteLock();
693 } 669 }
670
671 return presence;
694 } 672 }
695 673
696 /// <summary> 674 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 59a453a..cf03d7c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4522,7 +4522,7 @@ namespace OpenSim.Region.Framework.Scenes
4522 // For now, we use the NINJA naming scheme for identifying joints. 4522 // For now, we use the NINJA naming scheme for identifying joints.
4523 // In the future, we can support other joint specification schemes such as a 4523 // In the future, we can support other joint specification schemes such as a
4524 // custom checkbox in the viewer GUI. 4524 // custom checkbox in the viewer GUI.
4525 if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) 4525 if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints)
4526 { 4526 {
4527 return IsHingeJoint() || IsBallJoint(); 4527 return IsHingeJoint() || IsBallJoint();
4528 } 4528 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3f4979e..88ecda2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2707,6 +2707,9 @@ namespace OpenSim.Region.Framework.Scenes
2707 2707
2708 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) 2708 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID)
2709 { 2709 {
2710 if (IsChildAgent)
2711 return;
2712
2710 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 2713 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
2711 2714
2712 if (part != null) 2715 if (part != null)
@@ -2793,6 +2796,9 @@ namespace OpenSim.Region.Framework.Scenes
2793 2796
2794 public void HandleAgentSitOnGround() 2797 public void HandleAgentSitOnGround()
2795 { 2798 {
2799 if (IsChildAgent)
2800 return;
2801
2796// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.. 2802// m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick..
2797 m_AngularVelocity = Vector3.Zero; 2803 m_AngularVelocity = Vector3.Zero;
2798 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); 2804 Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
@@ -3451,11 +3457,6 @@ namespace OpenSim.Region.Framework.Scenes
3451 } 3457 }
3452 } 3458 }
3453 3459
3454 public void RestoreInCurrentScene()
3455 {
3456 AddToPhysicalScene(false); // not exactly false
3457 }
3458
3459 public void Reset() 3460 public void Reset()
3460 { 3461 {
3461// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName); 3462// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);
diff --git a/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs b/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs
new file mode 100644
index 0000000..5a6b284
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs
@@ -0,0 +1,220 @@
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;
29using System.Collections.Generic;
30using System.Linq;
31using System.Reflection;
32using System.Text;
33using System.Text.RegularExpressions;
34using log4net;
35using Mono.Addins;
36using NDesk.Options;
37using Nini.Config;
38using OpenMetaverse;
39using OpenSim.Framework;
40using OpenSim.Framework.Console;
41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes;
43
44namespace OpenSim.Region.OptionalModules.Avatar.SitStand
45{
46 /// <summary>
47 /// A module that just holds commands for changing avatar sitting and standing states.
48 /// </summary>
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AnimationsCommandModule")]
50 public class SitStandCommandModule : INonSharedRegionModule
51 {
52// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53
54 private Scene m_scene;
55
56 public string Name { get { return "SitStand Command Module"; } }
57
58 public Type ReplaceableInterface { get { return null; } }
59
60 public void Initialise(IConfigSource source)
61 {
62// m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: INITIALIZED MODULE");
63 }
64
65 public void PostInitialise()
66 {
67// m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: POST INITIALIZED MODULE");
68 }
69
70 public void Close()
71 {
72// m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: CLOSED MODULE");
73 }
74
75 public void AddRegion(Scene scene)
76 {
77// m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
78 }
79
80 public void RemoveRegion(Scene scene)
81 {
82// m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
83 }
84
85 public void RegionLoaded(Scene scene)
86 {
87// m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
88
89 m_scene = scene;
90
91 scene.AddCommand(
92 "Users", this, "sit user name",
93 "sit user name [--regex] <first-name> <last-name>",
94 "Sit the named user on an unoccupied object with a sit target.",
95 "If there are no such objects then nothing happens.\n"
96 + "If --regex is specified then the names are treated as regular expressions.",
97 HandleSitUserNameCommand);
98
99 scene.AddCommand(
100 "Users", this, "stand user name",
101 "stand user name [--regex] <first-name> <last-name>",
102 "Stand the named user.",
103 "If --regex is specified then the names are treated as regular expressions.",
104 HandleStandUserNameCommand);
105 }
106
107 private void HandleSitUserNameCommand(string module, string[] cmd)
108 {
109 if (MainConsole.Instance.ConsoleScene != m_scene && MainConsole.Instance.ConsoleScene != null)
110 return;
111
112 if (cmd.Length < 5)
113 {
114 MainConsole.Instance.Output("Usage: sit user name [--regex] <first-name> <last-name>");
115 return;
116 }
117
118 List<ScenePresence> scenePresences = GetScenePresences(cmd);
119
120 foreach (ScenePresence sp in scenePresences)
121 {
122 if (sp.SitGround || sp.IsSatOnObject)
123 continue;
124
125 SceneObjectPart sitPart = null;
126 List<SceneObjectGroup> sceneObjects = m_scene.GetSceneObjectGroups();
127
128 foreach (SceneObjectGroup sceneObject in sceneObjects)
129 {
130 if (sceneObject.IsAttachment)
131 continue;
132
133 foreach (SceneObjectPart part in sceneObject.Parts)
134 {
135 if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero)
136 {
137 sitPart = part;
138 break;
139 }
140 }
141 }
142
143 if (sitPart != null)
144 {
145 MainConsole.Instance.OutputFormat(
146 "Sitting {0} on {1} {2} in {3}",
147 sp.Name, sitPart.ParentGroup.Name, sitPart.ParentGroup.UUID, m_scene.Name);
148
149 sp.HandleAgentRequestSit(sp.ControllingClient, sp.UUID, sitPart.UUID, Vector3.Zero);
150 sp.HandleAgentSit(sp.ControllingClient, sp.UUID);
151 }
152 else
153 {
154 MainConsole.Instance.OutputFormat(
155 "Could not find any unoccupied set seat on which to sit {0} in {1}. Aborting",
156 sp.Name, m_scene.Name);
157
158 break;
159 }
160 }
161 }
162
163 private void HandleStandUserNameCommand(string module, string[] cmd)
164 {
165 if (MainConsole.Instance.ConsoleScene != m_scene && MainConsole.Instance.ConsoleScene != null)
166 return;
167
168 if (cmd.Length < 5)
169 {
170 MainConsole.Instance.Output("Usage: stand user name [--regex] <first-name> <last-name>");
171 return;
172 }
173
174 List<ScenePresence> scenePresences = GetScenePresences(cmd);
175
176 foreach (ScenePresence sp in scenePresences)
177 {
178 if (sp.SitGround || sp.IsSatOnObject)
179 {
180 MainConsole.Instance.OutputFormat("Standing {0} in {1}", sp.Name, m_scene.Name);
181 sp.StandUp();
182 }
183 }
184 }
185
186 private List<ScenePresence> GetScenePresences(string[] cmdParams)
187 {
188 bool useRegex = false;
189 OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null );
190
191 List<string> mainParams = options.Parse(cmdParams);
192
193 string firstName = mainParams[3];
194 string lastName = mainParams[4];
195
196 List<ScenePresence> scenePresencesMatched = new List<ScenePresence>();
197
198 if (useRegex)
199 {
200 Regex nameRegex = new Regex(string.Format("{0} {1}", firstName, lastName));
201 List<ScenePresence> scenePresences = m_scene.GetScenePresences();
202
203 foreach (ScenePresence sp in scenePresences)
204 {
205 if (!sp.IsChildAgent && nameRegex.IsMatch(sp.Name))
206 scenePresencesMatched.Add(sp);
207 }
208 }
209 else
210 {
211 ScenePresence sp = m_scene.GetScenePresence(firstName, lastName);
212
213 if (sp != null && !sp.IsChildAgent)
214 scenePresencesMatched.Add(sp);
215 }
216
217 return scenePresencesMatched;
218 }
219 }
220} \ No newline at end of file
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
index 6db5f5e..2a820be 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs
@@ -1221,6 +1221,50 @@ private sealed class BulletConstraintXNA : BulletConstraint
1221 //BSParam.TerrainImplementation = 0; 1221 //BSParam.TerrainImplementation = 0;
1222 world.SetGravity(new IndexedVector3(0,0,p.gravity)); 1222 world.SetGravity(new IndexedVector3(0,0,p.gravity));
1223 1223
1224 // Turn off Pooling since globals and pooling are bad for threading.
1225 BulletGlobals.VoronoiSimplexSolverPool.SetPoolingEnabled(false);
1226 BulletGlobals.SubSimplexConvexCastPool.SetPoolingEnabled(false);
1227 BulletGlobals.ManifoldPointPool.SetPoolingEnabled(false);
1228 BulletGlobals.CastResultPool.SetPoolingEnabled(false);
1229 BulletGlobals.SphereShapePool.SetPoolingEnabled(false);
1230 BulletGlobals.DbvtNodePool.SetPoolingEnabled(false);
1231 BulletGlobals.SingleRayCallbackPool.SetPoolingEnabled(false);
1232 BulletGlobals.SubSimplexClosestResultPool.SetPoolingEnabled(false);
1233 BulletGlobals.GjkPairDetectorPool.SetPoolingEnabled(false);
1234 BulletGlobals.DbvtTreeColliderPool.SetPoolingEnabled(false);
1235 BulletGlobals.SingleSweepCallbackPool.SetPoolingEnabled(false);
1236 BulletGlobals.BroadphaseRayTesterPool.SetPoolingEnabled(false);
1237 BulletGlobals.ClosestNotMeConvexResultCallbackPool.SetPoolingEnabled(false);
1238 BulletGlobals.GjkEpaPenetrationDepthSolverPool.SetPoolingEnabled(false);
1239 BulletGlobals.ContinuousConvexCollisionPool.SetPoolingEnabled(false);
1240 BulletGlobals.DbvtStackDataBlockPool.SetPoolingEnabled(false);
1241
1242 BulletGlobals.BoxBoxCollisionAlgorithmPool.SetPoolingEnabled(false);
1243 BulletGlobals.CompoundCollisionAlgorithmPool.SetPoolingEnabled(false);
1244 BulletGlobals.ConvexConcaveCollisionAlgorithmPool.SetPoolingEnabled(false);
1245 BulletGlobals.ConvexConvexAlgorithmPool.SetPoolingEnabled(false);
1246 BulletGlobals.ConvexPlaneAlgorithmPool.SetPoolingEnabled(false);
1247 BulletGlobals.SphereBoxCollisionAlgorithmPool.SetPoolingEnabled(false);
1248 BulletGlobals.SphereSphereCollisionAlgorithmPool.SetPoolingEnabled(false);
1249 BulletGlobals.SphereTriangleCollisionAlgorithmPool.SetPoolingEnabled(false);
1250 BulletGlobals.GImpactCollisionAlgorithmPool.SetPoolingEnabled(false);
1251 BulletGlobals.GjkEpaSolver2MinkowskiDiffPool.SetPoolingEnabled(false);
1252 BulletGlobals.PersistentManifoldPool.SetPoolingEnabled(false);
1253 BulletGlobals.ManifoldResultPool.SetPoolingEnabled(false);
1254 BulletGlobals.GJKPool.SetPoolingEnabled(false);
1255 BulletGlobals.GIM_ShapeRetrieverPool.SetPoolingEnabled(false);
1256 BulletGlobals.TriangleShapePool.SetPoolingEnabled(false);
1257 BulletGlobals.SphereTriangleDetectorPool.SetPoolingEnabled(false);
1258 BulletGlobals.CompoundLeafCallbackPool.SetPoolingEnabled(false);
1259 BulletGlobals.GjkConvexCastPool.SetPoolingEnabled(false);
1260 BulletGlobals.LocalTriangleSphereCastCallbackPool.SetPoolingEnabled(false);
1261 BulletGlobals.BridgeTriangleRaycastCallbackPool.SetPoolingEnabled(false);
1262 BulletGlobals.BridgeTriangleConcaveRaycastCallbackPool.SetPoolingEnabled(false);
1263 BulletGlobals.BridgeTriangleConvexcastCallbackPool.SetPoolingEnabled(false);
1264 BulletGlobals.MyNodeOverlapCallbackPool.SetPoolingEnabled(false);
1265 BulletGlobals.ClosestRayResultCallbackPool.SetPoolingEnabled(false);
1266 BulletGlobals.DebugDrawcallbackPool.SetPoolingEnabled(false);
1267
1224 return world; 1268 return world;
1225 } 1269 }
1226 //m_constraint.ptr, ConstraintParams.BT_CONSTRAINT_STOP_CFM, cfm, ConstraintParamAxis.AXIS_ALL 1270 //m_constraint.ptr, ConstraintParams.BT_CONSTRAINT_STOP_CFM, cfm, ConstraintParamAxis.AXIS_ALL
@@ -1914,7 +1958,7 @@ private sealed class BulletConstraintXNA : BulletConstraint
1914 heightMap, scaleFactor, 1958 heightMap, scaleFactor,
1915 minHeight, maxHeight, upAxis, 1959 minHeight, maxHeight, upAxis,
1916 false); 1960 false);
1917 terrainShape.SetMargin(collisionMargin + 0.5f); 1961 terrainShape.SetMargin(collisionMargin);
1918 terrainShape.SetUseDiamondSubdivision(true); 1962 terrainShape.SetUseDiamondSubdivision(true);
1919 terrainShape.SetUserPointer(id); 1963 terrainShape.SetUserPointer(id);
1920 return new BulletShapeXNA(terrainShape, BSPhysicsShapeType.SHAPE_TERRAIN); 1964 return new BulletShapeXNA(terrainShape, BSPhysicsShapeType.SHAPE_TERRAIN);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 88d50b4..c92c9b9 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -946,7 +946,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
946 946
947 private void ProcessRegularTaints() 947 private void ProcessRegularTaints()
948 { 948 {
949 if (_taintOperations.Count > 0) // save allocating new list if there is nothing to process 949 if (m_initialized && _taintOperations.Count > 0) // save allocating new list if there is nothing to process
950 { 950 {
951 // swizzle a new list into the list location so we can process what's there 951 // swizzle a new list into the list location so we can process what's there
952 List<TaintCallbackEntry> oldList; 952 List<TaintCallbackEntry> oldList;
@@ -989,7 +989,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
989 // Taints that happen after the normal taint processing but before the simulation step. 989 // Taints that happen after the normal taint processing but before the simulation step.
990 private void ProcessPostTaintTaints() 990 private void ProcessPostTaintTaints()
991 { 991 {
992 if (_postTaintOperations.Count > 0) 992 if (m_initialized && _postTaintOperations.Count > 0)
993 { 993 {
994 Dictionary<string, TaintCallbackEntry> oldList; 994 Dictionary<string, TaintCallbackEntry> oldList;
995 lock (_taintLock) 995 lock (_taintLock)