From f7916d10f3b5ee006035afefe5301a8610820a0c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 21 Nov 2009 19:38:38 -0500 Subject: * This fixes landing on Prim and removes the hack from yesterday. Landing on prim should work fine again. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7eb829e..9570769 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4060,7 +4060,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (collisionPlane == Vector4.Zero) collisionPlane = Vector4.UnitW; - + //m_log.DebugFormat("CollisionPlane: {0}",collisionPlane); collisionPlane.ToBytes(data, pos); pos += 16; } @@ -4145,12 +4145,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP update.PCode = (byte)PCode.Avatar; update.ProfileCurve = 1; update.PSBlock = Utils.EmptyBytes; - update.Scale = Vector3.One; + update.Scale = new Vector3(0.45f,0.6f,1.9f); update.Text = Utils.EmptyBytes; update.TextColor = new byte[4]; update.TextureAnim = Utils.EmptyBytes; update.TextureEntry = data.TextureEntry ?? Utils.EmptyBytes; - update.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); // TODO: Replace these numbers with PrimFlags + 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 return update; } -- cgit v1.1 From 079691b98f0a2d42087a99742a44705cf34071d5 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 21 Nov 2009 21:58:11 -0500 Subject: * Move a few of the ProcessInPacket switch case blocks into packet handler delegates --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 109 +++++++++++++++++++-- 1 file changed, 103 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9570769..ab4b7a0 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -350,7 +350,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected IAssetService m_assetService; private IHyperAssetService m_hyperAssets; - + private const bool m_checkPackets = true; #endregion Class Members @@ -4297,6 +4297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); + AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); + AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); + AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate); + AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); + AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); } #region Packet Handlers @@ -4512,6 +4517,98 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + private bool HandleAvatarPropertiesRequest(IClientAPI sender, Packet Pack) + { + AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; + + #region Packet Session and User Check + if (m_checkPackets) + { + if (avatarProperties.AgentData.SessionID != SessionId || + avatarProperties.AgentData.AgentID != AgentId) + return true; + } + #endregion + + RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties; + if (handlerRequestAvatarProperties != null) + { + handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); + } + return true; + } + + private bool HandleChatFromViewer(IClientAPI sender, Packet Pack) + { + ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; + + #region Packet Session and User Check + if (m_checkPackets) + { + if (inchatpack.AgentData.SessionID != SessionId || + inchatpack.AgentData.AgentID != AgentId) + return true; + } + #endregion + + string fromName = String.Empty; //ClientAvatar.firstname + " " + ClientAvatar.lastname; + byte[] message = inchatpack.ChatData.Message; + byte type = inchatpack.ChatData.Type; + Vector3 fromPos = new Vector3(); // ClientAvatar.Pos; + // UUID fromAgentID = AgentId; + + int channel = inchatpack.ChatData.Channel; + + if (OnChatFromClient != null) + { + OSChatMessage args = new OSChatMessage(); + args.Channel = channel; + args.From = fromName; + args.Message = Utils.BytesToString(message); + args.Type = (ChatTypeEnum)type; + args.Position = fromPos; + + args.Scene = Scene; + args.Sender = this; + args.SenderUUID = this.AgentId; + + ChatMessage handlerChatFromClient = OnChatFromClient; + if (handlerChatFromClient != null) + handlerChatFromClient(this, args); + } + return true; + } + + private bool HandlerAvatarPropertiesUpdate(IClientAPI sender, Packet Pack) + { + AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack; + + #region Packet Session and User Check + if (m_checkPackets) + { + if (avatarProps.AgentData.SessionID != SessionId || + avatarProps.AgentData.AgentID != AgentId) + return true; + } + #endregion + + UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties; + if (handlerUpdateAvatarProperties != null) + { + AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData; + UserProfileData UserProfile = new UserProfileData(); + UserProfile.ID = AgentId; + UserProfile.AboutText = Utils.BytesToString(Properties.AboutText); + UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText); + UserProfile.FirstLifeImage = Properties.FLImageID; + UserProfile.Image = Properties.ImageID; + UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL); + + handlerUpdateAvatarProperties(this, UserProfile); + } + return true; + } + #endregion Packet Handlers public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) @@ -5003,13 +5100,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP return; } - const bool m_checkPackets = true; + // Main packet processing conditional switch (Pack.Type) { #region Scene/Avatar - + /* case PacketType.AvatarPropertiesRequest: AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; @@ -5029,7 +5126,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; - + case PacketType.ChatFromViewer: ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; @@ -5068,7 +5165,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerChatFromClient(this, args); } break; - + case PacketType.AvatarPropertiesUpdate: AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack; @@ -5096,7 +5193,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdateAvatarProperties(this, UserProfile); } break; - + */ case PacketType.ScriptDialogReply: ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; -- cgit v1.1 From 2c8fbc15e82d26edf7d1cf0a79bd9a91c63c1c97 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 21 Nov 2009 21:59:31 -0500 Subject: * Comment out some example code for later. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ab4b7a0..d178187 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4300,8 +4300,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate); - AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); - AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); + //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); + //AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); } #region Packet Handlers -- cgit v1.1