Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/IClientAPI.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.csavinationmerge
commit
f8603a215d
|
@ -199,7 +199,14 @@ namespace OpenSim.Framework
|
||||||
//
|
//
|
||||||
public class Cache
|
public class Cache
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Must only be accessed under lock.
|
||||||
|
/// </summary>
|
||||||
private List<CacheItemBase> m_Index = new List<CacheItemBase>();
|
private List<CacheItemBase> m_Index = new List<CacheItemBase>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Must only be accessed under m_Index lock.
|
||||||
|
/// </summary>
|
||||||
private Dictionary<string, CacheItemBase> m_Lookup =
|
private Dictionary<string, CacheItemBase> m_Lookup =
|
||||||
new Dictionary<string, CacheItemBase>();
|
new Dictionary<string, CacheItemBase>();
|
||||||
|
|
||||||
|
@ -320,7 +327,6 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
if (m_Lookup.ContainsKey(index))
|
if (m_Lookup.ContainsKey(index))
|
||||||
item = m_Lookup[index];
|
item = m_Lookup[index];
|
||||||
}
|
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
{
|
{
|
||||||
|
@ -332,6 +338,7 @@ namespace OpenSim.Framework
|
||||||
item.lastUsed = DateTime.Now;
|
item.lastUsed = DateTime.Now;
|
||||||
|
|
||||||
Expire(true);
|
Expire(true);
|
||||||
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
@ -385,7 +392,10 @@ namespace OpenSim.Framework
|
||||||
//
|
//
|
||||||
public Object Find(Predicate<CacheItemBase> d)
|
public Object Find(Predicate<CacheItemBase> d)
|
||||||
{
|
{
|
||||||
CacheItemBase item = m_Index.Find(d);
|
CacheItemBase item;
|
||||||
|
|
||||||
|
lock (m_Index)
|
||||||
|
item = m_Index.Find(d);
|
||||||
|
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -419,12 +429,12 @@ namespace OpenSim.Framework
|
||||||
public virtual void Store(string index, Object data, Type container,
|
public virtual void Store(string index, Object data, Type container,
|
||||||
Object[] parameters)
|
Object[] parameters)
|
||||||
{
|
{
|
||||||
Expire(false);
|
|
||||||
|
|
||||||
CacheItemBase item;
|
CacheItemBase item;
|
||||||
|
|
||||||
lock (m_Index)
|
lock (m_Index)
|
||||||
{
|
{
|
||||||
|
Expire(false);
|
||||||
|
|
||||||
if (m_Index.Contains(new CacheItemBase(index)))
|
if (m_Index.Contains(new CacheItemBase(index)))
|
||||||
{
|
{
|
||||||
if ((m_Flags & CacheFlags.AllowUpdate) != 0)
|
if ((m_Flags & CacheFlags.AllowUpdate) != 0)
|
||||||
|
@ -450,9 +460,17 @@ namespace OpenSim.Framework
|
||||||
m_Index.Add(item);
|
m_Index.Add(item);
|
||||||
m_Lookup[index] = item;
|
m_Lookup[index] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.Store(data);
|
item.Store(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Expire items as appropriate.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Callers must lock m_Index.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name='getting'></param>
|
||||||
protected virtual void Expire(bool getting)
|
protected virtual void Expire(bool getting)
|
||||||
{
|
{
|
||||||
if (getting && (m_Strategy == CacheStrategy.Aggressive))
|
if (getting && (m_Strategy == CacheStrategy.Aggressive))
|
||||||
|
@ -479,8 +497,6 @@ namespace OpenSim.Framework
|
||||||
if (Count < Size)
|
if (Count < Size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lock (m_Index)
|
|
||||||
{
|
|
||||||
m_Index.Sort(new SortLRU());
|
m_Index.Sort(new SortLRU());
|
||||||
m_Index.Reverse();
|
m_Index.Reverse();
|
||||||
|
|
||||||
|
@ -513,14 +529,17 @@ namespace OpenSim.Framework
|
||||||
foreach (CacheItemBase item in m_Index)
|
foreach (CacheItemBase item in m_Index)
|
||||||
m_Lookup[item.uuid] = item;
|
m_Lookup[item.uuid] = item;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Invalidate(string uuid)
|
public void Invalidate(string uuid)
|
||||||
|
{
|
||||||
|
lock (m_Index)
|
||||||
{
|
{
|
||||||
if (!m_Lookup.ContainsKey(uuid))
|
if (!m_Lookup.ContainsKey(uuid))
|
||||||
return;
|
return;
|
||||||
|
@ -529,11 +548,15 @@ namespace OpenSim.Framework
|
||||||
m_Lookup.Remove(uuid);
|
m_Lookup.Remove(uuid);
|
||||||
m_Index.Remove(item);
|
m_Index.Remove(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
|
{
|
||||||
|
lock (m_Index)
|
||||||
{
|
{
|
||||||
m_Index.Clear();
|
m_Index.Clear();
|
||||||
m_Lookup.Clear();
|
m_Lookup.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1046,8 +1046,21 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
void InPacket(object NewPack);
|
void InPacket(object NewPack);
|
||||||
void ProcessInPacket(Packet NewPack);
|
void ProcessInPacket(Packet NewPack);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Close this client
|
||||||
|
/// </summary>
|
||||||
void Close();
|
void Close();
|
||||||
void Close(bool sendStop);
|
|
||||||
|
/// <summary>
|
||||||
|
/// Close this client
|
||||||
|
/// </summary>
|
||||||
|
/// <param name='force'>
|
||||||
|
/// If true, attempts the close without checking active status. You do not want to try this except as a last
|
||||||
|
/// ditch attempt where Active == false but the ScenePresence still exists.
|
||||||
|
/// </param>
|
||||||
|
void Close(bool sendStop, bool force);
|
||||||
|
|
||||||
void Kick(string message);
|
void Kick(string message);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -35,6 +35,7 @@ using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using NDesk.Options;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -310,8 +311,11 @@ namespace OpenSim
|
||||||
"Change the scale of a named prim", HandleEditScale);
|
"Change the scale of a named prim", HandleEditScale);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Users", false, "kick user",
|
m_console.Commands.AddCommand("Users", false, "kick user",
|
||||||
"kick user <first> <last> [message]",
|
"kick user <first> <last> [--force] [message]",
|
||||||
"Kick a user off the simulator", KickUserCommand);
|
"Kick a user off the simulator",
|
||||||
|
"The --force option will kick the user without any checks to see whether it's already in the process of closing\n"
|
||||||
|
+ "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them",
|
||||||
|
KickUserCommand);
|
||||||
|
|
||||||
m_console.Commands.AddCommand("Users", false, "show users",
|
m_console.Commands.AddCommand("Users", false, "show users",
|
||||||
"show users [full]",
|
"show users [full]",
|
||||||
|
@ -416,6 +420,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
RunCommandScript(m_shutdownCommandsFile);
|
RunCommandScript(m_shutdownCommandsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
base.ShutdownSpecific();
|
base.ShutdownSpecific();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,11 +458,17 @@ namespace OpenSim
|
||||||
/// <param name="cmdparams">name of avatar to kick</param>
|
/// <param name="cmdparams">name of avatar to kick</param>
|
||||||
private void KickUserCommand(string module, string[] cmdparams)
|
private void KickUserCommand(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
if (cmdparams.Length < 4)
|
bool force = false;
|
||||||
|
|
||||||
|
OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; });
|
||||||
|
|
||||||
|
List<string> mainParams = options.Parse(cmdparams);
|
||||||
|
|
||||||
|
if (mainParams.Count < 4)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string alert = null;
|
string alert = null;
|
||||||
if (cmdparams.Length > 4)
|
if (mainParams.Count > 4)
|
||||||
alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4));
|
alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4));
|
||||||
|
|
||||||
IList agents = SceneManager.GetCurrentSceneAvatars();
|
IList agents = SceneManager.GetCurrentSceneAvatars();
|
||||||
|
@ -466,8 +477,8 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
RegionInfo regionInfo = presence.Scene.RegionInfo;
|
RegionInfo regionInfo = presence.Scene.RegionInfo;
|
||||||
|
|
||||||
if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) &&
|
if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) &&
|
||||||
presence.Lastname.ToLower().Contains(cmdparams[3].ToLower()))
|
presence.Lastname.ToLower().Contains(mainParams[3].ToLower()))
|
||||||
{
|
{
|
||||||
MainConsole.Instance.Output(
|
MainConsole.Instance.Output(
|
||||||
String.Format(
|
String.Format(
|
||||||
|
@ -480,7 +491,7 @@ namespace OpenSim
|
||||||
else
|
else
|
||||||
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
|
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
|
||||||
|
|
||||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
presence.Scene.IncomingCloseAgent(presence.UUID, force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
|
||||||
UUID spId = TestHelpers.ParseTail(0x1);
|
UUID spId = TestHelpers.ParseTail(0x1);
|
||||||
|
|
||||||
SceneHelpers.AddScenePresence(m_scene, spId);
|
SceneHelpers.AddScenePresence(m_scene, spId);
|
||||||
m_scene.IncomingCloseAgent(spId);
|
m_scene.IncomingCloseAgent(spId, false);
|
||||||
|
|
||||||
// TODO: Add more assertions for the other aspects of event queues
|
// TODO: Add more assertions for the other aspects of event queues
|
||||||
Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0));
|
Assert.That(MainServer.Instance.GetPollServiceHandlerKeys().Count, Is.EqualTo(0));
|
||||||
|
|
|
@ -509,19 +509,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
Close(true);
|
Close(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void Close(bool sendStop, bool force)
|
||||||
/// Shut down the client view
|
|
||||||
/// </summary>
|
|
||||||
public void Close(bool sendStop)
|
|
||||||
{
|
{
|
||||||
// We lock here to prevent race conditions between two threads calling close simultaneously (e.g.
|
// We lock here to prevent race conditions between two threads calling close simultaneously (e.g.
|
||||||
// a simultaneous relog just as a client is being closed out due to no packet ack from the old connection.
|
// a simultaneous relog just as a client is being closed out due to no packet ack from the old connection.
|
||||||
lock (CloseSyncLock)
|
lock (CloseSyncLock)
|
||||||
{
|
{
|
||||||
if (!IsActive)
|
// We still perform a force close inside the sync lock since this is intended to attempt close where
|
||||||
|
// there is some unidentified connection problem, not where we have issues due to deadlock
|
||||||
|
if (!IsActive && !force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
|
@ -12140,7 +12139,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
{
|
{
|
||||||
Kick(reason);
|
Kick(reason);
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
Close();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disconnect()
|
public void Disconnect()
|
||||||
|
|
|
@ -1515,7 +1515,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (!client.IsLoggingOut)
|
if (!client.IsLoggingOut)
|
||||||
{
|
{
|
||||||
client.IsLoggingOut = true;
|
client.IsLoggingOut = true;
|
||||||
client.Close(false);
|
client.Close(false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,7 +461,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||||
|
|
||||||
SceneObjectGroup rezzedAtt = presence.GetAttachments()[0];
|
SceneObjectGroup rezzedAtt = presence.GetAttachments()[0];
|
||||||
|
|
||||||
scene.IncomingCloseAgent(presence.UUID);
|
scene.IncomingCloseAgent(presence.UUID, false);
|
||||||
|
|
||||||
// Check that we can't retrieve this attachment from the scene.
|
// Check that we can't retrieve this attachment from the scene.
|
||||||
Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null);
|
Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null);
|
||||||
|
|
|
@ -644,7 +644,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// an agent cannot teleport back to this region if it has teleported away.
|
// an agent cannot teleport back to this region if it has teleported away.
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
sp.Scene.IncomingCloseAgent(sp.UUID);
|
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -307,6 +307,13 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
Graphics graph = null;
|
Graphics graph = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
// XXX: In testing, it appears that if multiple threads dispose of separate GDI+ objects simultaneously,
|
||||||
|
// the native malloc heap can become corrupted, possibly due to a double free(). This may be due to
|
||||||
|
// bugs in the underlying libcairo used by mono's libgdiplus.dll on Linux/OSX. These problems were
|
||||||
|
// seen with both libcario 1.10.2-6.1ubuntu3 and 1.8.10-2ubuntu1. They go away if disposal is perfomed
|
||||||
|
// under lock.
|
||||||
|
lock (this)
|
||||||
{
|
{
|
||||||
if (alpha == 256)
|
if (alpha == 256)
|
||||||
bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb);
|
bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb);
|
||||||
|
@ -337,6 +344,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
}
|
}
|
||||||
|
|
||||||
GDIDraw(data, graph, altDataDelim);
|
GDIDraw(data, graph, altDataDelim);
|
||||||
|
}
|
||||||
|
|
||||||
byte[] imageJ2000 = new byte[0];
|
byte[] imageJ2000 = new byte[0];
|
||||||
|
|
||||||
|
@ -354,6 +362,13 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
m_textureManager.ReturnData(id, imageJ2000);
|
m_textureManager.ReturnData(id, imageJ2000);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
{
|
||||||
|
// XXX: In testing, it appears that if multiple threads dispose of separate GDI+ objects simultaneously,
|
||||||
|
// the native malloc heap can become corrupted, possibly due to a double free(). This may be due to
|
||||||
|
// bugs in the underlying libcairo used by mono's libgdiplus.dll on Linux/OSX. These problems were
|
||||||
|
// seen with both libcario 1.10.2-6.1ubuntu3 and 1.8.10-2ubuntu1. They go away if disposal is perfomed
|
||||||
|
// under lock.
|
||||||
|
lock (this)
|
||||||
{
|
{
|
||||||
if (graph != null)
|
if (graph != null)
|
||||||
graph.Dispose();
|
graph.Dispose();
|
||||||
|
@ -362,6 +377,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
bitmap.Dispose();
|
bitmap.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private int parseIntParam(string strInt)
|
private int parseIntParam(string strInt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -313,7 +313,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
|
|
||||||
if (m_scenes.ContainsKey(destination.RegionID))
|
if (m_scenes.ContainsKey(destination.RegionID))
|
||||||
{
|
{
|
||||||
Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id); });
|
// m_log.DebugFormat(
|
||||||
|
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||||
|
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||||
|
|
||||||
|
Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id, false); });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||||
|
|
|
@ -97,6 +97,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to cache lookups for valid groups.
|
||||||
|
/// </summary>
|
||||||
|
private IDictionary<UUID, bool> m_validGroupUuids = new Dictionary<UUID, bool>();
|
||||||
|
|
||||||
|
private IGroupsModule m_groupsModule;
|
||||||
|
|
||||||
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId)
|
public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
@ -120,6 +127,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
// Zero can never be a valid user id
|
// Zero can never be a valid user id
|
||||||
m_validUserUuids[UUID.Zero] = false;
|
m_validUserUuids[UUID.Zero] = false;
|
||||||
|
|
||||||
|
m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
|
public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
|
||||||
|
@ -132,6 +141,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
// Zero can never be a valid user id
|
// Zero can never be a valid user id
|
||||||
m_validUserUuids[UUID.Zero] = false;
|
m_validUserUuids[UUID.Zero] = false;
|
||||||
|
|
||||||
|
m_groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -302,6 +313,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
if (!ResolveUserUuid(part.LastOwnerID))
|
if (!ResolveUserUuid(part.LastOwnerID))
|
||||||
part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||||
|
|
||||||
|
if (!ResolveGroupUuid(part.GroupID))
|
||||||
|
part.GroupID = UUID.Zero;
|
||||||
|
|
||||||
// And zap any troublesome sit target information
|
// And zap any troublesome sit target information
|
||||||
// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||||
// part.SitTargetPosition = new Vector3(0, 0, 0);
|
// part.SitTargetPosition = new Vector3(0, 0, 0);
|
||||||
|
@ -335,13 +349,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
{
|
{
|
||||||
kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty)
|
if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty)
|
||||||
{
|
{
|
||||||
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
if (!ResolveUserUuid(kvp.Value.CreatorID))
|
||||||
kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UserManager != null)
|
if (UserManager != null)
|
||||||
UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
|
UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
|
||||||
|
|
||||||
|
if (!ResolveGroupUuid(kvp.Value.GroupID))
|
||||||
|
kvp.Value.GroupID = UUID.Zero;
|
||||||
}
|
}
|
||||||
part.TaskInventory.LockItemsForRead(false);
|
part.TaskInventory.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
@ -382,9 +401,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
foreach (string serialisedParcel in serialisedParcels)
|
foreach (string serialisedParcel in serialisedParcels)
|
||||||
{
|
{
|
||||||
LandData parcel = LandDataSerializer.Deserialize(serialisedParcel);
|
LandData parcel = LandDataSerializer.Deserialize(serialisedParcel);
|
||||||
|
|
||||||
|
// Validate User and Group UUID's
|
||||||
|
|
||||||
if (!ResolveUserUuid(parcel.OwnerID))
|
if (!ResolveUserUuid(parcel.OwnerID))
|
||||||
parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||||
|
|
||||||
|
if (!ResolveGroupUuid(parcel.GroupID))
|
||||||
|
{
|
||||||
|
parcel.GroupID = UUID.Zero;
|
||||||
|
parcel.IsGroupOwned = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LandAccessEntry> accessList = new List<LandAccessEntry>();
|
||||||
|
foreach (LandAccessEntry entry in parcel.ParcelAccessList)
|
||||||
|
{
|
||||||
|
if (ResolveUserUuid(entry.AgentID))
|
||||||
|
accessList.Add(entry);
|
||||||
|
// else, drop this access rule
|
||||||
|
}
|
||||||
|
parcel.ParcelAccessList = accessList;
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}",
|
// "[ARCHIVER]: Adding parcel {0}, local id {1}, area {2}",
|
||||||
// parcel.Name, parcel.LocalID, parcel.Area);
|
// parcel.Name, parcel.LocalID, parcel.Area);
|
||||||
|
@ -419,6 +456,30 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Look up the given group id to check whether it's one that is valid for this grid.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool ResolveGroupUuid(UUID uuid)
|
||||||
|
{
|
||||||
|
if (uuid == UUID.Zero)
|
||||||
|
return true; // this means the object has no group
|
||||||
|
|
||||||
|
if (!m_validGroupUuids.ContainsKey(uuid))
|
||||||
|
{
|
||||||
|
bool exists;
|
||||||
|
|
||||||
|
if (m_groupsModule == null)
|
||||||
|
exists = false;
|
||||||
|
else
|
||||||
|
exists = (m_groupsModule.GetGroupRecord(uuid) != null);
|
||||||
|
|
||||||
|
m_validGroupUuids.Add(uuid, exists);
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_validGroupUuids[uuid];
|
||||||
|
}
|
||||||
|
|
||||||
/// Load an asset
|
/// Load an asset
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assetFilename"></param>
|
/// <param name="assetFilename"></param>
|
||||||
|
|
|
@ -85,13 +85,15 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
dis = 0;
|
dis = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float thisSpGain;
|
||||||
|
|
||||||
// Scale by distance
|
// Scale by distance
|
||||||
if (radius == 0)
|
if (radius == 0)
|
||||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
thisSpGain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||||
else
|
else
|
||||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
thisSpGain = (float)((double)gain * ((radius - dis) / radius));
|
||||||
|
|
||||||
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
|
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, thisSpGain, flags);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4340,15 +4340,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Tell a single agent to disconnect from the region.
|
/// Tell a single agent to disconnect from the region.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="agentID"></param>
|
/// <param name="agentID"></param>
|
||||||
/// <param name="childOnly"></param>
|
/// <param name="force">
|
||||||
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
|
/// Force the agent to close even if it might be in the middle of some other operation. You do not want to
|
||||||
|
/// force unless you are absolutely sure that the agent is dead and a normal close is not working.
|
||||||
|
/// </param>
|
||||||
|
public bool IncomingCloseAgent(UUID agentID, bool force)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
|
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
|
||||||
|
|
||||||
ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
|
ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.Close();
|
presence.ControllingClient.Close(true, force);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3560,23 +3560,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the color of prim faces
|
/// Set the color & alpha of prim faces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="color"></param>
|
|
||||||
/// <param name="face"></param>
|
/// <param name="face"></param>
|
||||||
public void SetFaceColor(Vector3 color, int face)
|
/// <param name="color"></param>
|
||||||
|
/// <param name="alpha"></param>
|
||||||
|
public void SetFaceColorAlpha(int face, Vector3 color, double ?alpha)
|
||||||
{
|
{
|
||||||
|
Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f);
|
||||||
|
float clippedAlpha = alpha.HasValue ?
|
||||||
|
Util.Clip((float)alpha.Value, 0.0f, 1.0f) : 0;
|
||||||
|
|
||||||
// The only way to get a deep copy/ If we don't do this, we can
|
// The only way to get a deep copy/ If we don't do this, we can
|
||||||
// mever detect color changes further down.
|
// never detect color changes further down.
|
||||||
Byte[] buf = Shape.Textures.GetBytes();
|
Byte[] buf = Shape.Textures.GetBytes();
|
||||||
Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
|
Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
|
||||||
Color4 texcolor;
|
Color4 texcolor;
|
||||||
if (face >= 0 && face < GetNumberOfSides())
|
if (face >= 0 && face < GetNumberOfSides())
|
||||||
{
|
{
|
||||||
texcolor = tex.CreateFace((uint)face).RGBA;
|
texcolor = tex.CreateFace((uint)face).RGBA;
|
||||||
texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
|
texcolor.R = clippedColor.X;
|
||||||
texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
|
texcolor.G = clippedColor.Y;
|
||||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
texcolor.B = clippedColor.Z;
|
||||||
|
if (alpha.HasValue)
|
||||||
|
{
|
||||||
|
texcolor.A = clippedAlpha;
|
||||||
|
}
|
||||||
tex.FaceTextures[face].RGBA = texcolor;
|
tex.FaceTextures[face].RGBA = texcolor;
|
||||||
UpdateTextureEntry(tex.GetBytes());
|
UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
|
@ -3588,15 +3597,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (tex.FaceTextures[i] != null)
|
if (tex.FaceTextures[i] != null)
|
||||||
{
|
{
|
||||||
texcolor = tex.FaceTextures[i].RGBA;
|
texcolor = tex.FaceTextures[i].RGBA;
|
||||||
texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
|
texcolor.R = clippedColor.X;
|
||||||
texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
|
texcolor.G = clippedColor.Y;
|
||||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
texcolor.B = clippedColor.Z;
|
||||||
|
if (alpha.HasValue)
|
||||||
|
{
|
||||||
|
texcolor.A = clippedAlpha;
|
||||||
|
}
|
||||||
tex.FaceTextures[i].RGBA = texcolor;
|
tex.FaceTextures[i].RGBA = texcolor;
|
||||||
}
|
}
|
||||||
texcolor = tex.DefaultTexture.RGBA;
|
texcolor = tex.DefaultTexture.RGBA;
|
||||||
texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
|
texcolor.R = clippedColor.X;
|
||||||
texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
|
texcolor.G = clippedColor.Y;
|
||||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
texcolor.B = clippedColor.Z;
|
||||||
|
if (alpha.HasValue)
|
||||||
|
{
|
||||||
|
texcolor.A = clippedAlpha;
|
||||||
|
}
|
||||||
tex.DefaultTexture.RGBA = texcolor;
|
tex.DefaultTexture.RGBA = texcolor;
|
||||||
}
|
}
|
||||||
UpdateTextureEntry(tex.GetBytes());
|
UpdateTextureEntry(tex.GetBytes());
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestScene scene = new SceneHelpers().SetupScene();
|
TestScene scene = new SceneHelpers().SetupScene();
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
|
|
||||||
scene.IncomingCloseAgent(sp.UUID);
|
scene.IncomingCloseAgent(sp.UUID, false);
|
||||||
|
|
||||||
Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
|
Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
|
||||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
|
||||||
|
|
|
@ -890,10 +890,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
Close(true);
|
Close(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close(bool sendStop)
|
public void Close(bool sendStop, bool force)
|
||||||
{
|
{
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -905,11 +905,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
Close(true);
|
Close(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close(bool sendStop)
|
public void Close(bool sendStop, bool force)
|
||||||
{
|
{
|
||||||
|
// Remove ourselves from the scene
|
||||||
|
m_scene.RemoveClient(AgentId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
|
|
|
@ -1490,11 +1490,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
scale.y = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.y));
|
scale.y = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.y));
|
||||||
scale.z = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.z));
|
scale.z = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.z));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// Next we clamp the scale to the non-physical min/max
|
{
|
||||||
|
// If not physical, then we clamp the scale to the non-physical min/max
|
||||||
scale.x = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.x));
|
scale.x = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.x));
|
||||||
scale.y = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.y));
|
scale.y = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.y));
|
||||||
scale.z = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.z));
|
scale.z = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.z));
|
||||||
|
}
|
||||||
|
|
||||||
Vector3 tmp = part.Scale;
|
Vector3 tmp = part.Scale;
|
||||||
tmp.X = (float)scale.x;
|
tmp.X = (float)scale.x;
|
||||||
|
@ -1568,7 +1570,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (face == ScriptBaseClass.ALL_SIDES)
|
if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
face = SceneObjectPart.ALL_SIDES;
|
face = SceneObjectPart.ALL_SIDES;
|
||||||
|
|
||||||
m_host.SetFaceColor(color, face);
|
m_host.SetFaceColorAlpha(face, color, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetTexGen(SceneObjectPart part, int face,int style)
|
public void SetTexGen(SceneObjectPart part, int face,int style)
|
||||||
|
@ -3900,7 +3902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in parts)
|
foreach (SceneObjectPart part in parts)
|
||||||
part.SetFaceColor(color, face);
|
part.SetFaceColorAlpha(face, color, null);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -8243,8 +8245,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSL_Vector color=rules.GetVector3Item(idx++);
|
LSL_Vector color=rules.GetVector3Item(idx++);
|
||||||
double alpha=(double)rules.GetLSLFloatItem(idx++);
|
double alpha=(double)rules.GetLSLFloatItem(idx++);
|
||||||
|
|
||||||
part.SetFaceColor(color, face);
|
part.SetFaceColorAlpha(face, color, alpha);
|
||||||
SetAlpha(part, alpha, face);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -2925,7 +2925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
avatar.SpeedModifier = (float)SpeedModifier;
|
avatar.SpeedModifier = (float)SpeedModifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void osKickAvatar(string FirstName,string SurName,string alert)
|
public void osKickAvatar(string FirstName, string SurName, string alert)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -2939,7 +2939,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
sp.ControllingClient.Kick(alert);
|
sp.ControllingClient.Kick(alert);
|
||||||
|
|
||||||
// ...and close on our side
|
// ...and close on our side
|
||||||
sp.Scene.IncomingCloseAgent(sp.UUID);
|
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -546,6 +546,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
"OpenSim.Region.ScriptEngine.Shared.dll"));
|
"OpenSim.Region.ScriptEngine.Shared.dll"));
|
||||||
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
|
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
|
||||||
"OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
|
"OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));
|
||||||
|
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
|
||||||
|
"OpenMetaverseTypes.dll"));
|
||||||
|
|
||||||
if (lang == enumCompileType.yp)
|
if (lang == enumCompileType.yp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -935,12 +935,12 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close(bool c)
|
public void Close()
|
||||||
{
|
{
|
||||||
Close();
|
Close(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close(bool sendStop, bool force)
|
||||||
{
|
{
|
||||||
// Fire the callback for this connection closing
|
// Fire the callback for this connection closing
|
||||||
// This is necesary to get the presence detector to notice that a client has logged out.
|
// This is necesary to get the presence detector to notice that a client has logged out.
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1880,6 +1880,7 @@
|
||||||
<Reference name="System.Core"/>
|
<Reference name="System.Core"/>
|
||||||
<Reference name="System.Xml"/>
|
<Reference name="System.Xml"/>
|
||||||
<Reference name="Mono.Addins" path="../../../bin/"/>
|
<Reference name="Mono.Addins" path="../../../bin/"/>
|
||||||
|
<Reference name="NDesk.Options" path="../../../bin/"/>
|
||||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||||
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
|
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
|
||||||
<Reference name="OpenMetaverse" path="../../../bin/"/>
|
<Reference name="OpenMetaverse" path="../../../bin/"/>
|
||||||
|
|
Loading…
Reference in New Issue