From 863195612bdef56165f2b4354bab280c371618b9 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Sep 2007 14:57:43 +0000 Subject: Reverting back to 2017 since 2018 were causing Linux breakage; reopening Tleiades patch 444 and 445. --- .../ClientStack/ClientView.ProcessPackets.cs | 5 +- OpenSim/Region/ClientStack/ClientView.cs | 1 + .../Communications/Local/CommunicationsLocal.cs | 2 +- .../Communications/Local/LocalInventoryService.cs | 3 +- .../Communications/Local/LocalLoginService.cs | 51 +++++++++++++++- .../Communications/Local/LocalUserServices.cs | 5 +- .../Communications/OGS1/CommunicationsOGS1.cs | 2 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 20 +------ .../Communications/OGS1/OGS1InventoryService.cs | 69 ++++------------------ OpenSim/Region/Environment/Modules/ChatModule.cs | 4 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 6 +- 11 files changed, 76 insertions(+), 92 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index b35a9d3..e526f73 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -30,6 +30,7 @@ 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; @@ -352,7 +353,7 @@ namespace OpenSim.Region.ClientStack // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated()); if (OnAssetUploadRequest != null) { - OnAssetUploadRequest(this, LLUUID.Combine(request.AssetBlock.TransactionID, this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); + OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal); } break; case PacketType.RequestXfer: @@ -417,7 +418,7 @@ namespace OpenSim.Region.ClientStack { if (update.InventoryData[i].TransactionID != LLUUID.Zero) { - OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, LLUUID.Combine(update.InventoryData[i].TransactionID, this.SecureSessionID), update.InventoryData[i].ItemID); + OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, update.InventoryData[i].TransactionID.Combine(this.SecureSessionID), update.InventoryData[i].ItemID); } } } diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index ecf78cb..2489739 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -37,6 +37,7 @@ 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; diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 7e08297..a00b35f 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.Local } else { - this.m_inventoryService.CreateNewUserInventory(LLUUID.Zero, userProf.UUID); + this.m_inventoryService.CreateNewUserInventory(userProf.UUID); Console.WriteLine("Created new inventory set for " + firstName + " " + lastName); return userProf.UUID; } diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs index 5bd3277..53f6ffa 100644 --- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs +++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs @@ -3,7 +3,6 @@ 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 { @@ -50,7 +49,7 @@ namespace OpenSim.Region.Communications.Local } } - public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) + public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) { this.AddFolder(folder); } diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 95fdf5a..ab8e397 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -7,6 +7,7 @@ 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 { @@ -24,7 +25,7 @@ namespace OpenSim.Region.Communications.Local public event LoginToRegionEvent OnLoginToRegion; public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate) - : base(userManager, parent.InventoryService, welcomeMess) + : base(userManager, welcomeMess) { m_Parent = parent; this.serversInfo = serversInfo; @@ -52,7 +53,7 @@ namespace OpenSim.Region.Communications.Local profile = this.m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { - m_Parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); + m_Parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; @@ -122,5 +123,51 @@ namespace OpenSim.Region.Communications.Local } } + + protected override InventoryData CreateInventoryData(LLUUID userID) + { + List 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); + } + } } } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 61b8633..3bc4301 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -1,5 +1,4 @@ using System; -using libsecondlife; using OpenSim.Framework.Communications; using OpenSim.Framework.Data; using OpenSim.Framework.Types; @@ -49,10 +48,10 @@ namespace OpenSim.Region.Communications.Local } else { - m_parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID); + m_parent.InventoryService.CreateNewUserInventory(profile.UUID); } return profile; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 1aa6498..96f1933 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs @@ -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); } } } diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 0b78c83..1b4b54c 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -5,7 +5,6 @@ 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; @@ -303,23 +302,8 @@ namespace OpenSim.Region.Communications.OGS1 /// private void StartRemoting() { - // 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); - } + TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort); + ChannelServices.RegisterChannel(ch, true); WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); RemotingConfiguration.RegisterWellKnownServiceType(wellType); diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 2ec4d10..45188c1 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs @@ -1,15 +1,8 @@ -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 OpenSim.Framework.Types; +using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder; namespace OpenSim.Region.Communications.OGS1 @@ -17,83 +10,43 @@ namespace OpenSim.Region.Communications.OGS1 public class OGS1InventoryService : IInventoryServices { - IUserServices _userServices; - IInventoryServices _inventoryServices; - - public OGS1InventoryService(NetworkServersInfo networkConfig, IUserServices userServices) : - this(networkConfig.InventoryServerName, networkConfig.InventoryServerPort, userServices) - { - } - - public OGS1InventoryService(string serverName, int serverPort, IUserServices userServices) + public OGS1InventoryService() { - _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, InventoryFolderBase folder) + public void AddNewInventoryFolder(LLUUID userID, InventoryFolder 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 List RequestFirstLevelFolders(LLUUID folderID) - { - return _inventoryServices.RequestFirstLevelFolders(folderID); + } - public List RequestFolderItems(LLUUID folderID) + public void CreateNewUserInventory(LLUUID user) { - return _inventoryServices.RequestFolderItems(folderID); + } - public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder) + public List RequestFirstLevelFolders(LLUUID userID) { - _inventoryServices.GetRootFoldersForUser(user, out libraryFolder, out personalFolder); + return new List(); } - public void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user) - { - throw new Exception("method not implemented"); - } #endregion } } diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index d76ffe3..1c7b806 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules avatar = m_scene.GetScenePresence(presence.ControllingClient.AgentId); if (avatar != null) { - dis = (int)LLVector3.Mag(avatar.AbsolutePosition-fromPos); + dis = (int) avatar.AbsolutePosition.GetDistanceTo(fromPos); } switch (type) @@ -211,4 +211,4 @@ namespace OpenSim.Region.Environment.Modules } } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 5b6fe46..e6b8364 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes } /// check for physics-related movement - else if (LLVector3.Dist(lastPhysPos,AbsolutePosition) > 0.02) + else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) { SendTerseUpdateToAllClients(); m_updateCount = 0; @@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Scenes protected void CheckForSignificantMovement() { - if (LLVector3.Dist(AbsolutePosition, posLastSignificantMove) > 2.0) + if (Helpers.VecDist(AbsolutePosition, posLastSignificantMove) > 2.0) { posLastSignificantMove = AbsolutePosition; if (OnSignificantClientMovement != null) @@ -919,4 +919,4 @@ namespace OpenSim.Region.Environment.Scenes RemoveFromPhysicalScene(); } } -} +} \ No newline at end of file -- cgit v1.1