aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs66
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs116
2 files changed, 130 insertions, 52 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index f19e391..e50dac6 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -141,6 +141,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
141 availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod); 141 availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod);
142 142
143 // Agent management 143 // Agent management
144 availableMethods["admin_get_agents"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcGetAgentsMethod);
144 availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod); 145 availableMethods["admin_teleport_agent"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcTeleportAgentMethod);
145 146
146 // User management 147 // User management
@@ -1901,6 +1902,71 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1901 m_log.Info("[RADMIN]: Access List List Request complete"); 1902 m_log.Info("[RADMIN]: Access List List Request complete");
1902 } 1903 }
1903 1904
1905 private void XmlRpcGetAgentsMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
1906 {
1907 Hashtable responseData = (Hashtable)response.Value;
1908 Hashtable requestData = (Hashtable)request.Params[0];
1909
1910 bool includeChildren = false;
1911
1912 if (requestData.Contains("include_children"))
1913 bool.TryParse((string)requestData["include_children"], out includeChildren);
1914
1915 Scene scene;
1916 GetSceneFromRegionParams(requestData, responseData, out scene);
1917
1918 ArrayList xmlRpcRegions = new ArrayList();
1919 responseData["regions"] = xmlRpcRegions;
1920
1921 Hashtable xmlRpcRegion = new Hashtable();
1922 xmlRpcRegions.Add(xmlRpcRegion);
1923
1924 xmlRpcRegion["name"] = scene.Name;
1925 xmlRpcRegion["id"] = scene.RegionInfo.RegionID.ToString();
1926
1927 List<ScenePresence> agents = scene.GetScenePresences();
1928 ArrayList xmlrpcAgents = new ArrayList();
1929
1930 foreach (ScenePresence agent in agents)
1931 {
1932 if (agent.IsChildAgent && !includeChildren)
1933 continue;
1934
1935 Hashtable xmlRpcAgent = new Hashtable();
1936 xmlRpcAgent.Add("name", agent.Name);
1937 xmlRpcAgent.Add("id", agent.UUID.ToString());
1938 xmlRpcAgent.Add("type", agent.PresenceType.ToString());
1939 xmlRpcAgent.Add("current_parcel_id", agent.currentParcelUUID.ToString());
1940
1941 Vector3 pos = agent.AbsolutePosition;
1942 xmlRpcAgent.Add("pos_x", pos.X.ToString());
1943 xmlRpcAgent.Add("pos_y", pos.Y.ToString());
1944 xmlRpcAgent.Add("pos_z", pos.Z.ToString());
1945
1946 Vector3 lookAt = agent.Lookat;
1947 xmlRpcAgent.Add("lookat_x", lookAt.X.ToString());
1948 xmlRpcAgent.Add("lookat_y", lookAt.Y.ToString());
1949 xmlRpcAgent.Add("lookat_z", lookAt.Z.ToString());
1950
1951 Vector3 vel = agent.Velocity;
1952 xmlRpcAgent.Add("vel_x", vel.X.ToString());
1953 xmlRpcAgent.Add("vel_y", vel.Y.ToString());
1954 xmlRpcAgent.Add("vel_z", vel.Z.ToString());
1955
1956 xmlRpcAgent.Add("is_flying", agent.Flying.ToString());
1957 xmlRpcAgent.Add("is_sat_on_ground", agent.SitGround.ToString());
1958 xmlRpcAgent.Add("is_sat_on_object", agent.IsSatOnObject.ToString());
1959
1960 xmlrpcAgents.Add(xmlRpcAgent);
1961 }
1962
1963 m_log.DebugFormat(
1964 "[REMOTE ADMIN]: XmlRpcGetAgents found {0} agents in {1}", xmlrpcAgents.Count, scene.Name);
1965
1966 xmlRpcRegion["agents"] = xmlrpcAgents;
1967 responseData["success"] = true;
1968 }
1969
1904 private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) 1970 private void XmlRpcTeleportAgentMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
1905 { 1971 {
1906 Hashtable responseData = (Hashtable)response.Value; 1972 Hashtable responseData = (Hashtable)response.Value;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index 7609578..220fbbc 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
@@ -931,67 +931,79 @@ public sealed class BSShapeCollection : IDisposable
931 if (newShape.HasPhysicalShape) 931 if (newShape.HasPhysicalShape)
932 return newShape; 932 return newShape;
933 933
934 // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset 934 // VerifyMeshCreated is called after trying to create the mesh. If we think the asset had been
935 if (prim.BaseShape.SculptEntry 935 // fetched but we end up here again, the meshing of the asset must have failed.
936 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Failed 936 // Prevent trying to keep fetching the mesh by declaring failure.
937 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Waiting 937 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched)
938 && prim.BaseShape.SculptTexture != OMV.UUID.Zero
939 )
940 { 938 {
941 DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset", prim.LocalID); 939 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed;
942 // Multiple requestors will know we're waiting for this asset 940 PhysicsScene.Logger.WarnFormat("{0} Fetched asset would not mesh. {1}, texture={2}",
943 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Waiting; 941 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture);
942 }
943 else
944 {
945 // If this mesh has an underlying asset and we have not failed getting it before, fetch the asset
946 if (prim.BaseShape.SculptEntry
947 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Failed
948 && prim.PrimAssetState != BSPhysObject.PrimAssetCondition.Waiting
949 && prim.BaseShape.SculptTexture != OMV.UUID.Zero
950 )
951 {
952 DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset", prim.LocalID);
953 // Multiple requestors will know we're waiting for this asset
954 prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Waiting;
944 955
945 BSPhysObject xprim = prim; 956 BSPhysObject xprim = prim;
946 Util.FireAndForget(delegate 957 Util.FireAndForget(delegate
947 {
948 RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod;
949 if (assetProvider != null)
950 { 958 {
951 BSPhysObject yprim = xprim; // probably not necessary, but, just in case. 959 RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod;
952 assetProvider(yprim.BaseShape.SculptTexture, delegate(AssetBase asset) 960 if (assetProvider != null)
953 { 961 {
954 bool assetFound = false; 962 BSPhysObject yprim = xprim; // probably not necessary, but, just in case.
955 string mismatchIDs = String.Empty; // DEBUG DEBUG 963 assetProvider(yprim.BaseShape.SculptTexture, delegate(AssetBase asset)
956 if (asset != null && yprim.BaseShape.SculptEntry)
957 { 964 {
958 if (yprim.BaseShape.SculptTexture.ToString() == asset.ID) 965 bool assetFound = false;
966 string mismatchIDs = String.Empty; // DEBUG DEBUG
967 if (asset != null && yprim.BaseShape.SculptEntry)
959 { 968 {
960 yprim.BaseShape.SculptData = asset.Data; 969 if (yprim.BaseShape.SculptTexture.ToString() == asset.ID)
961 // This will cause the prim to see that the filler shape is not the right 970 {
962 // one and try again to build the object. 971 yprim.BaseShape.SculptData = asset.Data;
963 // No race condition with the normal shape setting since the rebuild is at taint time. 972 // This will cause the prim to see that the filler shape is not the right
964 yprim.ForceBodyShapeRebuild(false /* inTaintTime */); 973 // one and try again to build the object.
965 assetFound = true; 974 // No race condition with the normal shape setting since the rebuild is at taint time.
975 yprim.ForceBodyShapeRebuild(false /* inTaintTime */);
976 assetFound = true;
977 }
978 else
979 {
980 mismatchIDs = yprim.BaseShape.SculptTexture.ToString() + "/" + asset.ID;
981 }
966 } 982 }
983 if (assetFound)
984 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Fetched;
967 else 985 else
968 { 986 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed;
969 mismatchIDs = yprim.BaseShape.SculptTexture.ToString() + "/" + asset.ID; 987 DetailLog("{0},BSShapeCollection,fetchAssetCallback,found={1},isSculpt={2},ids={3}",
970 } 988 yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs );
971 } 989
972 if (assetFound) 990 });
973 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Fetched; 991 }
974 else 992 else
975 yprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed; 993 {
976 DetailLog("{0},BSShapeCollection,fetchAssetCallback,found={1},isSculpt={2},ids={3}", 994 xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed;
977 yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs ); 995 PhysicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}",
978 996 LogHeader, PhysicsScene.Name);
979 }); 997 }
980 } 998 });
981 else 999 }
982 { 1000 else
983 xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.Failed;
984 PhysicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}",
985 LogHeader, PhysicsScene.Name);
986 }
987 });
988 }
989 else
990 {
991 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed)
992 { 1001 {
993 PhysicsScene.Logger.ErrorFormat("{0} Mesh failed to fetch asset. lID={1}, texture={2}", 1002 if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Failed)
994 LogHeader, prim.LocalID, prim.BaseShape.SculptTexture); 1003 {
1004 PhysicsScene.Logger.WarnFormat("{0} Mesh failed to fetch asset. obj={1}, texture={2}",
1005 LogHeader, prim.PhysObjectName, prim.BaseShape.SculptTexture);
1006 }
995 } 1007 }
996 } 1008 }
997 1009