Merge branch 'master' of ssh://MyConnection/var/git/opensim
commit
acc14c472d
|
@ -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;
|
||||||
|
|
|
@ -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 { };
|
||||||
|
|
|
@ -1,3 +1,30 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
@ -1,3 +1,30 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -520,7 +520,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Depreciated idea. Number of visitors ~= free money
|
/// Deprecated idea. Number of visitors ~= free money
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Dwell {
|
public int Dwell {
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Framework.Tests
|
||||||
Vector3 StartPos = new Vector3(5, 23, 125);
|
Vector3 StartPos = new Vector3(5, 23, 125);
|
||||||
|
|
||||||
UUID SecureSessionId = UUID.Random();
|
UUID SecureSessionId = UUID.Random();
|
||||||
UUID SessionId = UUID.Random();
|
// TODO: unused: UUID SessionId = UUID.Random();
|
||||||
|
|
||||||
m_agentCircuitData1 = new AgentCircuitData();
|
m_agentCircuitData1 = new AgentCircuitData();
|
||||||
m_agentCircuitData1.AgentID = AgentId1;
|
m_agentCircuitData1.AgentID = AgentId1;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
|
|
||||||
responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);
|
responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
|
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
|
||||||
|
|
||||||
responseMap["connect"] = OSD.FromBoolean(true);
|
responseMap["connect"] = OSD.FromBoolean(true);
|
||||||
|
@ -591,7 +591,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
httpaddr = httpsCN;
|
httpaddr = httpsCN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
responseMap["seed_capability"]
|
responseMap["seed_capability"]
|
||||||
= OSD.FromString(
|
= OSD.FromString(
|
||||||
regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
|
regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
|
||||||
|
@ -764,7 +764,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port);
|
responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port);
|
||||||
responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString());
|
responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString());
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
|
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
|
||||||
|
|
||||||
responseMap["session_id"] = OSD.FromUUID(SessionID);
|
responseMap["session_id"] = OSD.FromUUID(SessionID);
|
||||||
|
@ -851,7 +851,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
|
|
||||||
string rezRespSeedCap = "";
|
string rezRespSeedCap = "";
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
if (rezResponseMap.ContainsKey("seed_capability"))
|
if (rezResponseMap.ContainsKey("seed_capability"))
|
||||||
rezRespSeedCap = rezResponseMap["seed_capability"].AsString();
|
rezRespSeedCap = rezResponseMap["seed_capability"].AsString();
|
||||||
|
|
||||||
|
@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
if (rezResponseMap.ContainsKey("rez_avatar/rez"))
|
if (rezResponseMap.ContainsKey("rez_avatar/rez"))
|
||||||
rezRespSeedCap = rezResponseMap["rez_avatar/rez"].AsString();
|
rezRespSeedCap = rezResponseMap["rez_avatar/rez"].AsString();
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
string rezRespSim_ip = rezResponseMap["sim_ip"].AsString();
|
string rezRespSim_ip = rezResponseMap["sim_ip"].AsString();
|
||||||
|
|
||||||
string rezRespSim_host = rezResponseMap["sim_host"].AsString();
|
string rezRespSim_host = rezResponseMap["sim_host"].AsString();
|
||||||
|
@ -879,13 +879,13 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
{
|
{
|
||||||
RezResponsePositionArray = (OSDArray)rezResponseMap["position"];
|
RezResponsePositionArray = (OSDArray)rezResponseMap["position"];
|
||||||
}
|
}
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap);
|
responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap);
|
||||||
|
|
||||||
// REPLACEMENT r3
|
// REPLACEMENT r3
|
||||||
responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap);
|
responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap);
|
||||||
|
|
||||||
// DEPRECIATED
|
// DEPRECATED
|
||||||
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
|
responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
|
||||||
|
|
||||||
responseMap["sim_host"] = OSD.FromString(rezRespSim_host);
|
responseMap["sim_host"] = OSD.FromString(rezRespSim_host);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public delegate void OnNewClientDelegate(IClientAPI client);
|
public delegate void OnNewClientDelegate(IClientAPI client);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Depreciated in favour of OnClientConnect.
|
/// Deprecated in favour of OnClientConnect.
|
||||||
/// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
|
/// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event OnNewClientDelegate OnNewClient;
|
public event OnNewClientDelegate OnNewClient;
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -928,25 +928,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// Primitive Ray Tracing
|
// Primitive Ray Tracing
|
||||||
float closestDistance = 280f;
|
float closestDistance = 280f;
|
||||||
EntityIntersection returnResult = new EntityIntersection();
|
EntityIntersection result = new EntityIntersection();
|
||||||
List<EntityBase> EntityList = GetEntities();
|
List<EntityBase> EntityList = GetEntities();
|
||||||
foreach (EntityBase ent in EntityList)
|
foreach (EntityBase ent in EntityList)
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
SceneObjectGroup reportingG = (SceneObjectGroup)ent;
|
SceneObjectGroup reportingG = (SceneObjectGroup)ent;
|
||||||
EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters);
|
EntityIntersection inter = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters);
|
||||||
if (result.HitTF)
|
if (inter.HitTF && inter.distance < closestDistance)
|
||||||
{
|
{
|
||||||
if (result.distance < closestDistance)
|
closestDistance = inter.distance;
|
||||||
{
|
result = inter;
|
||||||
closestDistance = result.distance;
|
|
||||||
returnResult = result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return result;
|
||||||
return returnResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -555,7 +555,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// If we get a result, we're going to find the closest result to the origin of the ray
|
// If we get a result, we're going to find the closest result to the origin of the ray
|
||||||
// and send back the intersection information back to the innerscene.
|
// and send back the intersection information back to the innerscene.
|
||||||
|
|
||||||
EntityIntersection returnresult = new EntityIntersection();
|
EntityIntersection result = new EntityIntersection();
|
||||||
|
|
||||||
lock (m_parts)
|
lock (m_parts)
|
||||||
{
|
{
|
||||||
|
@ -576,26 +576,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// when the camera crosses the border.
|
// when the camera crosses the border.
|
||||||
float idist = Constants.RegionSize;
|
float idist = Constants.RegionSize;
|
||||||
|
|
||||||
|
|
||||||
if (inter.HitTF)
|
if (inter.HitTF)
|
||||||
{
|
{
|
||||||
// We need to find the closest prim to return to the testcaller along the ray
|
// We need to find the closest prim to return to the testcaller along the ray
|
||||||
if (inter.distance < idist)
|
if (inter.distance < idist)
|
||||||
{
|
{
|
||||||
returnresult.HitTF = true;
|
result.HitTF = true;
|
||||||
returnresult.ipoint = inter.ipoint;
|
result.ipoint = inter.ipoint;
|
||||||
returnresult.obj = part;
|
result.obj = part;
|
||||||
returnresult.normal = inter.normal;
|
result.normal = inter.normal;
|
||||||
returnresult.distance = inter.distance;
|
result.distance = inter.distance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnresult;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a vector representing the size of the bounding box containing all the prims in the group
|
/// Gets a vector representing the size of the bounding box containing all the prims in the group
|
||||||
/// Treats all prims as rectangular, so no shape (cut etc) is taken into account
|
/// Treats all prims as rectangular, so no shape (cut etc) is taken into account
|
||||||
|
@ -652,7 +649,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
frontBottomRight.Y = orig.Y + (part.Scale.Y / 2);
|
frontBottomRight.Y = orig.Y + (part.Scale.Y / 2);
|
||||||
frontBottomRight.Z = orig.Z - (part.Scale.Z / 2);
|
frontBottomRight.Z = orig.Z - (part.Scale.Z / 2);
|
||||||
|
|
||||||
|
|
||||||
backTopLeft.X = orig.X + (part.Scale.X / 2);
|
backTopLeft.X = orig.X + (part.Scale.X / 2);
|
||||||
backTopLeft.Y = orig.Y - (part.Scale.Y / 2);
|
backTopLeft.Y = orig.Y - (part.Scale.Y / 2);
|
||||||
backTopLeft.Z = orig.Z + (part.Scale.Z / 2);
|
backTopLeft.Z = orig.Z + (part.Scale.Z / 2);
|
||||||
|
@ -839,7 +835,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (backBottomLeft.Z < minZ)
|
if (backBottomLeft.Z < minZ)
|
||||||
minZ = backBottomLeft.Z;
|
minZ = backBottomLeft.Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
|
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
|
||||||
|
@ -860,6 +855,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
|
// m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
|
||||||
return boundingBox;
|
return boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void SaveScriptedState(XmlTextWriter writer)
|
public void SaveScriptedState(XmlTextWriter writer)
|
||||||
|
@ -1029,8 +1025,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
|
//m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
|
||||||
//AttachToBackup();
|
//AttachToBackup();
|
||||||
//m_rootPart.ScheduleFullUpdate();
|
//m_rootPart.ScheduleFullUpdate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1130,6 +1126,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper provided for parts.
|
// helper provided for parts.
|
||||||
public int GetSceneMaxUndo()
|
public int GetSceneMaxUndo()
|
||||||
{
|
{
|
||||||
|
@ -1183,7 +1180,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart part = GetChildPart(localId);
|
SceneObjectPart part = GetChildPart(localId);
|
||||||
OnGrabPart(part, offsetPos, remoteClient);
|
OnGrabPart(part, offsetPos, remoteClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1267,28 +1263,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((aggregateScriptEvents & scriptEvents.at_target) != 0)
|
m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0);
|
||||||
{
|
m_scriptListens_notAtTarget = ((aggregateScriptEvents & scriptEvents.not_at_target) != 0);
|
||||||
m_scriptListens_atTarget = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_scriptListens_atTarget = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((aggregateScriptEvents & scriptEvents.not_at_target) != 0)
|
if (!m_scriptListens_atTarget && !m_scriptListens_notAtTarget)
|
||||||
{
|
|
||||||
m_scriptListens_notAtTarget = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_scriptListens_notAtTarget = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_scriptListens_atTarget || m_scriptListens_notAtTarget)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
lock (m_targets)
|
lock (m_targets)
|
||||||
m_targets.Clear();
|
m_targets.Clear();
|
||||||
|
@ -1787,9 +1765,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the owner of the root part.
|
/// Set the owner of the root part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2710,11 +2710,10 @@ if (m_shape != null) {
|
||||||
|
|
||||||
public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot)
|
public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot)
|
||||||
{
|
{
|
||||||
// In this case we're using a sphere with a radius of the largest dimention of the prim
|
// In this case we're using a sphere with a radius of the largest dimension of the prim
|
||||||
// TODO: Change to take shape into account
|
// TODO: Change to take shape into account
|
||||||
|
|
||||||
|
EntityIntersection result = new EntityIntersection();
|
||||||
EntityIntersection returnresult = new EntityIntersection();
|
|
||||||
Vector3 vAbsolutePosition = AbsolutePosition;
|
Vector3 vAbsolutePosition = AbsolutePosition;
|
||||||
Vector3 vScale = Scale;
|
Vector3 vScale = Scale;
|
||||||
Vector3 rOrigin = iray.Origin;
|
Vector3 rOrigin = iray.Origin;
|
||||||
|
@ -2738,8 +2737,7 @@ if (m_shape != null) {
|
||||||
|
|
||||||
Vector3 tmVal6 = vAbsolutePosition*rOrigin;
|
Vector3 tmVal6 = vAbsolutePosition*rOrigin;
|
||||||
|
|
||||||
|
// Set Radius to the largest dimension of the prim
|
||||||
// Set Radius to the largest dimention of the prim
|
|
||||||
float radius = 0f;
|
float radius = 0f;
|
||||||
if (vScale.X > radius)
|
if (vScale.X > radius)
|
||||||
radius = vScale.X;
|
radius = vScale.X;
|
||||||
|
@ -2765,7 +2763,7 @@ if (m_shape != null) {
|
||||||
if (rootsqr < 0.0f)
|
if (rootsqr < 0.0f)
|
||||||
{
|
{
|
||||||
// No intersection
|
// No intersection
|
||||||
return returnresult;
|
return result;
|
||||||
}
|
}
|
||||||
float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f);
|
float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f);
|
||||||
|
|
||||||
|
@ -2778,7 +2776,7 @@ if (m_shape != null) {
|
||||||
if (root < 0.0f)
|
if (root < 0.0f)
|
||||||
{
|
{
|
||||||
// nope, no intersection
|
// nope, no intersection
|
||||||
return returnresult;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2788,12 +2786,12 @@ if (m_shape != null) {
|
||||||
new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root),
|
new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root),
|
||||||
iray.Origin.Z + (iray.Direction.Z*root));
|
iray.Origin.Z + (iray.Direction.Z*root));
|
||||||
|
|
||||||
returnresult.HitTF = true;
|
result.HitTF = true;
|
||||||
returnresult.ipoint = ipoint;
|
result.ipoint = ipoint;
|
||||||
|
|
||||||
// Normal is calculated by the difference and then normalizing the result
|
// Normal is calculated by the difference and then normalizing the result
|
||||||
Vector3 normalpart = ipoint - vAbsolutePosition;
|
Vector3 normalpart = ipoint - vAbsolutePosition;
|
||||||
returnresult.normal = normalpart / normalpart.Length();
|
result.normal = normalpart / normalpart.Length();
|
||||||
|
|
||||||
// It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't.
|
// It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't.
|
||||||
// I can write a function to do it.. but I like the fact that this one is Static.
|
// I can write a function to do it.. but I like the fact that this one is Static.
|
||||||
|
@ -2802,9 +2800,9 @@ if (m_shape != null) {
|
||||||
Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z);
|
Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z);
|
||||||
float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2);
|
float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2);
|
||||||
|
|
||||||
returnresult.distance = distance;
|
result.distance = distance;
|
||||||
|
|
||||||
return returnresult;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters)
|
public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters)
|
||||||
|
@ -3008,9 +3006,9 @@ if (m_shape != null) {
|
||||||
//distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1;
|
//distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityIntersection returnresult = new EntityIntersection();
|
EntityIntersection result = new EntityIntersection();
|
||||||
|
|
||||||
returnresult.distance = 1024;
|
result.distance = 1024;
|
||||||
float c = 0;
|
float c = 0;
|
||||||
float a = 0;
|
float a = 0;
|
||||||
float d = 0;
|
float d = 0;
|
||||||
|
@ -3030,7 +3028,7 @@ if (m_shape != null) {
|
||||||
//{
|
//{
|
||||||
//if (iray.Origin.Dot(normals[i]) > d)
|
//if (iray.Origin.Dot(normals[i]) > d)
|
||||||
//{
|
//{
|
||||||
//return returnresult;
|
//return result;
|
||||||
//}
|
//}
|
||||||
// else
|
// else
|
||||||
//{
|
//{
|
||||||
|
@ -3044,7 +3042,7 @@ if (m_shape != null) {
|
||||||
//{
|
//{
|
||||||
//if (a > fmin)
|
//if (a > fmin)
|
||||||
//{
|
//{
|
||||||
//return returnresult;
|
//return result;
|
||||||
//}
|
//}
|
||||||
//fmax = a;
|
//fmax = a;
|
||||||
//}
|
//}
|
||||||
|
@ -3056,7 +3054,7 @@ if (m_shape != null) {
|
||||||
//{
|
//{
|
||||||
//if (a < 0 || a < fmax)
|
//if (a < 0 || a < fmax)
|
||||||
//{
|
//{
|
||||||
//return returnresult;
|
//return result;
|
||||||
//}
|
//}
|
||||||
//fmin = a;
|
//fmin = a;
|
||||||
//}
|
//}
|
||||||
|
@ -3112,17 +3110,17 @@ if (m_shape != null) {
|
||||||
// distance2 = (float)GetDistanceTo(q, iray.Origin);
|
// distance2 = (float)GetDistanceTo(q, iray.Origin);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (distance2 < returnresult.distance)
|
if (distance2 < result.distance)
|
||||||
{
|
{
|
||||||
returnresult.distance = distance2;
|
result.distance = distance2;
|
||||||
returnresult.HitTF = true;
|
result.HitTF = true;
|
||||||
returnresult.ipoint = q;
|
result.ipoint = q;
|
||||||
//m_log.Info("[FACE]:" + i.ToString());
|
//m_log.Info("[FACE]:" + i.ToString());
|
||||||
//m_log.Info("[POINT]: " + q.ToString());
|
//m_log.Info("[POINT]: " + q.ToString());
|
||||||
//m_log.Info("[DIST]: " + distance2.ToString());
|
//m_log.Info("[DIST]: " + distance2.ToString());
|
||||||
if (faceCenters)
|
if (faceCenters)
|
||||||
{
|
{
|
||||||
returnresult.normal = AAfacenormals[i] * AXrot;
|
result.normal = AAfacenormals[i] * AXrot;
|
||||||
|
|
||||||
Vector3 scaleComponent = AAfacenormals[i];
|
Vector3 scaleComponent = AAfacenormals[i];
|
||||||
float ScaleOffset = 0.5f;
|
float ScaleOffset = 0.5f;
|
||||||
|
@ -3130,20 +3128,20 @@ if (m_shape != null) {
|
||||||
if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y;
|
if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y;
|
||||||
if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z;
|
if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z;
|
||||||
ScaleOffset = Math.Abs(ScaleOffset);
|
ScaleOffset = Math.Abs(ScaleOffset);
|
||||||
Vector3 offset = returnresult.normal * ScaleOffset;
|
Vector3 offset = result.normal * ScaleOffset;
|
||||||
returnresult.ipoint = AXpos + offset;
|
result.ipoint = AXpos + offset;
|
||||||
|
|
||||||
///pos = (intersectionpoint + offset);
|
///pos = (intersectionpoint + offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
returnresult.normal = normals[i];
|
result.normal = normals[i];
|
||||||
}
|
}
|
||||||
returnresult.AAfaceNormal = AAfacenormals[i];
|
result.AAfaceNormal = AAfacenormals[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnresult;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -634,7 +634,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
{
|
{
|
||||||
get { return (uint)Util.RandomClass.Next(0,int.MaxValue); }
|
get { return (uint)Util.RandomClass.Next(0,int.MaxValue); }
|
||||||
}
|
}
|
||||||
|
#pragma warning disable 67
|
||||||
public event GenericMessage OnGenericMessage;
|
public event GenericMessage OnGenericMessage;
|
||||||
public event ImprovedInstantMessage OnInstantMessage;
|
public event ImprovedInstantMessage OnInstantMessage;
|
||||||
public event ChatMessage OnChatFromClient;
|
public event ChatMessage OnChatFromClient;
|
||||||
|
@ -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;
|
||||||
|
@ -825,6 +826,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
public event AvatarNotesUpdate OnAvatarNotesUpdate;
|
public event AvatarNotesUpdate OnAvatarNotesUpdate;
|
||||||
public event MuteListRequest OnMuteListRequest;
|
public event MuteListRequest OnMuteListRequest;
|
||||||
public event PlacesQuery OnPlacesQuery;
|
public event PlacesQuery OnPlacesQuery;
|
||||||
|
#pragma warning restore 67
|
||||||
|
|
||||||
public void SetDebugPacketLevel(int newDebug)
|
public void SetDebugPacketLevel(int newDebug)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
{
|
||||||
|
public interface ISecurityCredential
|
||||||
|
{
|
||||||
|
ISocialEntity owner { get; }
|
||||||
|
bool CanEditObject(IObject target);
|
||||||
|
bool CanEditTerrain(int x, int y);
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,19 +32,6 @@ using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
public interface IAvatarAttachment
|
|
||||||
{
|
|
||||||
//// <value>
|
|
||||||
/// Describes where on the avatar the attachment is located
|
|
||||||
/// </value>
|
|
||||||
int Location { get ; }
|
|
||||||
|
|
||||||
//// <value>
|
|
||||||
/// Accessor to the rez'ed asset, representing the attachment
|
|
||||||
/// </value>
|
|
||||||
IObject Asset { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface IAvatar : IEntity
|
public interface IAvatar : IEntity
|
||||||
{
|
{
|
||||||
//// <value>
|
//// <value>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
{
|
||||||
|
public interface IAvatarAttachment
|
||||||
|
{
|
||||||
|
//// <value>
|
||||||
|
/// Describes where on the avatar the attachment is located
|
||||||
|
/// </value>
|
||||||
|
int Location { get ; }
|
||||||
|
|
||||||
|
//// <value>
|
||||||
|
/// Accessor to the rez'ed asset, representing the attachment
|
||||||
|
/// </value>
|
||||||
|
IObject Asset { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -212,6 +212,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
bool Bright { get; set; } // SetPrimParms(FULLBRIGHT)
|
bool Bright { get; set; } // SetPrimParms(FULLBRIGHT)
|
||||||
double Bloom { get; set; } // SetPrimParms(GLOW)
|
double Bloom { get; set; } // SetPrimParms(GLOW)
|
||||||
bool Shiny { get; set; } // SetPrimParms(SHINY)
|
bool Shiny { get; set; } // SetPrimParms(SHINY)
|
||||||
bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECIATE IN FAVOUR OF UUID?]
|
bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECATE IN FAVOUR OF UUID?]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,8 +166,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
|
||||||
public void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host)
|
public void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host)
|
||||||
{
|
{
|
||||||
world = new World(m_scene);
|
// UUID should be changed to object owner.
|
||||||
host = new Host(new SOPObject(m_scene, localID), m_scene, new ExtensionHandler(m_extensions), m_microthreads);
|
UUID owner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
|
||||||
|
SEUser securityUser = new SEUser(owner, "Name Unassigned");
|
||||||
|
SecurityCredential creds = new SecurityCredential(securityUser, m_scene);
|
||||||
|
|
||||||
|
world = new World(m_scene, creds);
|
||||||
|
host = new Host(new SOPObject(m_scene, localID, creds), m_scene, new ExtensionHandler(m_extensions),
|
||||||
|
m_microthreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID)
|
public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID)
|
||||||
|
|
|
@ -40,10 +40,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
private readonly Scene m_scene;
|
private readonly Scene m_scene;
|
||||||
private readonly IEnumerator<EntityBase> m_sogEnum;
|
private readonly IEnumerator<EntityBase> m_sogEnum;
|
||||||
|
private readonly ISecurityCredential m_security;
|
||||||
|
|
||||||
public IObjEnum(Scene scene)
|
public IObjEnum(Scene scene, ISecurityCredential security)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
m_security = security;
|
||||||
m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator();
|
m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new SOPObject(m_scene, m_sogEnum.Current.LocalId);
|
return new SOPObject(m_scene, m_sogEnum.Current.LocalId, m_security);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,17 +81,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor
|
public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor
|
||||||
{
|
{
|
||||||
private readonly Scene m_scene;
|
private readonly Scene m_scene;
|
||||||
|
private readonly ISecurityCredential m_security;
|
||||||
|
|
||||||
public ObjectAccessor(Scene scene)
|
public ObjectAccessor(Scene scene, ISecurityCredential security)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
m_security = security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IObject this[int index]
|
public IObject this[int index]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId);
|
return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId, m_security);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +101,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new SOPObject(m_scene, m_scene.Entities[index].LocalId);
|
return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new SOPObject(m_scene, m_scene.Entities[index].LocalId);
|
return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,20 +121,20 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public IObject Create(Vector3 position, Quaternion rotation)
|
public IObject Create(Vector3 position, Quaternion rotation)
|
||||||
{
|
{
|
||||||
|
|
||||||
SceneObjectGroup sog = m_scene.AddNewPrim(m_scene.RegionInfo.MasterAvatarAssignedUUID,
|
SceneObjectGroup sog = m_scene.AddNewPrim(m_security.owner.GlobalID,
|
||||||
UUID.Zero,
|
UUID.Zero,
|
||||||
position,
|
position,
|
||||||
rotation,
|
rotation,
|
||||||
PrimitiveBaseShape.CreateBox());
|
PrimitiveBaseShape.CreateBox());
|
||||||
|
|
||||||
IObject ret = new SOPObject(m_scene, sog.LocalId);
|
IObject ret = new SOPObject(m_scene, sog.LocalId, m_security);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerator<IObject> GetEnumerator()
|
public IEnumerator<IObject> GetEnumerator()
|
||||||
{
|
{
|
||||||
return new IObjEnum(m_scene);
|
return new IObjEnum(m_scene, m_security);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Security;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenMetaverse.Packets;
|
using OpenMetaverse.Packets;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -42,13 +43,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
private readonly Scene m_rootScene;
|
private readonly Scene m_rootScene;
|
||||||
private readonly uint m_localID;
|
private readonly uint m_localID;
|
||||||
|
private readonly ISecurityCredential m_security;
|
||||||
|
|
||||||
|
[Obsolete("Replace with 'credential' constructor [security]")]
|
||||||
public SOPObject(Scene rootScene, uint localID)
|
public SOPObject(Scene rootScene, uint localID)
|
||||||
{
|
{
|
||||||
m_rootScene = rootScene;
|
m_rootScene = rootScene;
|
||||||
m_localID = localID;
|
m_localID = localID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SOPObject(Scene rootScene, uint localID, ISecurityCredential credential)
|
||||||
|
{
|
||||||
|
m_rootScene = rootScene;
|
||||||
|
m_localID = localID;
|
||||||
|
m_security = credential;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This needs to run very, very quickly.
|
/// This needs to run very, very quickly.
|
||||||
/// It is utilized in nearly every property and method.
|
/// It is utilized in nearly every property and method.
|
||||||
|
@ -59,6 +69,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
return m_rootScene.GetSceneObjectPart(m_localID);
|
return m_rootScene.GetSceneObjectPart(m_localID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CanEdit()
|
||||||
|
{
|
||||||
|
if(!m_security.CanEditObject(this))
|
||||||
|
{
|
||||||
|
throw new SecurityException("Insufficient Permission to edit object with UUID [" + GetSOP().UUID + "]");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#region OnTouch
|
#region OnTouch
|
||||||
|
|
||||||
private event OnTouchDelegate _OnTouch;
|
private event OnTouchDelegate _OnTouch;
|
||||||
|
@ -67,6 +86,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public event OnTouchDelegate OnTouch
|
public event OnTouchDelegate OnTouch
|
||||||
{
|
{
|
||||||
add
|
add
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
{
|
{
|
||||||
if (!_OnTouchActive)
|
if (!_OnTouchActive)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +98,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
|
||||||
_OnTouch += value;
|
_OnTouch += value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
remove
|
remove
|
||||||
{
|
{
|
||||||
_OnTouch -= value;
|
_OnTouch -= value;
|
||||||
|
@ -95,7 +117,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
if (_OnTouchActive && m_localID == localID)
|
if (_OnTouchActive && m_localID == localID)
|
||||||
{
|
{
|
||||||
TouchEventArgs e = new TouchEventArgs();
|
TouchEventArgs e = new TouchEventArgs();
|
||||||
e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId);
|
e.Avatar = new SPAvatar(m_rootScene, remoteClient.AgentId, m_security);
|
||||||
e.TouchBiNormal = surfaceArgs.Binormal;
|
e.TouchBiNormal = surfaceArgs.Binormal;
|
||||||
e.TouchMaterialIndex = surfaceArgs.FaceIndex;
|
e.TouchMaterialIndex = surfaceArgs.FaceIndex;
|
||||||
e.TouchNormal = surfaceArgs.Normal;
|
e.TouchNormal = surfaceArgs.Normal;
|
||||||
|
@ -130,13 +152,21 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return GetSOP().Name; }
|
get { return GetSOP().Name; }
|
||||||
set { GetSOP().Name = value; }
|
set
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
|
GetSOP().Name = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Description
|
public string Description
|
||||||
{
|
{
|
||||||
get { return GetSOP().Description; }
|
get { return GetSOP().Description; }
|
||||||
set { GetSOP().Description = value; }
|
set
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
|
GetSOP().Description = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IObject[] Children
|
public IObject[] Children
|
||||||
|
@ -151,7 +181,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children)
|
foreach (KeyValuePair<UUID, SceneObjectPart> pair in my.ParentGroup.Children)
|
||||||
{
|
{
|
||||||
rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId);
|
rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rets;
|
return rets;
|
||||||
|
@ -160,7 +190,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
|
||||||
public IObject Root
|
public IObject Root
|
||||||
{
|
{
|
||||||
get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId); }
|
get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId, m_security); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IObjectMaterial[] Materials
|
public IObjectMaterial[] Materials
|
||||||
|
@ -182,7 +212,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public Vector3 Scale
|
public Vector3 Scale
|
||||||
{
|
{
|
||||||
get { return GetSOP().Scale; }
|
get { return GetSOP().Scale; }
|
||||||
set { GetSOP().Scale = value; }
|
set
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
|
GetSOP().Scale = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Quaternion WorldRotation
|
public Quaternion WorldRotation
|
||||||
|
@ -201,16 +235,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
get { return GetSOP().AbsolutePosition; }
|
get { return GetSOP().AbsolutePosition; }
|
||||||
set
|
set
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
{
|
{
|
||||||
SceneObjectPart pos = GetSOP();
|
SceneObjectPart pos = GetSOP();
|
||||||
pos.UpdateOffSet(value - pos.AbsolutePosition);
|
pos.UpdateOffSet(value - pos.AbsolutePosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Vector3 OffsetPosition
|
public Vector3 OffsetPosition
|
||||||
{
|
{
|
||||||
get { return GetSOP().OffsetPosition; }
|
get { return GetSOP().OffsetPosition; }
|
||||||
set { GetSOP().OffsetPosition = value; }
|
set
|
||||||
|
{
|
||||||
|
if (CanEdit())
|
||||||
|
{
|
||||||
|
GetSOP().OffsetPosition = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 SitTarget
|
public Vector3 SitTarget
|
||||||
|
@ -310,8 +353,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
|
||||||
public void Say(string msg)
|
public void Say(string msg)
|
||||||
{
|
{
|
||||||
SceneObjectPart sop = GetSOP();
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
|
SceneObjectPart sop = GetSOP();
|
||||||
m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false);
|
m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,6 +548,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z);
|
GetSOP().PhysActor.RotationalVelocity = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,6 +564,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
|
GetSOP().PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,6 +580,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z);
|
GetSOP().PhysActor.Torque = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,27 +605,44 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z);
|
GetSOP().PhysActor.Force = new PhysicsVector(value.X, value.Y, value.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool FloatOnWater
|
public bool FloatOnWater
|
||||||
{
|
{
|
||||||
set { GetSOP().PhysActor.FloatOnWater = value; }
|
set
|
||||||
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
GetSOP().PhysActor.FloatOnWater = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddForce(Vector3 force, bool pushforce)
|
public void AddForce(Vector3 force, bool pushforce)
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
|
GetSOP().PhysActor.AddForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddAngularForce(Vector3 force, bool pushforce)
|
public void AddAngularForce(Vector3 force, bool pushforce)
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
|
GetSOP().PhysActor.AddAngularForce(new PhysicsVector(force.X, force.Y, force.Z), pushforce);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMomentum(Vector3 momentum)
|
public void SetMomentum(Vector3 momentum)
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z));
|
GetSOP().PhysActor.SetMomentum(new PhysicsVector(momentum.X, momentum.Y, momentum.Z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,6 +657,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
get { return m_sculptMap; }
|
get { return m_sculptMap; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
m_sculptMap = value;
|
m_sculptMap = value;
|
||||||
SetPrimitiveSculpted(SculptMap, (byte) SculptType);
|
SetPrimitiveSculpted(SculptMap, (byte) SculptType);
|
||||||
}
|
}
|
||||||
|
@ -598,6 +672,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
get { return m_sculptType; }
|
get { return m_sculptType; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if(!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
m_sculptType = value;
|
m_sculptType = value;
|
||||||
SetPrimitiveSculpted(SculptMap, (byte) SculptType);
|
SetPrimitiveSculpted(SculptMap, (byte) SculptType);
|
||||||
}
|
}
|
||||||
|
@ -654,6 +731,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
|
||||||
public void Play(UUID asset, double volume)
|
public void Play(UUID asset, double volume)
|
||||||
{
|
{
|
||||||
|
if (!CanEdit())
|
||||||
|
return;
|
||||||
|
|
||||||
GetSOP().SendSound(asset.ToString(), volume, true, 0);
|
GetSOP().SendSound(asset.ToString(), volume, true, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,11 +42,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
private readonly Scene m_rootScene;
|
private readonly Scene m_rootScene;
|
||||||
private readonly UUID m_ID;
|
private readonly UUID m_ID;
|
||||||
|
private readonly ISecurityCredential m_security;
|
||||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public SPAvatar(Scene scene, UUID ID)
|
public SPAvatar(Scene scene, UUID ID, ISecurityCredential security)
|
||||||
{
|
{
|
||||||
m_rootScene = scene;
|
m_rootScene = scene;
|
||||||
|
m_security = security;
|
||||||
m_ID = ID;
|
m_ID = ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +86,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
foreach (DictionaryEntry element in internalAttachments)
|
foreach (DictionaryEntry element in internalAttachments)
|
||||||
{
|
{
|
||||||
Hashtable attachInfo = (Hashtable)element.Value;
|
Hashtable attachInfo = (Hashtable)element.Value;
|
||||||
attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int)element.Key, new UUID((string)attachInfo["item"]), new UUID((string)attachInfo["asset"])));
|
attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int) element.Key,
|
||||||
|
new UUID((string) attachInfo["item"]),
|
||||||
|
new UUID((string) attachInfo["asset"]), m_security));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
//private readonly UUID m_itemId;
|
//private readonly UUID m_itemId;
|
||||||
private readonly UUID m_assetId;
|
private readonly UUID m_assetId;
|
||||||
|
|
||||||
public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId)
|
private readonly ISecurityCredential m_security;
|
||||||
|
|
||||||
|
public SPAvatarAttachment(Scene rootScene, IAvatar self, int location, UUID itemId, UUID assetId, ISecurityCredential security)
|
||||||
{
|
{
|
||||||
m_rootScene = rootScene;
|
m_rootScene = rootScene;
|
||||||
|
m_security = security;
|
||||||
//m_parent = self;
|
//m_parent = self;
|
||||||
m_location = location;
|
m_location = location;
|
||||||
//m_itemId = itemId;
|
//m_itemId = itemId;
|
||||||
|
@ -55,7 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId);
|
return new SOPObject(m_rootScene, m_rootScene.GetSceneObjectPart(m_assetId).LocalId, m_security);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using OpenMetaverse;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
|
{
|
||||||
|
class SecurityCredential : ISecurityCredential
|
||||||
|
{
|
||||||
|
private readonly ISocialEntity m_owner;
|
||||||
|
private readonly Scene m_scene;
|
||||||
|
|
||||||
|
public SecurityCredential(ISocialEntity m_owner, Scene m_scene)
|
||||||
|
{
|
||||||
|
this.m_owner = m_owner;
|
||||||
|
this.m_scene = m_scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISocialEntity owner
|
||||||
|
{
|
||||||
|
get { return m_owner; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanEditObject(IObject target)
|
||||||
|
{
|
||||||
|
return m_scene.Permissions.CanEditObject(target.GlobalID, m_owner.GlobalID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanEditTerrain(int x, int y)
|
||||||
|
{
|
||||||
|
return m_scene.Permissions.CanTerraformLand(m_owner.GlobalID, new Vector3(x, y, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,15 +37,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public class World : System.MarshalByRefObject, IWorld, IWorldAudio
|
public class World : System.MarshalByRefObject, IWorld, IWorldAudio
|
||||||
{
|
{
|
||||||
private readonly Scene m_internalScene;
|
private readonly Scene m_internalScene;
|
||||||
|
private readonly ISecurityCredential m_security;
|
||||||
private readonly Heightmap m_heights;
|
private readonly Heightmap m_heights;
|
||||||
|
|
||||||
private readonly ObjectAccessor m_objs;
|
private readonly ObjectAccessor m_objs;
|
||||||
|
|
||||||
public World(Scene internalScene)
|
public World(Scene internalScene, ISecurityCredential securityCredential)
|
||||||
{
|
{
|
||||||
|
m_security = securityCredential;
|
||||||
m_internalScene = internalScene;
|
m_internalScene = internalScene;
|
||||||
m_heights = new Heightmap(m_internalScene);
|
m_heights = new Heightmap(m_internalScene);
|
||||||
m_objs = new ObjectAccessor(m_internalScene);
|
m_objs = new ObjectAccessor(m_internalScene, securityCredential);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
|
@ -84,7 +86,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
if (_OnNewUser != null)
|
if (_OnNewUser != null)
|
||||||
{
|
{
|
||||||
NewUserEventArgs e = new NewUserEventArgs();
|
NewUserEventArgs e = new NewUserEventArgs();
|
||||||
e.Avatar = new SPAvatar(m_internalScene, presence.UUID);
|
e.Avatar = new SPAvatar(m_internalScene, presence.UUID, m_security);
|
||||||
_OnNewUser(this, e);
|
_OnNewUser(this, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
if (chat.Sender == null && chat.SenderObject != null)
|
if (chat.Sender == null && chat.SenderObject != null)
|
||||||
{
|
{
|
||||||
ChatEventArgs e = new ChatEventArgs();
|
ChatEventArgs e = new ChatEventArgs();
|
||||||
e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId);
|
e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security);
|
||||||
e.Text = chat.Message;
|
e.Text = chat.Message;
|
||||||
|
|
||||||
_OnChat(this, e);
|
_OnChat(this, e);
|
||||||
|
@ -154,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
if (chat.Sender != null && chat.SenderObject == null)
|
if (chat.Sender != null && chat.SenderObject == null)
|
||||||
{
|
{
|
||||||
ChatEventArgs e = new ChatEventArgs();
|
ChatEventArgs e = new ChatEventArgs();
|
||||||
e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID);
|
e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security);
|
||||||
e.Text = chat.Message;
|
e.Text = chat.Message;
|
||||||
|
|
||||||
_OnChat(this, e);
|
_OnChat(this, e);
|
||||||
|
@ -207,7 +209,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
for (int i = 0; i < ents.Count; i++)
|
for (int i = 0; i < ents.Count; i++)
|
||||||
{
|
{
|
||||||
EntityBase ent = ents[i];
|
EntityBase ent = ents[i];
|
||||||
rets[i] = new SPAvatar(m_internalScene, ent.UUID);
|
rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rets;
|
return rets;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -347,18 +347,13 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// zero out a heightmap array float array (single dimention [flattened]))
|
// zero out a heightmap array float array (single dimension [flattened]))
|
||||||
if ((int)Constants.RegionSize == 256)
|
if ((int)Constants.RegionSize == 256)
|
||||||
_heightmap = new float[514*514];
|
_heightmap = new float[514*514];
|
||||||
else
|
else
|
||||||
_heightmap = new float[(((int)Constants.RegionSize + 2) * ((int)Constants.RegionSize + 2))];
|
_heightmap = new float[(((int)Constants.RegionSize + 2) * ((int)Constants.RegionSize + 2))];
|
||||||
_watermap = new float[258 * 258];
|
_watermap = new float[258 * 258];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Zero out the prim spaces array (we split our space into smaller spaces so
|
// Zero out the prim spaces array (we split our space into smaller spaces so
|
||||||
// we can hit test less.
|
// we can hit test less.
|
||||||
}
|
}
|
||||||
|
@ -2197,7 +2192,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a static prim moves. Allocates a space for the prim based on it's position
|
/// Called when a static prim moves. Allocates a space for the prim based on its position
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="geom">the pointer to the geom that moved</param>
|
/// <param name="geom">the pointer to the geom that moved</param>
|
||||||
/// <param name="pos">the position that the geom moved to</param>
|
/// <param name="pos">the position that the geom moved to</param>
|
||||||
|
@ -3013,7 +3008,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
float[] returnarr = new float[262144];
|
float[] returnarr = new float[262144];
|
||||||
float[,] resultarr = new float[m_regionWidth, m_regionHeight];
|
float[,] resultarr = new float[m_regionWidth, m_regionHeight];
|
||||||
|
|
||||||
// Filling out the array into it's multi-dimentional components
|
// Filling out the array into its multi-dimensional components
|
||||||
for (int y = 0; y < m_regionHeight; y++)
|
for (int y = 0; y < m_regionHeight; y++)
|
||||||
{
|
{
|
||||||
for (int x = 0; x < m_regionWidth; x++)
|
for (int x = 0; x < m_regionWidth; x++)
|
||||||
|
@ -3126,7 +3121,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
float[] returnarr = new float[262144];
|
float[] returnarr = new float[262144];
|
||||||
float[,] resultarr = new float[m_regionWidth,m_regionHeight];
|
float[,] resultarr = new float[m_regionWidth,m_regionHeight];
|
||||||
|
|
||||||
// Filling out the array into it's multi-dimentional components
|
// Filling out the array into its multi-dimensional components
|
||||||
for (int y = 0; y < m_regionHeight; y++)
|
for (int y = 0; y < m_regionHeight; y++)
|
||||||
{
|
{
|
||||||
for (int x = 0; x < m_regionWidth; x++)
|
for (int x = 0; x < m_regionWidth; x++)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
save_crashes = false
|
save_crashes = false
|
||||||
|
|
||||||
; Directory to save crashes to if above is enabled
|
; Directory to save crashes to if above is enabled
|
||||||
; (eg default is /opensimdir/crashes/*.txt or C:\opensim\crashes\*.txt)
|
; (default is /opensimdir/crashes/*.txt or C:\opensim\crashes\*.txt)
|
||||||
crash_dir = "crashes"
|
crash_dir = "crashes"
|
||||||
|
|
||||||
; Place to create a PID file
|
; Place to create a PID file
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
; inside your firewall, separate patterns with a ';'
|
; inside your firewall, separate patterns with a ';'
|
||||||
; HttpProxyExceptions = ".mydomain.com;localhost"
|
; HttpProxyExceptions = ".mydomain.com;localhost"
|
||||||
|
|
||||||
; Set this to true if you are connecting your OpenSimulator regions to a grid
|
; Set this to true if you are connecting your regions to a grid
|
||||||
; Set this to false if you are running OpenSimulator in standalone mode
|
; Set this to false if you are running in standalone mode
|
||||||
gridmode = false
|
gridmode = false
|
||||||
|
|
||||||
; Set this to true if you want this OpenSimulator to run the Hypergrid functionality
|
; Set this to true if you want Hypergrid functionality
|
||||||
hypergrid = false
|
hypergrid = false
|
||||||
|
|
||||||
startup_console_commands_file = "startup_commands.txt"
|
startup_console_commands_file = "startup_commands.txt"
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
; Enables EventQueueGet Service.
|
; Enables EventQueueGet Service.
|
||||||
EventQueue = true
|
EventQueue = true
|
||||||
|
|
||||||
; Set this to the DLL containig the client stack to use.
|
; Set this to the DLL containing the client stack to use.
|
||||||
clientstack_plugin="OpenSim.Region.ClientStack.LindenUDP.dll"
|
clientstack_plugin="OpenSim.Region.ClientStack.LindenUDP.dll"
|
||||||
|
|
||||||
; ##
|
; ##
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
; except that everything is also enclosed in a <Regions> tag.
|
; except that everything is also enclosed in a <Regions> tag.
|
||||||
; regionload_webserver_url = "http://example.com/regions.xml";
|
; regionload_webserver_url = "http://example.com/regions.xml";
|
||||||
|
|
||||||
; Draw objects on maptile. This step might take a long time if you've got a huge amount of
|
; Draw objects on maptile. This step might take a long time if you've got a large number of
|
||||||
; objects, so you can turn it off here if you'd like.
|
; objects, so you can turn it off here if you'd like.
|
||||||
DrawPrimOnMapTile = true
|
DrawPrimOnMapTile = true
|
||||||
; Use terrain texture for maptiles if true, use shaded green if false
|
; Use terrain texture for maptiles if true, use shaded green if false
|
||||||
|
@ -129,11 +129,11 @@
|
||||||
; if you would like to allow prims to be physical and move by physics with the physical checkbox in the client set this to true.
|
; if you would like to allow prims to be physical and move by physics with the physical checkbox in the client set this to true.
|
||||||
physical_prim = true
|
physical_prim = true
|
||||||
|
|
||||||
; Select a mesher here. ZeroMesher is save and fast.
|
; Select a mesher here. ZeroMesher is safe and fast.
|
||||||
; ZeroMesher also means that the physics engine models the physics of prims
|
; ZeroMesher also means that the physics engine models the physics of prims
|
||||||
; sticking to the basic shapes the engine does support. Usually this is only a box.
|
; sticking to the basic shapes the engine does support. Usually this is only a box.
|
||||||
; Meshmerizer gives a better handling of complex prims by using triangle meshes.
|
; Meshmerizer gives a better handling of complex prims by using triangle meshes.
|
||||||
; Note, that only ODE physics currently deals with meshed prims in a satisfactoring way
|
; Note that only ODE physics currently deals with meshed prims in a satisfactory way
|
||||||
;
|
;
|
||||||
meshing = ZeroMesher
|
meshing = ZeroMesher
|
||||||
;meshing = Meshmerizer
|
;meshing = Meshmerizer
|
||||||
|
@ -429,9 +429,8 @@
|
||||||
; surface layer around geometries other geometries can sink into before generating a contact
|
; surface layer around geometries other geometries can sink into before generating a contact
|
||||||
world_contact_surface_layer = 0.001
|
world_contact_surface_layer = 0.001
|
||||||
|
|
||||||
; Filtering Collisions helps keep things stable physics wise, but sometimes
|
; Filtering collisions helps keep things stable physics wise, but sometimes
|
||||||
; it can be over zealous. If you notice bouncing, chances are it's being just
|
; it can be overzealous. If you notice bouncing, chances are it's that.
|
||||||
; that
|
|
||||||
filter_collisions = false
|
filter_collisions = false
|
||||||
|
|
||||||
; Non Moving Terrain Contact (avatar isn't moving)
|
; Non Moving Terrain Contact (avatar isn't moving)
|
||||||
|
@ -1371,7 +1370,6 @@
|
||||||
; to customize your data
|
; to customize your data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; The below pulls in optional module config files
|
;; The below pulls in optional module config files
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
Loading…
Reference in New Issue