aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs115
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
2 files changed, 108 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 39eb968..c515ded 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -350,7 +350,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
350 350
351 protected IAssetService m_assetService; 351 protected IAssetService m_assetService;
352 private IHyperAssetService m_hyperAssets; 352 private IHyperAssetService m_hyperAssets;
353 353 private const bool m_checkPackets = true;
354 354
355 #endregion Class Members 355 #endregion Class Members
356 356
@@ -4043,7 +4043,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4043 4043
4044 if (collisionPlane == Vector4.Zero) 4044 if (collisionPlane == Vector4.Zero)
4045 collisionPlane = Vector4.UnitW; 4045 collisionPlane = Vector4.UnitW;
4046 4046 //m_log.DebugFormat("CollisionPlane: {0}",collisionPlane);
4047 collisionPlane.ToBytes(data, pos); 4047 collisionPlane.ToBytes(data, pos);
4048 pos += 16; 4048 pos += 16;
4049 } 4049 }
@@ -4128,12 +4128,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4128 update.PCode = (byte)PCode.Avatar; 4128 update.PCode = (byte)PCode.Avatar;
4129 update.ProfileCurve = 1; 4129 update.ProfileCurve = 1;
4130 update.PSBlock = Utils.EmptyBytes; 4130 update.PSBlock = Utils.EmptyBytes;
4131 update.Scale = Vector3.One; 4131 update.Scale = new Vector3(0.45f,0.6f,1.9f);
4132 update.Text = Utils.EmptyBytes; 4132 update.Text = Utils.EmptyBytes;
4133 update.TextColor = new byte[4]; 4133 update.TextColor = new byte[4];
4134 update.TextureAnim = Utils.EmptyBytes; 4134 update.TextureAnim = Utils.EmptyBytes;
4135 update.TextureEntry = data.TextureEntry ?? Utils.EmptyBytes; 4135 update.TextureEntry = data.TextureEntry ?? Utils.EmptyBytes;
4136 update.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); // TODO: Replace these numbers with PrimFlags 4136 update.UpdateFlags = (uint)(PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | PrimFlags.ObjectOwnerModify);//61 + (9 << 8) + (130 << 16) + (16 << 24); // TODO: Replace these numbers with PrimFlags
4137 4137
4138 return update; 4138 return update;
4139 } 4139 }
@@ -4280,6 +4280,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4280 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); 4280 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
4281 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); 4281 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
4282 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); 4282 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
4283 AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest);
4284 AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4285 AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate);
4286 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4287 //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
4283 } 4288 }
4284 4289
4285 #region Packet Handlers 4290 #region Packet Handlers
@@ -4495,6 +4500,98 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4495 return true; 4500 return true;
4496 } 4501 }
4497 4502
4503 private bool HandleAvatarPropertiesRequest(IClientAPI sender, Packet Pack)
4504 {
4505 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
4506
4507 #region Packet Session and User Check
4508 if (m_checkPackets)
4509 {
4510 if (avatarProperties.AgentData.SessionID != SessionId ||
4511 avatarProperties.AgentData.AgentID != AgentId)
4512 return true;
4513 }
4514 #endregion
4515
4516 RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties;
4517 if (handlerRequestAvatarProperties != null)
4518 {
4519 handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
4520 }
4521 return true;
4522 }
4523
4524 private bool HandleChatFromViewer(IClientAPI sender, Packet Pack)
4525 {
4526 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
4527
4528 #region Packet Session and User Check
4529 if (m_checkPackets)
4530 {
4531 if (inchatpack.AgentData.SessionID != SessionId ||
4532 inchatpack.AgentData.AgentID != AgentId)
4533 return true;
4534 }
4535 #endregion
4536
4537 string fromName = String.Empty; //ClientAvatar.firstname + " " + ClientAvatar.lastname;
4538 byte[] message = inchatpack.ChatData.Message;
4539 byte type = inchatpack.ChatData.Type;
4540 Vector3 fromPos = new Vector3(); // ClientAvatar.Pos;
4541 // UUID fromAgentID = AgentId;
4542
4543 int channel = inchatpack.ChatData.Channel;
4544
4545 if (OnChatFromClient != null)
4546 {
4547 OSChatMessage args = new OSChatMessage();
4548 args.Channel = channel;
4549 args.From = fromName;
4550 args.Message = Utils.BytesToString(message);
4551 args.Type = (ChatTypeEnum)type;
4552 args.Position = fromPos;
4553
4554 args.Scene = Scene;
4555 args.Sender = this;
4556 args.SenderUUID = this.AgentId;
4557
4558 ChatMessage handlerChatFromClient = OnChatFromClient;
4559 if (handlerChatFromClient != null)
4560 handlerChatFromClient(this, args);
4561 }
4562 return true;
4563 }
4564
4565 private bool HandlerAvatarPropertiesUpdate(IClientAPI sender, Packet Pack)
4566 {
4567 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
4568
4569 #region Packet Session and User Check
4570 if (m_checkPackets)
4571 {
4572 if (avatarProps.AgentData.SessionID != SessionId ||
4573 avatarProps.AgentData.AgentID != AgentId)
4574 return true;
4575 }
4576 #endregion
4577
4578 UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties;
4579 if (handlerUpdateAvatarProperties != null)
4580 {
4581 AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
4582 UserProfileData UserProfile = new UserProfileData();
4583 UserProfile.ID = AgentId;
4584 UserProfile.AboutText = Utils.BytesToString(Properties.AboutText);
4585 UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText);
4586 UserProfile.FirstLifeImage = Properties.FLImageID;
4587 UserProfile.Image = Properties.ImageID;
4588 UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL);
4589
4590 handlerUpdateAvatarProperties(this, UserProfile);
4591 }
4592 return true;
4593 }
4594
4498 #endregion Packet Handlers 4595 #endregion Packet Handlers
4499 4596
4500 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) 4597 public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
@@ -4986,13 +5083,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4986 return; 5083 return;
4987 } 5084 }
4988 5085
4989 const bool m_checkPackets = true; 5086
4990 5087
4991 // Main packet processing conditional 5088 // Main packet processing conditional
4992 switch (Pack.Type) 5089 switch (Pack.Type)
4993 { 5090 {
4994 #region Scene/Avatar 5091 #region Scene/Avatar
4995 5092 /*
4996 case PacketType.AvatarPropertiesRequest: 5093 case PacketType.AvatarPropertiesRequest:
4997 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; 5094 AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
4998 5095
@@ -5012,7 +5109,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5012 } 5109 }
5013 5110
5014 break; 5111 break;
5015 5112
5016 case PacketType.ChatFromViewer: 5113 case PacketType.ChatFromViewer:
5017 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; 5114 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
5018 5115
@@ -5051,7 +5148,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5051 handlerChatFromClient(this, args); 5148 handlerChatFromClient(this, args);
5052 } 5149 }
5053 break; 5150 break;
5054 5151
5055 case PacketType.AvatarPropertiesUpdate: 5152 case PacketType.AvatarPropertiesUpdate:
5056 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack; 5153 AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
5057 5154
@@ -5079,7 +5176,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5079 handlerUpdateAvatarProperties(this, UserProfile); 5176 handlerUpdateAvatarProperties(this, UserProfile);
5080 } 5177 }
5081 break; 5178 break;
5082 5179 */
5083 case PacketType.ScriptDialogReply: 5180 case PacketType.ScriptDialogReply:
5084 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; 5181 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
5085 5182
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 99f3141..0437a6d 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1016,9 +1016,9 @@ namespace OpenSim.Region.Framework.Scenes
1016 } 1016 }
1017 1017
1018 Animator.TrySetMovementAnimation("LAND"); 1018 Animator.TrySetMovementAnimation("LAND");
1019 SendFullUpdateToAllClients(); 1019 //SendFullUpdateToAllClients();
1020 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, 1020 ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
1021 AbsolutePosition, Velocity, -Vector3.UnitZ, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(ControllingClient))); 1021 AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
1022 } 1022 }
1023 1023
1024 public void AddNeighbourRegion(ulong regionHandle, string cap) 1024 public void AddNeighbourRegion(ulong regionHandle, string cap)