httptests
UbitUmarov 2017-06-10 02:48:51 +01:00
commit b5910cfdb7
14 changed files with 181 additions and 110 deletions

View File

@ -254,14 +254,12 @@ namespace OpenSim.Framework.Monitoring
twi.Cleanup(); twi.Cleanup();
m_threads.Remove(threadID); m_threads.Remove(threadID);
return true; return true;
} }
else else
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID); "[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID);
return false; return false;
} }
} }
@ -360,7 +358,7 @@ namespace OpenSim.Framework.Monitoring
List<ThreadWatchdogInfo> callbackInfos = null; List<ThreadWatchdogInfo> callbackInfos = null;
List<ThreadWatchdogInfo> threadsToRemove = null; List<ThreadWatchdogInfo> threadsToRemove = null;
const ThreadState thgone = ThreadState.Stopped | ThreadState.Aborted | ThreadState.AbortRequested; const ThreadState thgone = ThreadState.Stopped;
lock (m_threads) lock (m_threads)
{ {
@ -368,7 +366,7 @@ namespace OpenSim.Framework.Monitoring
{ {
if(!m_enabled) if(!m_enabled)
return; return;
if(!threadInfo.Thread.IsAlive || (threadInfo.Thread.ThreadState & thgone) != 0) if((threadInfo.Thread.ThreadState & thgone) != 0)
{ {
if(threadsToRemove == null) if(threadsToRemove == null)
threadsToRemove = new List<ThreadWatchdogInfo>(); threadsToRemove = new List<ThreadWatchdogInfo>();

View File

@ -1580,10 +1580,14 @@ namespace OpenSim.Framework
{ {
MediaList ml = new MediaList(); MediaList ml = new MediaList();
ml.ReadXml(rawXml); ml.ReadXml(rawXml);
if(ml.Count == 0)
return null;
return ml; return ml;
} }
public void ReadXml(string rawXml) public void ReadXml(string rawXml)
{
try
{ {
using (StringReader sr = new StringReader(rawXml)) using (StringReader sr = new StringReader(rawXml))
{ {
@ -1598,18 +1602,27 @@ namespace OpenSim.Framework
return; return;
xtr.ReadStartElement("OSMedia"); xtr.ReadStartElement("OSMedia");
OSD osdp = OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml());
if(osdp == null || !(osdp is OSDArray))
return;
OSDArray osdMeArray = osdp as OSDArray;
if(osdMeArray.Count == 0)
return;
OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml());
foreach (OSD osdMe in osdMeArray) foreach (OSD osdMe in osdMeArray)
{ {
MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry()); MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry());
Add(me); Add(me);
} }
xtr.ReadEndElement();
} }
} }
} }
catch
{
m_log.Debug("PrimitiveBaseShape] error decoding MOAP xml" );
}
}
public void ReadXml(XmlReader reader) public void ReadXml(XmlReader reader)
{ {

View File

@ -1577,7 +1577,10 @@ namespace OpenSim.Region.ClientStack.Linden
break; break;
m_Scene.TryGetScenePresence(m_AgentID, out sp); m_Scene.TryGetScenePresence(m_AgentID, out sp);
if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit) if(sp == null || sp.IsChildAgent || sp.IsDeleted)
break;
if(sp.IsInTransit && !sp.IsInLocalTransit)
break; break;
client = sp.ControllingClient; client = sp.ControllingClient;
@ -1699,7 +1702,10 @@ namespace OpenSim.Region.ClientStack.Linden
break; break;
m_Scene.TryGetScenePresence(m_AgentID, out sp); m_Scene.TryGetScenePresence(m_AgentID, out sp);
if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit) if(sp == null || sp.IsChildAgent || sp.IsDeleted)
break;
if(sp.IsInTransit && !sp.IsInLocalTransit)
break; break;
client = sp.ControllingClient; client = sp.ControllingClient;
@ -1807,7 +1813,7 @@ namespace OpenSim.Region.ClientStack.Linden
if(sp == null || sp.IsDeleted) if(sp == null || sp.IsDeleted)
return ""; return "";
if(sp.IsInTransit) if(sp.IsInTransit && !sp.IsInLocalTransit)
{ {
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable; httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable;
httpResponse.AddHeader("Retry-After","30"); httpResponse.AddHeader("Retry-After","30");
@ -1817,7 +1823,6 @@ namespace OpenSim.Region.ClientStack.Linden
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
string[] ids = query.GetValues("ids"); string[] ids = query.GetValues("ids");
Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids); Dictionary<UUID,string> names = m_UserManager.GetUsersNames(ids);
OSDMap osdReply = new OSDMap(); OSDMap osdReply = new OSDMap();
@ -1833,12 +1838,18 @@ namespace OpenSim.Region.ClientStack.Linden
string[] parts = kvp.Value.Split(new char[] {' '}); string[] parts = kvp.Value.Split(new char[] {' '});
OSDMap osdname = new OSDMap(); OSDMap osdname = new OSDMap();
// dont tell about unknown users, we can't send them back on Bad either
if(parts[0] == "Unknown")
continue;
/*
if(parts[0] == "Unknown") if(parts[0] == "Unknown")
{ {
osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1)); osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1));
osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2));
} }
else else
*/
{ {
osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8)); osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8));
osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1));

