aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs120
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs8
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs20
3 files changed, 146 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index df65af9..5542680 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -97,7 +97,9 @@ namespace OpenSim.Region.ClientStack.Linden
97 private static readonly string m_copyFromNotecardPath = "0007/"; 97 private static readonly string m_copyFromNotecardPath = "0007/";
98 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. 98 // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
99 private static readonly string m_getObjectPhysicsDataPath = "0101/"; 99 private static readonly string m_getObjectPhysicsDataPath = "0101/";
100 100 private static readonly string m_getObjectCostPath = "0102/";
101 private static readonly string m_ResourceCostSelectedPath = "0103/";
102
101 103
102 // These are callbacks which will be setup by the scene so that we can update scene data when we 104 // These are callbacks which will be setup by the scene so that we can update scene data when we
103 // receive capability calls 105 // receive capability calls
@@ -185,7 +187,12 @@ namespace OpenSim.Region.ClientStack.Linden
185 m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard)); 187 m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
186 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData); 188 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData);
187 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); 189 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
188 190 IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost);
191 m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler);
192 IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected);
193 m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
194
195
189 // As of RC 1.22.9 of the Linden client this is 196 // As of RC 1.22.9 of the Linden client this is
190 // supported 197 // supported
191 198
@@ -834,6 +841,115 @@ namespace OpenSim.Region.ClientStack.Linden
834 Console.WriteLine(response); 841 Console.WriteLine(response);
835 return response; 842 return response;
836 } 843 }
844
845 public string GetObjectCost(string request, string path,
846 string param, IOSHttpRequest httpRequest,
847 IOSHttpResponse httpResponse)
848 {
849 // see being triggered but see no efect .. have something wrong ??
850 //
851 OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
852 OSDMap resp = new OSDMap();
853
854 OSDArray object_ids = (OSDArray)req["object_ids"];
855
856 for (int i = 0; i < object_ids.Count; i++)
857 {
858 UUID uuid = object_ids[i].AsUUID();
859
860 // only see root parts .. so guess should go by SOG only
861 SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid);
862 if (obj != null)
863 {
864 OSDMap object_data = new OSDMap();
865
866 object_data["linked_set_resource_cost"] = 1.0f;
867 object_data["resource_cost"] = 1.0f;
868 object_data["physics_cost"] = 1.0f;
869 object_data["linked_set_physics_cost"] = 1.0f;
870
871 resp[uuid.ToString()] = object_data;
872 }
873 }
874
875 string response = OSDParser.SerializeLLSDXmlString(resp);
876 Console.WriteLine(response);
877 return response;
878 }
879
880 public string ResourceCostSelected(string request, string path,
881 string param, IOSHttpRequest httpRequest,
882 IOSHttpResponse httpResponse)
883 {
884 OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
885 OSDMap resp = new OSDMap();
886
887
888 float phys=0;
889 float stream=0;
890 float simul=0;
891
892 if (req.ContainsKey("selected_roots"))
893 {
894 OSDArray object_ids = (OSDArray)req["selected_roots"];
895
896 // should go by SOG suming costs for all parts
897 // ll v3 works ok with several objects select we get the list and adds ok
898 // FS calls per object so results are wrong guess fs bug
899 for (int i = 0; i < object_ids.Count; i++)
900 {
901 UUID uuid = object_ids[i].AsUUID();
902
903 SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid);
904 if (obj != null)
905 {
906 phys += 0.1f; // just to see...
907 stream += 0.2f;
908 simul += 0.5f;
909 }
910 }
911 }
912 else if (req.ContainsKey("selected_prims"))
913 {
914 OSDArray object_ids = (OSDArray)req["selected_prims"];
915
916 // don't see in use in any of the 2 viewers
917 // guess it should be for edit linked but... nothing
918 // should go to SOP per part
919 for (int i = 0; i < object_ids.Count; i++)
920 {
921 UUID uuid = object_ids[i].AsUUID();
922
923 SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid);
924 if (obj != null)
925 {
926 phys += 0.1f;
927 stream += 0.2f;
928 simul += 0.5f;
929 }
930 }
931 }
932
933 if (simul != 0)
934 {
935 OSDMap object_data = new OSDMap();
936
937 object_data["physics"] = phys;
938 object_data["streaming"] = stream;
939 object_data["simulation"] = simul;
940
941 resp["selected"] = object_data;
942 }
943
944 string response = OSDParser.SerializeLLSDXmlString(resp);
945 Console.WriteLine(response);
946 return response;
947 }
948
949
950
951
952
837 } 953 }
838 954
839 public class AssetUploader 955 public class AssetUploader
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 7c07c56..a91b02c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -805,5 +805,13 @@ namespace OpenSim.Region.ClientStack.Linden
805 { 805 {
806 return EventQueueHelper.BuildEvent(eventName, eventBody); 806 return EventQueueHelper.BuildEvent(eventName, eventBody);
807 } 807 }
808
809 public void partPhysicsProperties(uint localID, byte physhapetype,
810 float density, float friction, float bounce, float gravmod,UUID avatarID)
811 {
812 OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype,
813 density, friction, bounce, gravmod);
814 Enqueue(item, avatarID);
815 }
808 } 816 }
809} 817}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
index 3f49aba..b9222e3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
@@ -395,5 +395,25 @@ namespace OpenSim.Region.ClientStack.Linden
395 return message; 395 return message;
396 } 396 }
397 397
398 public static OSD partPhysicsProperties(uint localID, byte physhapetype,
399 float density, float friction, float bounce, float gravmod)
400 {
401
402 OSDMap physinfo = new OSDMap(6);
403 physinfo["LocalID"] = localID;
404 physinfo["Density"] = density;
405 physinfo["Friction"] = friction;
406 physinfo["GravityMultiplier"] = gravmod;
407 physinfo["Restitution"] = bounce;
408 physinfo["PhysicsShapeType"] = (int)physhapetype;
409
410 OSDArray array = new OSDArray(1);
411 array.Add(physinfo);
412
413 OSDMap llsdBody = new OSDMap(1);
414 llsdBody.Add("ObjectData", array);
415
416 return BuildEvent("ObjectPhysicsProperties", llsdBody);
417 }
398 } 418 }
399} 419}