mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
@@ -306,13 +306,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
|
||||
if (c.Scene != null)
|
||||
{
|
||||
((Scene)c.Scene).ForEachScenePresence
|
||||
((Scene)c.Scene).ForEachRootScenePresence
|
||||
(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
|
||||
@@ -98,10 +98,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
presence.ControllingClient.SendAlertMessage(message);
|
||||
presence.ControllingClient.SendAlertMessage(message);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -163,10 +162,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
}
|
||||
else if (agentID == ALL_AGENTS)
|
||||
{
|
||||
m_scene.ForEachScenePresence(
|
||||
m_scene.ForEachRootScenePresence(
|
||||
delegate(ScenePresence p)
|
||||
{
|
||||
if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID)))
|
||||
|
||||
@@ -143,24 +143,19 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Try root avatar only first
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}",
|
||||
// toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
// Local message
|
||||
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
// m_log.DebugFormat(
|
||||
// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}",
|
||||
// toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
{
|
||||
// Local message
|
||||
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
|
||||
sp.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
result(true);
|
||||
return;
|
||||
}
|
||||
// Message sent
|
||||
result(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,16 +163,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
|
||||
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
{
|
||||
// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}",
|
||||
// toAgentID, scene.RegionInfo.RegionName);
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null)
|
||||
{
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
|
||||
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
sp.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
result(true);
|
||||
@@ -231,17 +224,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
bool successful = false;
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if(!sp.IsChildAgent)
|
||||
{
|
||||
ScenePresence user =
|
||||
(ScenePresence)scene.Entities[toAgentID];
|
||||
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
scene.EventManager.TriggerIncomingInstantMessage(gim);
|
||||
successful = true;
|
||||
}
|
||||
scene.EventManager.TriggerIncomingInstantMessage(gim);
|
||||
successful = true;
|
||||
}
|
||||
}
|
||||
if (!successful)
|
||||
|
||||
@@ -140,8 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Try root avatar only first
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
// m_log.DebugFormat(
|
||||
// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
|
||||
// toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
|
||||
@@ -165,9 +168,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
|
||||
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null)
|
||||
{
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
@@ -405,17 +407,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Trigger the Instant message in the scene.
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
ScenePresence sp = scene.GetScenePresence(toAgentID);
|
||||
if (sp != null && !sp.IsChildAgent)
|
||||
{
|
||||
ScenePresence user =
|
||||
(ScenePresence)scene.Entities[toAgentID];
|
||||
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
scene.EventManager.TriggerIncomingInstantMessage(gim);
|
||||
successful = true;
|
||||
}
|
||||
scene.EventManager.TriggerIncomingInstantMessage(gim);
|
||||
successful = true;
|
||||
}
|
||||
}
|
||||
if (!successful)
|
||||
|
||||
@@ -277,19 +277,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {
|
||||
// Send BulkUpdateInventory
|
||||
IInventoryService invService = scene.InventoryService;
|
||||
UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip
|
||||
|
||||
InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
|
||||
folder = invService.GetFolder(folder);
|
||||
// justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011
|
||||
// and is apparently supposed to fix bulk inventory updates after accepting items. But
|
||||
// instead it appears to cause two copies of an accepted folder for the receiving user in
|
||||
// at least some cases. Folder/item update is already done when the offer is made (see code above)
|
||||
|
||||
ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
|
||||
|
||||
// If the user has left the scene by the time the message comes back then we can't send
|
||||
// them the update.
|
||||
if (fromUser != null)
|
||||
fromUser.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
// // Send BulkUpdateInventory
|
||||
// IInventoryService invService = scene.InventoryService;
|
||||
// UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip
|
||||
//
|
||||
// InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
|
||||
// folder = invService.GetFolder(folder);
|
||||
//
|
||||
// ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
|
||||
//
|
||||
// // If the user has left the scene by the time the message comes back then we can't send
|
||||
// // them the update.
|
||||
// if (fromUser != null)
|
||||
// fromUser.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,11 +678,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
|
||||
return;
|
||||
|
||||
Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
Scene.ForEachRootScenePresence(delegate(ScenePresence p)
|
||||
{
|
||||
if (sp.UUID != senderID)
|
||||
if (p.UUID != senderID)
|
||||
{
|
||||
ScenePresence p = Scene.GetScenePresence(sp.UUID);
|
||||
// make sure they are still there, we could be working down a long list
|
||||
// Also make sure they are actually in the region
|
||||
if (p != null && !p.IsChildAgent)
|
||||
@@ -953,10 +952,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public void sendRegionInfoPacketToAll()
|
||||
{
|
||||
Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
HandleRegionInfoRequest(sp.ControllingClient);
|
||||
HandleRegionInfoRequest(sp.ControllingClient);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -533,11 +533,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
|
||||
{
|
||||
if (avatar.IsChildAgent)
|
||||
return;
|
||||
|
||||
ILandObject over = null;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -70,11 +70,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
|
||||
SceneObjectGroup grp = part.ParentGroup;
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||
if (dis > 100.0) // Max audio distance
|
||||
return;
|
||||
@@ -122,11 +119,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
}
|
||||
}
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||
if (dis > 100.0) // Max audio distance
|
||||
return;
|
||||
|
||||
@@ -488,12 +488,9 @@ namespace OpenSim.Region.CoreModules
|
||||
|
||||
private void SunUpdateToAllClients()
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
{
|
||||
SunToClient(sp.ControllingClient);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -435,10 +435,9 @@ namespace OpenSim.Region.CoreModules
|
||||
m_frameLastUpdateClientArray = m_frame;
|
||||
}
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
sp.ControllingClient.SendWindData(windSpeeds);
|
||||
sp.ControllingClient.SendWindData(windSpeeds);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,10 +401,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
// Don't send a green dot for yourself
|
||||
if (!sp.IsChildAgent && sp.UUID != remoteClient.AgentId)
|
||||
if (sp.UUID != remoteClient.AgentId)
|
||||
{
|
||||
mapitem = new mapItemReply();
|
||||
mapitem.x = (uint)(xstart + sp.AbsolutePosition.X);
|
||||
|
||||
Reference in New Issue
Block a user