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)
0.6.2-post-fixes
Melanie Thielker 2009-01-09 02:59:56 +00:00
parent fcc3325f3b
commit 7c7ea57c5c
5 changed files with 88 additions and 9 deletions

View File

@ -424,6 +424,9 @@ namespace OpenSim.Framework
public delegate void ParcelDwellRequest(int localID, IClientAPI client);
public delegate void UserInfoRequest(IClientAPI client);
public delegate void UpdateUserInfo(bool imViaEmail, bool visible, IClientAPI client);
#endregion
public struct DirPlacesReplyData
@ -577,7 +580,6 @@ namespace OpenSim.Framework
event AddNewPrim OnAddPrim;
event FetchInventory OnAgentDataUpdateRequest;
event FetchInventory OnUserInfoRequest;
event TeleportLocationRequest OnSetStartLocationRequest;
event RequestGodlikePowers OnRequestGodlikePowers;
@ -745,6 +747,9 @@ namespace OpenSim.Framework
event ParcelDwellRequest OnParcelDwellRequest;
event UserInfoRequest OnUserInfoRequest;
event UpdateUserInfo OnUpdateUserInfo;
// void ActivateGesture(UUID assetId, UUID gestureId);
/// <summary>
@ -1088,6 +1093,8 @@ namespace OpenSim.Framework
void SendParcelDwellReply(int localID, UUID parcelID, float dwell);
void SendUserInfoReply(bool imViaEmail, bool visible, string email);
void KillEndDone();
bool AddGenericPacketHandler(string MethodName, GenericMessage handler);

View File

@ -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()

View File

@ -204,7 +204,6 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event ViewerEffectEventHandler OnViewerEffect;
public event FetchInventory OnAgentDataUpdateRequest;
public event FetchInventory OnUserInfoRequest;
public event TeleportLocationRequest OnSetStartLocationRequest;
public event UpdateShape OnUpdatePrimShape;
@ -357,6 +356,9 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event ParcelDwellRequest OnParcelDwellRequest;
public event UserInfoRequest OnUserInfoRequest;
public event UpdateUserInfo OnUpdateUserInfo;
#pragma warning restore 67
#endregion
@ -1045,6 +1047,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{
}
public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
{
}
#endregion
}
}

View File

@ -98,7 +98,6 @@ namespace OpenSim.Region.Examples.SimpleModule
public event ViewerEffectEventHandler OnViewerEffect;
public event FetchInventory OnAgentDataUpdateRequest;
public event FetchInventory OnUserInfoRequest;
public event TeleportLocationRequest OnSetStartLocationRequest;
public event UpdateShape OnUpdatePrimShape;
@ -251,6 +250,8 @@ namespace OpenSim.Region.Examples.SimpleModule
public event EventGodDelete OnEventGodDelete;
public event ParcelDwellRequest OnParcelDwellRequest;
public event UserInfoRequest OnUserInfoRequest;
public event UpdateUserInfo OnUpdateUserInfo;
#pragma warning restore 67
@ -1046,6 +1047,10 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
{
}
#endregion
}
}

View File

@ -93,7 +93,6 @@ namespace OpenSim.Tests.Common.Mock
public event ViewerEffectEventHandler OnViewerEffect;
public event FetchInventory OnAgentDataUpdateRequest;
public event FetchInventory OnUserInfoRequest;
public event TeleportLocationRequest OnSetStartLocationRequest;
public event UpdateShape OnUpdatePrimShape;
@ -248,6 +247,9 @@ namespace OpenSim.Tests.Common.Mock
public event ParcelDwellRequest OnParcelDwellRequest;
public event UserInfoRequest OnUserInfoRequest;
public event UpdateUserInfo OnUpdateUserInfo;
#pragma warning restore 67
/// <value>
@ -991,5 +993,9 @@ namespace OpenSim.Tests.Common.Mock
public void SendParcelDwellReply(int localID, UUID parcelID, float dwell)
{
}
public void SendUserInfoReply(bool imViaEmail, bool visible, string email)
{
}
}
}