View File

@ -6473,8 +6473,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack) private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack)
{ {
UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack; ScenePresence sp = (ScenePresence)SceneAgent;
if(sp == null || sp.IsDeleted || (sp.IsInTransit && !sp.IsInLocalTransit))
return true;
UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack;
for (int i = 0; i < upack.UUIDNameBlock.Length; i++) for (int i = 0; i < upack.UUIDNameBlock.Length; i++)
{ {
@ -7493,7 +7496,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
SendUserInfoReply(false, true, ""); SendUserInfoReply(false, true, "");
} }
return true; return true;
} }
private bool HandleUpdateUserInfo(IClientAPI sender, Packet Pack) private bool HandleUpdateUserInfo(IClientAPI sender, Packet Pack)
@ -9648,6 +9650,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private bool HandleUUIDNameRequest(IClientAPI sender, Packet Pack) private bool HandleUUIDNameRequest(IClientAPI sender, Packet Pack)
{ {
ScenePresence sp = (ScenePresence)SceneAgent;
if(sp == null || sp.IsDeleted || (sp.IsInTransit && !sp.IsInLocalTransit))
return true;
UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock)

View File

@ -1168,7 +1168,7 @@ namespace OpenSim.Region.CoreModules.Asset
con.Output("FloatSam Ensuring assets are cached for all scenes."); con.Output("FloatSam Ensuring assets are cached for all scenes.");
WorkManager.RunInThread(delegate WorkManager.RunInThreadPool(delegate
{ {
bool wasRunning= false; bool wasRunning= false;
lock(timerLock) lock(timerLock)

View File

@ -771,8 +771,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
else if (sp.Flying) else if (sp.Flying)
teleportFlags |= (uint)TeleportFlags.IsFlying; teleportFlags |= (uint)TeleportFlags.IsFlying;
sp.IsInLocalTransit = finalDestination.RegionLocY != 0; // HG
sp.IsInTransit = true; sp.IsInTransit = true;
if (DisableInterRegionTeleportCancellation) if (DisableInterRegionTeleportCancellation)
teleportFlags |= (uint)TeleportFlags.DisableCancel; teleportFlags |= (uint)TeleportFlags.DisableCancel;
@ -1524,6 +1526,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public bool Cross(ScenePresence agent, bool isFlying) public bool Cross(ScenePresence agent, bool isFlying)
{ {
agent.IsInLocalTransit = true;
agent.IsInTransit = true; agent.IsInTransit = true;
CrossAsyncDelegate d = CrossAsync; CrossAsyncDelegate d = CrossAsync;
d.BeginInvoke(agent, isFlying, CrossCompleted, d); d.BeginInvoke(agent, isFlying, CrossCompleted, d);

View File

@ -175,6 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{ {
client.OnNameFromUUIDRequest -= new UUIDNameRequest(HandleUUIDNameRequest); client.OnNameFromUUIDRequest -= new UUIDNameRequest(HandleUUIDNameRequest);
client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest); client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest);
client.OnConnectionClosed -= new Action<IClientAPI>(HandleConnectionClosed);
} }
protected virtual void HandleUUIDNameRequest(UUID uuid, IClientAPI client) protected virtual void HandleUUIDNameRequest(UUID uuid, IClientAPI client)

View File

@ -394,6 +394,7 @@ namespace OpenSim.Region.Framework.Scenes
/// asynchronously from the update loop. /// asynchronously from the update loop.
/// </summary> /// </summary>
private bool m_cleaningTemps = false; private bool m_cleaningTemps = false;
private bool m_sendingCoarseLocations = false; // same for async course locations sending
/// <summary> /// <summary>
/// Used to control main scene thread looping time when not updating via timer. /// Used to control main scene thread looping time when not updating via timer.
@ -1654,18 +1655,24 @@ namespace OpenSim.Region.Framework.Scenes
if (Frame % m_update_entitymovement == 0) if (Frame % m_update_entitymovement == 0)
m_sceneGraph.UpdateScenePresenceMovement(); m_sceneGraph.UpdateScenePresenceMovement();
if (Frame % (m_update_coarse_locations) == 0) if (Frame % (m_update_coarse_locations) == 0 && !m_sendingCoarseLocations)
{
m_sendingCoarseLocations = true;
WorkManager.RunInThreadPool(
delegate
{ {
List<Vector3> coarseLocations; List<Vector3> coarseLocations;
List<UUID> avatarUUIDs; List<UUID> avatarUUIDs;
SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60); SceneGraph.GetCoarseLocations(out coarseLocations, out avatarUUIDs, 60);
// Send coarse locations to clients // Send coarse locations to clients
ForEachScenePresence(delegate(ScenePresence presence) ForEachScenePresence(delegate(ScenePresence presence)
{ {
presence.SendCoarseLocations(coarseLocations, avatarUUIDs); presence.SendCoarseLocations(coarseLocations, avatarUUIDs);
}); });
m_sendingCoarseLocations = false;
}, null, string.Format("SendCoarseLocations ({0})", Name));
} }
// Get the simulation frame time that the avatar force input // Get the simulation frame time that the avatar force input
// took // took
tmpMS2 = Util.GetTimeStampMS(); tmpMS2 = Util.GetTimeStampMS();
@ -1708,7 +1715,7 @@ namespace OpenSim.Region.Framework.Scenes
if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps) if (Frame % m_update_temp_cleaning == 0 && !m_cleaningTemps)
{ {
m_cleaningTemps = true; m_cleaningTemps = true;
WorkManager.RunInThread( WorkManager.RunInThreadPool(
delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name)); delegate { CleanTempObjects(); m_cleaningTemps = false; }, null, string.Format("CleanTempObjects ({0})", Name));
tmpMS2 = Util.GetTimeStampMS(); tmpMS2 = Util.GetTimeStampMS();
tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects tempOnRezMS = (float)(tmpMS2 - tmpMS); // bad.. counts the FireAndForget, not CleanTempObjects
@ -1936,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_backingup) if (!m_backingup)
{ {
m_backingup = true; m_backingup = true;
WorkManager.RunInThread(o => Backup(false), null, string.Format("BackupWorker ({0})", Name)); WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name));
} }
} }

