aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs88
1 files changed, 60 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index fd82db7..98160c9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -51,6 +51,7 @@ using RegionFlags = OpenMetaverse.RegionFlags;
51using Nini.Config; 51using Nini.Config;
52 52
53using System.IO; 53using System.IO;
54using PermissionMask = OpenSim.Framework.PermissionMask;
54 55
55namespace OpenSim.Region.ClientStack.LindenUDP 56namespace OpenSim.Region.ClientStack.LindenUDP
56{ 57{
@@ -822,6 +823,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
822 handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); 823 handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType);
823 handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; 824 handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes;
824 825
826 handshake.RegionInfo4 = new RegionHandshakePacket.RegionInfo4Block[0];
825// OutPacket(handshake, ThrottleOutPacketType.Task); 827// OutPacket(handshake, ThrottleOutPacketType.Task);
826 // use same as MoveAgentIntoRegion (both should be task ) 828 // use same as MoveAgentIntoRegion (both should be task )
827 OutPacket(handshake, ThrottleOutPacketType.Unknown); 829 OutPacket(handshake, ThrottleOutPacketType.Unknown);
@@ -901,9 +903,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
901 } 903 }
902 } 904 }
903 905
904 public void SendGenericMessage(string method, List<string> message) 906 public void SendGenericMessage(string method, UUID invoice, List<string> message)
905 { 907 {
906 GenericMessagePacket gmp = new GenericMessagePacket(); 908 GenericMessagePacket gmp = new GenericMessagePacket();
909
910 gmp.AgentData.AgentID = AgentId;
911 gmp.AgentData.SessionID = m_sessionId;
912 gmp.AgentData.TransactionID = invoice;
913
907 gmp.MethodData.Method = Util.StringToBytes256(method); 914 gmp.MethodData.Method = Util.StringToBytes256(method);
908 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 915 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
909 int i = 0; 916 int i = 0;
@@ -916,9 +923,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
916 OutPacket(gmp, ThrottleOutPacketType.Task); 923 OutPacket(gmp, ThrottleOutPacketType.Task);
917 } 924 }
918 925
919 public void SendGenericMessage(string method, List<byte[]> message) 926 public void SendGenericMessage(string method, UUID invoice, List<byte[]> message)
920 { 927 {
921 GenericMessagePacket gmp = new GenericMessagePacket(); 928 GenericMessagePacket gmp = new GenericMessagePacket();
929
930 gmp.AgentData.AgentID = AgentId;
931 gmp.AgentData.SessionID = m_sessionId;
932 gmp.AgentData.TransactionID = invoice;
933
922 gmp.MethodData.Method = Util.StringToBytes256(method); 934 gmp.MethodData.Method = Util.StringToBytes256(method);
923 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 935 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
924 int i = 0; 936 int i = 0;
@@ -1801,7 +1813,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1801 1813
1802 public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) 1814 public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item)
1803 { 1815 {
1804 const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 1816 // Fudge this value. It's only needed to make the CRC anyway
1817 const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff;
1805 1818
1806 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); 1819 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply);
1807 // TODO: don't create new blocks if recycling an old packet 1820 // TODO: don't create new blocks if recycling an old packet
@@ -2006,7 +2019,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2006 2019
2007 protected void SendBulkUpdateInventoryItem(InventoryItemBase item) 2020 protected void SendBulkUpdateInventoryItem(InventoryItemBase item)
2008 { 2021 {
2009 const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 2022 const uint FULL_MASK_PERMISSIONS = (uint)0x7ffffff;
2010 2023
2011 BulkUpdateInventoryPacket bulkUpdate 2024 BulkUpdateInventoryPacket bulkUpdate
2012 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); 2025 = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory);
@@ -2065,7 +2078,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2065 /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> 2078 /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see>
2066 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) 2079 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId)
2067 { 2080 {
2068 const uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 2081 const uint FULL_MASK_PERMISSIONS = (uint)0x7fffffff;
2069 2082
2070 UpdateCreateInventoryItemPacket InventoryReply 2083 UpdateCreateInventoryItemPacket InventoryReply
2071 = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket( 2084 = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(
@@ -2654,7 +2667,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2654 byte physshapetype = part.PhysicsShapeType; 2667 byte physshapetype = part.PhysicsShapeType;
2655 float density = part.Density; 2668 float density = part.Density;
2656 float friction = part.Friction; 2669 float friction = part.Friction;
2657 float bounce = part.Bounciness; 2670 float bounce = part.Restitution;
2658 float gravmod = part.GravityModifier; 2671 float gravmod = part.GravityModifier;
2659 2672
2660 eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId); 2673 eq.partPhysicsProperties(localid, physshapetype, density, friction, bounce, gravmod,AgentId);
@@ -3604,7 +3617,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3604 3617
3605 avp.Sender.IsTrial = false; 3618 avp.Sender.IsTrial = false;
3606 avp.Sender.ID = agentID; 3619 avp.Sender.ID = agentID;
3607 m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); 3620 avp.AppearanceData = new AvatarAppearancePacket.AppearanceDataBlock[0];
3621 //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
3608 OutPacket(avp, ThrottleOutPacketType.Task); 3622 OutPacket(avp, ThrottleOutPacketType.Task);
3609 } 3623 }
3610 3624
@@ -3892,6 +3906,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3892 { 3906 {
3893 part.Shape.LightEntry = false; 3907 part.Shape.LightEntry = false;
3894 } 3908 }
3909
3910 if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh))
3911 {
3912 // Ensure that mesh has at least 8 valid faces
3913 part.Shape.ProfileBegin = 12500;
3914 part.Shape.ProfileEnd = 0;
3915 part.Shape.ProfileHollow = 27500;
3916 }
3917 }
3918
3919 if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh))
3920 {
3921 // Ensure that mesh has at least 8 valid faces
3922 part.Shape.ProfileBegin = 12500;
3923 part.Shape.ProfileEnd = 0;
3924 part.Shape.ProfileHollow = 27500;
3895 } 3925 }
3896 } 3926 }
3897 3927
@@ -4208,7 +4238,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4208 pack.Stat = stats.StatsBlock; 4238 pack.Stat = stats.StatsBlock;
4209 4239
4210 pack.Header.Reliable = false; 4240 pack.Header.Reliable = false;
4211 4241 pack.RegionInfo = new SimStatsPacket.RegionInfoBlock[0];
4212 OutPacket(pack, ThrottleOutPacketType.Task); 4242 OutPacket(pack, ThrottleOutPacketType.Task);
4213 } 4243 }
4214 4244
@@ -4599,7 +4629,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4599 rinfopack.AgentData = new RegionInfoPacket.AgentDataBlock(); 4629 rinfopack.AgentData = new RegionInfoPacket.AgentDataBlock();
4600 rinfopack.AgentData.AgentID = AgentId; 4630 rinfopack.AgentData.AgentID = AgentId;
4601 rinfopack.AgentData.SessionID = SessionId; 4631 rinfopack.AgentData.SessionID = SessionId;
4602 4632 rinfopack.RegionInfo3 = new RegionInfoPacket.RegionInfo3Block[0];
4603 4633
4604 OutPacket(rinfopack, ThrottleOutPacketType.Task); 4634 OutPacket(rinfopack, ThrottleOutPacketType.Task);
4605 } 4635 }
@@ -4952,6 +4982,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4952 position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset; 4982 position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset;
4953 rotation = part.RotationOffset * presence.Rotation; 4983 rotation = part.RotationOffset * presence.Rotation;
4954 } 4984 }
4985 angularVelocity = Vector3.Zero;
4986 }
4987 else
4988 {
4989 angularVelocity = presence.AngularVelocity;
4990 rotation = presence.Rotation;
4955 } 4991 }
4956 4992
4957 attachPoint = 0; 4993 attachPoint = 0;
@@ -4963,9 +4999,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4963 // in that direction, even though we don't model this on the server. Implementing this in the future 4999 // in that direction, even though we don't model this on the server. Implementing this in the future
4964 // may improve movement smoothness. 5000 // may improve movement smoothness.
4965// acceleration = new Vector3(1, 0, 0); 5001// acceleration = new Vector3(1, 0, 0);
4966 5002
4967 angularVelocity = Vector3.Zero;
4968
4969 if (sendTexture) 5003 if (sendTexture)
4970 textureEntry = presence.Appearance.Texture.GetBytes(); 5004 textureEntry = presence.Appearance.Texture.GetBytes();
4971 else 5005 else
@@ -6575,19 +6609,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6575 #endregion 6609 #endregion
6576 6610
6577 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit; 6611 AgentRequestSit handlerAgentRequestSit = OnAgentRequestSit;
6578 if (handlerAgentRequestSit != null)
6579 if (!(agentRequestSit.AgentData == null
6580 || agentRequestSit.TargetObject == null
6581 || agentRequestSit.TargetObject.TargetID == null
6582 || agentRequestSit.TargetObject.Offset == null))
6583 {
6584 var sp = m_scene.GetScenePresence(agentRequestSit.AgentData.AgentID);
6585 if (sp == null || sp.ParentID != 0) // ignore packet if agent is already sitting
6586 return true;
6587 6612
6588 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID, 6613 if (handlerAgentRequestSit != null)
6589 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); 6614 handlerAgentRequestSit(this, agentRequestSit.AgentData.AgentID,
6590 } 6615 agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset);
6591 } 6616 }
6592 return true; 6617 return true;
6593 } 6618 }
@@ -7193,7 +7218,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7193 7218
7194 if (handlerUpdatePrimFlags != null) 7219 if (handlerUpdatePrimFlags != null)
7195 { 7220 {
7196 byte[] data = Pack.ToBytes(); 7221// byte[] data = Pack.ToBytes();
7197 // 46,47,48 are special positions within the packet 7222 // 46,47,48 are special positions within the packet
7198 // This may change so perhaps we need a better way 7223 // This may change so perhaps we need a better way
7199 // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?) 7224 // of storing this (OMV.FlagUpdatePacket.UsePhysics,etc?)
@@ -9835,7 +9860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
9835 EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest; 9860 EconomyDataRequest handlerEconomoyDataRequest = OnEconomyDataRequest;
9836 if (handlerEconomoyDataRequest != null) 9861 if (handlerEconomoyDataRequest != null)
9837 { 9862 {
9838 handlerEconomoyDataRequest(AgentId); 9863 handlerEconomoyDataRequest(this);
9839 } 9864 }
9840 return true; 9865 return true;
9841 } 9866 }
@@ -12242,11 +12267,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12242 if (logPacket) 12267 if (logPacket)
12243 m_log.DebugFormat( 12268 m_log.DebugFormat(
12244 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", 12269 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
12245 Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); 12270 Name, SceneAgent.IsChildAgent ? "child" : "root ", Scene.Name, packet.Type);
12246 } 12271 }
12247 12272
12248 if (!ProcessPacketMethod(packet)) 12273 if (!ProcessPacketMethod(packet))
12249 m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); 12274 m_log.WarnFormat(
12275 "[CLIENT]: Unhandled packet {0} from {1} ({2}) in {3}. Ignoring.",
12276 packet.Type, Name, SceneAgent.IsChildAgent ? "child" : "root ", Scene.Name);
12250 } 12277 }
12251 12278
12252 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) 12279 private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
@@ -12454,6 +12481,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12454 return String.Empty; 12481 return String.Empty;
12455 } 12482 }
12456 12483
12484 public OSDMap OReport(string uptime, string version)
12485 {
12486 return new OSDMap();
12487 }
12488
12457 /// <summary> 12489 /// <summary>
12458 /// Make an asset request to the asset service in response to a client request. 12490 /// Make an asset request to the asset service in response to a client request.
12459 /// </summary> 12491 /// </summary>