Start of inventory items, when you upload a texture the data will now be stored in the inventory database and you will still have that texture in inventory on later logins (Again only in standalone mode with authentication.)
Also there might be some problems if you upload textures in other regions to the start one (due to us not updating the CAPS url properly).afrisby
parent
09e1f5f22e
commit
181a90967e
|
@ -128,7 +128,7 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
}
|
||||
if (this.OnUpLoad != null)
|
||||
{
|
||||
this.OnUpLoad(this.m_assetName, this.newAssetID, inventoryItemID, data);
|
||||
this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
}
|
||||
if (this.OnUpLoad != null)
|
||||
{
|
||||
this.OnUpLoad(this.m_assetName, this.newAssetID, inventoryItemID, data);
|
||||
this.OnUpLoad(this.m_assetName, "description", this.newAssetID, inventoryItemID, LLUUID.Zero, data);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -40,10 +40,16 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
{
|
||||
public class CachedUserInfo
|
||||
{
|
||||
private CommunicationsManager m_parentCommsManager;
|
||||
// Fields
|
||||
public InventoryFolder RootFolder = null;
|
||||
public UserProfileData UserProfile = null;
|
||||
|
||||
public CachedUserInfo(CommunicationsManager commsManager)
|
||||
{
|
||||
m_parentCommsManager = commsManager;
|
||||
}
|
||||
|
||||
// Methods
|
||||
public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
|
||||
{
|
||||
|
@ -73,6 +79,7 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
|
||||
public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo)
|
||||
{
|
||||
Console.WriteLine("received new inventory item " + itemInfo.inventoryID + " with asset id of " + itemInfo.assetID);
|
||||
if ((userID == this.UserProfile.UUID) && (this.RootFolder != null))
|
||||
{
|
||||
if (itemInfo.parentFolderID == this.RootFolder.folderID)
|
||||
|
@ -84,11 +91,23 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
InventoryFolder folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID);
|
||||
if (folder != null)
|
||||
{
|
||||
folder.Items.Add(itemInfo.inventoryID, itemInfo);
|
||||
folder.Items.Add(itemInfo.inventoryID, itemInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddItem(LLUUID userID, InventoryItemBase itemInfo)
|
||||
{
|
||||
if ((userID == this.UserProfile.UUID) && (this.RootFolder != null))
|
||||
{
|
||||
this.ItemReceive(userID, itemInfo);
|
||||
Console.WriteLine("now adding inventory item to database");
|
||||
this.m_parentCommsManager.InventoryServer.AddNewInventoryItem(userID, itemInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Framework.Communications.Caches
|
|||
{
|
||||
if (!this.UserProfiles.ContainsKey(userID))
|
||||
{
|
||||
CachedUserInfo userInfo = new CachedUserInfo();
|
||||
CachedUserInfo userInfo = new CachedUserInfo(this.m_parent);
|
||||
userInfo.UserProfile = this.RequestUserProfileForUser(userID);
|
||||
if (userInfo.UserProfile != null)
|
||||
{
|
||||
|
|
|
@ -35,10 +35,12 @@ using OpenSim.Framework.Servers;
|
|||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Communications.Caches;
|
||||
using OpenSim.Framework.Data;
|
||||
|
||||
namespace OpenSim.Region.Capabilities
|
||||
{
|
||||
public delegate void UpLoadedTexture(string assetName, LLUUID assetID, LLUUID inventoryItem, byte[] data);
|
||||
public delegate void UpLoadedTexture(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data);
|
||||
public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
|
||||
public class Caps
|
||||
{
|
||||
|
@ -56,6 +58,7 @@ namespace OpenSim.Region.Capabilities
|
|||
private AssetCache assetCache;
|
||||
private int eventQueueCount = 1;
|
||||
private Queue<string> CapsEventQueue = new Queue<string>();
|
||||
public NewInventoryItem AddNewInventoryItem = null;
|
||||
|
||||
public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent)
|
||||
{
|
||||
|
@ -122,7 +125,7 @@ namespace OpenSim.Region.Capabilities
|
|||
string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath;
|
||||
caps.MapLayer = capsBaseUrl + m_mapLayerPath;
|
||||
caps.NewFileAgentInventory = capsBaseUrl + m_newInventory;
|
||||
caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath;
|
||||
// caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath;
|
||||
return caps;
|
||||
}
|
||||
|
||||
|
@ -242,7 +245,7 @@ namespace OpenSim.Region.Capabilities
|
|||
LLUUID newInvItem = LLUUID.Random();
|
||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||
|
||||
AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener);
|
||||
AssetUploader uploader = new AssetUploader(assetName, "description", newAsset, newInvItem, LLUUID.Zero, "", "", capsBase + uploaderPath, this.httpListener);
|
||||
httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath;
|
||||
|
||||
|
@ -261,13 +264,16 @@ namespace OpenSim.Region.Capabilities
|
|||
public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest)
|
||||
{
|
||||
// Console.WriteLine("asset upload request via CAPS");
|
||||
|
||||
string assetName = llsdRequest.name;
|
||||
string assetDes = llsdRequest.description;
|
||||
string capsBase = "/CAPS/" + m_capsObjectPath;
|
||||
LLUUID newAsset = LLUUID.Random();
|
||||
LLUUID newInvItem = LLUUID.Random();
|
||||
LLUUID parentFolder = llsdRequest.folder_id;
|
||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||
|
||||
AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener);
|
||||
AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, "" , "", capsBase + uploaderPath, this.httpListener);
|
||||
httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath;
|
||||
|
||||
|
@ -284,7 +290,7 @@ namespace OpenSim.Region.Capabilities
|
|||
/// <param name="assetID"></param>
|
||||
/// <param name="inventoryItem"></param>
|
||||
/// <param name="data"></param>
|
||||
public void UploadCompleteHandler(string assetName, LLUUID assetID, LLUUID inventoryItem, byte[] data)
|
||||
public void UploadCompleteHandler(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data)
|
||||
{
|
||||
AssetBase asset;
|
||||
asset = new AssetBase();
|
||||
|
@ -294,6 +300,25 @@ namespace OpenSim.Region.Capabilities
|
|||
asset.Name = assetName;
|
||||
asset.Data = data;
|
||||
this.assetCache.AddAsset(asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
item.avatarID = agentID;
|
||||
item.creatorsID = agentID;
|
||||
item.inventoryID = inventoryItem;
|
||||
item.assetID = asset.FullID;
|
||||
item.inventoryDescription = assetDescription;
|
||||
item.inventoryName = assetName;
|
||||
item.assetType = 0;
|
||||
item.invType = 0;
|
||||
item.parentFolderID = parentFolder;
|
||||
item.inventoryCurrentPermissions = 2147483647;
|
||||
item.inventoryNextPermissions = 2147483647;
|
||||
|
||||
if (AddNewInventoryItem != null)
|
||||
{
|
||||
AddNewInventoryItem(agentID, item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class AssetUploader
|
||||
|
@ -303,9 +328,11 @@ namespace OpenSim.Region.Capabilities
|
|||
private string uploaderPath = "";
|
||||
private LLUUID newAssetID;
|
||||
private LLUUID inventoryItemID;
|
||||
private LLUUID parentFolder;
|
||||
private BaseHttpServer httpListener;
|
||||
private bool SaveAssets = false;
|
||||
private string m_assetName = "";
|
||||
private string m_assetDes = "";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -314,13 +341,15 @@ namespace OpenSim.Region.Capabilities
|
|||
/// <param name="inventoryItem"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="httpServer"></param>
|
||||
public AssetUploader(string assetName, LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer)
|
||||
public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer)
|
||||
{
|
||||
m_assetName = assetName;
|
||||
m_assetDes = description;
|
||||
newAssetID = assetID;
|
||||
inventoryItemID = inventoryItem;
|
||||
uploaderPath = path;
|
||||
httpListener = httpServer;
|
||||
parentFolder = parentFolderID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -348,7 +377,7 @@ namespace OpenSim.Region.Capabilities
|
|||
|
||||
if (OnUpLoad != null)
|
||||
{
|
||||
OnUpLoad(m_assetName, newAssetID, inv, data);
|
||||
OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -15,5 +15,6 @@ namespace OpenSim.Framework.Communications
|
|||
{
|
||||
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
|
||||
void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
|
||||
void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
data.Add("inventoryCurrentPermissions", DbType.Int32);
|
||||
data.Add("inventoryBasePermissions", DbType.Int32);
|
||||
data.Add("inventoryEveryOnePermissions", DbType.Int32);
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -219,6 +219,44 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
row["version"] = folder.version;
|
||||
}
|
||||
|
||||
public InventoryItemBase BuildItem(DataRow row)
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
item.inventoryID = new LLUUID((string)row["UUID"]);
|
||||
item.assetID = new LLUUID((string)row["assetID"]);
|
||||
item.assetType = Convert.ToInt32(row["assetType"]);
|
||||
item.invType = Convert.ToInt32(row["invType"]);
|
||||
item.parentFolderID = new LLUUID((string)row["parentFolderID"]);
|
||||
item.avatarID = new LLUUID((string)row["avatarID"]);
|
||||
item.creatorsID = new LLUUID((string)row["creatorsID"]);
|
||||
item.inventoryName =(string) row["inventoryName"];
|
||||
item.inventoryDescription = (string) row["inventoryDescription"];
|
||||
|
||||
item.inventoryNextPermissions = Convert.ToUInt32(row["inventoryNextPermissions"]);
|
||||
item.inventoryCurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]);
|
||||
item.inventoryBasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]);
|
||||
item.inventoryEveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]);
|
||||
return item;
|
||||
}
|
||||
|
||||
private void fillItemRow(DataRow row, InventoryItemBase item)
|
||||
{
|
||||
row["UUID"] = item.inventoryID;
|
||||
row["assetID"] = item.assetID;
|
||||
row["assetType"] = item.assetType;
|
||||
row["invType"] = item.invType;
|
||||
row["parentFolderID"] = item.parentFolderID;
|
||||
row["avatarID"] = item.avatarID;
|
||||
row["creatorsID"] = item.creatorsID;
|
||||
row["inventoryName"] = item.inventoryName;
|
||||
row["inventoryDescription"] = item.inventoryDescription;
|
||||
|
||||
row["inventoryNextPermissions"] = item.inventoryNextPermissions;
|
||||
row["inventoryCurrentPermissions"] = item.inventoryCurrentPermissions;
|
||||
row["inventoryBasePermissions"] = item.inventoryBasePermissions;
|
||||
row["inventoryEveryOnePermissions"] = item.inventoryEveryOnePermissions;
|
||||
}
|
||||
|
||||
private void addFolder(InventoryFolderBase folder)
|
||||
{
|
||||
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
|
||||
|
@ -238,6 +276,24 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
this.invFoldersDa.Update(ds, "inventoryfolders");
|
||||
}
|
||||
|
||||
private void addItem(InventoryItemBase item)
|
||||
{
|
||||
DataTable inventoryItemTable = ds.Tables["inventoryitems"];
|
||||
|
||||
DataRow inventoryRow = inventoryItemTable.Rows.Find(item.inventoryID);
|
||||
if (inventoryRow == null)
|
||||
{
|
||||
inventoryRow = inventoryItemTable.NewRow();
|
||||
fillItemRow(inventoryRow, item);
|
||||
inventoryItemTable.Rows.Add(inventoryRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
fillItemRow(inventoryRow, item);
|
||||
}
|
||||
this.invItemsDa.Update(ds, "inventoryitems");
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
// TODO: DataSet commit
|
||||
|
@ -275,7 +331,16 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
/// <returns>A List of InventoryItemBase items</returns>
|
||||
public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID)
|
||||
{
|
||||
return null;
|
||||
List<InventoryItemBase> retval = new List<InventoryItemBase>();
|
||||
DataTable inventoryItemTable = ds.Tables["inventoryitems"];
|
||||
string selectExp = "parentFolderID = '" + folderID.ToString() + "'";
|
||||
DataRow[] rows = inventoryItemTable.Select(selectExp);
|
||||
foreach (DataRow row in rows)
|
||||
{
|
||||
retval.Add(BuildItem(row));
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -297,7 +362,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
{
|
||||
List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
|
||||
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
|
||||
string selectExp = "agentID = '"+ user.ToString()+"' AND parentID = '"+ LLUUID.Zero.ToString()+"'";
|
||||
string selectExp = "agentID = '" + user.ToString() + "' AND parentID = '" + LLUUID.Zero.ToString() + "'";
|
||||
DataRow[] rows = inventoryFolderTable.Select(selectExp);
|
||||
foreach (DataRow row in rows)
|
||||
{
|
||||
|
@ -339,7 +404,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
{
|
||||
folders.Add(this.buildFolder(row));
|
||||
}
|
||||
// System.Console.WriteLine("found " + folders.Count + " inventory folders");
|
||||
// System.Console.WriteLine("found " + folders.Count + " inventory folders");
|
||||
return folders;
|
||||
}
|
||||
|
||||
|
@ -369,6 +434,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
/// <param name="item">The item to be created</param>
|
||||
public void addInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
this.addItem(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -377,6 +443,7 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
/// <param name="item">The updated item</param>
|
||||
public void updateInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
this.addItem(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -116,6 +116,14 @@ namespace OpenSim.Framework.InventoryServiceBase
|
|||
}
|
||||
}
|
||||
|
||||
public void AddItem(InventoryItemBase item)
|
||||
{
|
||||
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
|
||||
{
|
||||
plugin.Value.addInventoryItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
@ -43,6 +43,12 @@ namespace OpenSim.Region.Communications.Local
|
|||
{
|
||||
InventoryFolder newfolder = new InventoryFolder(folder);
|
||||
folderCallBack(userID, newfolder);
|
||||
|
||||
List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID);
|
||||
foreach (InventoryItemBase item in items)
|
||||
{
|
||||
itemCallBack(userID, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,5 +58,10 @@ namespace OpenSim.Region.Communications.Local
|
|||
{
|
||||
this.AddFolder(folder);
|
||||
}
|
||||
|
||||
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
|
||||
{
|
||||
this.AddItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,5 +24,10 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -727,7 +727,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
item.inventoryCurrentPermissions = 2147483647;
|
||||
item.inventoryNextPermissions = nextOwnerMask;
|
||||
|
||||
userInfo.ItemReceive(remoteClient.AgentId, item);
|
||||
userInfo.AddItem(remoteClient.AgentId, item);
|
||||
remoteClient.SendInventoryItemUpdate(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,8 +41,9 @@ using OpenSim.Framework.Communications.Caches;
|
|||
using OpenSim.Region.Environment.LandManagement;
|
||||
using OpenSim.Region.Scripting;
|
||||
using OpenSim.Region.Terrain;
|
||||
using Caps=OpenSim.Region.Capabilities.Caps;
|
||||
using Timer=System.Timers.Timer;
|
||||
using OpenSim.Framework.Data;
|
||||
using Caps = OpenSim.Region.Capabilities.Caps;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
|
@ -205,7 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
phyScene.GetResults();
|
||||
}
|
||||
|
||||
List<EntityBase> moveEntities = new List<EntityBase>( Entities.Values );
|
||||
List<EntityBase> moveEntities = new List<EntityBase>(Entities.Values);
|
||||
|
||||
foreach (EntityBase entity in moveEntities)
|
||||
{
|
||||
|
@ -503,9 +504,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (obj is SceneObjectGroup)
|
||||
{
|
||||
if (((SceneObjectGroup) obj).LocalId == localID)
|
||||
if (((SceneObjectGroup)obj).LocalId == localID)
|
||||
{
|
||||
RemoveEntity((SceneObjectGroup) obj);
|
||||
RemoveEntity((SceneObjectGroup)obj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -607,8 +608,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
|
||||
|
||||
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
|
||||
|
||||
//client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
||||
|
||||
//client.OnCreateNewInventoryItem += CreateNewInventoryItem;
|
||||
client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder;
|
||||
client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents;
|
||||
client.OnRequestTaskInventory += RequestTaskInventory;
|
||||
|
@ -670,9 +671,9 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
presence.ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId);
|
||||
});
|
||||
{
|
||||
presence.ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId);
|
||||
});
|
||||
|
||||
lock (Avatars)
|
||||
{
|
||||
|
@ -689,7 +690,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
// TODO: Add the removal from physics ?
|
||||
|
||||
|
||||
// Remove client agent from profile, so new logins will work
|
||||
commsManager.UserServer.clearUserAgent(agentID);
|
||||
|
||||
|
@ -787,7 +788,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
((SceneObjectGroup) ent).SendFullUpdateToClient(client);
|
||||
((SceneObjectGroup)ent).SendFullUpdateToClient(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -825,6 +826,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
new Caps(assetCache, httpListener, m_regInfo.ExternalHostName, m_regInfo.ExternalEndPoint.Port,
|
||||
agent.CapsPath, agent.AgentID);
|
||||
cap.RegisterHandlers();
|
||||
cap.AddNewInventoryItem = this.AddInventoryItem;
|
||||
if (capsHandlers.ContainsKey(agent.AgentID))
|
||||
{
|
||||
MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
|
||||
|
@ -1009,7 +1011,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
string result = "";
|
||||
for (int i = pos; i < commandParams.Length; i++)
|
||||
{
|
||||
result += commandParams[i]+ " ";
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1020,25 +1022,45 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger)
|
||||
{
|
||||
ScriptEngines.Add(ScriptEngine);
|
||||
|
||||
ScriptEngine.InitializeEngine(this, m_logger);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public LLUUID ConvertLocalIDToFullID(uint localID)
|
||||
{
|
||||
bool hasPrim = false;
|
||||
foreach (EntityBase ent in Entities.Values)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||
if (hasPrim != false)
|
||||
{
|
||||
bool hasPrim = false;
|
||||
foreach (EntityBase ent in Entities.Values)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||
if (hasPrim != false)
|
||||
{
|
||||
return ((SceneObjectGroup)ent).GetPartsFullID(localID);
|
||||
}
|
||||
}
|
||||
}
|
||||
return LLUUID.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LLUUID.Zero;
|
||||
}
|
||||
|
||||
public void AddInventoryItem(LLUUID userID, InventoryItemBase item)
|
||||
{
|
||||
if(this.Avatars.ContainsKey(userID))
|
||||
{
|
||||
this.AddInventoryItem(this.Avatars[userID].ControllingClient, item);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
|
||||
{
|
||||
CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
|
||||
if (userInfo != null)
|
||||
{
|
||||
userInfo.AddItem(remoteClient.AgentId, item);
|
||||
remoteClient.SendInventoryItemUpdate(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue