mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
This commit is contained in:
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
client.FirstName+" "+client.LastName,
|
||||
destID, (byte)211, false,
|
||||
String.Empty,
|
||||
transactionID, false, new Vector3(), new byte[0]),
|
||||
transactionID, false, new Vector3(), new byte[0], true),
|
||||
delegate(bool success) {} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {});
|
||||
}
|
||||
}
|
||||
|
||||
// XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name>
|
||||
// to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis
|
||||
// of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously
|
||||
// done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here.
|
||||
else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
|
||||
{
|
||||
UUID destinationFolderID = UUID.Zero;
|
||||
@@ -324,6 +329,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
if (destinationFolderID != UUID.Zero)
|
||||
{
|
||||
InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId);
|
||||
if (destinationFolder == null)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist",
|
||||
client.Name, scene.Name, destinationFolderID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
IInventoryService invService = scene.InventoryService;
|
||||
|
||||
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||
@@ -331,9 +346,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
|
||||
item = invService.GetItem(item);
|
||||
InventoryFolderBase folder = null;
|
||||
UUID? previousParentFolderID = null;
|
||||
|
||||
if (item != null) // It's an item
|
||||
{
|
||||
previousParentFolderID = item.Folder;
|
||||
item.Folder = destinationFolderID;
|
||||
|
||||
invService.DeleteItems(item.Owner, new List<UUID>() { item.ID });
|
||||
@@ -346,10 +363,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
if (folder != null) // It's a folder
|
||||
{
|
||||
previousParentFolderID = folder.ParentID;
|
||||
folder.ParentID = destinationFolderID;
|
||||
invService.MoveFolder(folder);
|
||||
}
|
||||
}
|
||||
|
||||
// Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
|
||||
if (previousParentFolderID != null)
|
||||
{
|
||||
InventoryFolderBase previousParentFolder
|
||||
= new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
|
||||
previousParentFolder = invService.GetFolder(previousParentFolder);
|
||||
scene.SendInventoryUpdate(client, previousParentFolder, true, true);
|
||||
|
||||
scene.SendInventoryUpdate(client, destinationFolder, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (
|
||||
@@ -370,9 +399,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
|
||||
item = invService.GetItem(item);
|
||||
InventoryFolderBase folder = null;
|
||||
UUID? previousParentFolderID = null;
|
||||
|
||||
if (item != null && trashFolder != null)
|
||||
{
|
||||
previousParentFolderID = item.Folder;
|
||||
item.Folder = trashFolder.ID;
|
||||
|
||||
// Diva comment: can't we just update this item???
|
||||
@@ -388,6 +419,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
if (folder != null & trashFolder != null)
|
||||
{
|
||||
previousParentFolderID = folder.ParentID;
|
||||
folder.ParentID = trashFolder.ID;
|
||||
invService.MoveFolder(folder);
|
||||
client.SendBulkUpdateInventory(folder);
|
||||
@@ -408,6 +440,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
client.SendAgentAlertMessage("Unable to delete "+
|
||||
"received inventory" + reason, false);
|
||||
}
|
||||
// Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
|
||||
else if (previousParentFolderID != null)
|
||||
{
|
||||
InventoryFolderBase previousParentFolder
|
||||
= new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
|
||||
previousParentFolder = invService.GetFolder(previousParentFolder);
|
||||
scene.SendInventoryUpdate(client, previousParentFolder, true, true);
|
||||
|
||||
scene.SendInventoryUpdate(client, trashFolder, true, true);
|
||||
}
|
||||
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.RequestTeleport, false,
|
||||
message, sessionID, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
new Byte[0], true);
|
||||
m.RegionID = client.Scene.RegionInfo.RegionID.Guid;
|
||||
|
||||
m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message);
|
||||
|
||||
@@ -1028,6 +1028,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
Scene initiatingScene)
|
||||
{
|
||||
Thread.Sleep(10000);
|
||||
|
||||
IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
|
||||
if (im != null)
|
||||
{
|
||||
@@ -1040,11 +1041,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
(uint)(int)position.X,
|
||||
(uint)(int)position.Y,
|
||||
(uint)(int)position.Z);
|
||||
GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero,
|
||||
"Region", agent.UUID,
|
||||
(byte)InstantMessageDialog.GodLikeRequestTeleport, false,
|
||||
"", gotoLocation, false, new Vector3(127, 0, 0),
|
||||
new Byte[0]);
|
||||
|
||||
GridInstantMessage m
|
||||
= new GridInstantMessage(
|
||||
initiatingScene,
|
||||
UUID.Zero,
|
||||
"Region",
|
||||
agent.UUID,
|
||||
(byte)InstantMessageDialog.GodLikeRequestTeleport,
|
||||
false,
|
||||
"",
|
||||
gotoLocation,
|
||||
false,
|
||||
new Vector3(127, 0, 0),
|
||||
new Byte[0],
|
||||
false);
|
||||
|
||||
im.SendInstantMessage(m, delegate(bool success)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success);
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Reflection;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.ClientStack.LindenUDP;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
@@ -123,6 +123,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
"If --regex is specified then the name is treatead as a regular expression",
|
||||
HandleShowObjectByName);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Objects",
|
||||
false,
|
||||
"show object pos",
|
||||
"show object pos <start-coord> to <end-coord>",
|
||||
"Show details of scene objects within the given area.",
|
||||
"Each component of the coord is comma separated. There must be no spaces between the commas.\n"
|
||||
+ "If you don't care about the z component you can simply omit it.\n"
|
||||
+ "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n"
|
||||
+ "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n"
|
||||
+ "If you want to specify the minimum value of a component then you can use -~ instead of a number\n"
|
||||
+ "e.g.\n"
|
||||
+ "show object pos 20,20,20 to 40,40,40\n"
|
||||
+ "show object pos 20,20 to 40,40\n"
|
||||
+ "show object pos ,20,20 to ,40,40\n"
|
||||
+ "show object pos ,,30 to ,,~\n"
|
||||
+ "show object pos ,,-~ to ,,30",
|
||||
HandleShowObjectByPos);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Objects",
|
||||
false,
|
||||
@@ -138,6 +157,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
"Show details of scene object parts with the given name.",
|
||||
"If --regex is specified then the name is treatead as a regular expression",
|
||||
HandleShowPartByName);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Objects",
|
||||
false,
|
||||
"show part pos",
|
||||
"show part pos <start-coord> to <end-coord>",
|
||||
"Show details of scene object parts within the given area.",
|
||||
"Each component of the coord is comma separated. There must be no spaces between the commas.\n"
|
||||
+ "If you don't care about the z component you can simply omit it.\n"
|
||||
+ "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n"
|
||||
+ "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n"
|
||||
+ "If you want to specify the minimum value of a component then you can use -~ instead of a number\n"
|
||||
+ "e.g.\n"
|
||||
+ "show object pos 20,20,20 to 40,40,40\n"
|
||||
+ "show object pos 20,20 to 40,40\n"
|
||||
+ "show object pos ,20,20 to ,40,40\n"
|
||||
+ "show object pos ,,30 to ,,~\n"
|
||||
+ "show object pos ,,-~ to ,,30",
|
||||
HandleShowPartByPos);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
@@ -150,6 +188,43 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
private void OutputSogsToConsole(Predicate<SceneObjectGroup> searchPredicate)
|
||||
{
|
||||
List<SceneObjectGroup> sceneObjects = m_scene.GetSceneObjectGroups().FindAll(searchPredicate);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (SceneObjectGroup so in sceneObjects)
|
||||
{
|
||||
AddSceneObjectReport(sb, so);
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
sb.AppendFormat("{0} object(s) found in {1}\n", sceneObjects.Count, m_scene.Name);
|
||||
|
||||
m_console.OutputFormat(sb.ToString());
|
||||
}
|
||||
|
||||
private void OutputSopsToConsole(Predicate<SceneObjectPart> searchPredicate)
|
||||
{
|
||||
List<SceneObjectGroup> sceneObjects = m_scene.GetSceneObjectGroups();
|
||||
List<SceneObjectPart> parts = new List<SceneObjectPart>();
|
||||
|
||||
sceneObjects.ForEach(so => parts.AddRange(Array.FindAll<SceneObjectPart>(so.Parts, searchPredicate)));
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (SceneObjectPart part in parts)
|
||||
{
|
||||
AddScenePartReport(sb, part);
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
sb.AppendFormat("{0} parts found in {1}\n", parts.Count, m_scene.Name);
|
||||
|
||||
m_console.OutputFormat(sb.ToString());
|
||||
}
|
||||
|
||||
private void HandleShowObjectByUuid(string module, string[] cmd)
|
||||
{
|
||||
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
|
||||
@@ -200,36 +275,54 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
|
||||
string name = mainParams[3];
|
||||
|
||||
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
|
||||
Action<SceneObjectGroup> searchAction;
|
||||
Predicate<SceneObjectGroup> searchPredicate;
|
||||
|
||||
if (useRegex)
|
||||
{
|
||||
Regex nameRegex = new Regex(name);
|
||||
searchAction = so => { if (nameRegex.IsMatch(so.Name)) { sceneObjects.Add(so); }};
|
||||
searchPredicate = so => nameRegex.IsMatch(so.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchAction = so => { if (so.Name == name) { sceneObjects.Add(so); }};
|
||||
searchPredicate = so => so.Name == name;
|
||||
}
|
||||
|
||||
m_scene.ForEachSOG(searchAction);
|
||||
OutputSogsToConsole(searchPredicate);
|
||||
}
|
||||
|
||||
if (sceneObjects.Count == 0)
|
||||
private void HandleShowObjectByPos(string module, string[] cmdparams)
|
||||
{
|
||||
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
|
||||
return;
|
||||
|
||||
if (cmdparams.Length < 5)
|
||||
{
|
||||
m_console.OutputFormat("No objects with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
|
||||
m_console.OutputFormat("Usage: show object pos <start-coord> to <end-coord>");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string rawConsoleStartVector = cmdparams[3];
|
||||
Vector3 startVector;
|
||||
|
||||
foreach (SceneObjectGroup so in sceneObjects)
|
||||
if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
|
||||
{
|
||||
AddSceneObjectReport(sb, so);
|
||||
sb.Append("\n");
|
||||
m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector);
|
||||
return;
|
||||
}
|
||||
|
||||
m_console.OutputFormat(sb.ToString());
|
||||
string rawConsoleEndVector = cmdparams[5];
|
||||
Vector3 endVector;
|
||||
|
||||
if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
|
||||
{
|
||||
m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector);
|
||||
return;
|
||||
}
|
||||
|
||||
Predicate<SceneObjectGroup> searchPredicate
|
||||
= so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector);
|
||||
|
||||
OutputSogsToConsole(searchPredicate);
|
||||
}
|
||||
|
||||
private void HandleShowPartByUuid(string module, string[] cmd)
|
||||
@@ -264,6 +357,38 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
m_console.OutputFormat(sb.ToString());
|
||||
}
|
||||
|
||||
private void HandleShowPartByPos(string module, string[] cmdparams)
|
||||
{
|
||||
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
|
||||
return;
|
||||
|
||||
if (cmdparams.Length < 5)
|
||||
{
|
||||
m_console.OutputFormat("Usage: show part pos <start-coord> to <end-coord>");
|
||||
return;
|
||||
}
|
||||
|
||||
string rawConsoleStartVector = cmdparams[3];
|
||||
Vector3 startVector;
|
||||
|
||||
if (!ConsoleUtil.TryParseConsoleMinVector(rawConsoleStartVector, out startVector))
|
||||
{
|
||||
m_console.OutputFormat("Error: Start vector {0} does not have a valid format", rawConsoleStartVector);
|
||||
return;
|
||||
}
|
||||
|
||||
string rawConsoleEndVector = cmdparams[5];
|
||||
Vector3 endVector;
|
||||
|
||||
if (!ConsoleUtil.TryParseConsoleMaxVector(rawConsoleEndVector, out endVector))
|
||||
{
|
||||
m_console.OutputFormat("Error: End vector {0} does not have a valid format", rawConsoleEndVector);
|
||||
return;
|
||||
}
|
||||
|
||||
OutputSopsToConsole(sop => Util.IsInsideBox(sop.AbsolutePosition, startVector, endVector));
|
||||
}
|
||||
|
||||
private void HandleShowPartByName(string module, string[] cmdparams)
|
||||
{
|
||||
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
|
||||
@@ -282,37 +407,19 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
|
||||
string name = mainParams[3];
|
||||
|
||||
List<SceneObjectPart> parts = new List<SceneObjectPart>();
|
||||
|
||||
Action<SceneObjectGroup> searchAction;
|
||||
Predicate<SceneObjectPart> searchPredicate;
|
||||
|
||||
if (useRegex)
|
||||
{
|
||||
Regex nameRegex = new Regex(name);
|
||||
searchAction = so => so.ForEachPart(sop => { if (nameRegex.IsMatch(sop.Name)) { parts.Add(sop); } });
|
||||
searchPredicate = sop => nameRegex.IsMatch(sop.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchAction = so => so.ForEachPart(sop => { if (sop.Name == name) { parts.Add(sop); } });
|
||||
searchPredicate = sop => sop.Name == name;
|
||||
}
|
||||
|
||||
m_scene.ForEachSOG(searchAction);
|
||||
|
||||
if (parts.Count == 0)
|
||||
{
|
||||
m_console.OutputFormat("No parts with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (SceneObjectPart part in parts)
|
||||
{
|
||||
AddScenePartReport(sb, part);
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
m_console.OutputFormat(sb.ToString());
|
||||
OutputSopsToConsole(searchPredicate);
|
||||
}
|
||||
|
||||
private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so)
|
||||
|
||||
Reference in New Issue
Block a user