View File

@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (avtocrossInfo avinfo in avsToCross) foreach (avtocrossInfo avinfo in avsToCross)
{ {
ScenePresence av = avinfo.av; ScenePresence av = avinfo.av;
av.IsInLocalTransit = true;
av.IsInTransit = true; av.IsInTransit = true;
m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);

View File

@ -91,7 +91,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </value> /// </value>
protected internal TaskInventoryDictionary Items protected internal TaskInventoryDictionary Items
{ {
get { get
{
return m_items; return m_items;
} }
set set
@ -141,45 +142,53 @@ namespace OpenSim.Region.Framework.Scenes
/// </remarks> /// </remarks>
public void ResetInventoryIDs() public void ResetInventoryIDs()
{ {
if (null == m_part) if (m_part == null)
m_items.LockItemsForWrite(true); return;
if (Items.Count == 0) m_items.LockItemsForWrite(true);
if (m_items.Count == 0)
{ {
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
return; return;
} }
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); UUID partID = m_part.UUID;
Items.Clear(); IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
m_items.Clear();
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{ {
item.ResetIDs(m_part.UUID); item.ResetIDs(partID);
Items.Add(item.ItemID, item); m_items.Add(item.ItemID, item);
} }
m_inventorySerial++;
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
} }
public void ResetObjectID() public void ResetObjectID()
{ {
if (m_part == null)
return;
m_items.LockItemsForWrite(true); m_items.LockItemsForWrite(true);
if (Items.Count == 0) if (m_items.Count == 0)
{ {
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
return; return;
} }
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); IList<TaskInventoryItem> items = new List<TaskInventoryItem>(m_items.Values);
Items.Clear(); m_items.Clear();
UUID partID = m_part.UUID;
foreach (TaskInventoryItem item in items) foreach (TaskInventoryItem item in items)
{ {
item.ParentPartID = m_part.UUID; item.ParentPartID = partID;
item.ParentID = m_part.UUID; item.ParentID = partID;
Items.Add(item.ItemID, item); m_items.Add(item.ItemID, item);
} }
m_inventorySerial++;
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
} }
@ -189,15 +198,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="ownerId"></param> /// <param name="ownerId"></param>
public void ChangeInventoryOwner(UUID ownerId) public void ChangeInventoryOwner(UUID ownerId)
{ {
List<TaskInventoryItem> items = GetInventoryItems(); if(m_part == null)
if (items.Count == 0)
return; return;
m_items.LockItemsForWrite(true); m_items.LockItemsForWrite(true);
HasInventoryChanged = true; if (m_items.Count == 0)
m_part.ParentGroup.HasGroupChanged = true; {
foreach (TaskInventoryItem item in items) m_items.LockItemsForWrite(false);
return;
}
foreach (TaskInventoryItem item in m_items.Values)
{ {
if (ownerId != item.OwnerID) if (ownerId != item.OwnerID)
item.LastOwnerID = item.OwnerID; item.LastOwnerID = item.OwnerID;
@ -207,6 +218,8 @@ namespace OpenSim.Region.Framework.Scenes
item.PermsGranter = UUID.Zero; item.PermsGranter = UUID.Zero;
item.OwnerChanged = true; item.OwnerChanged = true;
} }
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
m_inventorySerial++; m_inventorySerial++;
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
} }
@ -217,8 +230,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="groupID"></param> /// <param name="groupID"></param>
public void ChangeInventoryGroup(UUID groupID) public void ChangeInventoryGroup(UUID groupID)
{ {
if(m_part == null)
return;
m_items.LockItemsForWrite(true); m_items.LockItemsForWrite(true);
if (0 == Items.Count) if (m_items.Count == 0)
{ {
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
return; return;
@ -233,11 +249,9 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
} }
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); foreach (TaskInventoryItem item in m_items.Values)
foreach (TaskInventoryItem item in items)
{
item.GroupID = groupID; item.GroupID = groupID;
}
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);
} }
@ -246,8 +260,8 @@ namespace OpenSim.Region.Framework.Scenes
if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null) if (m_part == null || m_part.ParentGroup == null || m_part.ParentGroup.Scene == null)
return; return;
Items.LockItemsForRead(true); m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in Items.Values) foreach (TaskInventoryItem item in m_items.Values)
{ {
if (item.InvType == (int)InventoryType.LSL) if (item.InvType == (int)InventoryType.LSL)
{ {
@ -257,7 +271,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
} }
public bool TryGetScriptInstanceRunning(UUID itemId, out bool running) public bool TryGetScriptInstanceRunning(UUID itemId, out bool running)
@ -345,7 +359,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void StopScriptInstances() public void StopScriptInstances()
{ {
GetInventoryItems(InventoryType.LSL).ForEach(i => StopScriptInstance(i)); List<TaskInventoryItem> scripts = GetInventoryItems(InventoryType.LSL);
foreach (TaskInventoryItem item in scripts)
StopScriptInstance(item);
} }
/// <summary> /// <summary>
@ -807,7 +823,6 @@ namespace OpenSim.Region.Framework.Scenes
m_part.AggregateInnerPerms(); m_part.AggregateInnerPerms();
m_inventorySerial++; m_inventorySerial++;
//m_inventorySerial += 2;
HasInventoryChanged = true; HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true; m_part.ParentGroup.HasGroupChanged = true;
} }
@ -1126,18 +1141,18 @@ namespace OpenSim.Region.Framework.Scenes
{ {
bool changed = false; bool changed = false;
Items.LockItemsForRead(true); m_items.LockItemsForRead(true);
if (m_inventorySerial == 0) // No inventory if (m_inventorySerial == 0) // No inventory
{ {
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
client.SendTaskInventory(m_part.UUID, 0, new byte[0]); client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
return; return;
} }
if (m_items.Count == 0) // No inventory if (m_items.Count == 0) // No inventory
{ {
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
client.SendTaskInventory(m_part.UUID, 0, new byte[0]); client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
return; return;
} }
@ -1148,7 +1163,7 @@ namespace OpenSim.Region.Framework.Scenes
changed = true; changed = true;
} }
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
if (m_inventoryFileData.Length < 2) if (m_inventoryFileData.Length < 2)
changed = true; changed = true;
@ -1173,7 +1188,7 @@ namespace OpenSim.Region.Framework.Scenes
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
Items.LockItemsForRead(true); m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values) foreach (TaskInventoryItem item in m_items.Values)
{ {
@ -1234,7 +1249,7 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddSectionEnd(); invString.AddSectionEnd();
} }
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
m_inventoryFileData = Utils.StringToBytes(invString.GetString()); m_inventoryFileData = Utils.StringToBytes(invString.GetString());
@ -1264,10 +1279,10 @@ namespace OpenSim.Region.Framework.Scenes
// of prim inventory loss. // of prim inventory loss.
// if (HasInventoryChanged) // if (HasInventoryChanged)
// { // {
Items.LockItemsForRead(true); m_items.LockItemsForRead(true);
ICollection<TaskInventoryItem> itemsvalues = Items.Values; ICollection<TaskInventoryItem> itemsvalues = m_items.Values;
HasInventoryChanged = false; HasInventoryChanged = false;
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
try try
{ {
datastore.StorePrimInventory(m_part.UUID, itemsvalues); datastore.StorePrimInventory(m_part.UUID, itemsvalues);
@ -1434,15 +1449,13 @@ namespace OpenSim.Region.Framework.Scenes
public int ScriptCount() public int ScriptCount()
{ {
int count = 0; int count = 0;
Items.LockItemsForRead(true); m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values) foreach (TaskInventoryItem item in m_items.Values)
{ {
if (item.InvType == (int)InventoryType.LSL) if (item.InvType == (int)InventoryType.LSL)
{
count++; count++;
} }
} m_items.LockItemsForRead(false);
Items.LockItemsForRead(false);
return count; return count;
} }
/// <summary> /// <summary>
@ -1465,48 +1478,44 @@ namespace OpenSim.Region.Framework.Scenes
if (engine != null) if (engine != null)
{ {
if (engine.GetScriptState(item.ItemID)) if (engine.GetScriptState(item.ItemID))
{
count++; count++;
} }
} }
} }
}
return count; return count;
} }
public List<UUID> GetInventoryList() public List<UUID> GetInventoryList()
{ {
List<UUID> ret = new List<UUID>(); m_items.LockItemsForRead(true);
List<UUID> ret = new List<UUID>(m_items.Count);
foreach (TaskInventoryItem item in m_items.Values) foreach (TaskInventoryItem item in m_items.Values)
ret.Add(item.ItemID); ret.Add(item.ItemID);
m_items.LockItemsForRead(false);
return ret; return ret;
} }
public List<TaskInventoryItem> GetInventoryItems() public List<TaskInventoryItem> GetInventoryItems()
{ {
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); m_items.LockItemsForRead(true);
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Values);
Items.LockItemsForRead(true); m_items.LockItemsForRead(false);
ret = new List<TaskInventoryItem>(m_items.Values);
Items.LockItemsForRead(false);
return ret; return ret;
} }
public List<TaskInventoryItem> GetInventoryItems(InventoryType type) public List<TaskInventoryItem> GetInventoryItems(InventoryType type)
{ {
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); m_items.LockItemsForRead(true);
Items.LockItemsForRead(true);
List<TaskInventoryItem> ret = new List<TaskInventoryItem>(m_items.Count);
foreach (TaskInventoryItem item in m_items.Values) foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType == (int)type) if (item.InvType == (int)type)
ret.Add(item); ret.Add(item);
Items.LockItemsForRead(false); m_items.LockItemsForRead(false);
return ret; return ret;
} }

