* Tleiades grid mode inventory (#444) - thanx Tleiades!

* updated to rev 1413 on libsecondlife.dll and libsecondlife.dll.config (#423)
This commit is contained in:
lbsa71
2007-09-27 13:25:45 +00:00
parent 569ba9eb9a
commit 8143c597fc
37 changed files with 1040 additions and 439 deletions

View File

@@ -30,7 +30,6 @@ using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Interfaces;
@@ -353,7 +352,7 @@ namespace OpenSim.Region.ClientStack
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated());
if (OnAssetUploadRequest != null)
{
OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
OnAssetUploadRequest(this, LLUUID.Combine(request.AssetBlock.TransactionID, this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
}
break;
case PacketType.RequestXfer:
@@ -418,7 +417,7 @@ namespace OpenSim.Region.ClientStack
{
if (update.InventoryData[i].TransactionID != LLUUID.Zero)
{
OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, update.InventoryData[i].TransactionID.Combine(this.SecureSessionID), update.InventoryData[i].ItemID);
OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, LLUUID.Combine(update.InventoryData[i].TransactionID, this.SecureSessionID), update.InventoryData[i].ItemID);
}
}
}

View File

@@ -37,7 +37,6 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using Timer = System.Timers.Timer;

View File

@@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.Local
}
else
{
this.m_inventoryService.CreateNewUserInventory(userProf.UUID);
this.m_inventoryService.CreateNewUserInventory(LLUUID.Zero, userProf.UUID);
Console.WriteLine("Created new inventory set for " + firstName + " " + lastName);
return userProf.UUID;
}

View File

@@ -3,6 +3,7 @@ using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Region.Communications.Local
{
@@ -49,7 +50,7 @@ namespace OpenSim.Region.Communications.Local
}
}
public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
this.AddFolder(folder);
}

View File

@@ -7,7 +7,6 @@ using OpenSim.Framework.Data;
using OpenSim.Framework.Types;
using OpenSim.Framework.UserManagement;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Inventory;
namespace OpenSim.Region.Communications.Local
{
@@ -25,7 +24,7 @@ namespace OpenSim.Region.Communications.Local
public event LoginToRegionEvent OnLoginToRegion;
public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
: base(userManager, welcomeMess)
: base(userManager, parent.InventoryService, welcomeMess)
{
m_Parent = parent;
this.serversInfo = serversInfo;
@@ -53,7 +52,7 @@ namespace OpenSim.Region.Communications.Local
profile = this.m_userManager.GetUserProfile(firstname, lastname);
if (profile != null)
{
m_Parent.InventoryService.CreateNewUserInventory(profile.UUID);
m_Parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID);
}
return profile;
@@ -123,51 +122,5 @@ namespace OpenSim.Region.Communications.Local
}
}
protected override InventoryData CreateInventoryData(LLUUID userID)
{
List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID);
if (folders.Count > 0)
{
LLUUID rootID = LLUUID.Zero;
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders)
{
if (InvFolder.parentID == LLUUID.Zero)
{
rootID = InvFolder.folderID;
}
TempHash = new Hashtable();
TempHash["name"] = InvFolder.name;
TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.version;
TempHash["type_default"] = (Int32)InvFolder.type;
TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
return new InventoryData(AgentInventoryArray, rootID);
}
else
{
AgentInventory userInventory = new AgentInventory();
userInventory.CreateRootFolder(userID, false);
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
foreach (OpenSim.Framework.Inventory.InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
{
TempHash = new Hashtable();
TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
}
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
using OpenSim.Framework.Types;
@@ -48,10 +49,10 @@ namespace OpenSim.Region.Communications.Local
}
else
{
m_parent.InventoryService.CreateNewUserInventory(profile.UUID);
m_parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID);
}
return profile;
}
}
}
}

View File

