mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
* Added prototypical AvatarFactory module interface to load avatar parameters
* Added dump_assets_to_file option to enable asset dumping for debug * normalized some namespaces * InventoryFolder renamed to InventoryFolderImpl to
This commit is contained in:
@@ -26,21 +26,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using libsecondlife;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Data;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Inventory;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Servers;
|
||||
|
||||
namespace OpenSim.Framework.UserManagement
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
public class CAPSService
|
||||
{
|
||||
@@ -63,4 +51,4 @@ namespace OpenSim.Framework.UserManagement
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,17 +36,19 @@ using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Data;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Caches
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
public class AssetTransactionManager
|
||||
{
|
||||
// Fields
|
||||
public CommunicationsManager CommsManager;
|
||||
public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>();
|
||||
private bool m_dumpAssetsToFile;
|
||||
|
||||
public AssetTransactionManager(CommunicationsManager commsManager)
|
||||
public AssetTransactionManager(CommunicationsManager commsManager, bool dumpAssetsToFile)
|
||||
{
|
||||
CommsManager = commsManager;
|
||||
m_dumpAssetsToFile = dumpAssetsToFile;
|
||||
}
|
||||
|
||||
// Methods
|
||||
@@ -54,7 +56,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
{
|
||||
if (!this.AgentTransactions.ContainsKey(userID))
|
||||
{
|
||||
AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this);
|
||||
AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
|
||||
this.AgentTransactions.Add(userID, transactions);
|
||||
return transactions;
|
||||
}
|
||||
@@ -82,7 +84,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
|
||||
public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal)
|
||||
{
|
||||
// Console.WriteLine("asset upload of " + assetID);
|
||||
// Console.WriteLine("asset upload of " + assetID);
|
||||
AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId);
|
||||
if (transactions != null)
|
||||
{
|
||||
@@ -103,6 +105,4 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Region.Capabilities;
|
||||
using OpenSim.Framework.Servers;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Caches
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
public class AgentAssetTransactions
|
||||
{
|
||||
@@ -49,12 +49,14 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
public LLUUID UserID;
|
||||
public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>();
|
||||
public AssetTransactionManager Manager;
|
||||
private bool m_dumpAssetsToFile;
|
||||
|
||||
// Methods
|
||||
public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager)
|
||||
public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager, bool dumpAssetsToFile)
|
||||
{
|
||||
this.UserID = agentID;
|
||||
Manager = manager;
|
||||
m_dumpAssetsToFile = dumpAssetsToFile;
|
||||
}
|
||||
|
||||
public AssetCapsUploader RequestCapsUploader()
|
||||
@@ -75,7 +77,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
{
|
||||
if (!this.XferUploaders.ContainsKey(transactionID))
|
||||
{
|
||||
AssetXferUploader uploader = new AssetXferUploader(this);
|
||||
AssetXferUploader uploader = new AssetXferUploader(this, m_dumpAssetsToFile);
|
||||
|
||||
this.XferUploaders.Add(transactionID, uploader);
|
||||
return uploader;
|
||||
@@ -122,14 +124,14 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
private string m_assetName = "";
|
||||
private LLUUID m_folderID;
|
||||
private LLUUID newAssetID;
|
||||
private bool SaveImages = false;
|
||||
private bool m_dumpImageToFile;
|
||||
private string uploaderPath = "";
|
||||
|
||||
// Events
|
||||
public event UpLoadedAsset OnUpLoad;
|
||||
|
||||
// Methods
|
||||
public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer)
|
||||
public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer, bool dumpImageToFile)
|
||||
{
|
||||
this.m_assetName = assetName;
|
||||
this.m_assetDescription = assetDescription;
|
||||
@@ -138,6 +140,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
this.inventoryItemID = inventoryItem;
|
||||
this.uploaderPath = path;
|
||||
this.httpListener = httpServer;
|
||||
m_dumpImageToFile = dumpImageToFile;
|
||||
}
|
||||
|
||||
private void SaveImageToFile(string filename, byte[] data)
|
||||
@@ -159,7 +162,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
complete.state = "complete";
|
||||
text = LLSDHelpers.SerialiseLLSDReply(complete);
|
||||
this.httpListener.RemoveStreamHandler("POST", this.uploaderPath);
|
||||
if (this.SaveImages)
|
||||
if (this.m_dumpImageToFile)
|
||||
{
|
||||
this.SaveImageToFile(this.m_assetName + ".jp2", data);
|
||||
}
|
||||
@@ -190,10 +193,12 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
private bool m_createItem = false;
|
||||
private AgentAssetTransactions m_userTransactions;
|
||||
private bool m_storeLocal;
|
||||
private bool m_dumpAssetToFile;
|
||||
|
||||
public AssetXferUploader(AgentAssetTransactions transactions)
|
||||
public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
|
||||
{
|
||||
this.m_userTransactions = transactions;
|
||||
m_dumpAssetToFile = dumpAssetToFile;
|
||||
}
|
||||
|
||||
// Methods
|
||||
@@ -278,9 +283,14 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset);
|
||||
}
|
||||
|
||||
// Console.WriteLine("upload complete "+ this.TransactionID);
|
||||
//SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
|
||||
// Console.WriteLine("upload complete "+ this.TransactionID);
|
||||
|
||||
if (m_dumpAssetToFile)
|
||||
{
|
||||
SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveAssetToFile(string filename, byte[] data)
|
||||
{
|
||||
FileStream fs = File.Create(filename);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Types;
|
||||
using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
@@ -35,7 +34,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
private readonly CommunicationsManager m_parentCommsManager;
|
||||
// Fields
|
||||
public InventoryFolder RootFolder = null;
|
||||
public InventoryFolderImpl RootFolder = null;
|
||||
public UserProfileData UserProfile = null;
|
||||
|
||||
public CachedUserInfo(CommunicationsManager commsManager)
|
||||
@@ -44,7 +43,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
|
||||
// Methods
|
||||
public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
|
||||
public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo)
|
||||
{
|
||||
if (userID == this.UserProfile.UUID)
|
||||
{
|
||||
@@ -61,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID);
|
||||
InventoryFolderImpl folder = this.RootFolder.HasSubFolder(folderInfo.parentID);
|
||||
if (folder != null)
|
||||
{
|
||||
folder.SubFolders.Add(folderInfo.folderID, folderInfo);
|
||||
@@ -80,7 +79,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID);
|
||||
InventoryFolderImpl folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID);
|
||||
if (folder != null)
|
||||
{
|
||||
folder.Items.Add(itemInfo.inventoryID, itemInfo);
|
||||
|
||||
@@ -35,15 +35,15 @@ using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Caches
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
public class InventoryFolder : InventoryFolderBase
|
||||
public class InventoryFolderImpl : InventoryFolderBase
|
||||
{
|
||||
// Fields
|
||||
public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
|
||||
public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>();
|
||||
public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
|
||||
|
||||
public InventoryFolder(InventoryFolderBase folderbase)
|
||||
public InventoryFolderImpl(InventoryFolderBase folderbase)
|
||||
{
|
||||
this.agentID = folderbase.agentID;
|
||||
this.folderID = folderbase.folderID;
|
||||
@@ -53,15 +53,15 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
this.version = folderbase.version;
|
||||
}
|
||||
|
||||
public InventoryFolder()
|
||||
public InventoryFolderImpl()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Methods
|
||||
public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
|
||||
public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
|
||||
{
|
||||
InventoryFolder subFold = new InventoryFolder();
|
||||
InventoryFolderImpl subFold = new InventoryFolderImpl();
|
||||
subFold.name = folderName;
|
||||
subFold.folderID = folderID;
|
||||
subFold.type = (short) type;
|
||||
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
{
|
||||
return this.Items[itemID];
|
||||
}
|
||||
foreach (InventoryFolder folder in this.SubFolders.Values)
|
||||
foreach (InventoryFolderImpl folder in this.SubFolders.Values)
|
||||
{
|
||||
base2 = folder.HasItem(itemID);
|
||||
if (base2 != null)
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
Items.Remove(itemID);
|
||||
return true;
|
||||
}
|
||||
foreach (InventoryFolder folder in this.SubFolders.Values)
|
||||
foreach (InventoryFolderImpl folder in this.SubFolders.Values)
|
||||
{
|
||||
found = folder.DeleteItem(itemID);
|
||||
if (found == true)
|
||||
@@ -109,16 +109,16 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
|
||||
|
||||
public InventoryFolder HasSubFolder(LLUUID folderID)
|
||||
public InventoryFolderImpl HasSubFolder(LLUUID folderID)
|
||||
{
|
||||
InventoryFolder returnFolder = null;
|
||||
InventoryFolderImpl returnFolder = null;
|
||||
if (this.SubFolders.ContainsKey(folderID))
|
||||
{
|
||||
returnFolder = this.SubFolders[folderID];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (InventoryFolder folder in this.SubFolders.Values)
|
||||
foreach (InventoryFolderImpl folder in this.SubFolders.Values)
|
||||
{
|
||||
returnFolder = folder.HasSubFolder(folderID);
|
||||
if (returnFolder != null)
|
||||
@@ -140,4 +140,4 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
return itemList;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,16 +35,16 @@ using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using Nini.Config;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Caches
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
/// <summary>
|
||||
/// Basically a hack to give us a Inventory library while we don't have a inventory server
|
||||
/// once the server is fully implemented then should read the data from that
|
||||
/// </summary>
|
||||
public class LibraryRootFolder : InventoryFolder
|
||||
public class LibraryRootFolder : Cache.InventoryFolderImpl
|
||||
{
|
||||
private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
|
||||
private InventoryFolder m_textureFolder;
|
||||
private Cache.InventoryFolderImpl m_textureFolder;
|
||||
|
||||
public LibraryRootFolder()
|
||||
{
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
this.type = (short)-1;
|
||||
this.version = (ushort)1;
|
||||
|
||||
InventoryFolder folderInfo = new InventoryFolder();
|
||||
Cache.InventoryFolderImpl folderInfo = new InventoryFolderImpl();
|
||||
folderInfo.agentID = libOwner;
|
||||
folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001");
|
||||
folderInfo.name = "Texture Library";
|
||||
@@ -242,4 +242,4 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
|
||||
namespace OpenSim.Framework.Communications.Caches
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
public class UserProfileCache
|
||||
{
|
||||
@@ -107,15 +107,15 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
|
||||
if (info.RootFolder.folderID == parentID)
|
||||
{
|
||||
InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
if (createdFolder != null)
|
||||
{
|
||||
this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
|
||||
}
|
||||
InventoryFolderImpl createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
if (createdFolder != null)
|
||||
{
|
||||
this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
|
||||
InventoryFolderImpl folder = info.RootFolder.HasSubFolder(parentID);
|
||||
if (folder != null)
|
||||
{
|
||||
folder.CreateNewSubFolder(folderID, folderName, folderType);
|
||||
@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
|
||||
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
|
||||
{
|
||||
InventoryFolder fold = null;
|
||||
InventoryFolderImpl fold = null;
|
||||
if (folderID == libraryRoot.folderID )
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
|
||||
@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryFolder folder = info.RootFolder.HasSubFolder(folderID);
|
||||
InventoryFolderImpl folder = info.RootFolder.HasSubFolder(folderID);
|
||||
if ((folder != null) && fetchItems)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems());
|
||||
@@ -185,7 +185,7 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
/// <param name="userID"></param>
|
||||
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
|
||||
{
|
||||
this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
|
||||
this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -223,5 +223,4 @@ namespace OpenSim.Framework.Communications.Caches
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,8 +61,9 @@ namespace OpenSim.Region.Capabilities
|
||||
private Queue<string> CapsEventQueue = new Queue<string>();
|
||||
public NewInventoryItem AddNewInventoryItem = null;
|
||||
public ItemUpdatedCallback ItemUpdatedCall = null;
|
||||
private bool m_dumpAssetsToFile;
|
||||
|
||||
public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent)
|
||||
public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent, bool dumpAssetsToFile)
|
||||
{
|
||||
assetCache = assetCach;
|
||||
m_capsObjectPath = capsPath;
|
||||
@@ -70,6 +71,7 @@ namespace OpenSim.Region.Capabilities
|
||||
m_httpListenerHostName = httpListen;
|
||||
m_httpListenPort = httpPort;
|
||||
agentID = agent;
|
||||
m_dumpAssetsToFile = dumpAssetsToFile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -250,7 +252,7 @@ namespace OpenSim.Region.Capabilities
|
||||
LLUUID newInvItem = llsdRequest.item_id;
|
||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||
|
||||
ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener);
|
||||
ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile );
|
||||
uploader.OnUpLoad += this.ItemUpdated;
|
||||
|
||||
httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
@@ -280,7 +282,7 @@ namespace OpenSim.Region.Capabilities
|
||||
LLUUID parentFolder = llsdRequest.folder_id;
|
||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||
|
||||
AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener);
|
||||
AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile);
|
||||
httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath;
|
||||
|
||||
@@ -360,21 +362,14 @@ namespace OpenSim.Region.Capabilities
|
||||
private LLUUID inventoryItemID;
|
||||
private LLUUID parentFolder;
|
||||
private BaseHttpServer httpListener;
|
||||
private bool SaveAssets = false;
|
||||
private bool m_dumpAssetsToFile;
|
||||
private string m_assetName = "";
|
||||
private string m_assetDes = "";
|
||||
|
||||
private string m_invType = "";
|
||||
private string m_assetType = "";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="inventoryItem"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="httpServer"></param>
|
||||
public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer)
|
||||
public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer, bool dumpAssetsToFile)
|
||||
{
|
||||
m_assetName = assetName;
|
||||
m_assetDes = description;
|
||||
@@ -385,7 +380,7 @@ namespace OpenSim.Region.Capabilities
|
||||
parentFolder = parentFolderID;
|
||||
m_assetType = assetType;
|
||||
m_invType = invType;
|
||||
|
||||
m_dumpAssetsToFile = dumpAssetsToFile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -408,8 +403,10 @@ namespace OpenSim.Region.Capabilities
|
||||
|
||||
httpListener.RemoveStreamHandler("POST", uploaderPath);
|
||||
|
||||
if(this.SaveAssets)
|
||||
if (this.m_dumpAssetsToFile)
|
||||
{
|
||||
this.SaveAssetToFile(m_assetName + ".jp2", data);
|
||||
}
|
||||
|
||||
if (OnUpLoad != null)
|
||||
{
|
||||
@@ -436,19 +433,12 @@ namespace OpenSim.Region.Capabilities
|
||||
private string uploaderPath = "";
|
||||
private LLUUID inventoryItemID;
|
||||
private BaseHttpServer httpListener;
|
||||
private bool SaveAssets = false;
|
||||
private bool m_dumpAssetToFile;
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="inventoryItem"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="httpServer"></param>
|
||||
public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer)
|
||||
public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer, bool dumpAssetToFile)
|
||||
{
|
||||
|
||||
m_dumpAssetToFile = dumpAssetToFile;
|
||||
|
||||
inventoryItemID = inventoryItem;
|
||||
uploaderPath = path;
|
||||
httpListener = httpServer;
|
||||
@@ -481,8 +471,10 @@ namespace OpenSim.Region.Capabilities
|
||||
|
||||
httpListener.RemoveStreamHandler("POST", uploaderPath);
|
||||
|
||||
if (this.SaveAssets)
|
||||
this.SaveAssetToFile("updateditem"+Util.RandomClass.Next(1,1000) + ".dat", data);
|
||||
if (this.m_dumpAssetToFile)
|
||||
{
|
||||
this.SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
using System;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Communications.Caches;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Types;
|
||||
@@ -87,12 +86,12 @@ namespace OpenSim.Framework.Communications
|
||||
get { return m_networkServersInfo; }
|
||||
}
|
||||
|
||||
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache)
|
||||
public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool dumpAssetsToFile)
|
||||
{
|
||||
m_networkServersInfo = serversInfo;
|
||||
m_assetCache = assetCache;
|
||||
m_userProfileCache = new UserProfileCache(this);
|
||||
m_transactionsManager = new AssetTransactionManager(this);
|
||||
m_transactionsManager = new AssetTransactionManager(this, dumpAssetsToFile );
|
||||
}
|
||||
|
||||
public void doCreate(string[] cmmdParams)
|
||||
|
||||
@@ -30,19 +30,18 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Communications.Caches;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Types;
|
||||
using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo);
|
||||
public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolderImpl folderInfo);
|
||||
public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo);
|
||||
|
||||
public interface IInventoryServices
|
||||
{
|
||||
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
||||
void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
|
||||
void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
|
||||
void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
void CreateNewUserInventory(LLUUID user);
|
||||
|
||||
@@ -31,9 +31,9 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Types;
|
||||
using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
|
||||
|
||||
namespace OpenSim.Framework.Communications
|
||||
{
|
||||
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications
|
||||
}
|
||||
|
||||
public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
||||
public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
|
||||
public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
|
||||
public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user