Thanks dmiles for a patch that adds PacketType.RequestMultipleObjects Packet Handler - ref mantis #4010

arthursv
Adam Johnson 2009-08-16 15:06:06 +09:00
parent 8b6d79aa3c
commit a42569d896
10 changed files with 58 additions and 0 deletions

View File

@ -612,6 +612,7 @@ namespace OpenSim.Client.MXP.ClientStack
public event SpinStop OnSpinStop; public event SpinStop OnSpinStop;
public event UpdateShape OnUpdatePrimShape; public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event ObjectRequest OnObjectRequest;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event ObjectDeselect OnObjectDeselect; public event ObjectDeselect OnObjectDeselect;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;

View File

@ -259,6 +259,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event SpinStop OnSpinStop = delegate { }; public event SpinStop OnSpinStop = delegate { };
public event UpdateShape OnUpdatePrimShape = delegate { }; public event UpdateShape OnUpdatePrimShape = delegate { };
public event ObjectExtraParams OnUpdateExtraParams = delegate { }; public event ObjectExtraParams OnUpdateExtraParams = delegate { };
public event ObjectRequest OnObjectRequest = delegate { };
public event ObjectSelect OnObjectSelect = delegate { }; public event ObjectSelect OnObjectSelect = delegate { };
public event ObjectDeselect OnObjectDeselect = delegate { }; public event ObjectDeselect OnObjectDeselect = delegate { };
public event GenericCall7 OnObjectDescription = delegate { }; public event GenericCall7 OnObjectDescription = delegate { };

View File

@ -111,6 +111,8 @@ namespace OpenSim.Framework
public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
public delegate void ObjectRequest(uint localID, IClientAPI remoteClient);
public delegate void RequestObjectPropertiesFamily( public delegate void RequestObjectPropertiesFamily(
IClientAPI remoteClient, UUID AgentID, uint RequestFlags, UUID TaskID); IClientAPI remoteClient, UUID AgentID, uint RequestFlags, UUID TaskID);
@ -622,6 +624,7 @@ namespace OpenSim.Framework
event UpdateShape OnUpdatePrimShape; event UpdateShape OnUpdatePrimShape;
event ObjectExtraParams OnUpdateExtraParams; event ObjectExtraParams OnUpdateExtraParams;
event ObjectRequest OnObjectRequest;
event ObjectSelect OnObjectSelect; event ObjectSelect OnObjectSelect;
event ObjectDeselect OnObjectDeselect; event ObjectDeselect OnObjectDeselect;
event GenericCall7 OnObjectDescription; event GenericCall7 OnObjectDescription;

View File

@ -197,6 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private ObjectExtraParams handlerUpdateExtraParams; //OnUpdateExtraParams; private ObjectExtraParams handlerUpdateExtraParams; //OnUpdateExtraParams;
private ObjectDuplicate handlerObjectDuplicate; private ObjectDuplicate handlerObjectDuplicate;
private ObjectDuplicateOnRay handlerObjectDuplicateOnRay; private ObjectDuplicateOnRay handlerObjectDuplicateOnRay;
private ObjectRequest handlerObjectRequest;
private ObjectSelect handlerObjectSelect; private ObjectSelect handlerObjectSelect;
private ObjectDeselect handlerObjectDeselect; private ObjectDeselect handlerObjectDeselect;
private ObjectIncludeInSearch handlerObjectIncludeInSearch; private ObjectIncludeInSearch handlerObjectIncludeInSearch;
@ -1083,6 +1084,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event GodKickUser OnGodKickUser; public event GodKickUser OnGodKickUser;
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event UpdateShape OnUpdatePrimShape; public event UpdateShape OnUpdatePrimShape;
public event ObjectRequest OnObjectRequest;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event ObjectDeselect OnObjectDeselect; public event ObjectDeselect OnObjectDeselect;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
@ -5937,6 +5939,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
break; break;
case PacketType.RequestMultipleObjects:
RequestMultipleObjectsPacket incomingRequest = (RequestMultipleObjectsPacket)Pack;
#region Packet Session and User Check
if (m_checkPackets)
{
if (incomingRequest.AgentData.SessionID != SessionId ||
incomingRequest.AgentData.AgentID != AgentId)
break;
}
#endregion
handlerObjectRequest = null;
for (int i = 0; i < incomingRequest.ObjectData.Length; i++)
{
handlerObjectRequest = OnObjectRequest;
if (handlerObjectRequest != null)
{
handlerObjectRequest(incomingRequest.ObjectData[i].ID, this);
}
}
break;
case PacketType.ObjectSelect: case PacketType.ObjectSelect:
ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;

View File

@ -107,6 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event UpdateShape OnUpdatePrimShape; public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
public event ObjectRequest OnObjectRequest;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;

View File

@ -108,6 +108,29 @@ namespace OpenSim.Region.Framework.Scenes
SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true); SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true);
} }
/// <summary>
/// Invoked when the client requests a prim.
/// </summary>
/// <param name="primLocalID"></param>
/// <param name="remoteClient"></param>
public void RequestPrim(uint primLocalID, IClientAPI remoteClient)
{
PacketType i = PacketType.ObjectUpdate;
List<EntityBase> EntityList = GetEntities();
foreach (EntityBase ent in EntityList)
{
if (ent is SceneObjectGroup)
{
if (((SceneObjectGroup)ent).LocalId == primLocalID)
{
((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient);
return;
}
}
}
}
/// <summary> /// <summary>
/// Invoked when the client selects a prim. /// Invoked when the client selects a prim.
/// </summary> /// </summary>

View File

@ -2076,6 +2076,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture;
client.OnTeleportLocationRequest += RequestTeleportLocation; client.OnTeleportLocationRequest += RequestTeleportLocation;
client.OnTeleportLandmarkRequest += RequestTeleportLandmark; client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
client.OnObjectRequest += RequestPrim;
client.OnObjectSelect += SelectPrim; client.OnObjectSelect += SelectPrim;
client.OnObjectDeselect += DeselectPrim; client.OnObjectDeselect += DeselectPrim;
client.OnGrabUpdate += m_sceneGraph.MoveObject; client.OnGrabUpdate += m_sceneGraph.MoveObject;

View File

@ -686,6 +686,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event SpinStop OnSpinStop; public event SpinStop OnSpinStop;
public event UpdateShape OnUpdatePrimShape; public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event ObjectRequest OnObjectRequest;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event ObjectDeselect OnObjectDeselect; public event ObjectDeselect OnObjectDeselect;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;

View File

@ -213,6 +213,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event UpdateShape OnUpdatePrimShape; public event UpdateShape OnUpdatePrimShape;
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
public event ObjectRequest OnObjectRequest;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;

View File

@ -120,6 +120,7 @@ namespace OpenSim.Tests.Common.Mock
public event ObjectExtraParams OnUpdateExtraParams; public event ObjectExtraParams OnUpdateExtraParams;
public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
public event ObjectSelect OnObjectSelect; public event ObjectSelect OnObjectSelect;
public event ObjectRequest OnObjectRequest;
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;
public event GenericCall7 OnObjectClickAction; public event GenericCall7 OnObjectClickAction;