mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
cosmetics ( i hope)
This commit is contained in:
@@ -80,18 +80,6 @@ namespace OpenSim.Framework
|
||||
rwLock.EnterWriteLock();
|
||||
gotLock = true;
|
||||
}
|
||||
/*
|
||||
if (Dictionary1.ContainsKey(key1))
|
||||
{
|
||||
if (!Dictionary2.ContainsKey(key2))
|
||||
throw new ArgumentException("key1 exists in the dictionary but not key2");
|
||||
}
|
||||
else if (Dictionary2.ContainsKey(key2))
|
||||
{
|
||||
if (!Dictionary1.ContainsKey(key1))
|
||||
throw new ArgumentException("key2 exists in the dictionary but not key1");
|
||||
}
|
||||
*/
|
||||
Dictionary1[key1] = value;
|
||||
Dictionary2[key2] = value;
|
||||
m_array = null;
|
||||
|
||||
@@ -241,8 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat.Tests
|
||||
sceneSouth.Update(4);
|
||||
sp1.DrawDistance += 64;
|
||||
sp2.DrawDistance += 64;
|
||||
sceneNorth.Update(2);
|
||||
sceneSouth.Update(2);
|
||||
sceneNorth.Update(4);
|
||||
sceneSouth.Update(4);
|
||||
|
||||
// Check child positions are correct.
|
||||
Assert.AreEqual(
|
||||
|
||||
@@ -290,8 +290,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
else
|
||||
connector = new UserAgentServiceConnector(userAgentDriver);
|
||||
|
||||
GridRegion source = new GridRegion(Scene.RegionInfo);
|
||||
source.RawServerURI = m_GatekeeperURI;
|
||||
GridRegion source = new GridRegion(Scene.RegionInfo)
|
||||
{
|
||||
RawServerURI = m_GatekeeperURI
|
||||
};
|
||||
|
||||
bool success = connector.LoginAgentToGrid(source, agentCircuit, reg, finalDestination, false, out reason);
|
||||
logout = success; // flag for later logout from this grid; this is an HG TP
|
||||
@@ -578,8 +580,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
string homeURI = Scene.GetAgentHomeURI(remoteClient.AgentId);
|
||||
|
||||
string message;
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message);
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out string message);
|
||||
|
||||
if (finalDestination != null)
|
||||
{
|
||||
@@ -793,19 +794,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
private GridRegion MakeGateKeeperRegion(string wantedURI)
|
||||
{
|
||||
Uri uri;
|
||||
if(!Uri.TryCreate(wantedURI, UriKind.Absolute, out uri))
|
||||
if(!Uri.TryCreate(wantedURI, UriKind.Absolute, out Uri uri))
|
||||
return null;
|
||||
|
||||
GridRegion region = new GridRegion();
|
||||
|
||||
region.ExternalHostName = uri.Host;
|
||||
region.HttpPort = (uint)uri.Port;
|
||||
region.ServerURI = wantedURI; //uri.AbsoluteUri for some reason default ports are needed
|
||||
region.RegionName = string.Empty;
|
||||
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
|
||||
region.RegionFlags = OpenSim.Framework.RegionFlags.Hyperlink;
|
||||
return region;
|
||||
return new GridRegion()
|
||||
{
|
||||
ExternalHostName = uri.Host,
|
||||
HttpPort = (uint)uri.Port,
|
||||
ServerURI = wantedURI, //uri.AbsoluteUri for some reason default ports are needed
|
||||
RegionName = string.Empty,
|
||||
InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0),
|
||||
RegionFlags = OpenSim.Framework.RegionFlags.Hyperlink
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// debugging we may want to simply report the failure if we can tell this is due to a failure
|
||||
// with a particular asset and not a destination network failure where all asset posts will fail (and
|
||||
// generate large amounts of log spam).
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
StringBuilder sb = null;
|
||||
|
||||
@@ -95,9 +95,9 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private object m_httpListLock = new object();
|
||||
private readonly object m_httpListLock = new object();
|
||||
private int m_httpTimeout = 30000;
|
||||
private string m_name = "HttpScriptRequests";
|
||||
private readonly string m_name = "HttpScriptRequests";
|
||||
|
||||
private OutboundUrlFilter m_outboundUrlFilter;
|
||||
private string m_proxyurl = "";
|
||||
@@ -135,11 +135,10 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
|
||||
public bool CheckThrottle(uint localID, UUID ownerID)
|
||||
{
|
||||
ThrottleData th;
|
||||
double now = Util.GetTimeStamp();
|
||||
bool ret;
|
||||
|
||||
if (m_RequestsThrottle.TryGetValue(localID, out th))
|
||||
if (m_RequestsThrottle.TryGetValue(localID, out ThrottleData th))
|
||||
{
|
||||
double delta = now - th.lastTime;
|
||||
th.lastTime = now;
|
||||
@@ -353,8 +352,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
|
||||
public IServiceRequest GetNextCompletedRequest()
|
||||
{
|
||||
HttpRequestClass req;
|
||||
if(m_CompletedRequests.TryDequeue(out req))
|
||||
if(m_CompletedRequests.TryDequeue(out HttpRequestClass req))
|
||||
return req;
|
||||
|
||||
return null;
|
||||
@@ -364,8 +362,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
{
|
||||
lock (m_httpListLock)
|
||||
{
|
||||
HttpRequestClass tmpReq;
|
||||
if (m_pendingRequests.TryGetValue(reqId, out tmpReq))
|
||||
if (m_pendingRequests.TryGetValue(reqId, out HttpRequestClass tmpReq))
|
||||
{
|
||||
tmpReq.Stop();
|
||||
m_pendingRequests.Remove(reqId);
|
||||
@@ -410,13 +407,15 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
// First instance sets this up for all sims
|
||||
if (ThreadPool == null)
|
||||
{
|
||||
STPStartInfo startInfo = new STPStartInfo();
|
||||
startInfo.IdleTimeout = 2000;
|
||||
startInfo.MaxWorkerThreads = maxThreads;
|
||||
startInfo.MinWorkerThreads = 0;
|
||||
startInfo.ThreadPriority = ThreadPriority.BelowNormal;
|
||||
startInfo.StartSuspended = true;
|
||||
startInfo.ThreadPoolName = "ScriptsHttpReq";
|
||||
STPStartInfo startInfo = new STPStartInfo()
|
||||
{
|
||||
IdleTimeout = 2000,
|
||||
MaxWorkerThreads = maxThreads,
|
||||
MinWorkerThreads = 0,
|
||||
ThreadPriority = ThreadPriority.Normal,
|
||||
StartSuspended = true,
|
||||
ThreadPoolName = "ScriptsHttpReq"
|
||||
};
|
||||
|
||||
ThreadPool = new SmartThreadPool(startInfo);
|
||||
ThreadPool.Start();
|
||||
@@ -540,7 +539,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
// We may want to ignore SSL
|
||||
if (sender is HttpWebRequest)
|
||||
{
|
||||
HttpWebRequest Request = (HttpWebRequest)sender;
|
||||
HttpWebRequest Request = sender as HttpWebRequest;
|
||||
ServicePoint sp = Request.ServicePoint;
|
||||
|
||||
// We don't case about encryption, get out of here
|
||||
|
||||
@@ -194,10 +194,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_scenes.ContainsKey(destination.RegionID))
|
||||
if (m_scenes.TryGetValue(destination.RegionID, out Scene destScene))
|
||||
{
|
||||
// m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
|
||||
return m_scenes[destination.RegionID].NewUserConnection(aCircuit, teleportFlags, source, out reason);
|
||||
return destScene.NewUserConnection(aCircuit, teleportFlags, source, out reason);
|
||||
}
|
||||
|
||||
reason = "Did not find region " + destination.RegionName;
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
private AssetBase m_asset;
|
||||
|
||||
public delegate void TerrainUploadComplete(string name, byte[] filedata, IClientAPI remoteClient);
|
||||
|
||||
public event TerrainUploadComplete TerrainUploadDone;
|
||||
|
||||
//private string m_description = String.Empty;
|
||||
@@ -48,15 +47,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
private sbyte type = 0;
|
||||
|
||||
public ulong mXferID;
|
||||
private TerrainUploadComplete handlerTerrainUploadDone;
|
||||
|
||||
public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
|
||||
{
|
||||
m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId.ToString());
|
||||
m_asset.Data = new byte[0];
|
||||
m_asset.Description = "empty";
|
||||
m_asset.Local = true;
|
||||
m_asset.Temporary = true;
|
||||
m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId.ToString())
|
||||
{
|
||||
Data = new byte[0],
|
||||
Description = "empty",
|
||||
Local = true,
|
||||
Temporary = true
|
||||
};
|
||||
}
|
||||
|
||||
public ulong XferID
|
||||
@@ -108,11 +108,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public void SendCompleteMessage(IClientAPI remoteClient)
|
||||
{
|
||||
handlerTerrainUploadDone = TerrainUploadDone;
|
||||
if (handlerTerrainUploadDone != null)
|
||||
{
|
||||
handlerTerrainUploadDone(m_asset.Name, m_asset.Data, remoteClient);
|
||||
}
|
||||
TerrainUploadDone?.Invoke(m_asset.Name, m_asset.Data, remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1756,7 +1756,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
foreach (SceneObjectGroup obj in primsOverMe)
|
||||
{
|
||||
if(m_scene.Permissions.CanSellObject(previousOwner,obj, (byte)SaleType.Original))
|
||||
m_BuySellModule.BuyObject(sp.ControllingClient, UUID.Zero, obj.LocalId, 1, 0);
|
||||
m_BuySellModule.BuyObject(sp.ControllingClient, UUID.Zero, obj.LocalId, (byte)SaleType.Original, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Triggered by <see cref="TriggerAtTargetEvent"/>
|
||||
/// in <see cref="SceneObjectGroup.checkAtTargets"/>
|
||||
/// in <see cref="SceneObjectGroup.CheckAtTargets"/>
|
||||
/// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
|
||||
/// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
|
||||
/// </remarks>
|
||||
@@ -591,7 +591,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Triggered by <see cref="TriggerNotAtTargetEvent"/>
|
||||
/// in <see cref="SceneObjectGroup.checkAtTargets"/>
|
||||
/// in <see cref="SceneObjectGroup.CheckAtTargets"/>
|
||||
/// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
|
||||
/// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
|
||||
/// </remarks>
|
||||
@@ -605,7 +605,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Triggered by <see cref="TriggerAtRotTargetEvent"/>
|
||||
/// in <see cref="SceneObjectGroup.checkAtTargets"/>
|
||||
/// in <see cref="SceneObjectGroup.CheckAtTargets"/>
|
||||
/// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
|
||||
/// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
|
||||
/// </remarks>
|
||||
@@ -619,7 +619,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Triggered by <see cref="TriggerNotAtRotTargetEvent"/>
|
||||
/// in <see cref="SceneObjectGroup.checkAtTargets"/>
|
||||
/// in <see cref="SceneObjectGroup.CheckAtTargets"/>
|
||||
/// via <see cref="SceneObjectGroup.ScheduleGroupForFullUpdate"/>,
|
||||
/// <see cref="Scene.CheckAtTargets"/> via <see cref="Scene.Update"/>
|
||||
/// </remarks>
|
||||
@@ -3344,11 +3344,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void TriggerThrottleUpdate(ScenePresence scenePresence)
|
||||
{
|
||||
ThrottleUpdate handler = OnThrottleUpdate;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(scenePresence);
|
||||
}
|
||||
OnThrottleUpdate?.Invoke(scenePresence);
|
||||
}
|
||||
|
||||
// public void TriggerGatherUuids(SceneObjectPart sop, IDictionary<UUID, AssetType> assetUuids)
|
||||
|
||||
@@ -220,9 +220,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void SetBypassPermissions(bool value)
|
||||
{
|
||||
SetBypassPermissionsHandler handler = OnSetBypassPermissions;
|
||||
if (handler != null)
|
||||
handler(value);
|
||||
OnSetBypassPermissions?.Invoke(value);
|
||||
}
|
||||
|
||||
public bool BypassPermissions()
|
||||
|
||||
@@ -115,12 +115,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_physicsEnabled = value;
|
||||
|
||||
if (PhysicsScene != null)
|
||||
if (PhysicsScene != null && PhysicsScene is IPhysicsParameters)
|
||||
{
|
||||
IPhysicsParameters physScene = PhysicsScene as IPhysicsParameters;
|
||||
|
||||
if (physScene != null)
|
||||
physScene.SetPhysicsParameter(
|
||||
((IPhysicsParameters)PhysicsScene).SetPhysicsParameter(
|
||||
"Active", m_physicsEnabled.ToString(), PhysParameterEntry.APPLY_TO_NONE);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +155,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup sog = (SceneObjectGroup)ent;
|
||||
SceneObjectGroup sog = ent as SceneObjectGroup;
|
||||
sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0);
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
@@ -848,8 +845,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_lastIncoming = 0;
|
||||
m_lastOutgoing = 0;
|
||||
|
||||
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
|
||||
m_asyncSceneObjectDeleter.Enabled = true;
|
||||
m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this)
|
||||
{
|
||||
Enabled = true
|
||||
};
|
||||
|
||||
m_asyncInventorySender = new AsyncInventorySender(this);
|
||||
|
||||
@@ -1048,13 +1047,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
string tile
|
||||
= Util.GetConfigVarFromSections<string>(
|
||||
string tile = Util.GetConfigVarFromSections<string>(
|
||||
config, "MaptileStaticUUID", possibleMapConfigSections, UUID.Zero.ToString());
|
||||
|
||||
UUID tileID;
|
||||
|
||||
if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out tileID))
|
||||
if (tile != UUID.Zero.ToString() && UUID.TryParse(tile, out UUID tileID))
|
||||
{
|
||||
RegionInfo.RegionSettings.TerrainImageID = tileID;
|
||||
}
|
||||
@@ -1300,8 +1296,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||
{
|
||||
List<ulong> old = new List<ulong>();
|
||||
old.Add(otherRegion.RegionHandle);
|
||||
List<ulong> old = new List<ulong>() {otherRegion.RegionHandle};
|
||||
agent.DropOldNeighbours(old);
|
||||
if (EntityTransferModule != null && agent.PresenceType != PresenceType.Npc)
|
||||
EntityTransferModule.EnableChildAgent(agent, otherRegion);
|
||||
@@ -1670,9 +1665,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
WorkManager.RunInThreadPool(
|
||||
delegate
|
||||
{
|
||||
List<Vector3> coarseLocations;
|
||||
List<UUID> avatarUUIDs;
|
||||
SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60);
|
||||
SceneGraph.GetCoarseLocations(out List<Vector3> coarseLocations, out List<UUID> avatarUUIDs, 60);
|
||||
// Send coarse locations to clients
|
||||
ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
@@ -1941,7 +1934,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (grp == null)
|
||||
m_groupsWithTargets.Remove(entry);
|
||||
else
|
||||
grp.checkAtTargets();
|
||||
grp.CheckAtTargets();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2030,21 +2023,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
|
||||
{
|
||||
GridInstantMessage msg = new GridInstantMessage();
|
||||
msg.fromAgentID = Guid.Empty; // From server
|
||||
msg.toAgentID = ret.Key.Guid;
|
||||
msg.imSessionID = Guid.NewGuid();
|
||||
msg.timestamp = unixtime;
|
||||
msg.fromAgentName = "Server";
|
||||
msg.dialog = 19; // Object msg
|
||||
msg.fromGroup = false;
|
||||
msg.offline = 1;
|
||||
msg.ParentEstateID = estateid;
|
||||
msg.Position = Vector3.Zero;
|
||||
msg.RegionID = regionguid;
|
||||
GridInstantMessage msg = new GridInstantMessage()
|
||||
{
|
||||
fromAgentID = Guid.Empty, // From server
|
||||
toAgentID = ret.Key.Guid,
|
||||
imSessionID = Guid.NewGuid(),
|
||||
timestamp = unixtime,
|
||||
fromAgentName = "Server",
|
||||
dialog = 19, // Object msg
|
||||
fromGroup = false,
|
||||
offline = 1,
|
||||
ParentEstateID = estateid,
|
||||
Position = Vector3.Zero,
|
||||
RegionID = regionguid,
|
||||
// We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
|
||||
binaryBucket = new Byte[1] {0}
|
||||
};
|
||||
|
||||
// We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
|
||||
msg.binaryBucket = new Byte[1] {0};
|
||||
if (ret.Value.count > 1)
|
||||
msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason);
|
||||
else
|
||||
@@ -2096,11 +2091,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
ReturnInfo info = new ReturnInfo();
|
||||
info.count = 1;
|
||||
info.objectName = objectName;
|
||||
info.location = location;
|
||||
info.reason = reason;
|
||||
ReturnInfo info = new ReturnInfo()
|
||||
{
|
||||
count = 1,
|
||||
objectName = objectName,
|
||||
location = location,
|
||||
reason = reason
|
||||
};
|
||||
m_returns[agentID] = info;
|
||||
}
|
||||
}
|
||||
@@ -2526,8 +2523,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
IClientAPI client = null;
|
||||
if (TryGetClient(ownerID, out client))
|
||||
if (TryGetClient(ownerID, out IClientAPI client))
|
||||
client.SendAlertMessage("You cannot create objects here.");
|
||||
}
|
||||
}
|
||||
@@ -2720,16 +2716,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (e is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup sog = (SceneObjectGroup)e;
|
||||
SceneObjectGroup sog = e as SceneObjectGroup;
|
||||
if (sog != null && !sog.IsAttachment)
|
||||
{
|
||||
if (!exceptNoCopy || ((sog.EffectiveOwnerPerms & (uint)PermissionMask.Copy) != 0))
|
||||
{
|
||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||
DeleteSceneObject(sog, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
toReturn.Add((SceneObjectGroup)e);
|
||||
toReturn.Add(sog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3247,8 +3243,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (aCircuit == null)
|
||||
return false;
|
||||
|
||||
bool vialogin = false;
|
||||
if (VerifyClient(aCircuit, ep, out vialogin))
|
||||
if (VerifyClient(aCircuit, ep, out bool vialogin))
|
||||
return true;
|
||||
|
||||
// if it doesn't pass, we remove the agentcircuitdata altogether
|
||||
@@ -5416,7 +5411,7 @@ Label_GroupsDone:
|
||||
{
|
||||
if (obj is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup grp = (SceneObjectGroup)obj;
|
||||
SceneObjectGroup grp = obj as SceneObjectGroup;
|
||||
|
||||
if (!grp.IsDeleted)
|
||||
{
|
||||
@@ -5689,10 +5684,11 @@ Environment.Exit(1);
|
||||
v0.Normalize();
|
||||
v1.Normalize();
|
||||
|
||||
Vector3 vsn = new Vector3();
|
||||
vsn.X = (v0.Y * v1.Z) - (v0.Z * v1.Y);
|
||||
vsn.Y = (v0.Z * v1.X) - (v0.X * v1.Z);
|
||||
vsn.Z = (v0.X * v1.Y) - (v0.Y * v1.X);
|
||||
Vector3 vsn = new Vector3(
|
||||
(v0.Y * v1.Z) - (v0.Z * v1.Y),
|
||||
(v0.Z * v1.X) - (v0.X * v1.Z),
|
||||
(v0.X * v1.Y) - (v0.Y * v1.X)
|
||||
);
|
||||
vsn.Normalize();
|
||||
|
||||
float xdiff = x - (float)((int)x);
|
||||
@@ -5937,11 +5933,10 @@ Environment.Exit(1);
|
||||
|
||||
foreach (SceneObjectGroup g in objects)
|
||||
{
|
||||
float ominX, ominY, ominZ, omaxX, omaxY, omaxZ;
|
||||
|
||||
Vector3 vec = g.AbsolutePosition;
|
||||
|
||||
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
|
||||
g.GetAxisAlignedBoundingBoxRaw(out float ominX, out float omaxX, out float ominY,
|
||||
out float omaxY, out float ominZ, out float omaxZ);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
|
||||
@@ -6127,10 +6122,12 @@ Environment.Exit(1);
|
||||
// Fake AgentCircuitData to keep IAuthorizationModule smiling
|
||||
if (aCircuit == null)
|
||||
{
|
||||
aCircuit = new AgentCircuitData();
|
||||
aCircuit.AgentID = agentID;
|
||||
aCircuit.firstname = String.Empty;
|
||||
aCircuit.lastname = String.Empty;
|
||||
aCircuit = new AgentCircuitData()
|
||||
{
|
||||
AgentID = agentID,
|
||||
firstname = String.Empty,
|
||||
lastname = String.Empty
|
||||
};
|
||||
}
|
||||
|
||||
try
|
||||
@@ -6280,11 +6277,9 @@ Environment.Exit(1);
|
||||
CheckHeartbeat();
|
||||
|
||||
IEtcdModule etcd = RequestModuleInterface<IEtcdModule>();
|
||||
int flags;
|
||||
string message;
|
||||
if (etcd != null)
|
||||
{
|
||||
int health = GetHealth(out flags, out message);
|
||||
int health = GetHealth(out int flags, out string message);
|
||||
if (health != m_lastHealth)
|
||||
{
|
||||
m_lastHealth = health;
|
||||
@@ -6350,15 +6345,10 @@ Environment.Exit(1);
|
||||
|
||||
public string GetExtraSetting(string name)
|
||||
{
|
||||
if (m_extraSettings == null)
|
||||
return String.Empty;
|
||||
if (m_extraSettings != null && m_extraSettings.TryGetValue(name, out string val))
|
||||
return val;
|
||||
|
||||
string val;
|
||||
|
||||
if (!m_extraSettings.TryGetValue(name, out val))
|
||||
return String.Empty;
|
||||
|
||||
return val;
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void StoreExtraSetting(string name, string val)
|
||||
@@ -6366,9 +6356,7 @@ Environment.Exit(1);
|
||||
if (m_extraSettings == null)
|
||||
return;
|
||||
|
||||
string oldVal;
|
||||
|
||||
if (m_extraSettings.TryGetValue(name, out oldVal))
|
||||
if (m_extraSettings.TryGetValue(name, out string oldVal))
|
||||
{
|
||||
if (oldVal == val)
|
||||
return;
|
||||
|
||||
@@ -96,8 +96,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// These operations rely on the parts composition of the object. If allowed to run concurrently then race
|
||||
/// conditions can occur.
|
||||
/// </remarks>
|
||||
private Object m_updateLock = new Object();
|
||||
private Object m_linkLock = new Object();
|
||||
private readonly Object m_updateLock = new Object();
|
||||
private readonly Object m_linkLock = new Object();
|
||||
private System.Threading.ReaderWriterLockSlim m_scenePresencesLock;
|
||||
private System.Threading.ReaderWriterLockSlim m_scenePartsLock;
|
||||
|
||||
@@ -526,8 +526,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// "[SCENE GRAPH]: Deleting scene object with uuid {0}, resultOfObjectLinked = {1}",
|
||||
// uuid, resultOfObjectLinked);
|
||||
|
||||
EntityBase entity;
|
||||
if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
|
||||
if (!Entities.TryGetValue(uuid, out EntityBase entity) || (!(entity is SceneObjectGroup)))
|
||||
return false;
|
||||
|
||||
SceneObjectGroup grp = (SceneObjectGroup)entity;
|
||||
@@ -608,26 +607,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void FireAttachToBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnAttachToBackup != null)
|
||||
{
|
||||
OnAttachToBackup(obj);
|
||||
}
|
||||
OnAttachToBackup?.Invoke(obj);
|
||||
}
|
||||
|
||||
public void FireDetachFromBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnDetachFromBackup != null)
|
||||
{
|
||||
OnDetachFromBackup(obj);
|
||||
}
|
||||
OnDetachFromBackup?.Invoke(obj);
|
||||
}
|
||||
|
||||
public void FireChangeBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnChangeBackup != null)
|
||||
{
|
||||
OnChangeBackup(obj);
|
||||
}
|
||||
OnChangeBackup?.Invoke(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -728,8 +718,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
++m_numChildAgents;
|
||||
|
||||
uint localid = presence.LocalId;
|
||||
ScenePresence oldref;
|
||||
if (m_scenePresenceMap.TryGetValue(id, out oldref))
|
||||
if (m_scenePresenceMap.TryGetValue(id, out ScenePresence oldref))
|
||||
{
|
||||
uint oldLocalID = oldref.LocalId;
|
||||
if (localid != oldLocalID)
|
||||
@@ -769,8 +758,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
entered = true;
|
||||
}
|
||||
// Remove the presence reference from the dictionary
|
||||
ScenePresence oldref;
|
||||
if(m_scenePresenceMap.TryGetValue(agentID, out oldref))
|
||||
if(m_scenePresenceMap.TryGetValue(agentID, out ScenePresence oldref))
|
||||
{
|
||||
m_scenePresenceMap.Remove(agentID);
|
||||
// Find the index in the list where the old ref was stored and remove the reference
|
||||
@@ -903,8 +891,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresencesLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
ScenePresence presence;
|
||||
if (m_scenePresenceMap.TryGetValue(agentId, out presence))
|
||||
if (m_scenePresenceMap.TryGetValue(agentId, out ScenePresence presence))
|
||||
return presence.ControllingClient;
|
||||
return null;
|
||||
}
|
||||
@@ -970,8 +957,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresencesLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
ScenePresence presence;
|
||||
m_scenePresenceMap.TryGetValue(agentID, out presence);
|
||||
m_scenePresenceMap.TryGetValue(agentID, out ScenePresence presence);
|
||||
return presence;
|
||||
}
|
||||
catch
|
||||
@@ -1019,8 +1005,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresencesLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
ScenePresence sp;
|
||||
if (m_scenePresenceLocalIDMap.TryGetValue(localID, out sp))
|
||||
if (m_scenePresenceLocalIDMap.TryGetValue(localID, out ScenePresence sp))
|
||||
return sp;
|
||||
}
|
||||
finally
|
||||
@@ -1087,8 +1072,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePartsLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
SceneObjectPart sop;
|
||||
if(m_scenePartsByLocalID.TryGetValue(localID, out sop))
|
||||
if(m_scenePartsByLocalID.TryGetValue(localID, out SceneObjectPart sop))
|
||||
return sop.ParentGroup;
|
||||
return null;
|
||||
}
|
||||
@@ -1115,8 +1099,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePartsLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
SceneObjectPart sop;
|
||||
if (m_scenePartsByID.TryGetValue(fullID, out sop))
|
||||
if (m_scenePartsByID.TryGetValue(fullID, out SceneObjectPart sop))
|
||||
return sop.ParentGroup;
|
||||
return null;
|
||||
}
|
||||
@@ -1137,7 +1120,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup reportingG = (SceneObjectGroup)ent;
|
||||
SceneObjectGroup reportingG = ent as SceneObjectGroup;
|
||||
EntityIntersection inter = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters);
|
||||
if (inter.HitTF && inter.distance < closestDistance)
|
||||
{
|
||||
@@ -1163,7 +1146,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
for (int i = 0; i < entities.Length; ++i)
|
||||
{
|
||||
if(entities[i] is SceneObjectGroup)
|
||||
ret.Add((SceneObjectGroup)entities[i]);
|
||||
ret.Add(entities[i] as SceneObjectGroup);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1175,9 +1158,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>null if no such group was found</returns>
|
||||
protected internal SceneObjectGroup GetSceneObjectGroup(UUID fullID)
|
||||
{
|
||||
EntityBase entity;
|
||||
if (Entities.TryGetValue(fullID, out entity) && (entity is SceneObjectGroup))
|
||||
return (SceneObjectGroup)entity;
|
||||
if (Entities.TryGetValue(fullID, out EntityBase entity) && (entity is SceneObjectGroup))
|
||||
return entity as SceneObjectGroup;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1187,9 +1169,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>null if no such group was found</returns>
|
||||
protected internal SceneObjectGroup GetSceneObjectGroup(uint localID)
|
||||
{
|
||||
EntityBase entity;
|
||||
if (Entities.TryGetValue(localID, out entity) && (entity is SceneObjectGroup))
|
||||
return (SceneObjectGroup)entity;
|
||||
if (Entities.TryGetValue(localID, out EntityBase entity) && (entity is SceneObjectGroup))
|
||||
return entity as SceneObjectGroup;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1228,8 +1209,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePartsLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
SceneObjectPart sop;
|
||||
if (m_scenePartsByLocalID.TryGetValue(localID, out sop))
|
||||
if (m_scenePartsByLocalID.TryGetValue(localID, out SceneObjectPart sop))
|
||||
{
|
||||
if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
|
||||
return null;
|
||||
@@ -1259,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePartsLock.EnterReadLock();
|
||||
entered = true;
|
||||
}
|
||||
SceneObjectPart sop;
|
||||
if (m_scenePartsByID.TryGetValue(fullID, out sop))
|
||||
if (m_scenePartsByID.TryGetValue(fullID, out SceneObjectPart sop))
|
||||
{
|
||||
if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
|
||||
return null;
|
||||
@@ -1336,11 +1315,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
protected internal void physicsBasedCrash()
|
||||
{
|
||||
handlerPhysicsCrash = UnRecoverableError;
|
||||
if (handlerPhysicsCrash != null)
|
||||
{
|
||||
handlerPhysicsCrash();
|
||||
}
|
||||
UnRecoverableError?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1846,27 +1821,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
|
||||
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
|
||||
shapeData.PathBegin = shapeBlock.PathBegin;
|
||||
shapeData.PathCurve = shapeBlock.PathCurve;
|
||||
shapeData.PathEnd = shapeBlock.PathEnd;
|
||||
shapeData.PathRadiusOffset = shapeBlock.PathRadiusOffset;
|
||||
shapeData.PathRevolutions = shapeBlock.PathRevolutions;
|
||||
shapeData.PathScaleX = shapeBlock.PathScaleX;
|
||||
shapeData.PathScaleY = shapeBlock.PathScaleY;
|
||||
shapeData.PathShearX = shapeBlock.PathShearX;
|
||||
shapeData.PathShearY = shapeBlock.PathShearY;
|
||||
shapeData.PathSkew = shapeBlock.PathSkew;
|
||||
shapeData.PathTaperX = shapeBlock.PathTaperX;
|
||||
shapeData.PathTaperY = shapeBlock.PathTaperY;
|
||||
shapeData.PathTwist = shapeBlock.PathTwist;
|
||||
shapeData.PathTwistBegin = shapeBlock.PathTwistBegin;
|
||||
shapeData.ProfileBegin = shapeBlock.ProfileBegin;
|
||||
shapeData.ProfileCurve = shapeBlock.ProfileCurve;
|
||||
shapeData.ProfileEnd = shapeBlock.ProfileEnd;
|
||||
shapeData.ProfileHollow = shapeBlock.ProfileHollow;
|
||||
|
||||
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock()
|
||||
{
|
||||
ObjectLocalID = shapeBlock.ObjectLocalID,
|
||||
PathBegin = shapeBlock.PathBegin,
|
||||
PathCurve = shapeBlock.PathCurve,
|
||||
PathEnd = shapeBlock.PathEnd,
|
||||
PathRadiusOffset = shapeBlock.PathRadiusOffset,
|
||||
PathRevolutions = shapeBlock.PathRevolutions,
|
||||
PathScaleX = shapeBlock.PathScaleX,
|
||||
PathScaleY = shapeBlock.PathScaleY,
|
||||
PathShearX = shapeBlock.PathShearX,
|
||||
PathShearY = shapeBlock.PathShearY,
|
||||
PathSkew = shapeBlock.PathSkew,
|
||||
PathTaperX = shapeBlock.PathTaperX,
|
||||
PathTaperY = shapeBlock.PathTaperY,
|
||||
PathTwist = shapeBlock.PathTwist,
|
||||
PathTwistBegin = shapeBlock.PathTwistBegin,
|
||||
ProfileBegin = shapeBlock.ProfileBegin,
|
||||
ProfileCurve = shapeBlock.ProfileCurve,
|
||||
ProfileEnd = shapeBlock.ProfileEnd,
|
||||
ProfileHollow = shapeBlock.ProfileHollow
|
||||
};
|
||||
group.UpdateShape(shapeData, primLocalID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,8 +663,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// We remove the object here
|
||||
try
|
||||
{
|
||||
List<uint> localIDs = new List<uint>();
|
||||
localIDs.Add(root.LocalId);
|
||||
List<uint> localIDs = new List<uint>(){root.LocalId};
|
||||
sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition,
|
||||
"Returned at region cross");
|
||||
sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero, false);
|
||||
@@ -1092,14 +1091,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return -1;
|
||||
}
|
||||
|
||||
TeleportObjectData tdata = new TeleportObjectData();
|
||||
tdata.flags = flags;
|
||||
tdata.vel = vel;
|
||||
tdata.avel = avel;
|
||||
tdata.acc = acc;
|
||||
tdata.ori = ori;
|
||||
tdata.sourceID = sourceID;
|
||||
|
||||
TeleportObjectData tdata = new TeleportObjectData()
|
||||
{
|
||||
flags = flags,
|
||||
vel = vel,
|
||||
avel = avel,
|
||||
acc = acc,
|
||||
ori = ori,
|
||||
sourceID = sourceID
|
||||
};
|
||||
|
||||
SOGCrossDelegate d = CrossAsync;
|
||||
d.BeginInvoke(this, targetPosition, tdata, CrossAsyncCompleted, d);
|
||||
@@ -1365,7 +1365,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
private bool disposed = false;
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -1379,6 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!disposed)
|
||||
{
|
||||
IsDeleted = true;
|
||||
disposed = true;
|
||||
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
for(int i= 0; i < parts.Length; ++i)
|
||||
@@ -1386,19 +1386,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
m_parts.Clear();
|
||||
m_sittingAvatars.Clear();
|
||||
// m_rootPart = null;
|
||||
// m_rootPart = null;
|
||||
|
||||
m_targets.Clear();
|
||||
m_rotTargets.Clear();
|
||||
m_targetsByScript.Clear();
|
||||
m_partsNameToLinkMap.Clear();
|
||||
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void LoadScriptState(XmlDocument doc)
|
||||
{
|
||||
XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState");
|
||||
@@ -1709,14 +1705,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight)
|
||||
{
|
||||
float minX;
|
||||
float maxX;
|
||||
float minY;
|
||||
float maxY;
|
||||
float minZ;
|
||||
float maxZ;
|
||||
|
||||
GetAxisAlignedBoundingBoxRaw(out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
|
||||
GetAxisAlignedBoundingBoxRaw(out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ);
|
||||
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
|
||||
|
||||
offsetHeight = 0;
|
||||
@@ -3089,9 +3078,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>null if a part with the primID was not found</returns>
|
||||
public SceneObjectPart GetPart(UUID primID)
|
||||
{
|
||||
SceneObjectPart childPart;
|
||||
m_parts.TryGetValue(primID, out childPart);
|
||||
return childPart;
|
||||
if(m_parts.TryGetValue(primID, out SceneObjectPart childPart))
|
||||
return childPart;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3102,7 +3091,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public SceneObjectPart GetPart(uint localID)
|
||||
{
|
||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(localID);
|
||||
if(sop.ParentGroup.Equals(this))
|
||||
if(sop.ParentGroup.LocalId == LocalId)
|
||||
return sop;
|
||||
return null;
|
||||
}
|
||||
@@ -3794,9 +3783,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// compute difference between previous old rotation and new incoming rotation
|
||||
Quaternion minimalRotationFromQ1ToQ2 = newOrientation * Quaternion.Inverse(old);
|
||||
|
||||
float rotationAngle;
|
||||
Vector3 spinforce;
|
||||
minimalRotationFromQ1ToQ2.GetAxisAngle(out spinforce, out rotationAngle);
|
||||
minimalRotationFromQ1ToQ2.GetAxisAngle(out Vector3 spinforce, out float rotationAngle);
|
||||
if(Math.Abs(rotationAngle)< 0.001)
|
||||
return;
|
||||
|
||||
@@ -4044,8 +4031,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
HasGroupChanged = true;
|
||||
|
||||
// Send the group's properties to all clients once all parts are updated
|
||||
IClientAPI client;
|
||||
if (Scene.TryGetClient(AgentID, out client))
|
||||
if (Scene.TryGetClient(AgentID, out IClientAPI client))
|
||||
SendPropertiesToClient(client);
|
||||
}
|
||||
|
||||
@@ -4833,12 +4819,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public int registerRotTargetWaypoint(UUID scriptID, Quaternion target, float tolerance)
|
||||
{
|
||||
scriptRotTarget waypoint = new scriptRotTarget();
|
||||
waypoint.targetRot = target;
|
||||
waypoint.tolerance = tolerance;
|
||||
waypoint.scriptID = scriptID;
|
||||
int handle = m_scene.AllocateIntId();
|
||||
waypoint.handle = handle;
|
||||
scriptRotTarget waypoint = new scriptRotTarget()
|
||||
{
|
||||
targetRot = target,
|
||||
tolerance = tolerance,
|
||||
scriptID = scriptID,
|
||||
handle = handle
|
||||
};
|
||||
|
||||
lock (m_targets)
|
||||
{
|
||||
@@ -4883,12 +4871,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public int registerTargetWaypoint(UUID scriptID, Vector3 target, float tolerance)
|
||||
{
|
||||
scriptPosTarget waypoint = new scriptPosTarget();
|
||||
waypoint.targetPos = target;
|
||||
waypoint.tolerance = tolerance * tolerance;
|
||||
waypoint.scriptID = scriptID;
|
||||
int handle = m_scene.AllocateIntId();
|
||||
waypoint.handle = handle;
|
||||
scriptPosTarget waypoint = new scriptPosTarget()
|
||||
{
|
||||
targetPos = target,
|
||||
tolerance = tolerance * tolerance,
|
||||
scriptID = scriptID,
|
||||
handle = handle
|
||||
};
|
||||
|
||||
lock (m_targets)
|
||||
{
|
||||
@@ -4952,7 +4942,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void checkAtTargets()
|
||||
public void CheckAtTargets()
|
||||
{
|
||||
int targetsCount = m_targets.Count;
|
||||
if (targetsCount > 0 && (m_scriptListens_atTarget || m_scriptListens_notAtTarget))
|
||||
@@ -5139,20 +5129,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void SetInertiaData(float TotalMass, Vector3 CenterOfMass, Vector3 Inertia, Vector4 aux )
|
||||
{
|
||||
PhysicsInertiaData inertia = new PhysicsInertiaData();
|
||||
inertia.TotalMass = TotalMass;
|
||||
inertia.CenterOfMass = CenterOfMass;
|
||||
inertia.Inertia = Inertia;
|
||||
inertia.InertiaRotation = aux;
|
||||
PhysicsInertiaData inertiaData = new PhysicsInertiaData()
|
||||
{
|
||||
TotalMass = TotalMass,
|
||||
CenterOfMass = CenterOfMass,
|
||||
Inertia = Inertia,
|
||||
InertiaRotation = aux
|
||||
};
|
||||
|
||||
if(TotalMass < 0)
|
||||
RootPart.PhysicsInertia = null;
|
||||
else
|
||||
RootPart.PhysicsInertia = new PhysicsInertiaData(inertia);
|
||||
RootPart.PhysicsInertia = inertiaData;
|
||||
|
||||
PhysicsActor pa = RootPart.PhysActor;
|
||||
if(pa !=null)
|
||||
pa.SetInertiaData(inertia);
|
||||
pa.SetInertiaData(inertiaData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private string m_text = String.Empty;
|
||||
private string m_touchName = String.Empty;
|
||||
private UndoRedoState m_UndoRedo = null;
|
||||
private object m_UndoLock = new object();
|
||||
private readonly object m_UndoLock = new object();
|
||||
|
||||
private bool m_passTouches = false;
|
||||
private bool m_passCollisions = false;
|
||||
@@ -1178,7 +1178,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
private object UpdateFlagLock = new object();
|
||||
private readonly object UpdateFlagLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Used for media on a prim.
|
||||
@@ -2494,7 +2494,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public uint AggregatedInnerOwnerPerms {get; private set; }
|
||||
public uint AggregatedInnerGroupPerms {get; private set; }
|
||||
public uint AggregatedInnerEveryonePerms {get; private set; }
|
||||
private object InnerPermsLock = new object();
|
||||
private readonly object InnerPermsLock = new object();
|
||||
|
||||
public void AggregateInnerPerms()
|
||||
{
|
||||
@@ -2676,59 +2676,55 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private DetectedObject CreateDetObject(SceneObjectPart obj)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = obj.UUID;
|
||||
detobj.nameStr = obj.Name;
|
||||
detobj.ownerUUID = obj.OwnerID;
|
||||
detobj.posVector = obj.AbsolutePosition;
|
||||
detobj.rotQuat = obj.GetWorldRotation();
|
||||
detobj.velVector = obj.Velocity;
|
||||
detobj.colliderType = 0;
|
||||
detobj.groupUUID = obj.GroupID;
|
||||
// allow detector link number to be seen, unlike spec
|
||||
//if (VolumeDetectActive)
|
||||
// detobj.linkNumber = 0;
|
||||
//else
|
||||
detobj.linkNumber = LinkNum;
|
||||
return detobj;
|
||||
return new DetectedObject()
|
||||
{
|
||||
keyUUID = obj.UUID,
|
||||
nameStr = obj.Name,
|
||||
ownerUUID = obj.OwnerID,
|
||||
posVector = obj.AbsolutePosition,
|
||||
rotQuat = obj.GetWorldRotation(),
|
||||
velVector = obj.Velocity,
|
||||
colliderType = 0,
|
||||
groupUUID = obj.GroupID,
|
||||
linkNumber = LinkNum
|
||||
};
|
||||
}
|
||||
|
||||
private DetectedObject CreateDetObject(ScenePresence av)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = av.UUID;
|
||||
detobj.nameStr = av.ControllingClient.Name;
|
||||
detobj.ownerUUID = av.UUID;
|
||||
detobj.posVector = av.AbsolutePosition;
|
||||
detobj.rotQuat = av.Rotation;
|
||||
detobj.velVector = av.Velocity;
|
||||
detobj.colliderType = av.IsNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
|
||||
DetectedObject detobj = new DetectedObject()
|
||||
{
|
||||
keyUUID = av.UUID,
|
||||
nameStr = av.ControllingClient.Name,
|
||||
ownerUUID = av.UUID,
|
||||
posVector = av.AbsolutePosition,
|
||||
rotQuat = av.Rotation,
|
||||
velVector = av.Velocity,
|
||||
colliderType = av.IsNPC ? 0x20 : 0x1, // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
|
||||
groupUUID = av.ControllingClient.ActiveGroupId,
|
||||
linkNumber = LinkNum
|
||||
};
|
||||
if(av.IsSatOnObject)
|
||||
detobj.colliderType |= 0x4; //passive
|
||||
else if(detobj.velVector != Vector3.Zero)
|
||||
detobj.colliderType |= 0x2; //active
|
||||
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
|
||||
//if (VolumeDetectActive)
|
||||
// detobj.linkNumber = 0;
|
||||
//else
|
||||
detobj.linkNumber = LinkNum;
|
||||
|
||||
return detobj;
|
||||
}
|
||||
|
||||
private DetectedObject CreateDetObjectForGround()
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = UUID.Zero;
|
||||
detobj.nameStr = "";
|
||||
detobj.ownerUUID = UUID.Zero;
|
||||
detobj.posVector = ParentGroup.RootPart.AbsolutePosition;
|
||||
detobj.rotQuat = Quaternion.Identity;
|
||||
detobj.velVector = Vector3.Zero;
|
||||
detobj.colliderType = 0;
|
||||
detobj.groupUUID = UUID.Zero;
|
||||
detobj.linkNumber = LinkNum;
|
||||
return detobj;
|
||||
return new DetectedObject()
|
||||
{
|
||||
keyUUID = UUID.Zero,
|
||||
nameStr = "",
|
||||
ownerUUID = UUID.Zero,
|
||||
posVector = ParentGroup.RootPart.AbsolutePosition,
|
||||
rotQuat = Quaternion.Identity,
|
||||
velVector = Vector3.Zero,
|
||||
colliderType = 0,
|
||||
groupUUID = UUID.Zero,
|
||||
linkNumber = LinkNum
|
||||
};
|
||||
}
|
||||
|
||||
private ColliderArgs CreateColliderArgs(SceneObjectPart dest, List<uint> colliders)
|
||||
@@ -2801,9 +2797,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
bool sendToRoot = true;
|
||||
|
||||
ColliderArgs LandCollidingMessage = new ColliderArgs();
|
||||
List<DetectedObject> colliding = new List<DetectedObject>();
|
||||
List<DetectedObject> colliding = new List<DetectedObject>(){CreateDetObjectForGround()};
|
||||
|
||||
colliding.Add(CreateDetObjectForGround());
|
||||
LandCollidingMessage.Colliders = colliding;
|
||||
|
||||
if (Inventory.ContainsScripts())
|
||||
@@ -2873,10 +2868,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
curcontact = collissionswith[id];
|
||||
if (Math.Abs(curcontact.RelativeSpeed) > 0.2)
|
||||
{
|
||||
soundinfo = new CollisionForSoundInfo();
|
||||
soundinfo.colliderID = id;
|
||||
soundinfo.position = curcontact.Position;
|
||||
soundinfo.relativeVel = curcontact.RelativeSpeed;
|
||||
soundinfo = new CollisionForSoundInfo()
|
||||
{
|
||||
colliderID = id,
|
||||
position = curcontact.Position,
|
||||
relativeVel = curcontact.RelativeSpeed
|
||||
};
|
||||
soundinfolist.Add(soundinfo);
|
||||
}
|
||||
}
|
||||
@@ -2891,10 +2888,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
curcontact = collissionswith[id];
|
||||
if (Math.Abs(curcontact.RelativeSpeed) > 0.2)
|
||||
{
|
||||
soundinfo = new CollisionForSoundInfo();
|
||||
soundinfo.colliderID = id;
|
||||
soundinfo.position = curcontact.Position;
|
||||
soundinfo.relativeVel = curcontact.RelativeSpeed;
|
||||
soundinfo = new CollisionForSoundInfo()
|
||||
{
|
||||
colliderID = id,
|
||||
position = curcontact.Position,
|
||||
relativeVel = curcontact.RelativeSpeed
|
||||
};
|
||||
soundinfolist.Add(soundinfo);
|
||||
}
|
||||
}
|
||||
@@ -4353,9 +4352,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1;
|
||||
}
|
||||
|
||||
EntityIntersection result = new EntityIntersection();
|
||||
EntityIntersection result = new EntityIntersection()
|
||||
{
|
||||
distance = 1024
|
||||
};
|
||||
|
||||
result.distance = 1024;
|
||||
float c = 0;
|
||||
float a = 0;
|
||||
float d = 0;
|
||||
@@ -5485,9 +5486,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Quaternion dR = currRot / APIDTarget;
|
||||
|
||||
// find axis and angle of rotation to rotate to desired orientation
|
||||
Vector3 axis = Vector3.UnitX;
|
||||
float angle;
|
||||
dR.GetAxisAngle(out axis, out angle);
|
||||
dR.GetAxisAngle(out Vector3 axis, out float angle);
|
||||
axis = axis * currRot;
|
||||
|
||||
// clamp strength to avoid overshoot
|
||||
@@ -5669,7 +5668,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
private object animsLock = new object();
|
||||
private readonly object animsLock = new object();
|
||||
public Dictionary<UUID, int> Animations = null;
|
||||
public Dictionary<UUID, string> AnimationsNames = null;
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// TODO: The child -> agent transition should be folded into LifecycleState and the CompleteMovement
|
||||
/// regulation done there.
|
||||
/// </remarks>
|
||||
private object m_completeMovementLock = new object();
|
||||
private readonly object m_completeMovementLock = new object();
|
||||
|
||||
// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
|
||||
private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags));
|
||||
@@ -197,7 +197,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private UUID m_currentParcelUUID = UUID.Zero;
|
||||
private bool m_previusParcelHide = false;
|
||||
private bool m_currentParcelHide = false;
|
||||
private object parcelLock = new Object();
|
||||
private readonly object parcelLock = new Object();
|
||||
public double ParcelDwellTickMS;
|
||||
|
||||
public UUID currentParcelUUID
|
||||
@@ -374,7 +374,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private float m_lastRegionsDrawDistance;
|
||||
private Vector3 m_lastChildAgentUpdatePosition;
|
||||
private Vector3 m_lastChildAgentCheckPosition;
|
||||
// private Vector3 m_lastChildAgentUpdateCamPosition;
|
||||
// private Vector3 m_lastChildAgentUpdateCamPosition;
|
||||
|
||||
private Vector3 m_lastCameraRayCastCam;
|
||||
private Vector3 m_lastCameraRayCastPos;
|
||||
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private bool CameraConstraintActive;
|
||||
|
||||
private object m_collisionEventLock = new Object();
|
||||
private readonly object m_collisionEventLock = new Object();
|
||||
|
||||
private int m_movementAnimationUpdateCounter = 0;
|
||||
|
||||
@@ -510,7 +510,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// the very latest value and not using some cached version. Cannot make m_originRegionID itself volatite as
|
||||
/// it is a value type.
|
||||
/// </summary>
|
||||
private object m_originRegionIDAccessLock = new object();
|
||||
private readonly object m_originRegionIDAccessLock = new object();
|
||||
|
||||
|
||||
private AutoResetEvent m_updateAgentReceivedAfterTransferEvent = new AutoResetEvent(false);
|
||||
@@ -535,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SL = 2
|
||||
}
|
||||
|
||||
private LandingPointBehavior m_LandingPointBehavior = LandingPointBehavior.OS;
|
||||
private readonly LandingPointBehavior m_LandingPointBehavior = LandingPointBehavior.OS;
|
||||
|
||||
#region Properties
|
||||
|
||||
@@ -1017,8 +1017,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.Info("================ KnownRegions "+Scene.RegionInfo.RegionName+" ================");
|
||||
foreach (KeyValuePair<ulong, string> kvp in KnownRegions)
|
||||
{
|
||||
uint x, y;
|
||||
Util.RegionHandleToRegionLoc(kvp.Key, out x, out y);
|
||||
Util.RegionHandleToRegionLoc(kvp.Key, out uint x, out uint y);
|
||||
m_log.Info(" >> "+x+", "+y+": "+kvp.Value);
|
||||
}
|
||||
}
|
||||
@@ -1831,8 +1830,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
newvel.Y = 0;
|
||||
}
|
||||
|
||||
string reason;
|
||||
if (!m_scene.TestLandRestrictions(UUID, out reason, ref newpos.X, ref newpos.Y))
|
||||
if (!m_scene.TestLandRestrictions(UUID, out string reason, ref newpos.X, ref newpos.Y))
|
||||
return ;
|
||||
|
||||
if (IsSatOnObject)
|
||||
@@ -2004,6 +2002,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
public int sizeX;
|
||||
public int sizeY;
|
||||
|
||||
public spRegionSizeInfo(int x, int y)
|
||||
{
|
||||
sizeX = x;
|
||||
sizeY = y;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<ulong, spRegionSizeInfo> m_knownChildRegionsSizeInfo = new Dictionary<ulong, spRegionSizeInfo>();
|
||||
@@ -2013,12 +2017,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
lock (m_knownChildRegions)
|
||||
{
|
||||
ulong regionHandle = region.RegionHandle;
|
||||
m_knownChildRegions.Add(regionHandle,capsPath);
|
||||
|
||||
spRegionSizeInfo sizeInfo = new spRegionSizeInfo();
|
||||
sizeInfo.sizeX = region.RegionSizeX;
|
||||
sizeInfo.sizeY = region.RegionSizeY;
|
||||
m_knownChildRegionsSizeInfo[regionHandle] = sizeInfo;
|
||||
m_knownChildRegions[regionHandle] = capsPath;
|
||||
m_knownChildRegionsSizeInfo[regionHandle] = new spRegionSizeInfo(region.RegionSizeX, region.RegionSizeY); ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2026,18 +2026,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
lock (m_knownChildRegions)
|
||||
{
|
||||
spRegionSizeInfo sizeInfo = new spRegionSizeInfo();
|
||||
sizeInfo.sizeX = region.RegionSizeX;
|
||||
sizeInfo.sizeY = region.RegionSizeY;
|
||||
ulong regionHandle = region.RegionHandle;
|
||||
|
||||
if (!m_knownChildRegionsSizeInfo.ContainsKey(regionHandle))
|
||||
{
|
||||
m_knownChildRegionsSizeInfo.Add(regionHandle, sizeInfo);
|
||||
|
||||
}
|
||||
else
|
||||
m_knownChildRegionsSizeInfo[regionHandle] = sizeInfo;
|
||||
m_knownChildRegionsSizeInfo[region.RegionHandle] = new spRegionSizeInfo(region.RegionSizeX, region.RegionSizeY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2046,14 +2035,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
lock (m_knownChildRegions)
|
||||
{
|
||||
m_knownChildRegionsSizeInfo.Clear();
|
||||
|
||||
foreach (GridRegion region in regionsList)
|
||||
{
|
||||
spRegionSizeInfo sizeInfo = new spRegionSizeInfo();
|
||||
sizeInfo.sizeX = region.RegionSizeX;
|
||||
sizeInfo.sizeY = region.RegionSizeY;
|
||||
ulong regionHandle = region.RegionHandle;
|
||||
m_knownChildRegionsSizeInfo.Add(regionHandle, sizeInfo);
|
||||
m_knownChildRegionsSizeInfo[region.RegionHandle] = new spRegionSizeInfo(region.RegionSizeX, region.RegionSizeY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2234,7 +2218,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Make sure it's not a login agent. We don't want to wait for updates during login
|
||||
if (!IsNPC && !IsRealLogin(m_teleportFlags))
|
||||
{
|
||||
|
||||
// Let's wait until UpdateAgent (called by departing region) is done
|
||||
if (!WaitForUpdateAgent(client))
|
||||
// The sending region never sent the UpdateAgent data, we have to refuse
|
||||
@@ -4641,17 +4624,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_lastChildAgentUpdateDrawDistance = DrawDistance;
|
||||
// m_lastChildAgentUpdateCamPosition = CameraPosition;
|
||||
|
||||
AgentPosition agentpos = new AgentPosition();
|
||||
agentpos.AgentID = new UUID(UUID.Guid);
|
||||
agentpos.SessionID = ControllingClient.SessionId;
|
||||
agentpos.Size = Appearance.AvatarSize;
|
||||
agentpos.Center = CameraPosition;
|
||||
agentpos.Far = DrawDistance;
|
||||
agentpos.Position = AbsolutePosition;
|
||||
agentpos.Velocity = Velocity;
|
||||
agentpos.RegionHandle = RegionHandle;
|
||||
agentpos.GodData = GodController.State();
|
||||
agentpos.Throttles = ControllingClient.GetThrottlesPacked(1);
|
||||
AgentPosition agentpos = new AgentPosition()
|
||||
{
|
||||
AgentID = new UUID(UUID.Guid),
|
||||
SessionID = ControllingClient.SessionId,
|
||||
Size = Appearance.AvatarSize,
|
||||
Center = CameraPosition,
|
||||
Far = DrawDistance,
|
||||
Position = AbsolutePosition,
|
||||
Velocity = Velocity,
|
||||
RegionHandle = RegionHandle,
|
||||
GodData = GodController.State(),
|
||||
Throttles = ControllingClient.GetThrottlesPacked(1)
|
||||
};
|
||||
|
||||
// Let's get this out of the update loop
|
||||
Util.FireAndForget(
|
||||
@@ -4798,15 +4783,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if(newRegionHandle == curRegionHandle) //??
|
||||
return byebyeRegions;
|
||||
|
||||
uint newRegionX, newRegionY;
|
||||
List<ulong> knownRegions = KnownRegionHandles;
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}",
|
||||
knownRegions.Count, Scene.RegionInfo.RegionName);
|
||||
|
||||
Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY);
|
||||
uint x, y;
|
||||
spRegionSizeInfo regInfo;
|
||||
Util.RegionHandleToRegionLoc(newRegionHandle, out uint newRegionX, out uint newRegionY);
|
||||
|
||||
foreach (ulong handle in knownRegions)
|
||||
{
|
||||
@@ -4826,8 +4808,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.RegionHandleToRegionLoc(handle, out x, out y);
|
||||
if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo))
|
||||
Util.RegionHandleToRegionLoc(handle, out uint x, out uint y);
|
||||
if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out spRegionSizeInfo regInfo))
|
||||
{
|
||||
// if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
|
||||
// for now need to close all but first order bc RegionViewDistance it the target value not ours
|
||||
@@ -5159,11 +5141,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
foreach (ControllerData c in cAgent.Controllers)
|
||||
{
|
||||
ScriptControllers sc = new ScriptControllers();
|
||||
sc.objectID = c.ObjectID;
|
||||
sc.itemID = c.ItemID;
|
||||
sc.ignoreControls = (ScriptControlled)c.IgnoreControls;
|
||||
sc.eventControls = (ScriptControlled)c.EventControls;
|
||||
ScriptControllers sc = new ScriptControllers()
|
||||
{
|
||||
objectID = c.ObjectID,
|
||||
itemID = c.ItemID,
|
||||
ignoreControls = (ScriptControlled)c.IgnoreControls,
|
||||
eventControls = (ScriptControlled)c.EventControls
|
||||
};
|
||||
|
||||
scriptedcontrols[sc.itemID] = sc;
|
||||
IgnoredControls |= sc.ignoreControls; // this is not correct, aparently only last applied should count
|
||||
@@ -5938,12 +5922,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ControllingClient.SendTakeControls(controls, false, false);
|
||||
ControllingClient.SendTakeControls(controls, true, false);
|
||||
|
||||
ScriptControllers obj = new ScriptControllers();
|
||||
obj.ignoreControls = ScriptControlled.CONTROL_ZERO;
|
||||
obj.eventControls = ScriptControlled.CONTROL_ZERO;
|
||||
ScriptControllers obj = new ScriptControllers()
|
||||
{
|
||||
ignoreControls = ScriptControlled.CONTROL_ZERO,
|
||||
eventControls = ScriptControlled.CONTROL_ZERO,
|
||||
objectID = part.ParentGroup.UUID,
|
||||
itemID = Script_item_UUID
|
||||
};
|
||||
|
||||
obj.objectID = part.ParentGroup.UUID;
|
||||
obj.itemID = Script_item_UUID;
|
||||
if (pass_on == 0 && accept == 0)
|
||||
{
|
||||
IgnoredControls |= (ScriptControlled)controls;
|
||||
@@ -6072,12 +6058,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void UnRegisterControlEventsToScript(uint Obj_localID, UUID Script_item_UUID)
|
||||
{
|
||||
ScriptControllers takecontrols;
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(Obj_localID);
|
||||
|
||||
lock (scriptedcontrols)
|
||||
{
|
||||
if (scriptedcontrols.TryGetValue(Script_item_UUID, out takecontrols))
|
||||
if (scriptedcontrols.TryGetValue(Script_item_UUID, out ScriptControllers takecontrols))
|
||||
{
|
||||
ScriptControlled sctc = takecontrols.eventControls;
|
||||
|
||||
@@ -6455,10 +6440,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// This is the behavior in OpenSim for a very long time, different from SL
|
||||
private bool CheckAndAdjustLandingPoint_OS(ref Vector3 pos, ref Vector3 lookat, ref bool positionChanged)
|
||||
{
|
||||
string reason;
|
||||
|
||||
// Honor bans
|
||||
if (!m_scene.TestLandRestrictions(UUID, out reason, ref pos.X, ref pos.Y))
|
||||
if (!m_scene.TestLandRestrictions(UUID, out string reason, ref pos.X, ref pos.Y))
|
||||
return false;
|
||||
|
||||
SceneObjectGroup telehub = null;
|
||||
@@ -6510,8 +6493,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// This is a behavior coming from AVN, somewhat mimicking SL
|
||||
private bool CheckAndAdjustLandingPoint_SL(ref Vector3 pos, ref Vector3 lookat, ref bool positionChanged)
|
||||
{
|
||||
string reason;
|
||||
|
||||
// dont mess with gods
|
||||
if(IsGod)
|
||||
return true;
|
||||
@@ -6531,7 +6512,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
// Honor bans, actually we don't honour them
|
||||
if (!m_scene.TestLandRestrictions(UUID, out reason, ref pos.X, ref pos.Y))
|
||||
if (!m_scene.TestLandRestrictions(UUID, out string reason, ref pos.X, ref pos.Y))
|
||||
return false;
|
||||
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
@@ -6564,52 +6545,56 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private DetectedObject CreateDetObject(SceneObjectPart obj)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = obj.UUID;
|
||||
detobj.nameStr = obj.Name;
|
||||
detobj.ownerUUID = obj.OwnerID;
|
||||
detobj.posVector = obj.AbsolutePosition;
|
||||
detobj.rotQuat = obj.GetWorldRotation();
|
||||
detobj.velVector = obj.Velocity;
|
||||
detobj.colliderType = 0;
|
||||
detobj.groupUUID = obj.GroupID;
|
||||
detobj.linkNumber = 0;
|
||||
|
||||
return detobj;
|
||||
return new DetectedObject()
|
||||
{
|
||||
keyUUID = obj.UUID,
|
||||
nameStr = obj.Name,
|
||||
ownerUUID = obj.OwnerID,
|
||||
posVector = obj.AbsolutePosition,
|
||||
rotQuat = obj.GetWorldRotation(),
|
||||
velVector = obj.Velocity,
|
||||
colliderType = 0,
|
||||
groupUUID = obj.GroupID,
|
||||
linkNumber = 0
|
||||
};
|
||||
}
|
||||
|
||||
private DetectedObject CreateDetObject(ScenePresence av)
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = av.UUID;
|
||||
detobj.nameStr = av.ControllingClient.Name;
|
||||
detobj.ownerUUID = av.UUID;
|
||||
detobj.posVector = av.AbsolutePosition;
|
||||
detobj.rotQuat = av.Rotation;
|
||||
detobj.velVector = av.Velocity;
|
||||
detobj.colliderType = av.IsNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
|
||||
if(av.IsSatOnObject)
|
||||
detobj.colliderType |= 0x4; //passive
|
||||
else if(detobj.velVector != Vector3.Zero)
|
||||
detobj.colliderType |= 0x2; //active
|
||||
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
|
||||
detobj.linkNumber = 0;
|
||||
DetectedObject detobj = new DetectedObject()
|
||||
{
|
||||
keyUUID = av.UUID,
|
||||
nameStr = av.ControllingClient.Name,
|
||||
ownerUUID = av.UUID,
|
||||
posVector = av.AbsolutePosition,
|
||||
rotQuat = av.Rotation,
|
||||
velVector = av.Velocity,
|
||||
colliderType = av.IsNPC ? 0x20 : 0x1, // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
|
||||
groupUUID = av.ControllingClient.ActiveGroupId,
|
||||
linkNumber = 0
|
||||
};
|
||||
|
||||
if (av.IsSatOnObject)
|
||||
detobj.colliderType |= 0x4; //passive
|
||||
else if (detobj.velVector != Vector3.Zero)
|
||||
detobj.colliderType |= 0x2; //active
|
||||
return detobj;
|
||||
}
|
||||
|
||||
private DetectedObject CreateDetObjectForGround()
|
||||
{
|
||||
DetectedObject detobj = new DetectedObject();
|
||||
detobj.keyUUID = UUID.Zero;
|
||||
detobj.nameStr = "";
|
||||
detobj.ownerUUID = UUID.Zero;
|
||||
detobj.posVector = AbsolutePosition;
|
||||
detobj.rotQuat = Quaternion.Identity;
|
||||
detobj.velVector = Vector3.Zero;
|
||||
detobj.colliderType = 0;
|
||||
detobj.groupUUID = UUID.Zero;
|
||||
detobj.linkNumber = 0;
|
||||
DetectedObject detobj = new DetectedObject()
|
||||
{
|
||||
keyUUID = UUID.Zero,
|
||||
nameStr = "",
|
||||
ownerUUID = UUID.Zero,
|
||||
posVector = AbsolutePosition,
|
||||
rotQuat = Quaternion.Identity,
|
||||
velVector = Vector3.Zero,
|
||||
colliderType = 0,
|
||||
groupUUID = UUID.Zero,
|
||||
linkNumber = 0
|
||||
};
|
||||
return detobj;
|
||||
}
|
||||
|
||||
@@ -6667,9 +6652,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if ((dest.RootPart.ScriptEvents & ev) != 0)
|
||||
{
|
||||
ColliderArgs LandCollidingMessage = new ColliderArgs();
|
||||
List<DetectedObject> colliding = new List<DetectedObject>();
|
||||
|
||||
colliding.Add(CreateDetObjectForGround());
|
||||
List<DetectedObject> colliding = new List<DetectedObject>(){CreateDetObjectForGround()};
|
||||
LandCollidingMessage.Colliders = colliding;
|
||||
|
||||
notify(dest.RootPart.LocalId, LandCollidingMessage);
|
||||
@@ -6711,10 +6694,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
curcontact = coldata[id];
|
||||
if (Math.Abs(curcontact.RelativeSpeed) > 0.2)
|
||||
{
|
||||
soundinfo = new CollisionForSoundInfo();
|
||||
soundinfo.colliderID = id;
|
||||
soundinfo.position = curcontact.Position;
|
||||
soundinfo.relativeVel = curcontact.RelativeSpeed;
|
||||
soundinfo = new CollisionForSoundInfo()
|
||||
{
|
||||
colliderID = id,
|
||||
position = curcontact.Position,
|
||||
relativeVel = curcontact.RelativeSpeed
|
||||
};
|
||||
soundinfolist.Add(soundinfo);
|
||||
}
|
||||
}
|
||||
@@ -7088,7 +7073,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private int m_bandwidthBurst = 20000;
|
||||
private int m_bytesControl;
|
||||
private double m_lastBandwithTime;
|
||||
private object m_throttleLock = new object();
|
||||
private readonly object m_throttleLock = new object();
|
||||
|
||||
public bool CapCanSendAsset(int type, int size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user