Merge branch 'master' into careminster-presence-refactor
commit
686837d9ed
|
@ -3,19 +3,10 @@
|
||||||
<Import assembly="OpenSim.Data.dll" />
|
<Import assembly="OpenSim.Data.dll" />
|
||||||
<Import assembly="OpenSim.Framework.dll" />
|
<Import assembly="OpenSim.Framework.dll" />
|
||||||
</Runtime>
|
</Runtime>
|
||||||
<ExtensionPoint path = "/OpenSim/GridData">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IGridDataPlugin" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path = "/OpenSim/LogData">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
<ExtensionPoint path = "/OpenSim/AssetData">
|
<ExtensionPoint path = "/OpenSim/AssetData">
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
<ExtensionPoint path = "/OpenSim/InventoryData">
|
<ExtensionPoint path = "/OpenSim/InventoryData">
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" />
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" />
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
<ExtensionPoint path = "/OpenSim/UserData">
|
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin" />
|
|
||||||
</ExtensionPoint>
|
|
||||||
</Addin>
|
</Addin>
|
||||||
|
|
|
@ -93,37 +93,37 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public List<InventoryNodeBase> Execute()
|
public List<InventoryNodeBase> Execute()
|
||||||
{
|
{
|
||||||
string filePath = "ERROR";
|
|
||||||
int successfulAssetRestores = 0;
|
|
||||||
int failedAssetRestores = 0;
|
|
||||||
int successfulItemRestores = 0;
|
|
||||||
|
|
||||||
List<InventoryNodeBase> loadedNodes = new List<InventoryNodeBase>();
|
|
||||||
|
|
||||||
List<InventoryFolderBase> folderCandidates
|
|
||||||
= InventoryArchiveUtils.FindFolderByPath(
|
|
||||||
m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath);
|
|
||||||
|
|
||||||
if (folderCandidates.Count == 0)
|
|
||||||
{
|
|
||||||
// Possibly provide an option later on to automatically create this folder if it does not exist
|
|
||||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath);
|
|
||||||
|
|
||||||
return loadedNodes;
|
|
||||||
}
|
|
||||||
|
|
||||||
InventoryFolderBase rootDestinationFolder = folderCandidates[0];
|
|
||||||
archive = new TarArchiveReader(m_loadStream);
|
|
||||||
|
|
||||||
// In order to load identically named folders, we need to keep track of the folders that we have already
|
|
||||||
// resolved
|
|
||||||
Dictionary <string, InventoryFolderBase> resolvedFolders = new Dictionary<string, InventoryFolderBase>();
|
|
||||||
|
|
||||||
byte[] data;
|
|
||||||
TarArchiveReader.TarEntryType entryType;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
string filePath = "ERROR";
|
||||||
|
int successfulAssetRestores = 0;
|
||||||
|
int failedAssetRestores = 0;
|
||||||
|
int successfulItemRestores = 0;
|
||||||
|
|
||||||
|
List<InventoryNodeBase> loadedNodes = new List<InventoryNodeBase>();
|
||||||
|
|
||||||
|
List<InventoryFolderBase> folderCandidates
|
||||||
|
= InventoryArchiveUtils.FindFolderByPath(
|
||||||
|
m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath);
|
||||||
|
|
||||||
|
if (folderCandidates.Count == 0)
|
||||||
|
{
|
||||||
|
// Possibly provide an option later on to automatically create this folder if it does not exist
|
||||||
|
m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath);
|
||||||
|
|
||||||
|
return loadedNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
InventoryFolderBase rootDestinationFolder = folderCandidates[0];
|
||||||
|
archive = new TarArchiveReader(m_loadStream);
|
||||||
|
|
||||||
|
// In order to load identically named folders, we need to keep track of the folders that we have already
|
||||||
|
// resolved
|
||||||
|
Dictionary <string, InventoryFolderBase> resolvedFolders = new Dictionary<string, InventoryFolderBase>();
|
||||||
|
|
||||||
|
byte[] data;
|
||||||
|
TarArchiveReader.TarEntryType entryType;
|
||||||
|
|
||||||
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
||||||
{
|
{
|
||||||
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
||||||
|
@ -166,18 +166,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
archive.Close();
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
|
||||||
|
successfulAssetRestores, failedAssetRestores);
|
||||||
|
m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores);
|
||||||
|
|
||||||
|
return loadedNodes;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
archive.Close();
|
m_loadStream.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat(
|
|
||||||
"[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures",
|
|
||||||
successfulAssetRestores, failedAssetRestores);
|
|
||||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores);
|
|
||||||
|
|
||||||
return loadedNodes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
|
@ -247,7 +249,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
ref string archivePath,
|
ref string archivePath,
|
||||||
Dictionary <string, InventoryFolderBase> resolvedFolders)
|
Dictionary <string, InventoryFolderBase> resolvedFolders)
|
||||||
{
|
{
|
||||||
string originalArchivePath = archivePath;
|
// string originalArchivePath = archivePath;
|
||||||
|
|
||||||
InventoryFolderBase destFolder = null;
|
InventoryFolderBase destFolder = null;
|
||||||
|
|
||||||
|
|
|
@ -119,22 +119,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids)
|
||||||
{
|
{
|
||||||
Exception reportedException = null;
|
Exception reportedException = null;
|
||||||
bool succeeded = true;
|
bool succeeded = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// We're almost done. Just need to write out the control file now
|
// We're almost done. Just need to write out the control file now
|
||||||
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
|
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
|
||||||
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
|
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
|
||||||
|
|
||||||
m_archiveWriter.Close();
|
m_archiveWriter.Close();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_saveStream.Close();
|
|
||||||
reportedException = e;
|
reportedException = e;
|
||||||
succeeded = false;
|
succeeded = false;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
m_saveStream.Close();
|
||||||
|
}
|
||||||
|
|
||||||
m_module.TriggerInventoryArchiveSaved(
|
m_module.TriggerInventoryArchiveSaved(
|
||||||
m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException);
|
m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException);
|
||||||
|
@ -213,70 +215,68 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Execute()
|
public void Execute()
|
||||||
{
|
{
|
||||||
InventoryFolderBase inventoryFolder = null;
|
|
||||||
InventoryItemBase inventoryItem = null;
|
|
||||||
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
|
|
||||||
|
|
||||||
bool foundStar = false;
|
|
||||||
|
|
||||||
// Eliminate double slashes and any leading / on the path.
|
|
||||||
string[] components
|
|
||||||
= m_invPath.Split(
|
|
||||||
new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
|
|
||||||
int maxComponentIndex = components.Length - 1;
|
|
||||||
|
|
||||||
// If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the
|
|
||||||
// folder itself. This may get more sophisicated later on
|
|
||||||
if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD)
|
|
||||||
{
|
|
||||||
foundStar = true;
|
|
||||||
maxComponentIndex--;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_invPath = String.Empty;
|
|
||||||
for (int i = 0; i <= maxComponentIndex; i++)
|
|
||||||
{
|
|
||||||
m_invPath += components[i] + InventoryFolderImpl.PATH_DELIMITER;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Annoyingly Split actually returns the original string if the input string consists only of delimiters
|
|
||||||
// Therefore if we still start with a / after the split, then we need the root folder
|
|
||||||
if (m_invPath.Length == 0)
|
|
||||||
{
|
|
||||||
inventoryFolder = rootFolder;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER));
|
|
||||||
List<InventoryFolderBase> candidateFolders
|
|
||||||
= InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
|
||||||
if (candidateFolders.Count > 0)
|
|
||||||
inventoryFolder = candidateFolders[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// The path may point to an item instead
|
|
||||||
if (inventoryFolder == null)
|
|
||||||
{
|
|
||||||
inventoryItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
|
||||||
//inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null == inventoryFolder && null == inventoryItem)
|
|
||||||
{
|
|
||||||
// We couldn't find the path indicated
|
|
||||||
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
|
|
||||||
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage);
|
|
||||||
m_module.TriggerInventoryArchiveSaved(
|
|
||||||
m_id, false, m_userInfo, m_invPath, m_saveStream,
|
|
||||||
new Exception(errorMessage));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
InventoryFolderBase inventoryFolder = null;
|
||||||
|
InventoryItemBase inventoryItem = null;
|
||||||
|
InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
|
||||||
|
|
||||||
|
bool foundStar = false;
|
||||||
|
|
||||||
|
// Eliminate double slashes and any leading / on the path.
|
||||||
|
string[] components
|
||||||
|
= m_invPath.Split(
|
||||||
|
new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
int maxComponentIndex = components.Length - 1;
|
||||||
|
|
||||||
|
// If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the
|
||||||
|
// folder itself. This may get more sophisicated later on
|
||||||
|
if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD)
|
||||||
|
{
|
||||||
|
foundStar = true;
|
||||||
|
maxComponentIndex--;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_invPath = String.Empty;
|
||||||
|
for (int i = 0; i <= maxComponentIndex; i++)
|
||||||
|
{
|
||||||
|
m_invPath += components[i] + InventoryFolderImpl.PATH_DELIMITER;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Annoyingly Split actually returns the original string if the input string consists only of delimiters
|
||||||
|
// Therefore if we still start with a / after the split, then we need the root folder
|
||||||
|
if (m_invPath.Length == 0)
|
||||||
|
{
|
||||||
|
inventoryFolder = rootFolder;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER));
|
||||||
|
List<InventoryFolderBase> candidateFolders
|
||||||
|
= InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
||||||
|
if (candidateFolders.Count > 0)
|
||||||
|
inventoryFolder = candidateFolders[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// The path may point to an item instead
|
||||||
|
if (inventoryFolder == null)
|
||||||
|
{
|
||||||
|
inventoryItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, rootFolder, m_invPath);
|
||||||
|
//inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null == inventoryFolder && null == inventoryItem)
|
||||||
|
{
|
||||||
|
// We couldn't find the path indicated
|
||||||
|
string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath);
|
||||||
|
Exception e = new InventoryArchiverException(errorMessage);
|
||||||
|
m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
||||||
|
|
||||||
if (inventoryFolder != null)
|
if (inventoryFolder != null)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
@ -297,16 +297,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
|
||||||
// Don't put all this profile information into the archive right now.
|
// Don't put all this profile information into the archive right now.
|
||||||
//SaveUsers();
|
//SaveUsers();
|
||||||
|
|
||||||
|
new AssetsRequest(
|
||||||
|
new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
m_archiveWriter.Close();
|
m_saveStream.Close();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
new AssetsRequest(
|
|
||||||
new AssetsArchiver(m_archiveWriter), m_assetUuids,
|
|
||||||
m_scene.AssetService, ReceivedAllAssets).Execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSimulator Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Signals an inventory archiving problem
|
||||||
|
/// </summary>
|
||||||
|
public class InventoryArchiverException : Exception
|
||||||
|
{
|
||||||
|
public InventoryArchiverException(string message) : base(message) {}
|
||||||
|
public InventoryArchiverException(string message, Exception e) : base(message, e) {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -322,34 +322,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
/// <param name="cmdparams"></param>
|
/// <param name="cmdparams"></param>
|
||||||
protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams)
|
protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
try
|
||||||
|
{
|
||||||
Dictionary<string, object> options = new Dictionary<string, object>();
|
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||||
OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
|
|
||||||
|
Dictionary<string, object> options = new Dictionary<string, object>();
|
||||||
List<string> mainParams = optionSet.Parse(cmdparams);
|
OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
|
||||||
|
|
||||||
if (mainParams.Count < 6)
|
List<string> mainParams = optionSet.Parse(cmdparams);
|
||||||
{
|
|
||||||
m_log.Error(
|
if (mainParams.Count < 6)
|
||||||
"[INVENTORY ARCHIVER]: usage is load iar <first name> <last name> <inventory path> <user password> [<load file path>]");
|
{
|
||||||
return;
|
m_log.Error(
|
||||||
}
|
"[INVENTORY ARCHIVER]: usage is load iar <first name> <last name> <inventory path> <user password> [<load file path>]");
|
||||||
|
return;
|
||||||
string firstName = mainParams[2];
|
}
|
||||||
string lastName = mainParams[3];
|
|
||||||
string invPath = mainParams[4];
|
string firstName = mainParams[2];
|
||||||
string pass = mainParams[5];
|
string lastName = mainParams[3];
|
||||||
string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
string invPath = mainParams[4];
|
||||||
|
string pass = mainParams[5];
|
||||||
m_log.InfoFormat(
|
string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
||||||
"[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}",
|
|
||||||
loadPath, invPath, firstName, lastName);
|
|
||||||
|
|
||||||
if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options))
|
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}",
|
"[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}",
|
||||||
loadPath, firstName, lastName);
|
loadPath, invPath, firstName, lastName);
|
||||||
|
|
||||||
|
if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options))
|
||||||
|
m_log.InfoFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}",
|
||||||
|
loadPath, firstName, lastName);
|
||||||
|
}
|
||||||
|
catch (InventoryArchiverException e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -358,30 +365,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||||
/// <param name="cmdparams"></param>
|
/// <param name="cmdparams"></param>
|
||||||
protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
|
protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
if (cmdparams.Length < 6)
|
|
||||||
{
|
|
||||||
m_log.Error(
|
|
||||||
"[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
|
||||||
|
|
||||||
string firstName = cmdparams[2];
|
|
||||||
string lastName = cmdparams[3];
|
|
||||||
string invPath = cmdparams[4];
|
|
||||||
string pass = cmdparams[5];
|
|
||||||
string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
|
||||||
|
|
||||||
m_log.InfoFormat(
|
|
||||||
"[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
|
|
||||||
savePath, invPath, firstName, lastName);
|
|
||||||
|
|
||||||
Guid id = Guid.NewGuid();
|
Guid id = Guid.NewGuid();
|
||||||
ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>());
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (cmdparams.Length < 6)
|
||||||
|
{
|
||||||
|
m_log.Error(
|
||||||
|
"[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||||
|
|
||||||
|
string firstName = cmdparams[2];
|
||||||
|
string lastName = cmdparams[3];
|
||||||
|
string invPath = cmdparams[4];
|
||||||
|
string pass = cmdparams[5];
|
||||||
|
string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
|
||||||
|
|
||||||
|
m_log.InfoFormat(
|
||||||
|
"[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
|
||||||
|
savePath, invPath, firstName, lastName);
|
||||||
|
|
||||||
|
ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>());
|
||||||
|
}
|
||||||
|
catch (InventoryArchiverException e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
lock (m_pendingConsoleSaves)
|
lock (m_pendingConsoleSaves)
|
||||||
m_pendingConsoleSaves.Add(id);
|
m_pendingConsoleSaves.Add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveInvConsoleCommandCompleted(
|
private void SaveInvConsoleCommandCompleted(
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
List<TaskInventoryItem> items = GetInventoryItems();
|
||||||
foreach (TaskInventoryItem item in items)
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
if (ownerId != item.OwnerID)
|
if (ownerId != item.OwnerID)
|
||||||
|
@ -207,10 +207,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
foreach (TaskInventoryItem item in items)
|
foreach (TaskInventoryItem item in items)
|
||||||
{
|
{
|
||||||
if ((int)InventoryType.LSL == item.InvType)
|
if ((int)InventoryType.LSL == item.InvType)
|
||||||
{
|
|
||||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||||
Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,8 +253,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_part.RemoveScriptEvents(item.ItemID);
|
m_part.RemoveScriptEvents(item.ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -270,7 +265,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_log.InfoFormat(
|
// m_log.InfoFormat(
|
||||||
// "[PRIM INVENTORY]: " +
|
// "[PRIM INVENTORY]: " +
|
||||||
// "Starting script {0}, {1} in prim {2}, {3}",
|
// "Starting script {0}, {1} in prim {2}, {3}",
|
||||||
// item.Name, item.ItemID, m_part.Name, m_part.UUID);
|
// item.Name, item.ItemID, Name, UUID);
|
||||||
|
|
||||||
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||||
{
|
{
|
||||||
|
@ -558,7 +553,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if the inventory holds an item with a given name.
|
/// Check if the inventory holds an item with a given name.
|
||||||
/// This method assumes that the task inventory is already locked.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
@ -663,7 +657,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
else
|
else
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
|
|
||||||
|
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
//m_inventorySerial += 2;
|
//m_inventorySerial += 2;
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
|
@ -754,7 +747,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// changed since permissions were last set.
|
// changed since permissions were last set.
|
||||||
if (item.GroupPermissions != (uint)PermissionMask.None)
|
if (item.GroupPermissions != (uint)PermissionMask.None)
|
||||||
item.GroupID = m_part.GroupID;
|
item.GroupID = m_part.GroupID;
|
||||||
|
|
||||||
if (item.AssetID == UUID.Zero)
|
if (item.AssetID == UUID.Zero)
|
||||||
{
|
{
|
||||||
item.AssetID = m_items[item.ItemID].AssetID;
|
item.AssetID = m_items[item.ItemID].AssetID;
|
||||||
|
@ -1114,6 +1107,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<TaskInventoryItem> GetInventoryItems()
|
||||||
|
{
|
||||||
|
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
|
||||||
|
|
||||||
|
lock (m_items)
|
||||||
|
ret = new List<TaskInventoryItem>(m_items.Values);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TaskInventoryItem> GetInventoryScripts()
|
||||||
|
{
|
||||||
|
List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
|
||||||
|
|
||||||
|
lock (m_items)
|
||||||
|
{
|
||||||
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
|
if (item.InvType == (int)InventoryType.LSL)
|
||||||
|
ret.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public Dictionary<UUID, string> GetScriptStates()
|
public Dictionary<UUID, string> GetScriptStates()
|
||||||
{
|
{
|
||||||
|
@ -1181,10 +1198,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
engine.ResumeScript(item.ItemID);
|
engine.ResumeScript(item.ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Items.LockItemsForRead(false);
|
Items.LockItemsForRead(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6134,6 +6134,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
PSYS_PART_MAX_AGE = 7,
|
PSYS_PART_MAX_AGE = 7,
|
||||||
PSYS_SRC_ACCEL = 8,
|
PSYS_SRC_ACCEL = 8,
|
||||||
PSYS_SRC_PATTERN = 9,
|
PSYS_SRC_PATTERN = 9,
|
||||||
|
PSYS_SRC_INNERANGLE = 10,
|
||||||
|
PSYS_SRC_OUTERANGLE = 11,
|
||||||
PSYS_SRC_TEXTURE = 12,
|
PSYS_SRC_TEXTURE = 12,
|
||||||
PSYS_SRC_BURST_RATE = 13,
|
PSYS_SRC_BURST_RATE = 13,
|
||||||
PSYS_SRC_BURST_PART_COUNT = 15,
|
PSYS_SRC_BURST_PART_COUNT = 15,
|
||||||
|
@ -6266,6 +6268,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
|
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
|
||||||
|
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
|
||||||
|
// client tells the difference between the two by looking at the 0x02 bit in
|
||||||
|
// the PartFlags variable.
|
||||||
|
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
|
||||||
|
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||||
|
prules.InnerAngle = (float)tempf;
|
||||||
|
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
|
||||||
|
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||||
|
prules.OuterAngle = (float)tempf;
|
||||||
|
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
|
||||||
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
|
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
|
||||||
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
|
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
|
||||||
break;
|
break;
|
||||||
|
@ -6322,11 +6340,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
|
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
|
||||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||||
prules.InnerAngle = (float)tempf;
|
prules.InnerAngle = (float)tempf;
|
||||||
|
prules.PartFlags |= 0x02; // Set new angle format.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
|
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
|
||||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||||
prules.OuterAngle = (float)tempf;
|
prules.OuterAngle = (float)tempf;
|
||||||
|
prules.PartFlags |= 0x02; // Set new angle format.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
|
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
|
||||||
|
|
|
@ -769,8 +769,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ScriptInstance instance = null;
|
ScriptInstance instance = null;
|
||||||
// Create the object record
|
// Create the object record
|
||||||
lockScriptsForRead(true);
|
lockScriptsForRead(true);
|
||||||
|
@ -952,7 +950,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
|
|
||||||
CleanAssemblies();
|
CleanAssemblies();
|
||||||
|
|
||||||
|
|
||||||
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
|
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
|
||||||
if (handlerScriptRemoved != null)
|
if (handlerScriptRemoved != null)
|
||||||
handlerScriptRemoved(itemID);
|
handlerScriptRemoved(itemID);
|
||||||
|
@ -1086,26 +1083,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
public bool PostObjectEvent(uint localID, EventParams p)
|
public bool PostObjectEvent(uint localID, EventParams p)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
List<UUID> uuids = null;
|
||||||
|
|
||||||
lock (m_PrimObjects)
|
lock (m_PrimObjects)
|
||||||
{
|
{
|
||||||
if (!m_PrimObjects.ContainsKey(localID))
|
if (!m_PrimObjects.ContainsKey(localID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
uuids = m_PrimObjects[localID];
|
||||||
foreach (UUID itemID in m_PrimObjects[localID])
|
}
|
||||||
|
|
||||||
|
foreach (UUID itemID in uuids)
|
||||||
|
{
|
||||||
|
IScriptInstance instance = null;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (m_Scripts.ContainsKey(itemID))
|
if (m_Scripts.ContainsKey(itemID))
|
||||||
{
|
instance = m_Scripts[itemID];
|
||||||
IScriptInstance instance = m_Scripts[itemID];
|
}
|
||||||
if (instance != null)
|
catch { /* ignore race conditions */ }
|
||||||
{
|
|
||||||
instance.PostEvent(p);
|
if (instance != null)
|
||||||
result = true;
|
{
|
||||||
}
|
instance.PostEvent(p);
|
||||||
}
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
;;
|
;;
|
||||||
|
|
||||||
[Startup]
|
[Startup]
|
||||||
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8003/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
|
||||||
|
|
||||||
; * This is common for all services, it's the network setup for the entire
|
; * This is common for all services, it's the network setup for the entire
|
||||||
; * server instance, if none if specified above
|
; * server instance, if none if specified above
|
||||||
|
|
Loading…
Reference in New Issue