aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs35
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs8
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs20
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs59
4 files changed, 118 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 568e216..1af61db 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -96,6 +96,8 @@ namespace OpenSim.Region.ClientStack.Linden
96 // private static readonly string m_fetchInventoryPath = "0006/"; 96 // private static readonly string m_fetchInventoryPath = "0006/";
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/";
100 /* 0102 - 0103 RESERVED */
99 private static readonly string m_UpdateAgentInformationPath = "0500/"; 101 private static readonly string m_UpdateAgentInformationPath = "0500/";
100 102
101 // These are callbacks which will be setup by the scene so that we can update scene data when we 103 // These are callbacks which will be setup by the scene so that we can update scene data when we
@@ -204,6 +206,8 @@ namespace OpenSim.Region.ClientStack.Linden
204 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); 206 m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
205 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); 207 m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
206 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); 208 m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
209 IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData);
210 m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
207 IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler("POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation); 211 IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler("POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation);
208 m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); 212 m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler);
209 213
@@ -873,6 +877,37 @@ namespace OpenSim.Region.ClientStack.Linden
873 return LLSDHelpers.SerialiseLLSDReply(response); 877 return LLSDHelpers.SerialiseLLSDReply(response);
874 } 878 }
875 879
880 public string GetObjectPhysicsData(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 OSDArray object_ids = (OSDArray)req["object_ids"];
887
888 for (int i = 0 ; i < object_ids.Count ; i++)
889 {
890 UUID uuid = object_ids[i].AsUUID();
891
892 SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid);
893 if (obj != null)
894 {
895 OSDMap object_data = new OSDMap();
896
897 object_data["PhysicsShapeType"] = obj.PhysicsShapeType;
898 object_data["Density"] = obj.Density;
899 object_data["Friction"] = obj.Friction;
900 object_data["Restitution"] = obj.Restitution;
901 object_data["GravityMultiplier"] = obj.GravityModifier;
902
903 resp[uuid.ToString()] = object_data;
904 }
905 }
906
907 string response = OSDParser.SerializeLLSDXmlString(resp);
908 return response;
909 }
910
876 public string UpdateAgentInformation(string request, string path, 911 public string UpdateAgentInformation(string request, string path,
877 string param, IOSHttpRequest httpRequest, 912 string param, IOSHttpRequest httpRequest,
878 IOSHttpResponse httpResponse) 913 IOSHttpResponse httpResponse)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 4d2c0f2..3cc3950 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -807,5 +807,13 @@ namespace OpenSim.Region.ClientStack.Linden
807 { 807 {
808 return EventQueueHelper.BuildEvent(eventName, eventBody); 808 return EventQueueHelper.BuildEvent(eventName, eventBody);
809 } 809 }
810
811 public void partPhysicsProperties(uint localID, byte physhapetype,
812 float density, float friction, float bounce, float gravmod,UUID avatarID)
813 {
814 OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype,
815 density, friction, bounce, gravmod);
816 Enqueue(item, avatarID);
817 }
810 } 818 }
811} 819}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
index 3f49aba..dab727f 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}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 88b64f5..bd4a2d1 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2627,6 +2627,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2627 } 2627 }
2628 } 2628 }
2629 2629
2630 public void SendPartPhysicsProprieties(ISceneEntity entity)
2631 {
2632 SceneObjectPart part = (SceneObjectPart)entity;
2633 if (part != null && AgentId != UUID.Zero)
2634 {
2635 try
2636 {
2637 IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
2638 if (eq != null)
2639 {
2640 uint localid = part.LocalId;
2641 byte physshapetype = part.PhysicsShapeType;
2642 float density = part.Density;
2643 float friction = part.Friction;
2644 float bounce = part.Restitution;
2645 float gravmod = part.GravityModifier;
2646 eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId);
2647 }
2648 }
2649 catch (Exception ex)
2650 {
2651 m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString());
2652 }
2653 part.UpdatePhysRequired = false;
2654 }
2655 }
2656
2657
2630 2658
2631 public void SendGroupNameReply(UUID groupLLUID, string GroupName) 2659 public void SendGroupNameReply(UUID groupLLUID, string GroupName)
2632 { 2660 {
@@ -7035,10 +7063,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7035 // 46,47,48 are special positions within the packet 7063 // 46,47,48 are special positions within the packet
7036 // This may change so perhaps we need a better way 7064 // This may change so perhaps we need a better way
7037 // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) 7065 // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?)
7038 bool UsePhysics = (data[46] != 0) ? true : false; 7066 /*
7039 bool IsTemporary = (data[47] != 0) ? true : false; 7067 bool UsePhysics = (data[46] != 0) ? true : false;
7040 bool IsPhantom = (data[48] != 0) ? true : false; 7068 bool IsTemporary = (data[47] != 0) ? true : false;
7041 handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, this); 7069 bool IsPhantom = (data[48] != 0) ? true : false;
7070 handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, this);
7071 */
7072 bool UsePhysics = flags.AgentData.UsePhysics;
7073 bool IsPhantom = flags.AgentData.IsPhantom;
7074 bool IsTemporary = flags.AgentData.IsTemporary;
7075 ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = flags.ExtraPhysics;
7076 ExtraPhysicsData physdata = new ExtraPhysicsData();
7077
7078 if (blocks == null || blocks.Length == 0)
7079 {
7080 physdata.PhysShapeType = PhysShapeType.invalid;
7081 }
7082 else
7083 {
7084 ObjectFlagUpdatePacket.ExtraPhysicsBlock phsblock = blocks[0];
7085 physdata.PhysShapeType = (PhysShapeType)phsblock.PhysicsShapeType;
7086 physdata.Bounce = phsblock.Restitution;
7087 physdata.Density = phsblock.Density;
7088 physdata.Friction = phsblock.Friction;
7089 physdata.GravitationModifier = phsblock.GravityMultiplier;
7090 }
7091
7092 handlerUpdatePrimFlags(flags.AgentData.ObjectLocalID, UsePhysics, IsTemporary, IsPhantom, physdata, this);
7042 } 7093 }
7043 return true; 7094 return true;
7044 } 7095 }