Merge branch 'master' into careminster

Conflicts:
	OpenSim/Framework/WebUtil.cs
	OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
	OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
	OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
This commit is contained in:
Melanie
2012-05-05 10:32:04 +01:00
60 changed files with 831 additions and 363 deletions

View File

@@ -83,7 +83,7 @@ namespace Flotsam.RegionModules.AssetCache
private Dictionary<string, ManualResetEvent> m_CurrentlyWriting = new Dictionary<string, ManualResetEvent>();
private int m_WaitOnInprogressTimeout = 3000;
#else
private List<string> m_CurrentlyWriting = new List<string>();
private HashSet<string> m_CurrentlyWriting = new HashSet<string>();
#endif
private bool m_FileCacheEnabled = true;
@@ -272,7 +272,11 @@ namespace Flotsam.RegionModules.AssetCache
// the other thread has updated the time for us.
try
{
File.SetLastAccessTime(filename, DateTime.Now);
lock (m_CurrentlyWriting)
{
if (!m_CurrentlyWriting.Contains(filename))
File.SetLastAccessTime(filename, DateTime.Now);
}
}
catch
{

View File

@@ -578,9 +578,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
private void AttachToAgent(
IScenePresence sp, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
{
// m_log.DebugFormat(
// "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}",
// so.Name, avatar.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos);
// m_log.DebugFormat(
// "[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1} in pt {2} pos {3} {4}",
// so.Name, sp.Name, attachmentpoint, attachOffset, so.RootPart.AttachedPos);
so.DetachFromBackup();
@@ -845,9 +845,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
/// <param name="att"></param>
private void ShowAttachInUserInventory(IScenePresence sp, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
{
// m_log.DebugFormat(
// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
// att.Name, sp.Name, AttachmentPt, itemID);
// m_log.DebugFormat(
// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
// att.Name, sp.Name, AttachmentPt, itemID);
if (UUID.Zero == itemID)
{
@@ -910,9 +910,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
private void Client_OnObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent)
{
// m_log.DebugFormat(
// "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})",
// objectLocalID, remoteClient.Name, AttachmentPt, silent);
// m_log.DebugFormat(
// "[ATTACHMENTS MODULE]: Attaching object local id {0} to {1} point {2} from ground (silent = {3})",
// objectLocalID, remoteClient.Name, AttachmentPt, silent);
if (!Enabled)
return;

View File

@@ -96,6 +96,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
ScenePresence killingAvatar = null;
// string killingAvatarMessage;
// check to see if it is an NPC and just remove it
INPCModule NPCmodule = deadAvatar.Scene.RequestModuleInterface<INPCModule>();
if (NPCmodule != null && NPCmodule.DeleteNPC(deadAvatar.UUID, deadAvatar.Scene))
{
return;
}
if (killerObjectLocalID == 0)
deadAvatarMessage = "You committed suicide!";
else
@@ -145,7 +152,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
catch (InvalidOperationException)
{ }
deadAvatar.Health = 100;
deadAvatar.setHealthWithUpdate(100.0f);
deadAvatar.Scene.TeleportClientHome(deadAvatar.UUID, deadAvatar.ControllingClient);
}
@@ -154,14 +161,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
try
{
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
|| avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
{
avatar.Invulnerable = false;
}
else
{
avatar.Invulnerable = true;
if (avatar.Health < 100.0f)
{
avatar.setHealthWithUpdate(100.0f);
}
}
}
catch (Exception)

View File

@@ -30,7 +30,6 @@ using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Threading;
using OpenSim.Framework;
using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Client;
@@ -596,7 +595,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
{
// Thread.Sleep(5000);
// We need to delay here because Imprudence viewers, unlike v1 or v3, have a short (<200ms, <500ms) delay before
// they regard the new region as the current region after receiving the AgentMovementComplete
// response. If close is sent before then, it will cause the viewer to quit instead.
// However, if this delay is longer, then a viewer can teleport back to this region and experience
// a failure because the old ScenePresence has not yet been cleaned up.
Thread.Sleep(2000);
sp.Close();
sp.Scene.IncomingCloseAgent(sp.UUID);
}
@@ -1913,12 +1918,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
Thread.Sleep(100);
}
if (count > 0)
return true;
else
return false;
return true;
return count > 0;
}
protected void SetInTransit(UUID id)

View File

@@ -147,6 +147,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void Close()
{
}
public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID)
{
UUID urlcode = UUID.Random();
@@ -176,6 +177,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
uri,
new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
m_log.DebugFormat(
"[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}",
uri, itemID, host.Name, host.LocalId);
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
}
@@ -218,6 +223,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
uri,
new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
m_log.DebugFormat(
"[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
uri, itemID, host.Name, host.LocalId);
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
}
@@ -241,6 +250,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
m_RequestMap.Remove(req);
}
// m_log.DebugFormat(
// "[URL MODULE]: Releasing url {0} for {1} in {2}",
// url, data.itemID, data.hostID);
RemoveUrl(data);
m_UrlMap.Remove(url);
}

