From fe49c96ee0db0974a91b9b175ac1b00aef035797 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 3 Mar 2008 08:30:36 +0000 Subject: * Applying Ahzz's profile patch. Thanks Ahzz! * Fixed a few bugs in the patch that are sim crashers. * There's still a bug in mySQL mode/ grid mode where the main userprofile text doesn't save. --- OpenSim/Region/ClientStack/ClientView.cs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/ClientView.cs') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index d032a2e..fe12cb7 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -123,6 +123,7 @@ namespace OpenSim.Region.ClientStack //- used so we don't create new objects for each incoming packet and then toss it out later */ private RequestAvatarProperties handlerRequestAvatarProperties = null; //OnRequestAvatarProperties; + private UpdateAvatarProperties handlerUpdateAvatarProperties = null; // OnUpdateAvatarProperties; private ChatFromViewer handlerChatFromViewer = null; //OnChatFromViewer; private ChatFromViewer handlerChatFromViewer2 = null; //OnChatFromViewer; private ImprovedInstantMessage handlerInstantMessage = null; //OnInstantMessage; @@ -217,7 +218,6 @@ namespace OpenSim.Region.ClientStack private PacketStats handlerPacketStats = null; // OnPacketStats;# private RequestAsset handlerRequestAsset = null; // OnRequestAsset; - /* Properties */ public LLUUID SecureSessionId @@ -670,6 +670,7 @@ namespace OpenSim.Region.ClientStack public event FetchInventory OnAgentDataUpdateRequest; public event FetchInventory OnUserInfoRequest; public event TeleportLocationRequest OnSetStartLocationRequest; + public event UpdateAvatarProperties OnUpdateAvatarProperties; public event CreateNewInventoryItem OnCreateNewInventoryItem; @@ -1591,7 +1592,10 @@ namespace OpenSim.Region.ClientStack avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText); avatarReply.PropertiesData.BornOn = Helpers.StringToField(bornOn); avatarReply.PropertiesData.CharterMember = Helpers.StringToField(charterMember); - avatarReply.PropertiesData.FLAboutText = Helpers.StringToField(flAbout); + if (flAbout != null) + avatarReply.PropertiesData.FLAboutText = Helpers.StringToField(flAbout); + else + avatarReply.PropertiesData.FLAboutText = Helpers.StringToField(""); avatarReply.PropertiesData.Flags = 0; avatarReply.PropertiesData.FLImageID = flImageID; avatarReply.PropertiesData.ImageID = imageID; @@ -2901,10 +2905,25 @@ namespace OpenSim.Region.ClientStack if (handlerChatFromViewer != null) handlerChatFromViewer(this, args); } + break; + case PacketType.AvatarPropertiesUpdate: + AvatarPropertiesUpdatePacket Packet = (AvatarPropertiesUpdatePacket)Pack; - - + handlerUpdateAvatarProperties = OnUpdateAvatarProperties; + if (handlerUpdateAvatarProperties != null) + { + AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = Packet.PropertiesData; + UserProfileData UserProfile = new UserProfileData(); + UserProfile.UUID = AgentId; + UserProfile.profileAboutText = Util.FieldToString(Properties.AboutText); + UserProfile.profileFirstText = Util.FieldToString(Properties.FLAboutText); + UserProfile.profileFirstImage = Properties.FLImageID; + UserProfile.profileImage = Properties.ImageID; + + handlerUpdateAvatarProperties(this, UserProfile); + } break; + case PacketType.ScriptDialogReply: ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; int ch = rdialog.Data.ChatChannel; -- cgit v1.1