View File

@ -971,6 +971,10 @@ namespace OpenSim.Region.Framework.Scenes
m_inTransit = value; m_inTransit = value;
} }
} }
// this is is only valid if IsInTransit is true
// only false on HG tps
// used work arounf viewers asking source region about destination user
public bool IsInLocalTransit {get; set; }
/// <summary> /// <summary>
@ -1040,6 +1044,7 @@ namespace OpenSim.Region.Framework.Scenes
m_uuid = client.AgentId; m_uuid = client.AgentId;
LocalId = m_scene.AllocateLocalId(); LocalId = m_scene.AllocateLocalId();
LegacySitOffsets = m_scene.LegacySitOffsets; LegacySitOffsets = m_scene.LegacySitOffsets;
IsInLocalTransit = true;
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null) if (account != null)

View File

@ -1361,10 +1361,28 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader) private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader)
{ {
// Get inner XML and pass to MediaList parser string value = String.Empty;
string value = reader.ReadInnerXml(); try
{
// The STANDARD content of Media elemet is escaped XML string (with &gt; etc).
value = reader.ReadElementContentAsString("Media", String.Empty);
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
} }
catch (XmlException e)
{
// There are versions of OAR files that contain unquoted XML.
// ie ONE comercial fork that never wanted their oars to be read by our code
try
{
value = reader.ReadInnerXml();
shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
}
catch
{
m_log.ErrorFormat("[SERIALIZER] Failed parsing halcyon MOAP information");
}
}
}
#endregion #endregion

