From 7c7ea57c5c2bf01280e2df03cedc999aa5e7be87 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 9 Jan 2009 02:59:56 +0000 Subject: Finish dwell sending, adding the forgotten method body. Add UserInfo and a dummy reply to enable Hippo Viewer users to disable IM logging (option was greyed out in OpenSim before) --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 65 ++++++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7398c70..c88e6b5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -147,7 +147,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP private AgentSit handlerAgentSit; //OnAgentSit; private AvatarPickerRequest handlerAvatarPickerRequest; //OnAvatarPickerRequest; private FetchInventory handlerAgentDataUpdateRequest; //OnAgentDataUpdateRequest; - private FetchInventory handlerUserInfoRequest; //OnUserInfoRequest; private TeleportLocationRequest handlerSetStartLocationRequest; //OnSetStartLocationRequest; private TeleportLandmarkRequest handlerTeleportLandmarkRequest; //OnTeleportLandmarkRequest; private LinkObjects handlerLinkObjects; //OnLinkObjects; @@ -288,6 +287,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private ParcelDwellRequest handlerParcelDwellRequest; + private UserInfoRequest handlerUserInfoRequest; + private UpdateUserInfo handlerUpdateUserInfo; + private readonly IGroupsModule m_GroupsModule; //private TerrainUnacked handlerUnackedTerrain = null; @@ -939,7 +941,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event RequestAvatarProperties OnRequestAvatarProperties; public event SetAlwaysRun OnSetAlwaysRun; public event FetchInventory OnAgentDataUpdateRequest; - public event FetchInventory OnUserInfoRequest; public event TeleportLocationRequest OnSetStartLocationRequest; public event UpdateAvatarProperties OnUpdateAvatarProperties; public event CreateNewInventoryItem OnCreateNewInventoryItem; @@ -1060,6 +1061,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event ParcelDwellRequest OnParcelDwellRequest; + public event UserInfoRequest OnUserInfoRequest; + public event UpdateUserInfo OnUpdateUserInfo; + public void ActivateGesture(UUID assetId, UUID gestureId) { } @@ -4680,15 +4684,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.UserInfoRequest: - UserInfoRequestPacket avUserInfoRequestPacket = (UserInfoRequestPacket)Pack; - handlerUserInfoRequest = OnUserInfoRequest; if (handlerUserInfoRequest != null) { - handlerUserInfoRequest(this, avUserInfoRequestPacket.AgentData.AgentID, avUserInfoRequestPacket.AgentData.SessionID); + handlerUserInfoRequest(this); + } + else + { + SendUserInfoReply(false, true, ""); } break; + case PacketType.UpdateUserInfo: + UpdateUserInfoPacket updateUserInfo = (UpdateUserInfoPacket)Pack; + handlerUpdateUserInfo = OnUpdateUserInfo; + if (handlerUpdateUserInfo != null) + { + bool visible = true; + string DirectoryVisibility = + Utils.BytesToString(updateUserInfo.UserData.DirectoryVisibility); + if (DirectoryVisibility == "hidden") + visible = false; + handlerUpdateUserInfo( + updateUserInfo.UserData.IMViaEMail, + visible, this); + } + break; case PacketType.SetStartLocationRequest: SetStartLocationRequestPacket avSetStartLocationRequestPacket = (SetStartLocationRequestPacket)Pack; @@ -8302,6 +8323,40 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) { + ParcelDwellReplyPacket pd = + (ParcelDwellReplyPacket)PacketPool.Instance.GetPacket( + PacketType.ParcelDwellReply); + + pd.AgentData = new ParcelDwellReplyPacket.AgentDataBlock(); + pd.AgentData.AgentID = AgentId; + + pd.Data = new ParcelDwellReplyPacket.DataBlock(); + pd.Data.LocalID = localID; + pd.Data.ParcelID = parcelID; + pd.Data.Dwell = dwell; + + OutPacket(pd, ThrottleOutPacketType.Land); + } + + public void SendUserInfoReply(bool imViaEmail, bool visible, string email) + { + UserInfoReplyPacket ur = + (UserInfoReplyPacket)PacketPool.Instance.GetPacket( + PacketType.UserInfoReply); + + string Visible = "hidden"; + if (visible) + Visible = "default"; + + ur.AgentData = new UserInfoReplyPacket.AgentDataBlock(); + ur.AgentData.AgentID = AgentId; + + ur.UserData = new UserInfoReplyPacket.UserDataBlock(); + ur.UserData.IMViaEMail = imViaEmail; + ur.UserData.DirectoryVisibility = Utils.StringToBytes(Visible); + ur.UserData.EMail = Utils.StringToBytes(email); + + OutPacket(ur, ThrottleOutPacketType.Task); } public void KillEndDone() -- cgit v1.1