View File

@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
MethodBase.GetCurrentMethod().DeclaringType);
private IUserManagement m_UserManagement;
private IGridService m_GridService;
// private IGridService m_GridService;
private Scene m_Scene;
AccessFlags m_accessValue = AccessFlags.None;
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
{
m_Scene = scene;
m_UserManagement = scene.RequestModuleInterface<IUserManagement>();
m_GridService = scene.GridService;
// m_GridService = scene.GridService;
if (config != null)
{

View File

@@ -1392,21 +1392,26 @@ namespace OpenSim.Region.CoreModules.World.Land
private void EventManagerOnRegisterCaps(UUID agentID, Caps caps)
{
string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("RemoteParcelRequest",
new RestStreamHandler("POST", capsBase + remoteParcelRequestPath,
delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return RemoteParcelRequest(request, path, param, agentID, caps);
}));
caps.RegisterHandler(
"RemoteParcelRequest",
new RestStreamHandler(
"POST",
capsBase + remoteParcelRequestPath,
(request, path, param, httpRequest, httpResponse)
=> RemoteParcelRequest(request, path, param, agentID, caps),
"RemoteParcelRequest",
agentID.ToString()));
UUID parcelCapID = UUID.Random();
caps.RegisterHandler("ParcelPropertiesUpdate",
new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return ProcessPropertiesUpdate(request, path, param, agentID, caps);
}));
caps.RegisterHandler(
"ParcelPropertiesUpdate",
new RestStreamHandler(
"POST",
"/CAPS/" + parcelCapID,
(request, path, param, httpRequest, httpResponse)
=> ProcessPropertiesUpdate(request, path, param, agentID, caps),
"ParcelPropertiesUpdate",
agentID.ToString()));
}
private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
{

View File

@@ -126,7 +126,6 @@ namespace OpenSim.Region.CoreModules.World.Land
// m_log.DebugFormat(
// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted",
// obj.Name, m_Scene.RegionInfo.RegionName);
}
}

View File

@@ -145,7 +145,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
// Even though we're registering for POST we're going to get GETS and UPDATES too
caps.RegisterHandler(
"ObjectMedia", new RestStreamHandler("POST", omCapUrl, HandleObjectMediaMessage));
"ObjectMedia",
new RestStreamHandler(
"POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString()));
}
string omuCapUrl = "/CAPS/" + UUID.Random();
@@ -157,7 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
// Even though we're registering for POST we're going to get GETS and UPDATES too
caps.RegisterHandler(
"ObjectMediaNavigate", new RestStreamHandler("POST", omuCapUrl, HandleObjectMediaNavigateMessage));
"ObjectMediaNavigate",
new RestStreamHandler(
"POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString()));
}
}

View File

@@ -190,14 +190,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
//m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("MapLayer",
new RestStreamHandler("POST", capsBase + m_mapLayerPath,
delegate(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
return MapLayerRequest(request, path, param,
agentID, caps);
}));
caps.RegisterHandler(
"MapLayer",
new RestStreamHandler(
"POST",
capsBase + m_mapLayerPath,
(request, path, param, httpRequest, httpResponse)
=> MapLayerRequest(request, path, param, agentID, caps),
"MapLayer",
agentID.ToString()));
}
/// <summary>