@@ -14,8 +14,8 @@ namespace OpenSim.Region.Communications.OGS1
m_gridService = gridInterComms;
m_interRegion = gridInterComms;
m_inventoryService = new OGS1InventoryService();
m_userService = new OGS1UserServices(this);
m_inventoryService = new OGS1InventoryService(serversInfo, m_userService);
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Net;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;
using libsecondlife;
using Nwc.XmlRpc;
using OpenSim.Framework;
@@ -302,8 +303,23 @@ namespace OpenSim.Region.Communications.OGS1
/// </summary>
private void StartRemoting()
{
TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort);
ChannelServices.RegisterChannel(ch, true);
// we only need to register the tcp channel once, and we don't know which other modules use remoting
if (ChannelServices.GetChannel("tcp") == null)
{
// Creating a custom formatter for a TcpChannel sink chain.
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
IDictionary props = new Hashtable();
props["port"] = this.serversInfo.RemotingListenerPort;
props["typeFilterLevel"] = TypeFilterLevel.Full;
TcpChannel ch = new TcpChannel(props, clientProvider, serverProvider);
ChannelServices.RegisterChannel(ch, true);
}
WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(wellType);

View File

@@ -1,8 +1,15 @@
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
using OpenSim.Framework.Types;
namespace OpenSim.Region.Communications.OGS1
@@ -10,43 +17,83 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InventoryService : IInventoryServices
{
public OGS1InventoryService()
IUserServices _userServices;
IInventoryServices _inventoryServices;
public OGS1InventoryService(NetworkServersInfo networkConfig, IUserServices userServices) :
this(networkConfig.InventoryServerName, networkConfig.InventoryServerPort, userServices)
{
}
public OGS1InventoryService(string serverName, int serverPort, IUserServices userServices)
{
_userServices = userServices;
// we only need to register the tcp channel once, and we don't know which other modules use remoting
if (ChannelServices.GetChannel("tcp") == null)
{
// Creating a custom formatter for a TcpChannel sink chain.
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
IDictionary props = new Hashtable();
props["typeFilterLevel"] = TypeFilterLevel.Full;
// Pass the properties for the port setting and the server provider in the server chain argument. (Client remains null here.)
TcpChannel chan = new TcpChannel(props, clientProvider, serverProvider);
ChannelServices.RegisterChannel(chan, true);
}
string remotingUrl = string.Format("tcp://{0}:{1}/Inventory", serverName, serverPort);
_inventoryServices = (IInventoryServices)Activator.GetObject(typeof(IInventoryServices), remotingUrl);
}
#region IInventoryServices Members
public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
{
_inventoryServices.RequestInventoryForUser(userID, folderCallBack, itemCallBack);
}
public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
_inventoryServices.AddNewInventoryFolder(userID, folder);
}
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
{
_inventoryServices.AddNewInventoryItem(userID, item);
}
public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
_inventoryServices.DeleteInventoryItem(userID, item);
}
public void CreateNewUserInventory(LLUUID user)
public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID folderID)
{
return _inventoryServices.RequestFirstLevelFolders(folderID);
}
public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
public List<InventoryItemBase> RequestFolderItems(LLUUID folderID)
{
return new List<InventoryFolderBase>();
return _inventoryServices.RequestFolderItems(folderID);
}
public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder)
{
_inventoryServices.GetRootFoldersForUser(user, out libraryFolder, out personalFolder);
}
public void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user)
{
throw new Exception("method not implemented");
}
#endregion
}
}

View File

@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules
avatar = m_scene.GetScenePresence(presence.ControllingClient.AgentId);
if (avatar != null)
{
dis = (int) avatar.AbsolutePosition.GetDistanceTo(fromPos);
dis = (int)LLVector3.Mag(avatar.AbsolutePosition-fromPos);
}
switch (type)
@@ -211,4 +211,4 @@ namespace OpenSim.Region.Environment.Modules
}
}
}
}
}

View File

@@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes
}
/// check for physics-related movement
else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02)
else if (LLVector3.Dist(lastPhysPos,AbsolutePosition) > 0.02)
{
SendTerseUpdateToAllClients();
m_updateCount = 0;
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Scenes
protected void CheckForSignificantMovement()
{
if (Helpers.VecDist(AbsolutePosition, posLastSignificantMove) > 2.0)
if (LLVector3.Dist(AbsolutePosition, posLastSignificantMove) > 2.0)
{
posLastSignificantMove = AbsolutePosition;
if (OnSignificantClientMovement != null)
@@ -919,4 +919,4 @@ namespace OpenSim.Region.Environment.Scenes
RemoveFromPhysicalScene();
}
}
}
}