aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2013-07-04 22:32:58 +0100
committerMelanie2013-07-04 22:32:58 +0100
commit5ddcc25ee9de481c40a26aabc57d77c71225162e (patch)
tree298768abaca492365ac1c9786b0d4ce7dae934ab /OpenSim
parentMerge branch 'master' into careminster (diff)
parentGuard against completely unknown user UUIDs. (diff)
downloadopensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.zip
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.gz
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.bz2
opensim-SC-5ddcc25ee9de481c40a26aabc57d77c71225162e.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/IGridUserData.cs1
-rw-r--r--OpenSim/Data/MSSQL/MSSQLGridUserData.cs7
-rw-r--r--OpenSim/Data/MySQL/MySQLGridUserData.cs7
-rw-r--r--OpenSim/Data/MySQL/Resources/FriendsStore.migrations2
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridUserData.cs4
-rw-r--r--OpenSim/Region/Application/OpenSim.cs51
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs96
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs43
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs9
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs23
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs80
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs2
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs2
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs16
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs2
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSMotors.cs15
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs6
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs1
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs89
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs5
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs6
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs32
-rw-r--r--OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs6
-rw-r--r--OpenSim/Services/UserAccountService/GridUserService.cs20
30 files changed, 398 insertions, 191 deletions
diff --git a/OpenSim/Data/IGridUserData.cs b/OpenSim/Data/IGridUserData.cs
index e15a1f8..9afa477 100644
--- a/OpenSim/Data/IGridUserData.cs
+++ b/OpenSim/Data/IGridUserData.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Data
50 public interface IGridUserData 50 public interface IGridUserData
51 { 51 {
52 GridUserData Get(string userID); 52 GridUserData Get(string userID);
53 GridUserData[] GetAll(string query);
53 bool Store(GridUserData data); 54 bool Store(GridUserData data);
54 } 55 }
55} \ No newline at end of file 56} \ No newline at end of file
diff --git a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
index 1870273..fd52122 100644
--- a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Data.MSSQL
50 { 50 {
51 } 51 }
52 52
53 public GridUserData Get(string userID) 53 public new GridUserData Get(string userID)
54 { 54 {
55 GridUserData[] ret = Get("UserID", userID); 55 GridUserData[] ret = Get("UserID", userID);
56 56
@@ -60,5 +60,10 @@ namespace OpenSim.Data.MSSQL
60 return ret[0]; 60 return ret[0];
61 } 61 }
62 62
63 public GridUserData[] GetAll(string userID)
64 {
65 return base.Get(String.Format("UserID LIKE '{0}%'", userID));
66 }
67
63 } 68 }
64} 69}
diff --git a/OpenSim/Data/MySQL/MySQLGridUserData.cs b/OpenSim/Data/MySQL/MySQLGridUserData.cs
index a9ce94d..00560c1 100644
--- a/OpenSim/Data/MySQL/MySQLGridUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridUserData.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.MySQL
46 46
47 public MySQLGridUserData(string connectionString, string realm) : base(connectionString, realm, "GridUserStore") {} 47 public MySQLGridUserData(string connectionString, string realm) : base(connectionString, realm, "GridUserStore") {}
48 48
49 public GridUserData Get(string userID) 49 public new GridUserData Get(string userID)
50 { 50 {
51 GridUserData[] ret = Get("UserID", userID); 51 GridUserData[] ret = Get("UserID", userID);
52 52
@@ -56,6 +56,9 @@ namespace OpenSim.Data.MySQL
56 return ret[0]; 56 return ret[0];
57 } 57 }
58 58
59 59 public GridUserData[] GetAll(string userID)
60 {
61 return base.Get(String.Format("UserID LIKE '{0}%'", userID));
62 }
60 } 63 }
61} \ No newline at end of file 64} \ No newline at end of file
diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
index 55d82ec..5faf956 100644
--- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
@@ -9,7 +9,7 @@ CREATE TABLE `Friends` (
9 `Offered` VARCHAR(32) NOT NULL DEFAULT 0, 9 `Offered` VARCHAR(32) NOT NULL DEFAULT 0,
10 PRIMARY KEY(`PrincipalID`, `Friend`), 10 PRIMARY KEY(`PrincipalID`, `Friend`),
11 KEY(`PrincipalID`) 11 KEY(`PrincipalID`)
12); 12) ENGINE=InnoDB;
13 13
14COMMIT; 14COMMIT;
15 15
diff --git a/OpenSim/Data/SQLite/SQLiteGridUserData.cs b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
index 1bb5ed8..d8c52f8 100644
--- a/OpenSim/Data/SQLite/SQLiteGridUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
@@ -56,6 +56,10 @@ namespace OpenSim.Data.SQLite
56 return ret[0]; 56 return ret[0];
57 } 57 }
58 58
59 public GridUserData[] GetAll(string userID)
60 {
61 return base.Get(String.Format("UserID LIKE '{0}%'", userID));
62 }
59 63
60 } 64 }
61} \ No newline at end of file 65} \ No newline at end of file
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6c22414..87c2792 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -226,18 +226,6 @@ namespace OpenSim
226 "Force the update of all objects on clients", 226 "Force the update of all objects on clients",
227 HandleForceUpdate); 227 HandleForceUpdate);
228 228
229 m_console.Commands.AddCommand("Debug", false, "debug packet",
230 "debug packet <level> [<avatar-first-name> <avatar-last-name>]",
231 "Turn on packet debugging",
232 "If level > 255 then all incoming and outgoing packets are logged.\n"
233 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
234 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
235 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
236 + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n"
237 + "If level <= 0 then no packets are logged.\n"
238 + "If an avatar name is given then only packets from that avatar are logged",
239 Debug);
240
241 m_console.Commands.AddCommand("General", false, "change region", 229 m_console.Commands.AddCommand("General", false, "change region",
242 "change region <region name>", 230 "change region <region name>",
243 "Change current console region", ChangeSelectedRegion); 231 "Change current console region", ChangeSelectedRegion);
@@ -701,45 +689,6 @@ namespace OpenSim
701 RefreshPrompt(); 689 RefreshPrompt();
702 } 690 }
703 691
704 /// <summary>
705 /// Turn on some debugging values for OpenSim.
706 /// </summary>
707 /// <param name="args"></param>
708 protected void Debug(string module, string[] args)
709 {
710 if (args.Length == 1)
711 return;
712
713 switch (args[1])
714 {
715 case "packet":
716 string name = null;
717 if (args.Length == 5)
718 name = string.Format("{0} {1}", args[3], args[4]);
719
720 if (args.Length > 2)
721 {
722 int newDebug;
723 if (int.TryParse(args[2], out newDebug))
724 {
725 SceneManager.SetDebugPacketLevelOnCurrentScene(newDebug, name);
726 // We provide user information elsewhere if any clients had their debug level set.
727// MainConsole.Instance.OutputFormat("Debug packet level set to {0}", newDebug);
728 }
729 else
730 {
731 MainConsole.Instance.Output("Usage: debug packet 0..255");
732 }
733 }
734
735 break;
736
737 default:
738 MainConsole.Instance.Output("Unknown debug command");
739 break;
740 }
741 }
742
743 // see BaseOpenSimServer 692 // see BaseOpenSimServer
744 /// <summary> 693 /// <summary>
745 /// Many commands list objects for debugging. Some of the types are listed here 694 /// Many commands list objects for debugging. Some of the types are listed here
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
index dfc4419..15d6f7f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs
@@ -424,7 +424,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
424 // foreign user is visiting, we need to try again after the first fail to the local 424 // foreign user is visiting, we need to try again after the first fail to the local
425 // asset service. 425 // asset service.
426 string assetServerURL = string.Empty; 426 string assetServerURL = string.Empty;
427 if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) 427 if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL) && !string.IsNullOrEmpty(assetServerURL))
428 { 428 {
429 if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) 429 if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
430 assetServerURL = assetServerURL + "/"; 430 assetServerURL = assetServerURL + "/";
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index d008702..7f14371 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -34,6 +34,7 @@ using System.Net.Sockets;
34using System.Reflection; 34using System.Reflection;
35using System.Threading; 35using System.Threading;
36using log4net; 36using log4net;
37using NDesk.Options;
37using Nini.Config; 38using Nini.Config;
38using OpenMetaverse.Packets; 39using OpenMetaverse.Packets;
39using OpenSim.Framework; 40using OpenSim.Framework;
@@ -102,10 +103,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
102 /// </summary> 103 /// </summary>
103 public class LLUDPServer : OpenSimUDPBase 104 public class LLUDPServer : OpenSimUDPBase
104 { 105 {
106 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
107
105 /// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary> 108 /// <summary>Maximum transmission unit, or UDP packet size, for the LLUDP protocol</summary>
106 public const int MTU = 1400; 109 public const int MTU = 1400;
107 110
108 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 111 /// <summary>
112 /// Default packet debug level given to new clients
113 /// </summary>
114 public int DefaultClientPacketDebugLevel { get; set; }
109 115
110 /// <summary>The measured resolution of Environment.TickCount</summary> 116 /// <summary>The measured resolution of Environment.TickCount</summary>
111 public readonly float TickCountResolution; 117 public readonly float TickCountResolution;
@@ -516,6 +522,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
516 EnablePoolStats(); 522 EnablePoolStats();
517 523
518 MainConsole.Instance.Commands.AddCommand( 524 MainConsole.Instance.Commands.AddCommand(
525 "Debug", false, "debug lludp packet",
526 "debug lludp packet [--default] <level> [<avatar-first-name> <avatar-last-name>]",
527 "Turn on packet debugging",
528 "If level > 255 then all incoming and outgoing packets are logged.\n"
529 + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n"
530 + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n"
531 + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n"
532 + "If level <= 50 then outgoing ImprovedTerseObjectUpdate packets are not logged.\n"
533 + "If level <= 0 then no packets are logged.\n"
534 + "If --default is specified then the level becomes the default logging level for all subsequent agents.\n"
535 + "In this case, you cannot also specify an avatar name.\n"
536 + "If an avatar name is given then only packets from that avatar are logged.",
537 HandlePacketCommand);
538
539 MainConsole.Instance.Commands.AddCommand(
519 "Debug", 540 "Debug",
520 false, 541 false,
521 "debug lludp start", 542 "debug lludp start",
@@ -556,8 +577,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP
556 HandleStatusCommand); 577 HandleStatusCommand);
557 } 578 }
558 579
580 private void HandlePacketCommand(string module, string[] args)
581 {
582 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
583 return;
584
585 bool setAsDefaultLevel = false;
586 OptionSet optionSet = new OptionSet().Add("default", o => setAsDefaultLevel = o != null);
587 List<string> filteredArgs = optionSet.Parse(args);
588
589 string name = null;
590
591 if (filteredArgs.Count == 6)
592 {
593 if (!setAsDefaultLevel)
594 {
595 name = string.Format("{0} {1}", filteredArgs[4], filteredArgs[5]);
596 }
597 else
598 {
599 MainConsole.Instance.OutputFormat("ERROR: Cannot specify a user name when setting default logging level");
600 return;
601 }
602 }
603
604 if (filteredArgs.Count > 3)
605 {
606 int newDebug;
607 if (int.TryParse(filteredArgs[3], out newDebug))
608 {
609 if (setAsDefaultLevel)
610 {
611 DefaultClientPacketDebugLevel = newDebug;
612 MainConsole.Instance.OutputFormat(
613 "Debug packet debug for new clients set to {0}", DefaultClientPacketDebugLevel);
614 }
615 else
616 {
617 m_scene.ForEachScenePresence(sp =>
618 {
619 if (name == null || sp.Name == name)
620 {
621 MainConsole.Instance.OutputFormat(
622 "Packet debug for {0} ({1}) set to {2} in {3}",
623 sp.Name, sp.IsChildAgent ? "child" : "root", newDebug, m_scene.Name);
624
625 sp.ControllingClient.DebugPacketLevel = newDebug;
626 }
627 });
628 }
629 }
630 else
631 {
632 MainConsole.Instance.Output("Usage: debug lludp packet [--default] 0..255 [<first-name> <last-name>]");
633 }
634 }
635 }
636
559 private void HandleStartCommand(string module, string[] args) 637 private void HandleStartCommand(string module, string[] args)
560 { 638 {
639 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
640 return;
641
561 if (args.Length != 4) 642 if (args.Length != 4)
562 { 643 {
563 MainConsole.Instance.Output("Usage: debug lludp start <in|out|all>"); 644 MainConsole.Instance.Output("Usage: debug lludp start <in|out|all>");
@@ -575,6 +656,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
575 656
576 private void HandleStopCommand(string module, string[] args) 657 private void HandleStopCommand(string module, string[] args)
577 { 658 {
659 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
660 return;
661
578 if (args.Length != 4) 662 if (args.Length != 4)
579 { 663 {
580 MainConsole.Instance.Output("Usage: debug lludp stop <in|out|all>"); 664 MainConsole.Instance.Output("Usage: debug lludp stop <in|out|all>");
@@ -592,6 +676,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
592 676
593 private void HandlePoolCommand(string module, string[] args) 677 private void HandlePoolCommand(string module, string[] args)
594 { 678 {
679 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
680 return;
681
595 if (args.Length != 4) 682 if (args.Length != 4)
596 { 683 {
597 MainConsole.Instance.Output("Usage: debug lludp pool <on|off>"); 684 MainConsole.Instance.Output("Usage: debug lludp pool <on|off>");
@@ -624,6 +711,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
624 711
625 private void HandleStatusCommand(string module, string[] args) 712 private void HandleStatusCommand(string module, string[] args)
626 { 713 {
714 if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
715 return;
716
627 MainConsole.Instance.OutputFormat( 717 MainConsole.Instance.OutputFormat(
628 "IN LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningInbound ? "enabled" : "disabled"); 718 "IN LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningInbound ? "enabled" : "disabled");
629 719
@@ -631,6 +721,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
631 "OUT LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningOutbound ? "enabled" : "disabled"); 721 "OUT LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningOutbound ? "enabled" : "disabled");
632 722
633 MainConsole.Instance.OutputFormat("LLUDP pools in {0} are {1}", m_scene.Name, UsePools ? "on" : "off"); 723 MainConsole.Instance.OutputFormat("LLUDP pools in {0} are {1}", m_scene.Name, UsePools ? "on" : "off");
724
725 MainConsole.Instance.OutputFormat(
726 "Packet debug level for new clients is {0}", DefaultClientPacketDebugLevel);
634 } 727 }
635 728
636 public bool HandlesRegion(Location x) 729 public bool HandlesRegion(Location x)
@@ -1544,6 +1637,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1544 1637
1545 client = new LLClientView(m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); 1638 client = new LLClientView(m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
1546 client.OnLogout += LogoutHandler; 1639 client.OnLogout += LogoutHandler;
1640 client.DebugPacketLevel = DefaultClientPacketDebugLevel;
1547 1641
1548 ((LLClientView)client).DisableFacelights = m_disableFacelights; 1642 ((LLClientView)client).DisableFacelights = m_disableFacelights;
1549 1643
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 41ea2a2..6d4c65d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -498,6 +498,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
498 498
499 protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online) 499 protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
500 { 500 {
501 m_log.DebugFormat("[FRIENDS]: Entering StatusNotify for {0}", userID);
502
501 List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend); 503 List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend);
502 List<string> remoteFriendStringIds = new List<string>(); 504 List<string> remoteFriendStringIds = new List<string>();
503 foreach (string friendStringId in friendStringIds) 505 foreach (string friendStringId in friendStringIds)
@@ -523,12 +525,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
523 foreach (PresenceInfo friendSession in friendSessions) 525 foreach (PresenceInfo friendSession in friendSessions)
524 { 526 {
525 // let's guard against sessions-gone-bad 527 // let's guard against sessions-gone-bad
526 if (friendSession.RegionID != UUID.Zero) 528 if (friendSession != null && friendSession.RegionID != UUID.Zero)
527 { 529 {
530 m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID);
528 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); 531 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
529 //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); 532 if (region != null)
530 m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online); 533 {
534 m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online);
535 }
531 } 536 }
537 else
538 m_log.DebugFormat("[FRIENDS]: friend session is null or the region is UUID.Zero");
532 } 539 }
533 } 540 }
534 541
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index ae45b99..a456009 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
252 252
253 protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online) 253 protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
254 { 254 {
255// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering StatusNotify for {0}", userID); 255 m_log.DebugFormat("[HGFRIENDS MODULE]: Entering StatusNotify for {0}", userID);
256 256
257 // First, let's divide the friends on a per-domain basis 257 // First, let's divide the friends on a per-domain basis
258 Dictionary<string, List<FriendInfo>> friendsPerDomain = new Dictionary<string, List<FriendInfo>>(); 258 Dictionary<string, List<FriendInfo>> friendsPerDomain = new Dictionary<string, List<FriendInfo>>();
@@ -348,31 +348,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
348 return null; 348 return null;
349 } 349 }
350 350
351// public override FriendInfo[] GetFriendsFromService(IClientAPI client) 351 public override FriendInfo[] GetFriendsFromService(IClientAPI client)
352// { 352 {
353//// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); 353 // m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
354// Boolean agentIsLocal = true; 354 Boolean agentIsLocal = true;
355// if (UserManagementModule != null) 355 if (UserManagementModule != null)
356// agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId); 356 agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
357
358// if (agentIsLocal)
359// return base.GetFriendsFromService(client);
360 357
361// FriendInfo[] finfos = new FriendInfo[0]; 358 if (agentIsLocal)
362// // Foreigner 359 return base.GetFriendsFromService(client);
363// AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
364// if (agentClientCircuit != null)
365// {
366// //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
367 360
368// finfos = FriendsService.GetFriends(client.AgentId.ToString()); 361 FriendInfo[] finfos = new FriendInfo[0];
369// m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString()); 362 // Foreigner
370// } 363 AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
364 if (agentClientCircuit != null)
365 {
366 // Note that this is calling a different interface than base; this one calls with a string param!
367 finfos = FriendsService.GetFriends(client.AgentId.ToString());
368 m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
369 }
371 370
372//// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name); 371 // m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);
373 372
374// return finfos; 373 return finfos;
375// } 374 }
376 375
377 protected override bool StoreRights(UUID agentID, UUID friendID, int rights) 376 protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
378 { 377 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 7871eda..144895c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -73,6 +73,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
73 73
74 private AssetMetadata FetchMetadata(string url, UUID assetID) 74 private AssetMetadata FetchMetadata(string url, UUID assetID)
75 { 75 {
76 if (string.IsNullOrEmpty(url))
77 return null;
78
76 if (!url.EndsWith("/") && !url.EndsWith("=")) 79 if (!url.EndsWith("/") && !url.EndsWith("="))
77 url = url + "/"; 80 url = url + "/";
78 81
@@ -92,6 +95,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
92 AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); 95 AssetBase asset = m_scene.AssetService.Get(assetID.ToString());
93 if (asset == null) 96 if (asset == null)
94 { 97 {
98 if (string.IsNullOrEmpty(url))
99 return null;
100
95 if (!url.EndsWith("/") && !url.EndsWith("=")) 101 if (!url.EndsWith("/") && !url.EndsWith("="))
96 url = url + "/"; 102 url = url + "/";
97 103
@@ -109,6 +115,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
109 115
110 public bool PostAsset(string url, AssetBase asset) 116 public bool PostAsset(string url, AssetBase asset)
111 { 117 {
118 if (string.IsNullOrEmpty(url))
119 return false;
120
112 if (asset != null) 121 if (asset != null)
113 { 122 {
114 if (!url.EndsWith("/") && !url.EndsWith("=")) 123 if (!url.EndsWith("/") && !url.EndsWith("="))
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index b2b628d..1eae0ac 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
244 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 244 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
245 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 245 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
246 { 246 {
247 m_log.DebugFormat("[HGScene] RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID); 247 m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
248 248
249 //if (fromTaskID.Equals(UUID.Zero)) 249 //if (fromTaskID.Equals(UUID.Zero))
250 //{ 250 //{
@@ -297,7 +297,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
297 if (m_Scene.TryGetScenePresence(userID, out sp)) 297 if (m_Scene.TryGetScenePresence(userID, out sp))
298 { 298 {
299 AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 299 AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
300 if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) 300 if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
301 { 301 {
302 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString(); 302 assetServerURL = aCircuit.ServiceURLs["AssetServerURI"].ToString();
303 assetServerURL = assetServerURL.Trim(new char[] { '/' }); 303 assetServerURL = assetServerURL.Trim(new char[] { '/' });
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 194b591..a7cbc8f 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -135,7 +135,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
135 s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); 135 s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); });
136 } 136 }
137 137
138
139 void EventManager_OnNewClient(IClientAPI client) 138 void EventManager_OnNewClient(IClientAPI client)
140 { 139 {
141 client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed); 140 client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed);
@@ -151,6 +150,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
151 150
152 void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) 151 void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client)
153 { 152 {
153// m_log.DebugFormat(
154// "[USER MANAGEMENT MODULE]: Handling request for name binding of UUID {0} from {1}",
155// uuid, remote_client.Name);
156
154 if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) 157 if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid))
155 { 158 {
156 remote_client.SendNameReply(uuid, "Mr", "OpenSim"); 159 remote_client.SendNameReply(uuid, "Mr", "OpenSim");
@@ -319,8 +322,34 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
319 } 322 }
320 else 323 else
321 { 324 {
325 // Let's try the GridUser service
326 GridUserInfo uInfo = m_Scenes[0].GridUserService.GetGridUserInfo(uuid.ToString());
327 if (uInfo != null)
328 {
329 string url, first, last, tmp;
330 UUID u;
331 if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out u, out url, out first, out last, out tmp))
332 {
333 AddUser(uuid, first, last, url);
334
335 if (m_UserCache.ContainsKey(uuid))
336 {
337 names[0] = m_UserCache[uuid].FirstName;
338 names[1] = m_UserCache[uuid].LastName;
339
340 return true;
341 }
342 }
343 else
344 m_log.DebugFormat("[USER MANAGEMENT MODULE]: Unable to parse UUI {0}", uInfo.UserID);
345 }
346 else
347 {
348 m_log.DebugFormat("[USER MANAGEMENT MODULE]: No grid user found for {0}", uuid);
349 }
350
322 names[0] = "Unknown"; 351 names[0] = "Unknown";
323 names[1] = "UserUMMTGUN3"; 352 names[1] = "UserUMMTGUN7";
324 353
325 return false; 354 return false;
326 } 355 }
@@ -474,7 +503,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
474 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData); 503 //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
475 504
476 UserData oldUser; 505 UserData oldUser;
477 //lock the whole block - prevent concurrent update
478 lock (m_UserCache) 506 lock (m_UserCache)
479 m_UserCache.TryGetValue(id, out oldUser); 507 m_UserCache.TryGetValue(id, out oldUser);
480 508
@@ -512,7 +540,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
512 UserData user = new UserData(); 540 UserData user = new UserData();
513 user.Id = id; 541 user.Id = id;
514 542
515 if (creatorData != null && creatorData != string.Empty) 543 if (!string.IsNullOrEmpty(creatorData))
516 { 544 {
517 //creatorData = <endpoint>;<name> 545 //creatorData = <endpoint>;<name>
518 546
@@ -536,8 +564,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
536 } 564 }
537 else 565 else
538 { 566 {
567 // Temporarily add unknown user entries of this type into the cache so that we can distinguish
568 // this source from other recent (hopefully resolved) bugs that fail to retrieve a user name binding
569 // TODO: Can be removed when GUN* unknown users have definitely dropped significantly or
570 // disappeared.
539 user.FirstName = "Unknown"; 571 user.FirstName = "Unknown";
540 user.LastName = "UserUMMAU"; 572 user.LastName = "UserUMMAU3";
541 } 573 }
542 574
543 AddUserInternal(user); 575 AddUserInternal(user);
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index e434b2e..0e79733 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -546,7 +546,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
546 { 546 {
547 ConsoleDisplayList cdl = new ConsoleDisplayList(); 547 ConsoleDisplayList cdl = new ConsoleDisplayList();
548 cdl.AddRow("Name", so.Name); 548 cdl.AddRow("Name", so.Name);
549 cdl.AddRow("Descrition", so.Description); 549 cdl.AddRow("Description", so.Description);
550 cdl.AddRow("Local ID", so.LocalId); 550 cdl.AddRow("Local ID", so.LocalId);
551 cdl.AddRow("UUID", so.UUID); 551 cdl.AddRow("UUID", so.UUID);
552 cdl.AddRow("Location", string.Format("{0} @ {1}", so.AbsolutePosition, so.Scene.Name)); 552 cdl.AddRow("Location", string.Format("{0} @ {1}", so.AbsolutePosition, so.Scene.Name));
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 436a544..c743190 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5091,6 +5091,7 @@ namespace OpenSim.Region.Framework.Scenes
5091 5091
5092 public void RegionHandleRequest(IClientAPI client, UUID regionID) 5092 public void RegionHandleRequest(IClientAPI client, UUID regionID)
5093 { 5093 {
5094 m_log.DebugFormat("[SCENE]: RegionHandleRequest {0}", regionID);
5094 ulong handle = 0; 5095 ulong handle = 0;
5095 if (regionID == RegionInfo.RegionID) 5096 if (regionID == RegionInfo.RegionID)
5096 handle = RegionInfo.RegionHandle; 5097 handle = RegionInfo.RegionHandle;
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index c70342f..c5c083a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -420,29 +420,6 @@ namespace OpenSim.Region.Framework.Scenes
420 return false; 420 return false;
421 } 421 }
422 422
423 /// <summary>
424 /// Set the debug packet level on each current scene. This level governs which packets are printed out to the
425 /// console.
426 /// </summary>
427 /// <param name="newDebug"></param>
428 /// <param name="name">Name of avatar to debug</param>
429 public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name)
430 {
431 ForEachSelectedScene(scene =>
432 scene.ForEachScenePresence(sp =>
433 {
434 if (name == null || sp.Name == name)
435 {
436 m_log.DebugFormat(
437 "Packet debug for {0} ({1}) set to {2}",
438 sp.Name, sp.IsChildAgent ? "child" : "root", newDebug);
439
440 sp.ControllingClient.DebugPacketLevel = newDebug;
441 }
442 })
443 );
444 }
445
446 public List<ScenePresence> GetCurrentSceneAvatars() 423 public List<ScenePresence> GetCurrentSceneAvatars()
447 { 424 {
448 List<ScenePresence> avatars = new List<ScenePresence>(); 425 List<ScenePresence> avatars = new List<ScenePresence>();
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs
index 75ff24e..bdf4bc0 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs
@@ -50,7 +50,8 @@ public class BSActorMoveToTarget : BSActor
50 // BSActor.isActive 50 // BSActor.isActive
51 public override bool isActive 51 public override bool isActive
52 { 52 {
53 get { return Enabled; } 53 // MoveToTarget only works on physical prims
54 get { return Enabled && m_controllingPrim.IsPhysicallyActive; }
54 } 55 }
55 56
56 // Release any connections and resources used by the actor. 57 // Release any connections and resources used by the actor.
@@ -102,16 +103,28 @@ public class BSActorMoveToTarget : BSActor
102 // We're taking over after this. 103 // We're taking over after this.
103 m_controllingPrim.ZeroMotion(true); 104 m_controllingPrim.ZeroMotion(true);
104 105
105 m_targetMotor = new BSVMotor("BSActorMoveToTargget.Activate", 106 /* Someday use the PID controller
106 m_controllingPrim.MoveToTargetTau, // timeScale 107 m_targetMotor = new BSPIDVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString());
107 BSMotor.Infinite, // decay time scale 108 m_targetMotor.TimeScale = m_controllingPrim.MoveToTargetTau;
108 1f // efficiency 109 m_targetMotor.Efficiency = 1f;
110 */
111 m_targetMotor = new BSVMotor("BSActorMoveToTarget-" + m_controllingPrim.LocalID.ToString(),
112 m_controllingPrim.MoveToTargetTau, // timeScale
113 BSMotor.Infinite, // decay time scale
114 1f // efficiency
109 ); 115 );
110 m_targetMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG so motor will output detail log messages. 116 m_targetMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG so motor will output detail log messages.
111 m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget); 117 m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget);
112 m_targetMotor.SetCurrent(m_controllingPrim.RawPosition); 118 m_targetMotor.SetCurrent(m_controllingPrim.RawPosition);
113 119
114 m_physicsScene.BeforeStep += Mover; 120 // m_physicsScene.BeforeStep += Mover;
121 m_physicsScene.BeforeStep += Mover2;
122 }
123 else
124 {
125 // If already allocated, make sure the target and other paramters are current
126 m_targetMotor.SetTarget(m_controllingPrim.MoveToTargetTarget);
127 m_targetMotor.SetCurrent(m_controllingPrim.RawPosition);
115 } 128 }
116 } 129 }
117 130
@@ -119,12 +132,16 @@ public class BSActorMoveToTarget : BSActor
119 { 132 {
120 if (m_targetMotor != null) 133 if (m_targetMotor != null)
121 { 134 {
122 m_physicsScene.BeforeStep -= Mover; 135 // m_physicsScene.BeforeStep -= Mover;
136 m_physicsScene.BeforeStep -= Mover2;
123 m_targetMotor = null; 137 m_targetMotor = null;
124 } 138 }
125 } 139 }
126 140
127 // Called just before the simulation step. Update the vertical position for hoverness. 141 // Origional mover that set the objects position to move to the target.
142 // The problem was that gravity would keep trying to push the object down so
143 // the overall downward velocity would increase to infinity.
144 // Called just before the simulation step.
128 private void Mover(float timeStep) 145 private void Mover(float timeStep)
129 { 146 {
130 // Don't do hovering while the object is selected. 147 // Don't do hovering while the object is selected.
@@ -142,6 +159,7 @@ public class BSActorMoveToTarget : BSActor
142 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,zeroMovement,movePos={1},pos={2},mass={3}", 159 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,zeroMovement,movePos={1},pos={2},mass={3}",
143 m_controllingPrim.LocalID, movePosition, m_controllingPrim.RawPosition, m_controllingPrim.Mass); 160 m_controllingPrim.LocalID, movePosition, m_controllingPrim.RawPosition, m_controllingPrim.Mass);
144 m_controllingPrim.ForcePosition = m_targetMotor.TargetValue; 161 m_controllingPrim.ForcePosition = m_targetMotor.TargetValue;
162 m_controllingPrim.ForceVelocity = OMV.Vector3.Zero;
145 // Setting the position does not cause the physics engine to generate a property update. Force it. 163 // Setting the position does not cause the physics engine to generate a property update. Force it.
146 m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody); 164 m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody);
147 } 165 }
@@ -151,7 +169,51 @@ public class BSActorMoveToTarget : BSActor
151 // Setting the position does not cause the physics engine to generate a property update. Force it. 169 // Setting the position does not cause the physics engine to generate a property update. Force it.
152 m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody); 170 m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody);
153 } 171 }
154 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,move,fromPos={1},movePos={2}", m_controllingPrim.LocalID, origPosition, movePosition); 172 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover,move,fromPos={1},movePos={2}",
173 m_controllingPrim.LocalID, origPosition, movePosition);
174 }
175
176 // Version of mover that applies forces to move the physical object to the target.
177 // Also overcomes gravity so the object doesn't just drop to the ground.
178 // Called just before the simulation step.
179 private void Mover2(float timeStep)
180 {
181 // Don't do hovering while the object is selected.
182 if (!isActive)
183 return;
184
185 OMV.Vector3 origPosition = m_controllingPrim.RawPosition; // DEBUG DEBUG (for printout below)
186 OMV.Vector3 addedForce = OMV.Vector3.Zero;
187
188 // CorrectionVector is the movement vector required this step
189 OMV.Vector3 correctionVector = m_targetMotor.Step(timeStep, m_controllingPrim.RawPosition);
190
191 // If we are very close to our target, turn off the movement motor.
192 if (m_targetMotor.ErrorIsZero())
193 {
194 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover3,zeroMovement,pos={1},mass={2}",
195 m_controllingPrim.LocalID, m_controllingPrim.RawPosition, m_controllingPrim.Mass);
196 m_controllingPrim.ForcePosition = m_targetMotor.TargetValue;
197 m_controllingPrim.ForceVelocity = OMV.Vector3.Zero;
198 // Setting the position does not cause the physics engine to generate a property update. Force it.
199 m_physicsScene.PE.PushUpdate(m_controllingPrim.PhysBody);
200 }
201 else
202 {
203 // First force to move us there -- the motor return a timestep scaled value.
204 addedForce = correctionVector / timeStep;
205 // Remove the existing velocity (only the moveToTarget force counts)
206 addedForce -= m_controllingPrim.RawVelocity;
207 // Overcome gravity.
208 addedForce -= m_controllingPrim.Gravity;
209
210 // Add enough force to overcome the mass of the object
211 addedForce *= m_controllingPrim.Mass;
212
213 m_controllingPrim.AddForce(addedForce, false /* pushForce */, true /* inTaintTime */);
214 }
215 m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover3,move,fromPos={1},addedForce={2}",
216 m_controllingPrim.LocalID, origPosition, addedForce);
155 } 217 }
156} 218}
157} 219}
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 48f842e..5ef6992 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -626,7 +626,7 @@ public sealed class BSCharacter : BSPhysObject
626 OMV.Vector3 addForce = force / PhysScene.LastTimeStep; 626 OMV.Vector3 addForce = force / PhysScene.LastTimeStep;
627 AddForce(addForce, pushforce, false); 627 AddForce(addForce, pushforce, false);
628 } 628 }
629 private void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { 629 public override void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) {
630 if (force.IsFinite()) 630 if (force.IsFinite())
631 { 631 {
632 OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); 632 OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 07e87d1..aa247dd 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1276 1276
1277 VehicleAddForce(appliedGravity); 1277 VehicleAddForce(appliedGravity);
1278 1278
1279 VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},collid={2},fudge={3},mass={4},appliedForce={3}", 1279 VDetailLog("{0}, MoveLinear,applyGravity,vehGrav={1},collid={2},fudge={3},mass={4},appliedForce={5}",
1280 ControllingPrim.LocalID, m_VehicleGravity, 1280 ControllingPrim.LocalID, m_VehicleGravity,
1281 ControllingPrim.IsColliding, BSParam.VehicleGroundGravityFudge, m_vehicleMass, appliedGravity); 1281 ControllingPrim.IsColliding, BSParam.VehicleGroundGravityFudge, m_vehicleMass, appliedGravity);
1282 } 1282 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index 76c2187..ad8e10f 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -33,14 +33,6 @@ using OMV = OpenMetaverse;
33namespace OpenSim.Region.Physics.BulletSPlugin 33namespace OpenSim.Region.Physics.BulletSPlugin
34{ 34{
35 35
36// A BSPrim can get individual information about its linkedness attached
37// to it through an instance of a subclass of LinksetInfo.
38// Each type of linkset will define the information needed for its type.
39public abstract class BSLinksetInfo
40{
41 public virtual void Clear() { }
42}
43
44public abstract class BSLinkset 36public abstract class BSLinkset
45{ 37{
46 // private static string LogHeader = "[BULLETSIM LINKSET]"; 38 // private static string LogHeader = "[BULLETSIM LINKSET]";
@@ -56,15 +48,15 @@ public abstract class BSLinkset
56 { 48 {
57 BSLinkset ret = null; 49 BSLinkset ret = null;
58 50
59 switch ((int)BSParam.LinksetImplementation) 51 switch (parent.LinksetType)
60 { 52 {
61 case (int)LinksetImplementation.Constraint: 53 case LinksetImplementation.Constraint:
62 ret = new BSLinksetConstraints(physScene, parent); 54 ret = new BSLinksetConstraints(physScene, parent);
63 break; 55 break;
64 case (int)LinksetImplementation.Compound: 56 case LinksetImplementation.Compound:
65 ret = new BSLinksetCompound(physScene, parent); 57 ret = new BSLinksetCompound(physScene, parent);
66 break; 58 break;
67 case (int)LinksetImplementation.Manual: 59 case LinksetImplementation.Manual:
68 // ret = new BSLinksetManual(physScene, parent); 60 // ret = new BSLinksetManual(physScene, parent);
69 break; 61 break;
70 default: 62 default:
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 350a5d1..308cf13 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -238,7 +238,6 @@ public sealed class BSLinksetCompound : BSLinkset
238 // there will already be a rebuild scheduled. 238 // there will already be a rebuild scheduled.
239 DetailLog("{0},BSLinksetCompound.UpdateProperties,couldNotUpdateChild.schedulingRebuild,whichUpdated={1}", 239 DetailLog("{0},BSLinksetCompound.UpdateProperties,couldNotUpdateChild.schedulingRebuild,whichUpdated={1}",
240 updated.LocalID, whichUpdated); 240 updated.LocalID, whichUpdated);
241 updated.LinksetInfo = null; // setting to 'null' causes relative position to be recomputed.
242 ScheduleRebuild(updated); 241 ScheduleRebuild(updated);
243 } 242 }
244 } 243 }
@@ -294,7 +293,6 @@ public sealed class BSLinksetCompound : BSLinkset
294 child.LocalID, child.PhysBody.AddrString); 293 child.LocalID, child.PhysBody.AddrString);
295 294
296 // Cause the child's body to be rebuilt and thus restored to normal operation 295 // Cause the child's body to be rebuilt and thus restored to normal operation
297 child.LinksetInfo = null;
298 child.ForceBodyShapeRebuild(false); 296 child.ForceBodyShapeRebuild(false);
299 297
300 if (!HasAnyChildren) 298 if (!HasAnyChildren)
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs b/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs
index ef662b5..1214703 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs
@@ -144,7 +144,6 @@ public class BSVMotor : BSMotor
144 144
145 Vector3 correction = Vector3.Zero; 145 Vector3 correction = Vector3.Zero;
146 Vector3 error = TargetValue - CurrentValue; 146 Vector3 error = TargetValue - CurrentValue;
147 LastError = error;
148 if (!ErrorIsZero(error)) 147 if (!ErrorIsZero(error))
149 { 148 {
150 correction = StepError(timeStep, error); 149 correction = StepError(timeStep, error);
@@ -179,6 +178,7 @@ public class BSVMotor : BSMotor
179 MDetailLog("{0}, BSVMotor.Step,zero,{1},origTgt={2},origCurr={3},currTgt={4},currCurr={5}", 178 MDetailLog("{0}, BSVMotor.Step,zero,{1},origTgt={2},origCurr={3},currTgt={4},currCurr={5}",
180 BSScene.DetailLogZero, UseName, origCurrVal, origTarget, TargetValue, CurrentValue); 179 BSScene.DetailLogZero, UseName, origCurrVal, origTarget, TargetValue, CurrentValue);
181 } 180 }
181 LastError = error;
182 182
183 return correction; 183 return correction;
184 } 184 }
@@ -293,7 +293,6 @@ public class BSFMotor : BSMotor
293 293
294 float correction = 0f; 294 float correction = 0f;
295 float error = TargetValue - CurrentValue; 295 float error = TargetValue - CurrentValue;
296 LastError = error;
297 if (!ErrorIsZero(error)) 296 if (!ErrorIsZero(error))
298 { 297 {
299 correction = StepError(timeStep, error); 298 correction = StepError(timeStep, error);
@@ -328,6 +327,7 @@ public class BSFMotor : BSMotor
328 MDetailLog("{0}, BSFMotor.Step,zero,{1},origTgt={2},origCurr={3},ret={4}", 327 MDetailLog("{0}, BSFMotor.Step,zero,{1},origTgt={2},origCurr={3},ret={4}",
329 BSScene.DetailLogZero, UseName, origCurrVal, origTarget, CurrentValue); 328 BSScene.DetailLogZero, UseName, origCurrVal, origTarget, CurrentValue);
330 } 329 }
330 LastError = error;
331 331
332 return CurrentValue; 332 return CurrentValue;
333 } 333 }
@@ -363,7 +363,7 @@ public class BSFMotor : BSMotor
363 363
364// ============================================================================ 364// ============================================================================
365// ============================================================================ 365// ============================================================================
366// Proportional, Integral, Derivitive Motor 366// Proportional, Integral, Derivitive ("PID") Motor
367// Good description at http://www.answers.com/topic/pid-controller . Includes processes for choosing p, i and d factors. 367// Good description at http://www.answers.com/topic/pid-controller . Includes processes for choosing p, i and d factors.
368public class BSPIDVMotor : BSVMotor 368public class BSPIDVMotor : BSVMotor
369{ 369{
@@ -434,15 +434,14 @@ public class BSPIDVMotor : BSVMotor
434 434
435 // A simple derivitive is the rate of change from the last error. 435 // A simple derivitive is the rate of change from the last error.
436 Vector3 derivitive = (error - LastError) * timeStep; 436 Vector3 derivitive = (error - LastError) * timeStep;
437 LastError = error;
438 437
439 // Correction = (proportionOfPresentError + accumulationOfPastError + rateOfChangeOfError) 438 // Correction = (proportionOfPresentError + accumulationOfPastError + rateOfChangeOfError)
440 Vector3 ret = error * timeStep * proportionFactor * FactorMix.X 439 Vector3 ret = error / TimeScale * timeStep * proportionFactor * FactorMix.X
441 + RunningIntegration * integralFactor * FactorMix.Y 440 + RunningIntegration / TimeScale * integralFactor * FactorMix.Y
442 + derivitive * derivFactor * FactorMix.Z 441 + derivitive / TimeScale * derivFactor * FactorMix.Z
443 ; 442 ;
444 443
445 MDetailLog("{0},BSPIDVMotor.step,ts={1},err={2},runnInt={3},deriv={4},ret={5}", 444 MDetailLog("{0}, BSPIDVMotor.step,ts={1},err={2},runnInt={3},deriv={4},ret={5}",
446 BSScene.DetailLogZero, timeStep, error, RunningIntegration, derivitive, ret); 445 BSScene.DetailLogZero, timeStep, error, RunningIntegration, derivitive, ret);
447 446
448 return ret; 447 return ret;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 6437b04..d17c8e7 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -706,7 +706,7 @@ public static class BSParam
706 new ParameterDefn<float>("ResetBroadphasePool", "Setting this is any value resets the broadphase collision pool", 706 new ParameterDefn<float>("ResetBroadphasePool", "Setting this is any value resets the broadphase collision pool",
707 0f, 707 0f,
708 (s) => { return 0f; }, 708 (s) => { return 0f; },
709 (s,v) => { BSParam.ResetBroadphasePoolTainted(s, v); } ), 709 (s,v) => { BSParam.ResetBroadphasePoolTainted(s, v, false /* inTaintTime */); } ),
710 new ParameterDefn<float>("ResetConstraintSolver", "Setting this is any value resets the constraint solver", 710 new ParameterDefn<float>("ResetConstraintSolver", "Setting this is any value resets the constraint solver",
711 0f, 711 0f,
712 (s) => { return 0f; }, 712 (s) => { return 0f; },
@@ -792,10 +792,10 @@ public static class BSParam
792 // ===================================================================== 792 // =====================================================================
793 // There are parameters that, when set, cause things to happen in the physics engine. 793 // There are parameters that, when set, cause things to happen in the physics engine.
794 // This causes the broadphase collision cache to be cleared. 794 // This causes the broadphase collision cache to be cleared.
795 private static void ResetBroadphasePoolTainted(BSScene pPhysScene, float v) 795 private static void ResetBroadphasePoolTainted(BSScene pPhysScene, float v, bool inTaintTime)
796 { 796 {
797 BSScene physScene = pPhysScene; 797 BSScene physScene = pPhysScene;
798 physScene.TaintedObject("BSParam.ResetBroadphasePoolTainted", delegate() 798 physScene.TaintedObject(inTaintTime, "BSParam.ResetBroadphasePoolTainted", delegate()
799 { 799 {
800 physScene.PE.ResetBroadphasePool(physScene.World); 800 physScene.PE.ResetBroadphasePool(physScene.World);
801 }); 801 });
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index a4c5e08..a0d5c42 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -210,6 +210,7 @@ public abstract class BSPhysObject : PhysicsActor
210 AddAngularForce(force, pushforce, false); 210 AddAngularForce(force, pushforce, false);
211 } 211 }
212 public abstract void AddAngularForce(OMV.Vector3 force, bool pushforce, bool inTaintTime); 212 public abstract void AddAngularForce(OMV.Vector3 force, bool pushforce, bool inTaintTime);
213 public abstract void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime);
213 214
214 public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } 215 public abstract OMV.Vector3 ForceRotationalVelocity { get; set; }
215 216
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 95bdc7b..b2947c6 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -70,18 +70,17 @@ public class BSPrim : BSPhysObject
70 private int CrossingFailures { get; set; } 70 private int CrossingFailures { get; set; }
71 71
72 // Keep a handle to the vehicle actor so it is easy to set parameters on same. 72 // Keep a handle to the vehicle actor so it is easy to set parameters on same.
73 public BSDynamics VehicleActor;
74 public const string VehicleActorName = "BasicVehicle"; 73 public const string VehicleActorName = "BasicVehicle";
75 74
76 // Parameters for the hover actor 75 // Parameters for the hover actor
77 public const string HoverActorName = "HoverActor"; 76 public const string HoverActorName = "BSPrim.HoverActor";
78 // Parameters for the axis lock actor 77 // Parameters for the axis lock actor
79 public const String LockedAxisActorName = "BSPrim.LockedAxis"; 78 public const String LockedAxisActorName = "BSPrim.LockedAxis";
80 // Parameters for the move to target actor 79 // Parameters for the move to target actor
81 public const string MoveToTargetActorName = "MoveToTargetActor"; 80 public const string MoveToTargetActorName = "BSPrim.MoveToTargetActor";
82 // Parameters for the setForce and setTorque actors 81 // Parameters for the setForce and setTorque actors
83 public const string SetForceActorName = "SetForceActor"; 82 public const string SetForceActorName = "BSPrim.SetForceActor";
84 public const string SetTorqueActorName = "SetTorqueActor"; 83 public const string SetTorqueActorName = "BSPrim.SetTorqueActor";
85 84
86 public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, 85 public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
87 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical) 86 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
@@ -100,9 +99,8 @@ public class BSPrim : BSPhysObject
100 _isPhysical = pisPhysical; 99 _isPhysical = pisPhysical;
101 _isVolumeDetect = false; 100 _isVolumeDetect = false;
102 101
103 // We keep a handle to the vehicle actor so we can set vehicle parameters later. 102 // Add a dynamic vehicle to our set of actors that can move this prim.
104 VehicleActor = new BSDynamics(PhysScene, this, VehicleActorName); 103 PhysicalActors.Add(VehicleActorName, new BSDynamics(PhysScene, this, VehicleActorName));
105 PhysicalActors.Add(VehicleActorName, VehicleActor);
106 104
107 _mass = CalculateMass(); 105 _mass = CalculateMass();
108 106
@@ -450,6 +448,9 @@ public class BSPrim : BSPhysObject
450 Gravity = ComputeGravity(Buoyancy); 448 Gravity = ComputeGravity(Buoyancy);
451 PhysScene.PE.SetGravity(PhysBody, Gravity); 449 PhysScene.PE.SetGravity(PhysBody, Gravity);
452 450
451 OMV.Vector3 currentScale = PhysScene.PE.GetLocalScaling(PhysShape.physShapeInfo); // DEBUG DEBUG
452 DetailLog("{0},BSPrim.UpdateMassProperties,currentScale{1},shape={2}", LocalID, currentScale, PhysShape.physShapeInfo); // DEBUG DEBUG
453
453 Inertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); 454 Inertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass);
454 PhysScene.PE.SetMassProps(PhysBody, physMass, Inertia); 455 PhysScene.PE.SetMassProps(PhysBody, physMass, Inertia);
455 PhysScene.PE.UpdateInertiaTensor(PhysBody); 456 PhysScene.PE.UpdateInertiaTensor(PhysBody);
@@ -502,9 +503,25 @@ public class BSPrim : BSPhysObject
502 } 503 }
503 } 504 }
504 505
506 // Find and return a handle to the current vehicle actor.
507 // Return 'null' if there is no vehicle actor.
508 public BSDynamics GetVehicleActor()
509 {
510 BSDynamics ret = null;
511 BSActor actor;
512 if (PhysicalActors.TryGetActor(VehicleActorName, out actor))
513 {
514 ret = actor as BSDynamics;
515 }
516 return ret;
517 }
505 public override int VehicleType { 518 public override int VehicleType {
506 get { 519 get {
507 return (int)VehicleActor.Type; 520 int ret = (int)Vehicle.TYPE_NONE;
521 BSDynamics vehicleActor = GetVehicleActor();
522 if (vehicleActor != null)
523 ret = (int)vehicleActor.Type;
524 return ret;
508 } 525 }
509 set { 526 set {
510 Vehicle type = (Vehicle)value; 527 Vehicle type = (Vehicle)value;
@@ -515,8 +532,12 @@ public class BSPrim : BSPhysObject
515 // change all the parameters. Like a plane changing to CAR when on the 532 // change all the parameters. Like a plane changing to CAR when on the
516 // ground. In this case, don't want to zero motion. 533 // ground. In this case, don't want to zero motion.
517 // ZeroMotion(true /* inTaintTime */); 534 // ZeroMotion(true /* inTaintTime */);
518 VehicleActor.ProcessTypeChange(type); 535 BSDynamics vehicleActor = GetVehicleActor();
519 ActivateIfPhysical(false); 536 if (vehicleActor != null)
537 {
538 vehicleActor.ProcessTypeChange(type);
539 ActivateIfPhysical(false);
540 }
520 }); 541 });
521 } 542 }
522 } 543 }
@@ -524,31 +545,47 @@ public class BSPrim : BSPhysObject
524 { 545 {
525 PhysScene.TaintedObject("BSPrim.VehicleFloatParam", delegate() 546 PhysScene.TaintedObject("BSPrim.VehicleFloatParam", delegate()
526 { 547 {
527 VehicleActor.ProcessFloatVehicleParam((Vehicle)param, value); 548 BSDynamics vehicleActor = GetVehicleActor();
528 ActivateIfPhysical(false); 549 if (vehicleActor != null)
550 {
551 vehicleActor.ProcessFloatVehicleParam((Vehicle)param, value);
552 ActivateIfPhysical(false);
553 }
529 }); 554 });
530 } 555 }
531 public override void VehicleVectorParam(int param, OMV.Vector3 value) 556 public override void VehicleVectorParam(int param, OMV.Vector3 value)
532 { 557 {
533 PhysScene.TaintedObject("BSPrim.VehicleVectorParam", delegate() 558 PhysScene.TaintedObject("BSPrim.VehicleVectorParam", delegate()
534 { 559 {
535 VehicleActor.ProcessVectorVehicleParam((Vehicle)param, value); 560 BSDynamics vehicleActor = GetVehicleActor();
536 ActivateIfPhysical(false); 561 if (vehicleActor != null)
562 {
563 vehicleActor.ProcessVectorVehicleParam((Vehicle)param, value);
564 ActivateIfPhysical(false);
565 }
537 }); 566 });
538 } 567 }
539 public override void VehicleRotationParam(int param, OMV.Quaternion rotation) 568 public override void VehicleRotationParam(int param, OMV.Quaternion rotation)
540 { 569 {
541 PhysScene.TaintedObject("BSPrim.VehicleRotationParam", delegate() 570 PhysScene.TaintedObject("BSPrim.VehicleRotationParam", delegate()
542 { 571 {
543 VehicleActor.ProcessRotationVehicleParam((Vehicle)param, rotation); 572 BSDynamics vehicleActor = GetVehicleActor();
544 ActivateIfPhysical(false); 573 if (vehicleActor != null)
574 {
575 vehicleActor.ProcessRotationVehicleParam((Vehicle)param, rotation);
576 ActivateIfPhysical(false);
577 }
545 }); 578 });
546 } 579 }
547 public override void VehicleFlags(int param, bool remove) 580 public override void VehicleFlags(int param, bool remove)
548 { 581 {
549 PhysScene.TaintedObject("BSPrim.VehicleFlags", delegate() 582 PhysScene.TaintedObject("BSPrim.VehicleFlags", delegate()
550 { 583 {
551 VehicleActor.ProcessVehicleFlags(param, remove); 584 BSDynamics vehicleActor = GetVehicleActor();
585 if (vehicleActor != null)
586 {
587 vehicleActor.ProcessVehicleFlags(param, remove);
588 }
552 }); 589 });
553 } 590 }
554 591
@@ -1040,6 +1077,20 @@ public class BSPrim : BSPhysObject
1040 } 1077 }
1041 } 1078 }
1042 1079
1080 public override OMV.Vector3 PIDTarget
1081 {
1082 set
1083 {
1084 base.PIDTarget = value;
1085 BSActor actor;
1086 if (PhysicalActors.TryGetActor(MoveToTargetActorName, out actor))
1087 {
1088 // if the actor exists, tell it to refresh its values.
1089 actor.Refresh();
1090 }
1091
1092 }
1093 }
1043 // Used for llSetHoverHeight and maybe vehicle height 1094 // Used for llSetHoverHeight and maybe vehicle height
1044 // Hover Height will override MoveTo target's Z 1095 // Hover Height will override MoveTo target's Z
1045 public override bool PIDHoverActive { 1096 public override bool PIDHoverActive {
@@ -1063,7 +1114,7 @@ public class BSPrim : BSPhysObject
1063 1114
1064 // Applying a force just adds this to the total force on the object. 1115 // Applying a force just adds this to the total force on the object.
1065 // This added force will only last the next simulation tick. 1116 // This added force will only last the next simulation tick.
1066 public void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { 1117 public override void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) {
1067 // for an object, doesn't matter if force is a pushforce or not 1118 // for an object, doesn't matter if force is a pushforce or not
1068 if (IsPhysicallyActive) 1119 if (IsPhysicallyActive)
1069 { 1120 {
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
index 235da78..87eed98 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -41,12 +41,15 @@ public class BSPrimLinkable : BSPrimDisplaced
41 // The index of this child prim. 41 // The index of this child prim.
42 public int LinksetChildIndex { get; set; } 42 public int LinksetChildIndex { get; set; }
43 43
44 public BSLinksetInfo LinksetInfo { get; set; } 44 public BSLinkset.LinksetImplementation LinksetType { get; set; }
45 45
46 public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size, 46 public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
47 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical) 47 OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
48 : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical) 48 : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
49 { 49 {
50 // Default linkset implementation for this prim
51 LinksetType = (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation;
52
50 Linkset = BSLinkset.Factory(PhysScene, this); 53 Linkset = BSLinkset.Factory(PhysScene, this);
51 54
52 PhysScene.TaintedObject("BSPrimLinksetCompound.Refresh", delegate() 55 PhysScene.TaintedObject("BSPrimLinksetCompound.Refresh", delegate()
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index dec6b6f..1645c98 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -223,8 +223,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
223 // can be left in and every call doesn't have to check for null. 223 // can be left in and every call doesn't have to check for null.
224 if (m_physicsLoggingEnabled) 224 if (m_physicsLoggingEnabled)
225 { 225 {
226 PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); 226 PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes, m_physicsLoggingDoFlush);
227 PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output error messages. 227 PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output its own error messages.
228 } 228 }
229 else 229 else
230 { 230 {
@@ -1106,8 +1106,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1106 public void DetailLog(string msg, params Object[] args) 1106 public void DetailLog(string msg, params Object[] args)
1107 { 1107 {
1108 PhysicsLogging.Write(msg, args); 1108 PhysicsLogging.Write(msg, args);
1109 // Add the Flush() if debugging crashes. Gets all the messages written out.
1110 if (m_physicsLoggingDoFlush) PhysicsLogging.Flush();
1111 } 1109 }
1112 // Used to fill in the LocalID when there isn't one. It's the correct number of characters. 1110 // Used to fill in the LocalID when there isn't one. It's the correct number of characters.
1113 public const string DetailLogZero = "0000000000"; 1111 public const string DetailLogZero = "0000000000";
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs b/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs
index b040e21..583c436 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs
@@ -114,21 +114,25 @@ public class BasicVehicles : OpenSimTestCase
114 // Instead the appropriate values are set and calls are made just the parts of the 114 // Instead the appropriate values are set and calls are made just the parts of the
115 // controller we want to exercise. Stepping the physics engine then applies 115 // controller we want to exercise. Stepping the physics engine then applies
116 // the actions of that one feature. 116 // the actions of that one feature.
117 TestVehicle.VehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, efficiency); 117 BSDynamics vehicleActor = TestVehicle.GetVehicleActor();
118 TestVehicle.VehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, timeScale); 118 if (vehicleActor != null)
119 TestVehicle.VehicleActor.enableAngularVerticalAttraction = true;
120
121 TestVehicle.IsPhysical = true;
122 PhysicsScene.ProcessTaints();
123
124 // Step the simulator a bunch of times and vertical attraction should orient the vehicle up
125 for (int ii = 0; ii < simSteps; ii++)
126 { 119 {
127 TestVehicle.VehicleActor.ForgetKnownVehicleProperties(); 120 vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, efficiency);
128 TestVehicle.VehicleActor.ComputeAngularVerticalAttraction(); 121 vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, timeScale);
129 TestVehicle.VehicleActor.PushKnownChanged(); 122 vehicleActor.enableAngularVerticalAttraction = true;
130 123
131 PhysicsScene.Simulate(simulationTimeStep); 124 TestVehicle.IsPhysical = true;
125 PhysicsScene.ProcessTaints();
126
127 // Step the simulator a bunch of times and vertical attraction should orient the vehicle up
128 for (int ii = 0; ii < simSteps; ii++)
129 {
130 vehicleActor.ForgetKnownVehicleProperties();
131 vehicleActor.ComputeAngularVerticalAttraction();
132 vehicleActor.PushKnownChanged();
133
134 PhysicsScene.Simulate(simulationTimeStep);
135 }
132 } 136 }
133 137
134 TestVehicle.IsPhysical = false; 138 TestVehicle.IsPhysical = false;
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 687cf8d..7483395 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -185,10 +185,12 @@ namespace OpenSim.Server.Handlers.GridUser
185 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(user); 185 GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(user);
186 186
187 Dictionary<string, object> result = new Dictionary<string, object>(); 187 Dictionary<string, object> result = new Dictionary<string, object>();
188 result["result"] = guinfo.ToKeyValuePairs(); 188 if (guinfo != null)
189 result["result"] = guinfo.ToKeyValuePairs();
190 else
191 result["result"] = "null";
189 192
190 string xmlString = ServerUtils.BuildXmlResponse(result); 193 string xmlString = ServerUtils.BuildXmlResponse(result);
191
192 //m_log.DebugFormat("[GRID USER HANDLER]: resp string: {0}", xmlString); 194 //m_log.DebugFormat("[GRID USER HANDLER]: resp string: {0}", xmlString);
193 return Util.UTF8NoBomEncoding.GetBytes(xmlString); 195 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
194 } 196 }
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs
index 8388180..fa9a4a8 100644
--- a/OpenSim/Services/UserAccountService/GridUserService.cs
+++ b/OpenSim/Services/UserAccountService/GridUserService.cs
@@ -46,12 +46,28 @@ namespace OpenSim.Services.UserAccountService
46 46
47 public GridUserService(IConfigSource config) : base(config) 47 public GridUserService(IConfigSource config) : base(config)
48 { 48 {
49 m_log.Debug("[USER GRID SERVICE]: Starting user grid service"); 49 m_log.Debug("[GRID USER SERVICE]: Starting user grid service");
50 } 50 }
51 51
52 public virtual GridUserInfo GetGridUserInfo(string userID) 52 public virtual GridUserInfo GetGridUserInfo(string userID)
53 { 53 {
54 GridUserData d = m_Database.Get(userID); 54 GridUserData d = null;
55 if (userID.Length > 36) // it's a UUI
56 d = m_Database.Get(userID);
57 else // it's a UUID
58 {
59 GridUserData[] ds = m_Database.GetAll(userID);
60 if (ds == null)
61 return null;
62
63 if (ds.Length > 0)
64 {
65 d = ds[0];
66 foreach (GridUserData dd in ds)
67 if (dd.UserID.Length > d.UserID.Length) // find the longest
68 d = dd;
69 }
70 }
55 71
56 if (d == null) 72 if (d == null)
57 return null; 73 return null;