View File

@ -936,7 +936,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
repData.actor.Name, asset.ID.ToString()); repData.actor.Name, asset.ID.ToString());
} }
else else
m_log.WarnFormat("[PHYSICS]: asset provider returned null asset fo mesh of prim {0}.", m_log.WarnFormat("[PHYSICS]: asset provider returned null asset for mesh of prim {0}.",
repData.actor.Name); repData.actor.Name);
} }
} }

View File

@ -138,7 +138,7 @@
;; The XML here has the same format as it does on the filesystem ;; The XML here has the same format as it does on the filesystem
;; (including the <Root> tag), except that everything is also enclosed ;; (including the <Root> tag), except that everything is also enclosed
;; in a <Regions> tag. ;; in a <Regions> tag.
; regionload_webserver_url = "http://example.com/regions.xml"; ; regionload_webserver_url = "http://example.com/regions.xml"
;# {allow_regionless} {} {Allow simulator to start up with no regions configured.} {true false} false ;# {allow_regionless} {} {Allow simulator to start up with no regions configured.} {true false} false
;; Allow the simulator to start up if there are no region configuration available ;; Allow the simulator to start up if there are no region configuration available
@ -286,8 +286,8 @@
;; SpawnPointRouting adjusts the landing for incoming avatars. ;; SpawnPointRouting adjusts the landing for incoming avatars.
;; "closest" will place the avatar at the SpawnPoint located in the closest ;; "closest" will place the avatar at the SpawnPoint located in the closest
;; available spot to the destination (typically map click/landmark). ;; available spot to the destination (typically map click/landmark).
;; "random" will place the avatar on a randomly selected spawnpoint; ;; "random" will place the avatar on a randomly selected spawnpoint.
;; "sequence" will place the avatar on the next sequential SpawnPoint ;; "sequence" will place the avatar on the next sequential SpawnPoint.
; SpawnPointRouting = closest ; SpawnPointRouting = closest
;# {TelehubAllowLandmark} {} {Allow users with landmarks to override telehub routing} {true false} false ;# {TelehubAllowLandmark} {} {Allow users with landmarks to override telehub routing} {true false} false
@ -375,8 +375,8 @@
; TexturePrimSize = 48 ; TexturePrimSize = 48
;# {RenderMeshes} {} {Render meshes and sculpties on map tiles?} {true false} false ;# {RenderMeshes} {} {Render meshes and sculpties on map tiles?} {true false} false
;; Attempt to render meshes and sculpties on the map ;; Attempt to render meshes and sculpties on the map.
; RenderMeshes = false; ; RenderMeshes = false
[Permissions] [Permissions]
@ -585,7 +585,7 @@
;; web server ;; web server
; user_agent = "OpenSim LSL (Mozilla Compatible)" ; user_agent = "OpenSim LSL (Mozilla Compatible)"
;; The follow 3 variables are for HTTP Basic Authentication for the Robust services. ;; The following 3 variables are for HTTP Basic Authentication for the Robust services.
;; Use this if your central services in port 8003 need to be accessible on the Internet ;; Use this if your central services in port 8003 need to be accessible on the Internet
;; but you want to protect them from unauthorized access. The username and password ;; but you want to protect them from unauthorized access. The username and password
;; here need to match the ones in the Robust service configuration. ;; here need to match the ones in the Robust service configuration.
@ -650,7 +650,6 @@
[SimulatorFeatures] [SimulatorFeatures]
;# {SearchServerURI} {} {URL of the search server} {} ;# {SearchServerURI} {} {URL of the search server} {}
;; Optional. If given this serves the same purpose as the grid wide ;; Optional. If given this serves the same purpose as the grid wide
;; [LoginServices] SearchURL setting and will override that where ;; [LoginServices] SearchURL setting and will override that where
@ -707,7 +706,7 @@
;; For standalones, this is the storage dll. ;; For standalones, this is the storage dll.
; StorageProvider = OpenSim.Data.MySQL.dll ; StorageProvider = OpenSim.Data.MySQL.dll
;# {MuteListModule} {OfflineMessageModule:OfflineMessageModule} {} {} MuteListModule ;# {MuteListModule} {OfflineMessageModule:OfflineMessageModule} {} {} None
;; Mute list handler (not yet implemented). MUST BE SET to allow offline ;; Mute list handler (not yet implemented). MUST BE SET to allow offline
;; messages to work ;; messages to work
; MuteListModule = MuteListModule ; MuteListModule = MuteListModule
@ -1163,7 +1162,7 @@
[MediaOnAPrim] [MediaOnAPrim]
;# {Enabled} {} {Enable Media-on-a-Prim (MOAP)} {true false} true ;# {Enabled} {} {Enable Media-on-a-Prim (MOAP)} {true false} true
;; Enable media on a prim facilities ;; Enable media on a prim facilities
; Enabled = true; ; Enabled = true
[NPC] [NPC]