From 90bcfefe093889914523743ff10388c0b39fa7d9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 8 Dec 2010 19:37:35 -0800 Subject: Fixed previous compile error -- I haven't pushed the CreatorID in AssetBase yet... --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index ac2ad7a..a8da330 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps } else { - AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.CreatorID); + AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.Metadata.CreatorID); newTexture.Data = ConvertTextureData(texture, format); if (newTexture.Data.Length == 0) return false; // !!! Caller try another codec, please! -- cgit v1.1 From ab980fc9274d1abaf26061f8fa0395695071c4b2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 8 Dec 2010 19:47:05 -0800 Subject: Fixed wrong comment --- OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index a8da330..1f60e36 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -336,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps try { - // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data + // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data imgstream = new MemoryStream(); -- cgit v1.1 From baa8ddfd2640e5138e8f1287df17e07007d2a3ed Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 9 Dec 2010 08:28:21 -0800 Subject: Minor bug fixes. Hunting down mantis #5259 --- OpenSim/Services/GridService/HypergridLinker.cs | 4 +++- OpenSim/Services/HypergridService/UserAgentService.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index d5d0195..2184498 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -215,7 +215,9 @@ namespace OpenSim.Services.GridService public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) { - m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc); + m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}", + ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), + remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); reason = string.Empty; regInfo = new GridRegion(); diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 3519250..12dda48 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -101,7 +101,7 @@ namespace OpenSim.Services.HypergridService serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } - else if (!m_GridName.EndsWith("/")) + if (!m_GridName.EndsWith("/")) m_GridName = m_GridName + "/"; } } -- cgit v1.1 From cefdee8aaf365d0395b44176ff46e48e933bf1bf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 9 Dec 2010 16:52:37 -0800 Subject: Normalized ALL URLs with trailing /'s hopefully. Fixed show hyperlinks command. mantis #5259 --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 2 +- OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 2 +- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 1 + OpenSim/Services/GridService/HypergridLinker.cs | 2 +- OpenSim/Services/LLLoginService/LLLoginService.cs | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index fd28ba0..a3251aa 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1299,7 +1299,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer #region Agent Arrived public void AgentArrivedAtDestination(UUID id) { - //m_log.Debug(" >>> ReleaseAgent called <<< "); + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id); ResetFromTransit(id); } diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 0c41935..7ddcfa6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -104,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid return false; } - string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; + string uri = m_ServerURL + "homeagent/" + aCircuit.AgentID + "/"; Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index e2032d9..4e3cfa5 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -235,6 +235,7 @@ namespace OpenSim.Services.Connectors.Simulation m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); return null; } + // Add the input arguments args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 2184498..31c7b80 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -433,7 +433,7 @@ namespace OpenSim.Services.GridService MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), - "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); + r.Data["serverURI"].ToString())); } return; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 25d80bd..281b6e3 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -772,6 +772,8 @@ namespace OpenSim.Services.LLLoginService { aCircuit.ServiceURLs[kvp.Key] = kvp.Value; } + if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/")) + aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/"; } // New style: service keys start with SRV_; override the previous @@ -784,6 +786,9 @@ namespace OpenSim.Services.LLLoginService { string keyName = serviceKey.Replace("SRV_", ""); aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); + if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/")) + aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/"; + m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); } } -- cgit v1.1 From 3053f5ba7dd22a68099b8b1dc6b41f389b6e7183 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Dec 2010 03:08:31 +0000 Subject: minor: remove some compiler warnings --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 2 +- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 2 +- OpenSim/Services/Interfaces/IUserAccountService.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 3c58a7d..3343f60 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1845,7 +1845,7 @@ namespace OpenSim.Framework.Servers.HttpServer /// property in StartHttp() for the HttpListener public class HttpServerLogWriter : ILogWriter { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public void Write(object source, LogPrio priority, string message) { diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 3386e72..211a0a7 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing OSD decodedMeshOsd = new OSD(); byte[] meshBytes = new byte[physSize]; System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize); - byte[] decompressed = new byte[physSize * 5]; +// byte[] decompressed = new byte[physSize * 5]; try { using (MemoryStream inMs = new MemoryStream(meshBytes)) diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index e58eb89..4a7f3ad 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -375,7 +375,7 @@ namespace PrimMesher int coordsDown = rows.Count; int coordsAcross = rows[0].Count; - int lastColumn = coordsAcross - 1; +// int lastColumn = coordsAcross - 1; float widthUnit = 1.0f / (coordsAcross - 1); float heightUnit = 1.0f / (coordsDown - 1); diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index c580078..9c992e0 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces if (str != string.Empty) { string[] parts = str.Split(new char[] { ';' }); - Dictionary dic = new Dictionary(); +// Dictionary dic = new Dictionary(); foreach (string s in parts) { string[] parts2 = s.Split(new char[] { '*' }); -- cgit v1.1 From a918c8df97572e49eea7155099feea6e4f207264 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Dec 2010 03:46:16 +0000 Subject: fix the minimap sitting avatar location bug a sitting avatar should have it's offset position added to the scene object, not its absolute position --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 032c859..78e5da3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -215,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); if (sop != null) { - coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); + coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition); avatarUUIDs.Add(sp.UUID); } else -- cgit v1.1 From 6f37290f4ccf0d3e516edcc38406cffaf35bcaac Mon Sep 17 00:00:00 2001 From: Marck Date: Fri, 10 Dec 2010 17:48:45 +0100 Subject: Adjust hypergrid console commands to latest changes. --- OpenSim/Services/GridService/HypergridLinker.cs | 105 +++++++++--------------- 1 file changed, 41 insertions(+), 64 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 31c7b80..9863ba0 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; @@ -244,7 +245,9 @@ namespace OpenSim.Services.GridService GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); if (region != null) { - m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID); + m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", + regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize, + region.RegionName, region.RegionID); reason = "Coordinates are already in use"; return false; } @@ -273,7 +276,8 @@ namespace OpenSim.Services.GridService region = m_GridService.GetRegionByUUID(scopeID, regionID); if (region != null) { - m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); + m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", + region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); regInfo = region; return true; } @@ -425,15 +429,14 @@ namespace OpenSim.Services.GridService return; } - MainConsole.Instance.Output("Region Name Region UUID"); - MainConsole.Instance.Output("Location URI"); - MainConsole.Instance.Output("-------------------------------------------------------------------------------"); + MainConsole.Instance.Output("Region Name"); + MainConsole.Instance.Output("Location Region UUID"); + MainConsole.Instance.Output(new string('-', 72)); foreach (RegionData r in regions) { - MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", - r.RegionName, r.RegionID, - String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), - r.Data["serverURI"].ToString())); + MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n", + r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY, + r.posX / Constants.RegionSize, r.posY / Constants.RegionSize))); } return; } @@ -461,11 +464,14 @@ namespace OpenSim.Services.GridService xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; serverURI = cmdparams[2]; - if (cmdparams.Length == 4) - remoteName = cmdparams[3]; + if (cmdparams.Length > 3) + remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3); string reason = string.Empty; GridRegion regInfo; - TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason); + if (TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason)) + MainConsole.Instance.Output("Hyperlink established"); + else + MainConsole.Instance.Output("Failed to link region: " + reason); } private void RunHGCommand(string command, string[] cmdparams) @@ -490,18 +496,6 @@ namespace OpenSim.Services.GridService } else if (command.Equals("link-region")) { - if (cmdparams.Length > 0 && cmdparams.Length < 5) - { - RunLinkRegionCommand(cmdparams); - } - else - { - LinkRegionCmdUsage(); - } - return; - } - else if (command.Equals("link-region")) - { if (cmdparams.Length < 3) { if ((cmdparams.Length == 1) || (cmdparams.Length == 2)) @@ -516,40 +510,24 @@ namespace OpenSim.Services.GridService } //this should be the prefererred way of setting up hg links now - if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) { + if (cmdparams[2].StartsWith("http")) + { RunLinkRegionCommand(cmdparams); } else if (cmdparams[2].Contains(":")) { // New format - int xloc, yloc; - string mapName; - try - { - xloc = Convert.ToInt32(cmdparams[0]); - yloc = Convert.ToInt32(cmdparams[1]); - mapName = cmdparams[2]; - if (cmdparams.Length > 3) - for (int i = 3; i < cmdparams.Length; i++) - mapName += " " + cmdparams[i]; - - //m_log.Info(">> MapName: " + mapName); - } - catch (Exception e) + string[] parts = cmdparams[2].Split(':'); + if (parts.Length > 2) { - MainConsole.Instance.Output("[HGrid] Wrong format for link-region command: " + e.Message); - LinkRegionCmdUsage(); - return; + // Insert remote region name + ArrayList parameters = new ArrayList(cmdparams); + parameters.Insert(3, parts[2]); + cmdparams = (string[])parameters.ToArray(typeof(string)); } + cmdparams[2] = "http://" + parts[0] + ':' + parts[1]; - // Convert cell coordinates given by the user to meters - xloc = xloc * (int)Constants.RegionSize; - yloc = yloc * (int)Constants.RegionSize; - string reason = string.Empty; - if (TryLinkRegionToCoords(UUID.Zero, mapName, xloc, yloc, out reason) == null) - MainConsole.Instance.Output("Failed to link region: " + reason); - else - MainConsole.Instance.Output("Hyperlink established"); + RunLinkRegionCommand(cmdparams); } else { @@ -558,16 +536,12 @@ namespace OpenSim.Services.GridService int xloc, yloc; uint externalPort; string externalHostName; - string serverURI; try { xloc = Convert.ToInt32(cmdparams[0]); yloc = Convert.ToInt32(cmdparams[1]); externalPort = Convert.ToUInt32(cmdparams[3]); externalHostName = cmdparams[2]; - if ( cmdparams.Length == 4 ) { - - } //internalPort = Convert.ToUInt32(cmdparams[4]); //remotingPort = Convert.ToUInt32(cmdparams[5]); } @@ -584,27 +558,30 @@ namespace OpenSim.Services.GridService string reason = string.Empty; if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { - if (cmdparams.Length >= 5) - { - regInfo.RegionName = ""; - for (int i = 4; i < cmdparams.Length; i++) - regInfo.RegionName += cmdparams[i] + " "; - } + // What is this? The GridRegion instance will be discarded anyway, + // which effectively ignores any local name given with the command. + //if (cmdparams.Length >= 5) + //{ + // regInfo.RegionName = ""; + // for (int i = 4; i < cmdparams.Length; i++) + // regInfo.RegionName += cmdparams[i] + " "; + //} } } return; } else if (command.Equals("unlink-region")) { - if (cmdparams.Length < 1 || cmdparams.Length > 1) + if (cmdparams.Length < 1) { UnlinkRegionCmdUsage(); return; } - if (TryUnlinkRegion(cmdparams[0])) - MainConsole.Instance.Output("Successfully unlinked " + cmdparams[0]); + string region = string.Join(" ", cmdparams); + if (TryUnlinkRegion(region)) + MainConsole.Instance.Output("Successfully unlinked " + region); else - MainConsole.Instance.Output("Unable to unlink " + cmdparams[0] + ", region not found."); + MainConsole.Instance.Output("Unable to unlink " + region + ", region not found."); } } -- cgit v1.1 From f84905e2949d61239c8bff815f8061a9435c124c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Dec 2010 11:32:46 -0800 Subject: A stab at mantis #5256. Separate ScenePresence updates from SceneObject updates, and place them in different queues. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 278 +++++++++++---------- 1 file changed, 150 insertions(+), 128 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f125822..9398c28 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3553,111 +3553,116 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> objectUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> compressedUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseUpdateBlocks = new OpenSim.Framework.Lazy>(); + OpenSim.Framework.Lazy> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy>(); if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; - lock (m_entityUpdates.SyncRoot) + EntityUpdate update; + while (updatesThisCall < maxUpdates) { - EntityUpdate update; - while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) + lock (m_entityUpdates.SyncRoot) + { + if (!m_entityUpdates.TryDequeue(out update)) + break; + } + + if (update.Entity is SceneObjectPart) { - if (update.Entity is SceneObjectPart) + SceneObjectPart part = (SceneObjectPart)update.Entity; + + // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client + // will never receive an update after a prim kill. Even then, keeping the kill record may be a good + // safety measure. + // + // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update + // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs + // updates and kills on different threads with different scheduling strategies, hence this protection. + // + // This doesn't appear to apply to child prims - a client will happily ignore these updates + // after the root prim has been deleted. + if (m_killRecord.Contains(part.LocalId)) { - SceneObjectPart part = (SceneObjectPart)update.Entity; - - // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client - // will never receive an update after a prim kill. Even then, keeping the kill record may be a good - // safety measure. - // - // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update - // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs - // updates and kills on different threads with different scheduling strategies, hence this protection. - // - // This doesn't appear to apply to child prims - a client will happily ignore these updates - // after the root prim has been deleted. - if (m_killRecord.Contains(part.LocalId)) - { - // m_log.WarnFormat( - // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", - // part.LocalId, Name); - continue; - } + // m_log.WarnFormat( + // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", + // part.LocalId, Name); + continue; + } - if (part.ParentGroup.IsAttachment && m_disableFacelights) + if (part.ParentGroup.IsAttachment && m_disableFacelights) + { + if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && + part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) { - if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && - part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) - { - part.Shape.LightEntry = false; - } + part.Shape.LightEntry = false; } } + } - ++updatesThisCall; + ++updatesThisCall; - #region UpdateFlags to packet type conversion + #region UpdateFlags to packet type conversion - PrimUpdateFlags updateFlags = update.Flags; + PrimUpdateFlags updateFlags = update.Flags; - bool canUseCompressed = true; - bool canUseImproved = true; + bool canUseCompressed = true; + bool canUseImproved = true; - // Compressed object updates only make sense for LL primitives - if (!(update.Entity is SceneObjectPart)) + // Compressed object updates only make sense for LL primitives + if (!(update.Entity is SceneObjectPart)) + { + canUseCompressed = false; + } + + if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) + { + canUseCompressed = false; + canUseImproved = false; + } + else + { + if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || + updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || + updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) { canUseCompressed = false; } - if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) + if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || + updateFlags.HasFlag(PrimUpdateFlags.ParentID) || + updateFlags.HasFlag(PrimUpdateFlags.Scale) || + updateFlags.HasFlag(PrimUpdateFlags.PrimData) || + updateFlags.HasFlag(PrimUpdateFlags.Text) || + updateFlags.HasFlag(PrimUpdateFlags.NameValue) || + updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || + updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || + updateFlags.HasFlag(PrimUpdateFlags.Sound) || + updateFlags.HasFlag(PrimUpdateFlags.Particles) || + updateFlags.HasFlag(PrimUpdateFlags.Material) || + updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || + updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) { - canUseCompressed = false; canUseImproved = false; } - else - { - if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || - updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || - updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) - { - canUseCompressed = false; - } - - if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || - updateFlags.HasFlag(PrimUpdateFlags.ParentID) || - updateFlags.HasFlag(PrimUpdateFlags.Scale) || - updateFlags.HasFlag(PrimUpdateFlags.PrimData) || - updateFlags.HasFlag(PrimUpdateFlags.Text) || - updateFlags.HasFlag(PrimUpdateFlags.NameValue) || - updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || - updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || - updateFlags.HasFlag(PrimUpdateFlags.Sound) || - updateFlags.HasFlag(PrimUpdateFlags.Particles) || - updateFlags.HasFlag(PrimUpdateFlags.Material) || - updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || - updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) - { - canUseImproved = false; - } - } + } - #endregion UpdateFlags to packet type conversion + #endregion UpdateFlags to packet type conversion - #region Block Construction + #region Block Construction - // TODO: Remove this once we can build compressed updates - canUseCompressed = false; + // TODO: Remove this once we can build compressed updates + canUseCompressed = false; - if (!canUseImproved && !canUseCompressed) + if (!canUseImproved && !canUseCompressed) + { + if (update.Entity is ScenePresence) + { + objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); + } + else { - if (update.Entity is ScenePresence) - { - objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); - } - else - { // if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment) // { // SceneObjectPart sop = (SceneObjectPart)update.Entity; @@ -3686,71 +3691,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP // } // else // { - objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); + objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); // } - } - } - else if (!canUseImproved) - { - compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); } + } + else if (!canUseImproved) + { + compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); + } + else + { + if (update.Entity is ScenePresence) + terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); else - { terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); - } - - #endregion Block Construction } - #region Packet Sending - - const float TIME_DILATION = 1.0f; - ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - - if (objectUpdateBlocks.IsValueCreated) - { - List blocks = objectUpdateBlocks.Value; - - ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + #endregion Block Construction + } + + #region Packet Sending - if (compressedUpdateBlocks.IsValueCreated) - { - List blocks = compressedUpdateBlocks.Value; + const float TIME_DILATION = 1.0f; + ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); + + if (terseAgentUpdateBlocks.IsValueCreated) + { + List blocks = terseAgentUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.State, true); + } + + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } + + if (objectUpdateBlocks.IsValueCreated) + { + List blocks = objectUpdateBlocks.Value; - ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; + ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + OutPacket(packet, ThrottleOutPacketType.Task, true); + } - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; + if (compressedUpdateBlocks.IsValueCreated) + { + List blocks = compressedUpdateBlocks.Value; - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + OutPacket(packet, ThrottleOutPacketType.Task, true); } #endregion Packet Sending -- cgit v1.1 From d8fd9170764e54bdc16e693584191a95f7b298b6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Dec 2010 12:40:12 -0800 Subject: Revert "A stab at mantis #5256. Separate ScenePresence updates from SceneObject updates, and place them in different queues." This reverts commit f84905e2949d61239c8bff815f8061a9435c124c. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 278 ++++++++++----------- 1 file changed, 128 insertions(+), 150 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9398c28..f125822 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3553,116 +3553,111 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> objectUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> compressedUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseUpdateBlocks = new OpenSim.Framework.Lazy>(); - OpenSim.Framework.Lazy> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy>(); if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; - EntityUpdate update; - while (updatesThisCall < maxUpdates) + lock (m_entityUpdates.SyncRoot) { - lock (m_entityUpdates.SyncRoot) - { - if (!m_entityUpdates.TryDequeue(out update)) - break; - } - - if (update.Entity is SceneObjectPart) + EntityUpdate update; + while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) { - SceneObjectPart part = (SceneObjectPart)update.Entity; - - // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client - // will never receive an update after a prim kill. Even then, keeping the kill record may be a good - // safety measure. - // - // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update - // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs - // updates and kills on different threads with different scheduling strategies, hence this protection. - // - // This doesn't appear to apply to child prims - a client will happily ignore these updates - // after the root prim has been deleted. - if (m_killRecord.Contains(part.LocalId)) + if (update.Entity is SceneObjectPart) { - // m_log.WarnFormat( - // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", - // part.LocalId, Name); - continue; - } + SceneObjectPart part = (SceneObjectPart)update.Entity; + + // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client + // will never receive an update after a prim kill. Even then, keeping the kill record may be a good + // safety measure. + // + // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update + // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs + // updates and kills on different threads with different scheduling strategies, hence this protection. + // + // This doesn't appear to apply to child prims - a client will happily ignore these updates + // after the root prim has been deleted. + if (m_killRecord.Contains(part.LocalId)) + { + // m_log.WarnFormat( + // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", + // part.LocalId, Name); + continue; + } - if (part.ParentGroup.IsAttachment && m_disableFacelights) - { - if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && - part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) + if (part.ParentGroup.IsAttachment && m_disableFacelights) { - part.Shape.LightEntry = false; + if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && + part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) + { + part.Shape.LightEntry = false; + } } } - } - ++updatesThisCall; + ++updatesThisCall; - #region UpdateFlags to packet type conversion + #region UpdateFlags to packet type conversion - PrimUpdateFlags updateFlags = update.Flags; + PrimUpdateFlags updateFlags = update.Flags; - bool canUseCompressed = true; - bool canUseImproved = true; + bool canUseCompressed = true; + bool canUseImproved = true; - // Compressed object updates only make sense for LL primitives - if (!(update.Entity is SceneObjectPart)) - { - canUseCompressed = false; - } - - if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) - { - canUseCompressed = false; - canUseImproved = false; - } - else - { - if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || - updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || - updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) + // Compressed object updates only make sense for LL primitives + if (!(update.Entity is SceneObjectPart)) { canUseCompressed = false; } - if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || - updateFlags.HasFlag(PrimUpdateFlags.ParentID) || - updateFlags.HasFlag(PrimUpdateFlags.Scale) || - updateFlags.HasFlag(PrimUpdateFlags.PrimData) || - updateFlags.HasFlag(PrimUpdateFlags.Text) || - updateFlags.HasFlag(PrimUpdateFlags.NameValue) || - updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || - updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || - updateFlags.HasFlag(PrimUpdateFlags.Sound) || - updateFlags.HasFlag(PrimUpdateFlags.Particles) || - updateFlags.HasFlag(PrimUpdateFlags.Material) || - updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || - updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) + if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) { + canUseCompressed = false; canUseImproved = false; } - } + else + { + if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || + updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || + updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) + { + canUseCompressed = false; + } + + if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || + updateFlags.HasFlag(PrimUpdateFlags.ParentID) || + updateFlags.HasFlag(PrimUpdateFlags.Scale) || + updateFlags.HasFlag(PrimUpdateFlags.PrimData) || + updateFlags.HasFlag(PrimUpdateFlags.Text) || + updateFlags.HasFlag(PrimUpdateFlags.NameValue) || + updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || + updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || + updateFlags.HasFlag(PrimUpdateFlags.Sound) || + updateFlags.HasFlag(PrimUpdateFlags.Particles) || + updateFlags.HasFlag(PrimUpdateFlags.Material) || + updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || + updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) + { + canUseImproved = false; + } + } - #endregion UpdateFlags to packet type conversion + #endregion UpdateFlags to packet type conversion - #region Block Construction + #region Block Construction - // TODO: Remove this once we can build compressed updates - canUseCompressed = false; + // TODO: Remove this once we can build compressed updates + canUseCompressed = false; - if (!canUseImproved && !canUseCompressed) - { - if (update.Entity is ScenePresence) - { - objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); - } - else + if (!canUseImproved && !canUseCompressed) { + if (update.Entity is ScenePresence) + { + objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); + } + else + { // if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment) // { // SceneObjectPart sop = (SceneObjectPart)update.Entity; @@ -3691,88 +3686,71 @@ namespace OpenSim.Region.ClientStack.LindenUDP // } // else // { - objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); + objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); // } + } + } + else if (!canUseImproved) + { + compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); } - } - else if (!canUseImproved) - { - compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); - } - else - { - if (update.Entity is ScenePresence) - terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); else + { terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); - } + } - #endregion Block Construction - } + #endregion Block Construction + } - #region Packet Sending + #region Packet Sending - const float TIME_DILATION = 1.0f; - ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - - if (terseAgentUpdateBlocks.IsValueCreated) - { - List blocks = terseAgentUpdateBlocks.Value; - - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.State, true); - } - - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; - - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); - } - - if (objectUpdateBlocks.IsValueCreated) - { - List blocks = objectUpdateBlocks.Value; + const float TIME_DILATION = 1.0f; + ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + if (objectUpdateBlocks.IsValueCreated) + { + List blocks = objectUpdateBlocks.Value; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - if (compressedUpdateBlocks.IsValueCreated) - { - List blocks = compressedUpdateBlocks.Value; + OutPacket(packet, ThrottleOutPacketType.Task, true); + } - ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; + if (compressedUpdateBlocks.IsValueCreated) + { + List blocks = compressedUpdateBlocks.Value; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; - OutPacket(packet, ThrottleOutPacketType.Task, true); + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } + + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } } #endregion Packet Sending -- cgit v1.1 From b512ecd1dc538f029e6772f526db78eb6687d938 Mon Sep 17 00:00:00 2001 From: Marck Date: Fri, 10 Dec 2010 22:13:05 +0100 Subject: Normalization of OSSL function names. Added the following replacement functions for compliance to the OSSL standards stated on the wiki: osGetTerrainHeight osSetTerrainHeight osGetSunParam osSetSunParam osSetPenColor The functions that do not comply to the standard give a warning when used but work normally otherwise. The graphics primitive drawing command "PenColor" has also been added as well as dynamic texture parameter "bgcolor" as an alternative to "bgcolour". The following two functions have been renamed because they are not enabled yet aynway: osWindParamSet => osSetWindParam osWindParamGet => osGetWindParam --- .../Scripting/VectorRender/VectorRenderModule.cs | 23 +++---- .../Shared/Api/Implementation/OSSL_Api.cs | 71 +++++++++++++++++++--- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 19 +++--- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 33 ++++++++-- 4 files changed, 115 insertions(+), 31 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 3291be4..7316e5b 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender int width = 256; int height = 256; int alpha = 255; // 0 is transparent - Color bgColour = Color.White; // Default background color + Color bgColor = Color.White; // Default background color char altDataDelim = ';'; char[] paramDelimiter = { ',' }; @@ -253,15 +253,16 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender alpha = 256; } break; + case "bgcolor": case "bgcolour": - int hex = 0; + int hex = 0; if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) { - bgColour = Color.FromArgb(hex); + bgColor = Color.FromArgb(hex); } else { - bgColour = Color.FromName(value); + bgColor = Color.FromName(value); } break; case "altdatadelim": @@ -315,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender // background color in their scripts, only do when fully opaque if (alpha >= 255) { - graph.FillRectangle(new SolidBrush(bgColour), 0, 0, width, height); + graph.FillRectangle(new SolidBrush(bgColor), 0, 0, width, height); } for (int w = 0; w < bitmap.Width; w++) @@ -616,25 +617,25 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } } } - else if (nextLine.StartsWith("PenColour")) + else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor")) { nextLine = nextLine.Remove(0, 9); nextLine = nextLine.Trim(); int hex = 0; - Color newColour; + Color newColor; if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) { - newColour = Color.FromArgb(hex); + newColor = Color.FromArgb(hex); } else { // this doesn't fail, it just returns black if nothing is found - newColour = Color.FromName(nextLine); + newColor = Color.FromName(nextLine); } - myBrush.Color = newColour; - drawPen.Color = newColour; + myBrush.Color = newColor; + drawPen.Color = newColor; } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 827626f..691b67f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -336,6 +336,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + internal void OSSLDeprecated(string function, string replacement) + { + OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); + } + protected void ScriptSleep(int delay) { delay = (int)((float)delay * m_ScriptDelayFactor); @@ -347,13 +352,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // // OpenSim functions // + public LSL_Integer osSetTerrainHeight(int x, int y, double val) + { + CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight"); + return SetTerrainHeight(x, y, val); + } public LSL_Integer osTerrainSetHeight(int x, int y, double val) { CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); - + OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight"); + return SetTerrainHeight(x, y, val); + } + private LSL_Integer SetTerrainHeight(int x, int y, double val) + { m_host.AddScriptLPS(1); if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) - OSSLError("osTerrainSetHeight: Coordinate out of bounds"); + OSSLError("osSetTerrainHeight: Coordinate out of bounds"); if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) { @@ -366,13 +380,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public LSL_Float osGetTerrainHeight(int x, int y) + { + CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight"); + return GetTerrainHeight(x, y); + } public LSL_Float osTerrainGetHeight(int x, int y) { CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); - + OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight"); + return GetTerrainHeight(x, y); + } + private LSL_Float GetTerrainHeight(int x, int y) + { m_host.AddScriptLPS(1); if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) - OSSLError("osTerrainGetHeight: Coordinate out of bounds"); + OSSLError("osGetTerrainHeight: Coordinate out of bounds"); return World.Heightmap[x, y]; } @@ -1001,9 +1024,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return drawList; } + public string osSetPenColor(string drawList, string color) + { + CheckThreatLevel(ThreatLevel.None, "osSetPenColor"); + + m_host.AddScriptLPS(1); + drawList += "PenColor " + color + "; "; + return drawList; + } + // Deprecated public string osSetPenColour(string drawList, string colour) { CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); + OSSLDeprecated("osSetPenColour", "osSetPenColor"); m_host.AddScriptLPS(1); drawList += "PenColour " + colour + "; "; @@ -1012,7 +1045,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public string osSetPenCap(string drawList, string direction, string type) { - CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); + CheckThreatLevel(ThreatLevel.None, "osSetPenCap"); m_host.AddScriptLPS(1); drawList += "PenCap " + direction + "," + type + "; "; @@ -1157,6 +1190,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public double osSunGetParam(string param) { CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); + OSSLDeprecated("osSunGetParam", "osGetSunParam"); + return GetSunParam(param); + } + public double osGetSunParam(string param) + { + CheckThreatLevel(ThreatLevel.None, "osGetSunParam"); + return GetSunParam(param); + } + private double GetSunParam(string param) + { m_host.AddScriptLPS(1); double value = 0.0; @@ -1173,6 +1216,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osSunSetParam(string param, double value) { CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); + OSSLDeprecated("osSunSetParam", "osSetSunParam"); + SetSunParam(param, value); + } + public void osSetSunParam(string param, double value) + { + CheckThreatLevel(ThreatLevel.None, "osSetSunParam"); + SetSunParam(param, value); + } + private void SetSunParam(string param, double value) + { m_host.AddScriptLPS(1); ISunModule module = World.RequestModuleInterface(); @@ -1198,9 +1251,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return String.Empty; } - public void osWindParamSet(string plugin, string param, float value) + public void osSetWindParam(string plugin, string param, float value) { - CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet"); + CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam"); m_host.AddScriptLPS(1); IWindModule module = World.RequestModuleInterface(); @@ -1214,9 +1267,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - public float osWindParamGet(string plugin, string param) + public float osGetWindParam(string plugin, string param) { - CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet"); + CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam"); m_host.AddScriptLPS(1); IWindModule module = World.RequestModuleInterface(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 10d61ca..da81a51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -67,8 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, bool blend, int disp, int timer, int alpha, int face); - LSL_Float osTerrainGetHeight(int x, int y); - LSL_Integer osTerrainSetHeight(int x, int y, double val); + LSL_Float osGetTerrainHeight(int x, int y); + LSL_Float osTerrainGetHeight(int x, int y); // Deprecated + LSL_Integer osSetTerrainHeight(int x, int y, double val); + LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated void osTerrainFlush(); int osRegionRestart(double seconds); @@ -107,7 +109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osSetFontName(string drawList, string fontName); string osSetFontSize(string drawList, int fontSize); string osSetPenSize(string drawList, int penSize); - string osSetPenColour(string drawList, string colour); + string osSetPenColor(string drawList, string color); + string osSetPenColour(string drawList, string colour); // Deprecated string osSetPenCap(string drawList, string direction, string type); string osDrawImage(string drawList, int width, int height, string imageUrl); vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize); @@ -119,13 +122,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour); void osSetEstateSunSettings(bool sunFixed, double sunHour); double osGetCurrentSunHour(); - double osSunGetParam(string param); - void osSunSetParam(string param, double value); + double osGetSunParam(string param); + double osSunGetParam(string param); // Deprecated + void osSetSunParam(string param, double value); + void osSunSetParam(string param, double value); // Deprecated // Wind Module Functions string osWindActiveModelPluginName(); - void osWindParamSet(string plugin, string param, float value); - float osWindParamGet(string plugin, string param); + void osSetWindParam(string plugin, string param, float value); + float osGetWindParam(string plugin, string param); // Parcel commands void osParcelJoin(vector pos1, vector pos2); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index f3142e6..70d489e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -81,11 +81,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetCurrentSunHour(); } + public double osGetSunParam(string param) + { + return m_OSSL_Functions.osGetSunParam(param); + } + // Deprecated public double osSunGetParam(string param) { return m_OSSL_Functions.osSunGetParam(param); } + public void osSetSunParam(string param, double value) + { + m_OSSL_Functions.osSetSunParam(param, value); + } + // Deprecated public void osSunSetParam(string param, double value) { m_OSSL_Functions.osSunSetParam(param, value); @@ -97,14 +107,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase } // Not yet plugged in as available OSSL functions, so commented out -// void osWindParamSet(string plugin, string param, float value) +// void osSetWindParam(string plugin, string param, float value) // { -// m_OSSL_Functions.osWindParamSet(plugin, param, value); +// m_OSSL_Functions.osSetWindParam(plugin, param, value); // } // -// float osWindParamGet(string plugin, string param) +// float osGetWindParam(string plugin, string param) // { -// return m_OSSL_Functions.osWindParamGet(plugin, param); +// return m_OSSL_Functions.osGetWindParam(plugin, param); // } public void osParcelJoin(vector pos1, vector pos2) @@ -165,11 +175,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase blend, disp, timer, alpha, face); } + public LSL_Float osGetTerrainHeight(int x, int y) + { + return m_OSSL_Functions.osGetTerrainHeight(x, y); + } + // Deprecated public LSL_Float osTerrainGetHeight(int x, int y) { return m_OSSL_Functions.osTerrainGetHeight(x, y); } + public LSL_Integer osSetTerrainHeight(int x, int y, double val) + { + return m_OSSL_Functions.osSetTerrainHeight(x, y, val); + } + // Deprecated public LSL_Integer osTerrainSetHeight(int x, int y, double val) { return m_OSSL_Functions.osTerrainSetHeight(x, y, val); @@ -333,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osSetPenCap(drawList, direction, type); } + public string osSetPenColor(string drawList, string color) + { + return m_OSSL_Functions.osSetPenColor(drawList, color); + } + // Deprecated public string osSetPenColour(string drawList, string colour) { return m_OSSL_Functions.osSetPenColour(drawList, colour); -- cgit v1.1 From 373ef594baeb7213f1f97c6bf444b7d348f25104 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Dec 2010 01:57:32 +0000 Subject: Drop current OAR version back to 0.5 since these are currently now compatible with older OpenSim versions again. Removed ability to choose 0.4 to avoid having to write code that polices this properly. Please shout on the ml if you really need this. --- OpenSim/Region/Application/OpenSim.cs | 7 ++- .../World/Archiver/ArchiveWriteRequestExecution.cs | 3 +- .../Archiver/ArchiveWriteRequestPreparation.cs | 64 +++++++++++----------- .../CoreModules/World/Archiver/ArchiverModule.cs | 2 +- 4 files changed, 38 insertions(+), 38 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index ae2d836..c2dd84c 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -265,10 +265,11 @@ namespace OpenSim LoadOar); m_console.Commands.AddCommand("region", false, "save oar", - "save oar [-v|--version=] [-p|--profile=] []", + //"save oar [-v|--version=] [-p|--profile=] []", + "save oar [-p|--profile=] []", "Save a region's data to an OAR archive.", - "-v|--version= generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine - + "-p|--profile= adds the url of the profile service to the saved user information" + Environment.NewLine +// "-v|--version= generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine + "-p|--profile= adds the url of the profile service to the saved user information" + Environment.NewLine + "The OAR path must be a filesystem path." + " If this is not given then the oar is saved to region.oar in the current directory.", SaveOar); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index f8a599a..9ec4ebe 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -136,14 +136,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver ms.Close(); m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); - // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); + string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index 0699407..f2d487e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// /// The maximum major version of OAR that we can write. /// - public static int MAX_MAJOR_VERSION = 1; + public static int MAX_MAJOR_VERSION = 0; protected Scene m_scene; protected Stream m_saveStream; @@ -206,37 +206,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public static string CreateControlFile(Dictionary options) { - int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0; - - if (options.ContainsKey("version")) - { - string[] parts = options["version"].ToString().Split('.'); - if (parts.Length >= 1) - { - majorVersion = Int32.Parse(parts[0]); - - if (parts.Length >= 2) - minorVersion = Int32.Parse(parts[1]); - } - } - - if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) - { - throw new Exception( - string.Format( - "OAR version number for save must be between {0} and {1}", - MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); - } - else if (majorVersion == MAX_MAJOR_VERSION) - { - // Force 1.0 - minorVersion = 0; - } - else if (majorVersion == MIN_MAJOR_VERSION) - { - // Force 0.4 - minorVersion = 4; - } + int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5; +// +// if (options.ContainsKey("version")) +// { +// string[] parts = options["version"].ToString().Split('.'); +// if (parts.Length >= 1) +// { +// majorVersion = Int32.Parse(parts[0]); +// +// if (parts.Length >= 2) +// minorVersion = Int32.Parse(parts[1]); +// } +// } +// +// if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) +// { +// throw new Exception( +// string.Format( +// "OAR version number for save must be between {0} and {1}", +// MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); +// } +// else if (majorVersion == MAX_MAJOR_VERSION) +// { +// // Force 1.0 +// minorVersion = 0; +// } +// else if (majorVersion == MIN_MAJOR_VERSION) +// { +// // Force 0.4 +// minorVersion = 4; +// } m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); //if (majorVersion == 1) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 2d7244e..9277c59 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Dictionary options = new Dictionary(); OptionSet ops = new OptionSet(); - ops.Add("v|version=", delegate(string v) { options["version"] = v; }); +// ops.Add("v|version=", delegate(string v) { options["version"] = v; }); ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); List mainParams = ops.Parse(cmdparams); -- cgit v1.1 From 387f743993456bb7dbc6ea639bfa98db4567789c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Dec 2010 02:18:16 +0000 Subject: If we're saving an IAR with --profile information, then label this a version 1.0 IAR since it isn't compatible with older OpenSim releases. --- .../Archiver/InventoryArchiveWriteRequest.cs | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index cab341d..5e5f6c0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -156,7 +156,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The inventory folder to save /// The path to which the folder should be saved /// If true, save this folder itself. If false, only saves contents - protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary options, IUserAccountService userAccountService) + /// + /// + protected void SaveInvFolder( + InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, + Dictionary options, IUserAccountService userAccountService) { if (saveThisFolderItself) { @@ -249,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Write out control file. This has to be done first so that subsequent loaders will see this file first // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this - m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); + // not sure how to fix this though, short of going with a completely different file format. + m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options)); m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); if (inventoryFolder != null) @@ -372,12 +377,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } /// - /// Create the control file for a 0.1 version archive + /// Create the control file for the archive /// + /// /// - public static string Create0p1ControlFile() + public static string CreateControlFile(Dictionary options) { - int majorVersion = 0, minorVersion = 1; + int majorVersion, minorVersion; + + if (options.ContainsKey("profile")) + { + majorVersion = 1; + minorVersion = 0; + } + else + { + majorVersion = 0; + minorVersion = 1; + } m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); -- cgit v1.1 From b46de6e025f1179f13841e1a8ccb1031b598895b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Dec 2010 03:09:00 +0000 Subject: Remove the restriction that you have to be logged in when loading/saving iars This is pointless as we're supplying the password on the command line --- .../Inventory/Archiver/InventoryArchiverModule.cs | 128 ++++++++++----------- .../Archiver/Tests/InventoryArchiverTests.cs | 14 +-- 2 files changed, 70 insertions(+), 72 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index b33c2b1..1e18095 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// /// Enable or disable checking whether the iar user is actually logged in /// - public bool DisablePresenceChecks { get; set; } +// public bool DisablePresenceChecks { get; set; } public event InventoryArchiveSaved OnInventoryArchiveSaved; @@ -95,10 +95,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public InventoryArchiverModule() {} - public InventoryArchiverModule(bool disablePresenceChecks) - { - DisablePresenceChecks = disablePresenceChecks; - } +// public InventoryArchiverModule(bool disablePresenceChecks) +// { +// DisablePresenceChecks = disablePresenceChecks; +// } public void Initialise(Scene scene, IConfigSource source) { @@ -172,8 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { try { new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService); @@ -189,13 +189,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -212,8 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { try { new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService); @@ -229,13 +229,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -257,9 +257,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { - +// if (CheckPresence(userInfo.PrincipalID)) +// { InventoryArchiveReadRequest request; bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); @@ -280,13 +279,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } else m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found", @@ -306,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (userInfo != null) { - if (CheckPresence(userInfo.PrincipalID)) - { +// if (CheckPresence(userInfo.PrincipalID)) +// { InventoryArchiveReadRequest request; bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); @@ -328,13 +327,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver UpdateClientWithLoadedNodes(userInfo, request.Execute()); return true; - } - else - { - m_log.ErrorFormat( - "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", - userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); - } +// } +// else +// { +// m_log.ErrorFormat( +// "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", +// userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); +// } } } @@ -529,28 +528,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } } - /// - /// Check if the given user is present in any of the scenes. - /// - /// The user to check - /// true if the user is in any of the scenes, false otherwise - protected bool CheckPresence(UUID userId) - { - if (DisablePresenceChecks) - return true; - - foreach (Scene scene in m_scenes.Values) - { - ScenePresence p; - if ((p = scene.GetScenePresence(userId)) != null) - { - p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); - return true; - } - } - - return false; - } - +// /// +// /// Check if the given user is present in any of the scenes. +// /// +// /// The user to check +// /// true if the user is in any of the scenes, false otherwise +// protected bool CheckPresence(UUID userId) +// { +// if (DisablePresenceChecks) +// return true; +// +// foreach (Scene scene in m_scenes.Values) +// { +// ScenePresence p; +// if ((p = scene.GetScenePresence(userId)) != null) +// { +// p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); +// return true; +// } +// } +// +// return false; +// } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 2747e15..76d0b85 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests TestHelper.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests TestHelper.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // log4net.Config.XmlConfigurator.Configure(); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("inventory"); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); @@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests //log4net.Config.XmlConfigurator.Configure(); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene Scene scene = SceneSetupHelpers.SetupScene("inventory"); @@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string humanEscapedItemName = @"You & you are a mean\/man\/"; string userPassword = "meowfood"; - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); Scene scene = SceneSetupHelpers.SetupScene("Inventory"); SceneSetupHelpers.SetupSceneModules(scene, archiverModule); @@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); SerialiserModule serialiserModule = new SerialiserModule(); - InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene Scene scene = SceneSetupHelpers.SetupScene("inventory"); @@ -619,7 +619,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); // SerialiserModule serialiserModule = new SerialiserModule(); - // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + // InventoryArchiverModule archiverModule = new InventoryArchiverModule(); // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Scene scene = SceneSetupHelpers.SetupScene(); -- cgit v1.1 From ccb4f958c0dbb2daad4249a6b97d1c0b008b6a47 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Dec 2010 23:16:26 -0800 Subject: Another stab at mantis #5256 --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 39 +++++++++++----------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ++++++---- 2 files changed, 32 insertions(+), 25 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f125822..08da05f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3706,7 +3706,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP const float TIME_DILATION = 1.0f; ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - + + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Unknown, true); + } + if (objectUpdateBlocks.IsValueCreated) { List blocks = objectUpdateBlocks.Value; @@ -3718,8 +3733,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); + + OutPacket(packet, ThrottleOutPacketType.Unknown, true); } if (compressedUpdateBlocks.IsValueCreated) @@ -3733,24 +3748,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); + + OutPacket(packet, ThrottleOutPacketType.Unknown, true); } - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; - - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); - } } #endregion Packet Sending diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a1c80e5..b4a7e02 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1217,6 +1217,8 @@ namespace OpenSim.Region.Framework.Scenes // return; //} + //m_log.DebugFormat("DEBUG: HandleAgentUpdate {0}", (AgentManager.ControlFlags)agentData.ControlFlags); + m_perfMonMS = Util.EnvironmentTickCount(); ++m_movementUpdateCount; @@ -1393,7 +1395,7 @@ namespace OpenSim.Region.Framework.Scenes try { agent_control_v3 += dirVectors[i]; - //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); + //m_log.DebugFormat("[Motion]: (0) {0}, {1}",i, dirVectors[i]); } catch (IndexOutOfRangeException) { @@ -1471,6 +1473,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f); LocalVectorToTarget2D.Normalize(); agent_control_v3 += LocalVectorToTarget2D; + //m_log.DebugFormat("[Motion]: (1) {0}, {1}", i, dirVectors[i]); // update avatar movement flags. the avatar coordinate system is as follows: // @@ -1554,11 +1557,11 @@ namespace OpenSim.Region.Framework.Scenes // If the agent update does move the avatar, then calculate the force ready for the velocity update, // which occurs later in the main scene loop - if (update_movementflag || (update_rotation && DCFlagKeyPressed)) + if ((update_movementflag) || (update_rotation && DCFlagKeyPressed)) { - // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); - // m_log.DebugFormat( - // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); + //m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); + //m_log.DebugFormat( + // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); AddNewMovement(agent_control_v3, q); @@ -2327,6 +2330,9 @@ namespace OpenSim.Region.Framework.Scenes !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) //Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { + //m_log.DebugFormat("XXX SendTerseUpdateToAllClients {0}-{1} {2}-{3} {4}-{5}", + // m_bodyRot, m_lastRotation, Velocity, m_lastVelocity, m_pos, m_lastPosition); + SendTerseUpdateToAllClients(); // Update the "last" values @@ -3226,7 +3232,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 force = m_forceToApply.Value; m_updateflag = true; -// movementvector = force; + // movementvector = force; Velocity = force; m_forceToApply = null; -- cgit v1.1 From c42876df6740cfe20e0a691357b56c31bdcecbf8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 Dec 2010 23:32:50 -0800 Subject: Revert "Another stab at mantis #5256" This reverts commit ccb4f958c0dbb2daad4249a6b97d1c0b008b6a47. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 39 +++++++++++----------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ++++------ 2 files changed, 25 insertions(+), 32 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 08da05f..f125822 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3706,22 +3706,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP const float TIME_DILATION = 1.0f; ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; - - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Unknown, true); - } - + if (objectUpdateBlocks.IsValueCreated) { List blocks = objectUpdateBlocks.Value; @@ -3733,8 +3718,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Unknown, true); + + OutPacket(packet, ThrottleOutPacketType.Task, true); } if (compressedUpdateBlocks.IsValueCreated) @@ -3748,10 +3733,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Unknown, true); + + OutPacket(packet, ThrottleOutPacketType.Task, true); } + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } } #endregion Packet Sending diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b4a7e02..a1c80e5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1217,8 +1217,6 @@ namespace OpenSim.Region.Framework.Scenes // return; //} - //m_log.DebugFormat("DEBUG: HandleAgentUpdate {0}", (AgentManager.ControlFlags)agentData.ControlFlags); - m_perfMonMS = Util.EnvironmentTickCount(); ++m_movementUpdateCount; @@ -1395,7 +1393,7 @@ namespace OpenSim.Region.Framework.Scenes try { agent_control_v3 += dirVectors[i]; - //m_log.DebugFormat("[Motion]: (0) {0}, {1}",i, dirVectors[i]); + //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); } catch (IndexOutOfRangeException) { @@ -1473,7 +1471,6 @@ namespace OpenSim.Region.Framework.Scenes Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f); LocalVectorToTarget2D.Normalize(); agent_control_v3 += LocalVectorToTarget2D; - //m_log.DebugFormat("[Motion]: (1) {0}, {1}", i, dirVectors[i]); // update avatar movement flags. the avatar coordinate system is as follows: // @@ -1557,11 +1554,11 @@ namespace OpenSim.Region.Framework.Scenes // If the agent update does move the avatar, then calculate the force ready for the velocity update, // which occurs later in the main scene loop - if ((update_movementflag) || (update_rotation && DCFlagKeyPressed)) + if (update_movementflag || (update_rotation && DCFlagKeyPressed)) { - //m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); - //m_log.DebugFormat( - // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); + // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); + // m_log.DebugFormat( + // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); AddNewMovement(agent_control_v3, q); @@ -2330,9 +2327,6 @@ namespace OpenSim.Region.Framework.Scenes !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) //Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { - //m_log.DebugFormat("XXX SendTerseUpdateToAllClients {0}-{1} {2}-{3} {4}-{5}", - // m_bodyRot, m_lastRotation, Velocity, m_lastVelocity, m_pos, m_lastPosition); - SendTerseUpdateToAllClients(); // Update the "last" values @@ -3232,7 +3226,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 force = m_forceToApply.Value; m_updateflag = true; - // movementvector = force; +// movementvector = force; Velocity = force; m_forceToApply = null; -- cgit v1.1 From 69538d14d4bfb9cc27705e7776845faeea123e5d Mon Sep 17 00:00:00 2001 From: Marck Date: Sat, 11 Dec 2010 11:41:45 +0100 Subject: More OSSL function name normalization, this time for osParcelSetDetails. --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 18 +++++++++++++++--- .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 3 ++- .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 7 ++++++- 3 files changed, 23 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 691b67f..3b13d06 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1310,7 +1310,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void osParcelSetDetails(LSL_Vector pos, LSL_List rules) { - CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails"); + const string functionName = "osParcelSetDetails"; + CheckThreatLevel(ThreatLevel.High, functionName); + OSSLDeprecated(functionName, "osSetParcelDetails"); + SetParcelDetails(pos, rules, functionName); + } + public void osSetParcelDetails(LSL_Vector pos, LSL_List rules) + { + const string functionName = "osSetParcelDetails"; + CheckThreatLevel(ThreatLevel.High, functionName); + SetParcelDetails(pos, rules, functionName); + } + private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName) + { m_host.AddScriptLPS(1); // Get a reference to the land data and make sure the owner of the script @@ -1349,13 +1361,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api break; case 2: - CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); + CheckThreatLevel(ThreatLevel.VeryHigh, functionName); if (UUID.TryParse(arg , out uuid)) newLand.OwnerID = uuid; break; case 3: - CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails"); + CheckThreatLevel(ThreatLevel.VeryHigh, functionName); if (UUID.TryParse(arg , out uuid)) newLand.GroupID = uuid; break; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index da81a51..63007c6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -135,7 +135,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces // Parcel commands void osParcelJoin(vector pos1, vector pos2); void osParcelSubdivide(vector pos1, vector pos2); - void osParcelSetDetails(vector pos, LSL_List rules); + void osSetParcelDetails(vector pos, LSL_List rules); + void osParcelSetDetails(vector pos, LSL_List rules); // Deprecated string osGetScriptEngineName(); string osGetSimulatorVersion(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 70d489e..e3ea556 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -126,7 +126,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_OSSL_Functions.osParcelSubdivide(pos1, pos2); } - + + public void osSetParcelDetails(vector pos, LSL_List rules) + { + m_OSSL_Functions.osSetParcelDetails(pos, rules); + } + // Deprecated public void osParcelSetDetails(vector pos, LSL_List rules) { m_OSSL_Functions.osParcelSetDetails(pos,rules); -- cgit v1.1 From 797ca8d0e787b20fdd0794f2017268f6e5b175e6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 11 Dec 2010 17:06:17 -0800 Subject: Fixes the nudge movements! --- .../Scenes/Animation/ScenePresenceAnimator.cs | 11 +-------- OpenSim/Region/Framework/Scenes/Prioritizer.cs | 28 ++++++++++++++-------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 27 --------------------- 3 files changed, 19 insertions(+), 47 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index a90e0f3..b8cdfc4 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -316,16 +316,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation public void UpdateMovementAnimations() { m_movementAnimation = GetMovementAnimation(); - - if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump) - { - // This was the previous behavior before PREJUMP - TrySetMovementAnimation("JUMP"); - } - else - { - TrySetMovementAnimation(m_movementAnimation); - } + TrySetMovementAnimation(m_movementAnimation); } public UUID[] GetAnimationArray() diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 19f8180..f9599f5 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs @@ -218,20 +218,28 @@ namespace OpenSim.Region.Framework.Scenes private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) { - ScenePresence presence = m_scene.GetScenePresence(client.AgentId); - if (presence != null) - { - // If this is an update for our own avatar give it the highest priority - if (presence == entity) - return 0.0; + // If this is an update for our own avatar give it the highest priority + if (client.AgentId == entity.UUID) + return 0.0; + if (entity == null) + return double.NaN; - // Use group position for child prims - Vector3 entityPos = entity.AbsolutePosition; - if (entity is SceneObjectPart) - entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; + // Use group position for child prims + Vector3 entityPos = entity.AbsolutePosition; + if (entity is SceneObjectPart) + { + SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; + if (group != null) + entityPos = group.AbsolutePosition; else entityPos = entity.AbsolutePosition; + } + else + entityPos = entity.AbsolutePosition; + ScenePresence presence = m_scene.GetScenePresence(client.AgentId); + if (presence != null) + { if (!presence.IsChildAgent) { if (entity is ScenePresence) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a1c80e5..f64d539 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2225,33 +2225,6 @@ namespace OpenSim.Region.Framework.Scenes { // WHAT??? m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!"); - - // we have to reset the user's child agent connections. - // Likely, here they've lost the eventqueue for other regions so border - // crossings will fail at this point unless we reset them. - - List regions = new List(KnownChildRegionHandles); - regions.Remove(m_scene.RegionInfo.RegionHandle); - - MakeRootAgent(new Vector3(127f, 127f, 127f), true); - - // Async command - if (m_scene.SceneGridService != null) - { - m_scene.SceneGridService.SendCloseChildAgentConnections(UUID, regions); - - // Give the above command some time to try and close the connections. - // this is really an emergency.. so sleep, or we'll get all discombobulated. - System.Threading.Thread.Sleep(500); - } - - if (m_scene.SceneGridService != null) - { - IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface(); - if (m_agentTransfer != null) - m_agentTransfer.EnableChildAgents(this); - } - return; } -- cgit v1.1 From 7f0350b98858309d8c6e8b7689c2efdf12ca60b9 Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 12 Dec 2010 20:06:23 +0100 Subject: Trigger event with flag CHANGED_LINK when agent sits on objects that have not a sit target defined. This fixes Mantis #4692. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 ------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++++-- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f87056e..4fcd8f5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes //} } - public void SetAvatarOnSitTarget(UUID avatarID) - { - m_sitTargetAvatar = avatarID; - if (ParentGroup != null) - ParentGroup.TriggerScriptChangedEvent(Changed.LINK); - } - public void SetAxisRotation(int axis, int rotate) { if (m_parentGroup != null) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f64d539..30c9365 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1703,7 +1703,9 @@ namespace OpenSim.Region.Framework.Scenes } // Reset sit target. if (part.GetAvatarOnSitTarget() == UUID) - part.SetAvatarOnSitTarget(UUID.Zero); + part.SitTargetAvatar = UUID.Zero; + if (part.ParentGroup != null) + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); m_parentPosition = part.GetWorldPosition(); ControllingClient.SendClearFollowCamProperties(part.ParentUUID); @@ -1807,11 +1809,13 @@ namespace OpenSim.Region.Framework.Scenes if (SitTargetisSet && SitTargetUnOccupied) { - part.SetAvatarOnSitTarget(UUID); + part.SitTargetAvatar = UUID; offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); sitOrientation = avSitOrientation; autopilot = false; } + if (part.ParentGroup != null) + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); pos = part.AbsolutePosition + offset; //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) -- cgit v1.1 From 870bbcfc6c264c515ac660837d16ccad4e59ac64 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 13 Dec 2010 09:42:27 -0800 Subject: This may have been the biggest, baddest bug in OpenSim ever... confusion between bytes per second and bytes per millisecond. --- OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs index bdbd284..4d9ca09 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs @@ -119,6 +119,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion Properties + // To help debugging + private static int idCount = 0; + private int id; + /// /// Default constructor /// @@ -134,6 +138,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP MaxBurst = maxBurst; DripRate = dripRate; lastDrip = Environment.TickCount & Int32.MaxValue; + id = idCount++; } /// @@ -191,6 +196,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (tokensPerMS == 0) { content = maxBurst; + //Console.WriteLine("XXX (" + id + ") content = maxBurst and maxBurst = " + maxBurst); return true; } else @@ -205,11 +211,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } - int dripAmount = deltaMS * tokensPerMS; - + // dripAmpount here is in bytes per millisecond + int dripAmount = deltaMS * tokensPerMS; + // but content is in bytes per second, so let's multiply by 1000 + dripAmount = dripAmount * 1000; content = Math.Min(content + dripAmount, maxBurst); lastDrip = now; + //Console.WriteLine("XXX (" + id + ") deltaMS=" + deltaMS + "; tokensPerMS=" + tokensPerMS + "; content=" + content + "; dripAmount=" + dripAmount); return true; } } -- cgit v1.1 From 6b8d01d8c4b4c4f05e0bc51724984dab22e4ee51 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 13 Dec 2010 11:45:17 -0800 Subject: It turns out that the 1/2 sec burst for prims download is not a bug, but a feature of the client. The client sets the throttles in such a way that makes the server behave like that. The same happens in the Linden Grid. Revert "This may have been the biggest, baddest bug in OpenSim ever... confusion between bytes per second and bytes per millisecond." This reverts commit 870bbcfc6c264c515ac660837d16ccad4e59ac64. --- OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs index 4d9ca09..bdbd284 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/TokenBucket.cs @@ -119,10 +119,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion Properties - // To help debugging - private static int idCount = 0; - private int id; - /// /// Default constructor /// @@ -138,7 +134,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP MaxBurst = maxBurst; DripRate = dripRate; lastDrip = Environment.TickCount & Int32.MaxValue; - id = idCount++; } /// @@ -196,7 +191,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (tokensPerMS == 0) { content = maxBurst; - //Console.WriteLine("XXX (" + id + ") content = maxBurst and maxBurst = " + maxBurst); return true; } else @@ -211,14 +205,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } - // dripAmpount here is in bytes per millisecond - int dripAmount = deltaMS * tokensPerMS; - // but content is in bytes per second, so let's multiply by 1000 - dripAmount = dripAmount * 1000; + int dripAmount = deltaMS * tokensPerMS; + content = Math.Min(content + dripAmount, maxBurst); lastDrip = now; - //Console.WriteLine("XXX (" + id + ") deltaMS=" + deltaMS + "; tokensPerMS=" + tokensPerMS + "; content=" + content + "; dripAmount=" + dripAmount); return true; } } -- cgit v1.1 From 9a24c0b41c786f49766c212c656f8162e4c263ef Mon Sep 17 00:00:00 2001 From: Marck Date: Mon, 13 Dec 2010 21:19:33 +0100 Subject: Show map tile for hyperlinks. Perform Check4096 before adding a hyperlink. Configuration option AssetService in section [GridService] must be set to enable this functionality. Map tiles do currently not show for hyperlinks set in simulators that are connected to grids, see Mantis #5270. --- .../Hypergrid/GatekeeperServiceConnector.cs | 29 +++++---- OpenSim/Services/GridService/HypergridLinker.cs | 76 ++++++++++++---------- .../Services/HypergridService/GatekeeperService.cs | 29 ++++----- 3 files changed, 70 insertions(+), 64 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 85c1380..d4fd1b8 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Drawing; +using System.IO; using System.Net; using System.Reflection; using OpenSim.Framework; @@ -48,7 +49,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -// private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); + private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); private IAssetService m_AssetService; @@ -143,24 +144,25 @@ namespace OpenSim.Services.Connectors.Hypergrid return true; } - UUID m_MissingTexture = new UUID("5748decc-f629-461c-9a36-a35a221fe21f"); - - public UUID GetMapImage(UUID regionID, string imageURL) + public UUID GetMapImage(UUID regionID, string imageURL, string storagePath) { if (m_AssetService == null) - return m_MissingTexture; + return m_HGMapImage; + UUID mapTile = m_HGMapImage; + string filename = string.Empty; + Bitmap bitmap = null; try { - WebClient c = new WebClient(); //m_log.Debug("JPEG: " + imageURL); - string filename = regionID.ToString(); - c.DownloadFile(imageURL, filename + ".jpg"); - Bitmap m = new Bitmap(filename + ".jpg"); + string name = regionID.ToString(); + filename = Path.Combine(storagePath, name + ".jpg"); + c.DownloadFile(imageURL, filename); + bitmap = new Bitmap(filename); //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); - byte[] imageData = OpenJPEG.EncodeFromImage(m, true); - AssetBase ass = new AssetBase(UUID.Random(), "region " + filename, (sbyte)AssetType.Texture, regionID.ToString()); + byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); + AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); // !!! for now //info.RegionSettings.TerrainImageID = ass.FullID; @@ -172,14 +174,13 @@ namespace OpenSim.Services.Connectors.Hypergrid m_AssetService.Store(ass); // finally - return ass.FullID; - + mapTile = ass.FullID; } catch // LEGIT: Catching problems caused by OpenJPEG p/invoke { m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache"); } - return UUID.Zero; + return mapTile; } public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID) diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 9863ba0..643d0fc 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net; using System.Reflection; @@ -52,8 +53,6 @@ namespace OpenSim.Services.GridService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); - private static uint m_autoMappingX = 0; private static uint m_autoMappingY = 0; private static bool m_enableAutoMapping = false; @@ -65,6 +64,7 @@ namespace OpenSim.Services.GridService protected UUID m_ScopeID = UUID.Zero; protected bool m_Check4096 = true; + protected string m_MapTileDirectory = string.Empty; // Hyperlink regions are hyperlinks on the map public readonly Dictionary m_HyperlinkRegions = new Dictionary(); @@ -121,9 +121,24 @@ namespace OpenSim.Services.GridService m_Check4096 = gridConfig.GetBoolean("Check4096", true); + m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", string.Empty); + m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); - m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); + m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); + } + + if (!string.IsNullOrEmpty(m_MapTileDirectory)) + { + try + { + Directory.CreateDirectory(m_MapTileDirectory); + } + catch (Exception e) + { + m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e); + m_MapTileDirectory = string.Empty; + } } if (MainConsole.Instance != null) @@ -271,42 +286,22 @@ namespace OpenSim.Services.GridService if (!m_GatekeeperConnector.LinkRegion(regInfo, out regionID, out handle, out externalName, out imageURL, out reason)) return false; - if (regionID != UUID.Zero) - { - region = m_GridService.GetRegionByUUID(scopeID, regionID); - if (region != null) - { - m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", - region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); - regInfo = region; - return true; - } - - regInfo.RegionID = regionID; - - if ( externalName == string.Empty ) - regInfo.RegionName = regInfo.ServerURI; - else - regInfo.RegionName = externalName; - - m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName); - - // Try get the map image - //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); - // I need a texture that works for this... the one I tried doesn't seem to be working - regInfo.TerrainImage = m_HGMapImage; - - AddHyperlinkRegion(regInfo, handle); - m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); - - } - else + if (regionID == UUID.Zero) { m_log.Warn("[HYPERGRID LINKER]: Unable to link region"); reason = "Remote region could not be found"; return false; } + region = m_GridService.GetRegionByUUID(scopeID, regionID); + if (region != null) + { + m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", + region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); + regInfo = region; + return true; + } + uint x, y; if (m_Check4096 && !Check4096(handle, out x, out y)) { @@ -316,7 +311,20 @@ namespace OpenSim.Services.GridService return false; } - m_log.Debug("[HYPERGRID LINKER]: link region succeeded"); + regInfo.RegionID = regionID; + + if ( externalName == string.Empty ) + regInfo.RegionName = regInfo.ServerURI; + else + regInfo.RegionName = externalName; + + m_log.Debug("[HYPERGRID LINKER]: naming linked region " + regInfo.RegionName); + + // Get the map image + regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL, m_MapTileDirectory); + + AddHyperlinkRegion(regInfo, handle); + m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); return true; } diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 05be7b8..4419201 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -123,42 +123,39 @@ namespace OpenSim.Services.HypergridService externalName = m_ExternalName + ((regionName != string.Empty) ? " " + regionName : ""); imageURL = string.Empty; reason = string.Empty; - + GridRegion region = null; m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to link to {0}", (regionName == string.Empty)? "default region" : regionName); if (!m_AllowTeleportsToAnyRegion || regionName == string.Empty) { List defs = m_GridService.GetDefaultRegions(m_ScopeID); if (defs != null && defs.Count > 0) - m_DefaultGatewayRegion = defs[0]; - - try { - regionID = m_DefaultGatewayRegion.RegionID; - regionHandle = m_DefaultGatewayRegion.RegionHandle; + region = defs[0]; + m_DefaultGatewayRegion = region; } - catch + else { reason = "Grid setup problem. Try specifying a particular region here."; m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to send information. Please specify a default region for this grid!"); return false; } - - return true; } - - GridRegion region = m_GridService.GetRegionByName(m_ScopeID, regionName); - if (region == null) + else { - reason = "Region not found"; - return false; + region = m_GridService.GetRegionByName(m_ScopeID, regionName); + if (region == null) + { + reason = "Region not found"; + return false; + } } regionID = region.RegionID; regionHandle = region.RegionHandle; - string regionimage = "regionImage" + region.RegionID.ToString(); - regionimage = regionimage.Replace("-", ""); + string regionimage = "regionImage" + regionID.ToString(); + regionimage = regionimage.Replace("-", ""); imageURL = region.ServerURI + "index.php?method=" + regionimage; return true; -- cgit v1.1 From a4588befb7b75d0b48664a3ff1998464aac5eed5 Mon Sep 17 00:00:00 2001 From: Marck Date: Mon, 13 Dec 2010 22:00:34 +0100 Subject: Changed logging level for message about failure to retrieve a map image from a linked region. --- OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index d4fd1b8..1ac8478 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -178,7 +178,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch // LEGIT: Catching problems caused by OpenJPEG p/invoke { - m_log.Warn("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache"); + m_log.Info("[GATEKEEPER SERVICE CONNECTOR]: Failed getting/storing map image, because it is probably already in the cache"); } return mapTile; } -- cgit v1.1 From d6803e6448535aac738d7193760d9d28b7146bd5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 13 Dec 2010 20:28:14 +0000 Subject: Change some lookups in he Land Management module to make group permissions work better. Add a generic group permissions hoot to the scene permissions system. --- OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index d67638a..ab0eed8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -68,6 +68,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool IsGodHandler(UUID user, Scene requestFromScene); public delegate bool IsAdministratorHandler(UUID user); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); + public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); @@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Scenes public event IsGodHandler OnIsGod; public event IsAdministratorHandler OnIsAdministrator; public event EditParcelHandler OnEditParcel; + public event EditParcelPropertiesHandler OnEditParcelProperties; public event SellParcelHandler OnSellParcel; public event AbandonParcelHandler OnAbandonParcel; public event ReclaimParcelHandler OnReclaimParcel; @@ -734,6 +736,21 @@ namespace OpenSim.Region.Framework.Scenes } return true; } + + public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p) + { + EditParcelPropertiesHandler handler = OnEditParcelProperties; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (EditParcelPropertiesHandler h in list) + { + if (h(user, parcel, p, m_scene) == false) + return false; + } + } + return true; + } #endregion #region SELL PARCEL @@ -1043,4 +1060,4 @@ namespace OpenSim.Region.Framework.Scenes return true; } } -} \ No newline at end of file +} -- cgit v1.1 From 9bd7f3b03a315d713d53451a36fd64c419ce5f35 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 13 Dec 2010 20:35:56 +0000 Subject: Revamp the viewer -> banlist packet processing so fix a number of bugs. Remove the too coarse CanEditParcel method in favor of a CanEditParcelProperties method that takes a GroupPowers argument to specify what action is to be taken. Also, make the method to set parcel data much more granular. Permissions in a deeded setting should now work. --- OpenSim/Framework/IClientAPI.cs | 7 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 10 +- .../CoreModules/World/Land/LandManagementModule.cs | 34 ++-- .../Region/CoreModules/World/Land/LandObject.cs | 200 +++++++++++++++------ .../World/Permissions/PermissionsModule.cs | 56 +----- OpenSim/Region/Framework/Interfaces/ILandObject.cs | 2 +- .../Region/Framework/Scenes/Scene.Permissions.cs | 14 -- .../RegionCombinerModule/RegionCombinerModule.cs | 2 +- .../RegionCombinerPermissionModule.cs | 4 +- .../Shared/Api/Implementation/LSL_Api.cs | 88 +++++---- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- 11 files changed, 241 insertions(+), 178 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 027f9c5..b9c9323 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -174,9 +174,10 @@ namespace OpenSim.Framework public delegate void ParcelAccessListRequest( UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); - public delegate void ParcelAccessListUpdateRequest( - UUID agentID, UUID sessionID, uint flags, int landLocalID, List entries, - IClientAPI remote_client); + public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags, + int landLocalID, UUID transactionID, int sequenceID, + int sections, List entries, + IClientAPI remote_client); public delegate void ParcelPropertiesRequest( int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index f125822..c934b9e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -8239,7 +8239,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = block.ID; entry.Flags = (AccessList)block.Flags; - entry.Time = new DateTime(); + entry.Time = Util.ToDateTime(block.Time); entries.Add(entry); } @@ -8247,8 +8247,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerParcelAccessListUpdateRequest != null) { handlerParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, - updatePacket.AgentData.SessionID, updatePacket.Data.Flags, - updatePacket.Data.LocalID, entries, this); + updatePacket.Data.Flags, + updatePacket.Data.LocalID, + updatePacket.Data.TransactionID, + updatePacket.Data.SequenceID, + updatePacket.Data.Sections, + entries, this); } return true; } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 695202f..ac4705c 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -159,7 +159,7 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelSelectObjects += ClientOnParcelSelectObjects; client.OnParcelObjectOwnerRequest += ClientOnParcelObjectOwnerRequest; client.OnParcelAccessListRequest += ClientOnParcelAccessListRequest; - client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessUpdateListRequest; + client.OnParcelAccessListUpdateRequest += ClientOnParcelAccessListUpdateRequest; client.OnParcelAbandonRequest += ClientOnParcelAbandonRequest; client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner; client.OnParcelReclaim += ClientOnParcelReclaim; @@ -508,14 +508,22 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - m_landList[landLocalID].SendAccessList(agentID, sessionID, flags, sequenceID, remote_client); + land.SendAccessList(agentID, sessionID, flags, sequenceID, remote_client); } } - public void ClientOnParcelAccessUpdateListRequest(UUID agentID, UUID sessionID, uint flags, int landLocalID, - List entries, - IClientAPI remote_client) + public void ClientOnParcelAccessListUpdateRequest(UUID agentID, + uint flags, int landLocalID, UUID transactionID, int sequenceID, + int sections, List entries, + IClientAPI remote_client) { + // Flags is the list to update, it can mean either the ban or + // the access list (WTH is a pass list? Mentioned in ParcelFlags) + // + // There may be multiple packets, because these can get LONG. + // Use transactionID to determine a new chain of packets since + // packets may have come in out of sequence and that would be + // a big mess if using the sequenceID ILandObject land; lock (m_landList) { @@ -524,9 +532,15 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - if (agentID == land.LandData.OwnerID) + GroupPowers requiredPowers = GroupPowers.LandManageAllowed; + if (flags == (uint)AccessList.Ban) + requiredPowers = GroupPowers.LandManageBanned; + + if (m_scene.Permissions.CanEditParcelProperties(agentID, + land, requiredPowers)) { - land.UpdateAccessList(flags, entries, remote_client); + land.UpdateAccessList(flags, transactionID, sequenceID, + sections, entries, remote_client); } } else @@ -854,7 +868,7 @@ namespace OpenSim.Region.CoreModules.World.Land //If we are still here, then they are subdividing within one piece of land //Check owner - if (!m_scene.Permissions.CanEditParcel(attempting_user_id, startLandObject)) + if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, startLandObject, GroupPowers.LandDivideJoin)) { return; } @@ -922,7 +936,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return; } - if (!m_scene.Permissions.CanEditParcel(attempting_user_id, masterLandObject)) + if (!m_scene.Permissions.CanEditParcelProperties(attempting_user_id, masterLandObject, GroupPowers.LandDivideJoin)) { return; } @@ -1570,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land == null) return; - if (!m_scene.Permissions.CanEditParcel(remoteClient.AgentId, land)) + if (!m_scene.Permissions.CanEditParcelProperties(remoteClient.AgentId, land, GroupPowers.LandOptions)) return; land.LandData.OtherCleanTime = otherCleanTime; diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index d87352f..801d3a4 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -54,6 +54,7 @@ namespace OpenSim.Region.CoreModules.World.Land protected LandData m_landData = new LandData(); protected Scene m_scene; protected List primsOverMe = new List(); + protected Dictionary m_listTransactions = new Dictionary(); public bool[,] LandBitmap { @@ -199,36 +200,81 @@ namespace OpenSim.Region.CoreModules.World.Land public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client) { - if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) + //Needs later group support + bool snap_selection = false; + LandData newData = LandData.Copy(); + + uint allowedDelta = 0; + + // These two are always blocked as no client can set them anyway + // ParcelFlags.ForSaleObjects + // ParcelFlags.LindenHome + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) { - //Needs later group support - bool snap_selection = false; - LandData newData = LandData.Copy(); + allowedDelta |= (uint)(ParcelFlags.AllowLandmark | + ParcelFlags.AllowTerraform | + ParcelFlags.AllowDamage | + ParcelFlags.CreateObjects | + ParcelFlags.RestrictPushObject | + ParcelFlags.AllowGroupScripts | + ParcelFlags.CreateGroupObjects | + ParcelFlags.AllowAPrimitiveEntry | + ParcelFlags.AllowGroupObjectEntry); + } - if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) + { + if (args.AuthBuyerID != newData.AuthBuyerID || + args.SalePrice != newData.SalePrice) { - if (m_scene.Permissions.CanSellParcel(remote_client.AgentId, this)) - { - newData.AuthBuyerID = args.AuthBuyerID; - newData.SalePrice = args.SalePrice; - snap_selection = true; - } + snap_selection = true; + } + + newData.AuthBuyerID = args.AuthBuyerID; + newData.SalePrice = args.SalePrice; + + if (!LandData.IsGroupOwned) + { + newData.GroupID = args.GroupID; + + allowedDelta |= (uint)(ParcelFlags.AllowDeedToGroup | + ParcelFlags.ContributeWithDeed | + ParcelFlags.SellParcelObjects); } + + allowedDelta |= (uint)ParcelFlags.ForSale; + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.FindPlaces)) + { newData.Category = args.Category; + + allowedDelta |= (uint)(ParcelFlags.ShowDirectory | + ParcelFlags.AllowPublish | + ParcelFlags.MaturePublish); + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity)) + { newData.Description = args.Desc; - newData.GroupID = args.GroupID; + newData.Name = args.Name; + newData.SnapshotID = args.SnapshotID; + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.SetLandingPoint)) + { newData.LandingType = args.LandingType; + newData.UserLocation = args.UserLocation; + newData.UserLookAt = args.UserLookAt; + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.ChangeMedia)) + { newData.MediaAutoScale = args.MediaAutoScale; newData.MediaID = args.MediaID; newData.MediaURL = args.MediaURL; newData.MusicURL = args.MusicURL; - newData.Name = args.Name; - newData.Flags = args.ParcelFlags; - newData.PassHours = args.PassHours; - newData.PassPrice = args.PassPrice; - newData.SnapshotID = args.SnapshotID; - newData.UserLocation = args.UserLocation; - newData.UserLookAt = args.UserLookAt; newData.MediaType = args.MediaType; newData.MediaDescription = args.MediaDescription; newData.MediaWidth = args.MediaWidth; @@ -237,10 +283,40 @@ namespace OpenSim.Region.CoreModules.World.Land newData.ObscureMusic = args.ObscureMusic; newData.ObscureMedia = args.ObscureMedia; - m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); + allowedDelta |= (uint)(ParcelFlags.SoundLocal | + ParcelFlags.UrlWebPage | + ParcelFlags.UrlRawHtml | + ParcelFlags.AllowVoiceChat | + ParcelFlags.UseEstateVoiceChan); + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandManagePasses)) + { + newData.PassHours = args.PassHours; + newData.PassPrice = args.PassPrice; + + allowedDelta |= (uint)ParcelFlags.UsePassList; + } + + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageAllowed)) + { + allowedDelta |= (uint)(ParcelFlags.UseAccessGroup | + ParcelFlags.UseAccessList); + } - SendLandUpdateToAvatarsOverMe(snap_selection); + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandManageBanned)) + { + allowedDelta |= (uint)(ParcelFlags.UseBanList | + ParcelFlags.DenyAnonymous | + ParcelFlags.DenyAgeUnverified); } + + uint preserve = LandData.Flags & ~allowedDelta; + newData.Flags = preserve | (args.ParcelFlags & allowedDelta); + + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); + + SendLandUpdateToAvatarsOverMe(snap_selection); } public void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area) @@ -295,14 +371,14 @@ namespace OpenSim.Region.CoreModules.World.Land if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) { - ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - entry.AgentID = avatar; - entry.Flags = AccessList.Ban; - entry.Time = new DateTime(); - //See if they are on the list, but make sure the owner isn't banned - if (LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) + if (LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == avatar && e.Flags == AccessList.Ban) + return true; + return false; + }) != -1 && LandData.OwnerID != avatar) { - //They are banned, so lets send them a notice about this parcel return true; } } @@ -316,15 +392,14 @@ namespace OpenSim.Region.CoreModules.World.Land if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) { - ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); - entry.AgentID = avatar; - entry.Flags = AccessList.Access; - entry.Time = new DateTime(); - - //If they are not on the access list and are not the owner - if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) + if (LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == avatar && e.Flags == AccessList.Access) + return true; + return false; + }) == -1 && LandData.OwnerID != avatar) { - //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel return true; } } @@ -421,39 +496,50 @@ namespace OpenSim.Region.CoreModules.World.Land } } - public void UpdateAccessList(uint flags, List entries, IClientAPI remote_client) + public void UpdateAccessList(uint flags, UUID transactionID, + int sequenceID, int sections, + List entries, + IClientAPI remote_client) { LandData newData = LandData.Copy(); - if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) + if ((!m_listTransactions.ContainsKey(flags)) || + m_listTransactions[flags] != transactionID) { - entries.Clear(); - } + m_listTransactions[flags] = transactionID; - List toRemove = new List(); - foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) - { - if (entry.Flags == (AccessList)flags) + List toRemove = + new List(); + + foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) { - toRemove.Add(entry); + if (entry.Flags == (AccessList)flags) + toRemove.Add(entry); } - } - foreach (ParcelManager.ParcelAccessEntry entry in toRemove) - { - newData.ParcelAccessList.Remove(entry); + foreach (ParcelManager.ParcelAccessEntry entry in toRemove) + { + newData.ParcelAccessList.Remove(entry); + } + + // Checked here because this will always be the first + // and only packet in a transaction + if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) + { + return; + } } + foreach (ParcelManager.ParcelAccessEntry entry in entries) { - ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); + ParcelManager.ParcelAccessEntry temp = + new ParcelManager.ParcelAccessEntry(); + temp.AgentID = entry.AgentID; - temp.Time = new DateTime(); //Pointless? Yes. + temp.Time = entry.Time; temp.Flags = (AccessList)flags; - if (!newData.ParcelAccessList.Contains(temp)) - { - newData.ParcelAccessList.Add(temp); - } + newData.ParcelAccessList.Add(temp); } m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); @@ -711,7 +797,7 @@ namespace OpenSim.Region.CoreModules.World.Land public void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client) { - if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) { List resultLocalIDs = new List(); try @@ -761,7 +847,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// public void SendLandObjectOwners(IClientAPI remote_client) { - if (m_scene.Permissions.CanEditParcel(remote_client.AgentId, this)) + if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions)) { Dictionary primCount = new Dictionary(); List groups = new List(); diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f5f3839..364dd6c 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -37,56 +37,6 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -// Temporary fix of wrong GroupPowers constants in OpenMetaverse library -enum GroupPowers : long - { - None = 0, - LandEjectAndFreeze = 1, - Invite = 2, - ReturnGroupSet = 2, - Eject = 4, - ReturnNonGroup = 4, - ChangeOptions = 8, - LandGardening = 8, - CreateRole = 16, - DeedObject = 16, - ModerateChat = 32, - DeleteRole = 32, - RoleProperties = 64, - ObjectManipulate = 64, - ObjectSetForSale = 128, - AssignMemberLimited = 128, - AssignMember = 256, - Accountable = 256, - RemoveMember = 512, - SendNotices = 1024, - ChangeActions = 1024, - ChangeIdentity = 2048, - ReceiveNotices = 2048, - StartProposal = 4096, - LandDeed = 4096, - VoteOnProposal = 8192, - LandRelease = 8192, - LandSetSale = 16384, - LandDivideJoin = 32768, - ReturnGroupOwned = 65536, - JoinChat = 65536, - FindPlaces = 131072, - LandChangeIdentity = 262144, - SetLandingPoint = 524288, - ChangeMedia = 1048576, - LandEdit = 2097152, - LandOptions = 4194304, - AllowEditLand = 8388608, - AllowFly = 16777216, - AllowRez = 33554432, - AllowLandmark = 67108864, - AllowVoiceChat = 134217728, - AllowSetHome = 268435456, - LandManageAllowed = 536870912, - LandManageBanned = 1073741824 - } - namespace OpenSim.Region.CoreModules.World.Permissions { public class PermissionsModule : IRegionModule @@ -214,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnInstantMessage += CanInstantMessage; m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED @@ -1005,12 +955,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions return GenericObjectPermission(editorID, objectID, false); } - private bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) + private bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandDivideJoin); + return GenericParcelOwnerPermission(user, parcel, (ulong)p); } /// diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs index 084184f..585eb00 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); List CreateAccessListArrayByFlag(AccessList flag); void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); - void UpdateAccessList(uint flags, List entries, IClientAPI remote_client); + void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List entries, IClientAPI remote_client); void UpdateLandBitmapByteArray(); void SetLandBitmapFromByteArray(); bool[,] GetLandBitmap(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index ab0eed8..1295e58 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -722,20 +722,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion #region EDIT PARCEL - public bool CanEditParcel(UUID user, ILandObject parcel) - { - EditParcelHandler handler = OnEditParcel; - if (handler != null) - { - Delegate[] list = handler.GetInvocationList(); - foreach (EditParcelHandler h in list) - { - if (h(user, parcel, m_scene) == false) - return false; - } - } - return true; - } public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p) { diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index ff0e743..4a24c7d 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -1001,7 +1001,7 @@ namespace OpenSim.Region.RegionCombinerModule VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED - VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED + VirtualRegion.Permissions.OnEditParcelProperties += BigRegion.PermissionModule.CanEditParcelProperties; //MAYBE FULLY IMPLEMENTED VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs index 393322d..7c662c9 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs @@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule return m_rootScene.Permissions.CanEditObject(objectid, editorid); } - public bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) + public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene) { - return m_rootScene.Permissions.CanEditParcel(user, parcel); + return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g); } public bool CanInstantMessage(UUID user, UUID target, Scene startscene) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3c5f2d0..30fb252 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6287,16 +6287,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; - if (land.OwnerID == m_host.OwnerID) + ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); if (UUID.TryParse(avatar, out key)) { - entry.AgentID = key; - entry.Flags = AccessList.Access; - entry.Time = DateTime.Now.AddHours(hours); - land.ParcelAccessList.Add(entry); + if (land.LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == key && e.Flags == AccessList.Access) + return true; + return false; + }) == -1) + { + entry.AgentID = key; + entry.Flags = AccessList.Access; + entry.Time = DateTime.Now.AddHours(hours); + land.LandData.ParcelAccessList.Add(entry); + } } } ScriptSleep(100); @@ -9023,7 +9032,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // according to the docs, this command only works if script owner and land owner are the same // lets add estate owners and gods, too, and use the generic permission check. ILandObject landObject = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); - if (!World.Permissions.CanEditParcel(m_host.OwnerID, landObject)) return; + if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, landObject, GroupPowers.ChangeMedia)) return; bool update = false; // send a ParcelMediaUpdate (and possibly change the land's media URL)? byte loop = 0; @@ -9466,16 +9475,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; - if (land.OwnerID == m_host.OwnerID) + ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); if (UUID.TryParse(avatar, out key)) { - entry.AgentID = key; - entry.Flags = AccessList.Ban; - entry.Time = DateTime.Now.AddHours(hours); - land.ParcelAccessList.Add(entry); + if (land.LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == key && e.Flags == AccessList.Ban) + return true; + return false; + }) == -1) + { + entry.AgentID = key; + entry.Flags = AccessList.Ban; + entry.Time = DateTime.Now.AddHours(hours); + land.LandData.ParcelAccessList.Add(entry); + } } } ScriptSleep(100); @@ -9485,19 +9503,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; - if (land.OwnerID == m_host.OwnerID) + ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) { if (UUID.TryParse(avatar, out key)) { - foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) - { - if (entry.AgentID == key && entry.Flags == AccessList.Access) - { - land.ParcelAccessList.Remove(entry); - break; - } - } + int idx = land.LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == key && e.Flags == AccessList.Access) + return true; + return false; + }); + + if (idx != -1) + land.LandData.ParcelAccessList.RemoveAt(idx); } } ScriptSleep(100); @@ -9507,19 +9527,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID key; - LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; - if (land.OwnerID == m_host.OwnerID) + ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); + if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) { if (UUID.TryParse(avatar, out key)) { - foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) - { - if (entry.AgentID == key && entry.Flags == AccessList.Ban) - { - land.ParcelAccessList.Remove(entry); - break; - } - } + int idx = land.LandData.ParcelAccessList.FindIndex( + delegate(ParcelManager.ParcelAccessEntry e) + { + if (e.AgentID == key && e.Flags == AccessList.Ban) + return true; + return false; + }); + + if (idx != -1) + land.LandData.ParcelAccessList.RemoveAt(idx); } } ScriptSleep(100); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3b13d06..5a796b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1335,7 +1335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - if (! World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject)) + if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions)) { OSSLShoutError("You do not have permission to modify the parcel"); return; -- cgit v1.1 From 2a9f0950710a84412e6276e5cc73c6245f838a36 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 13 Dec 2010 22:26:44 +0100 Subject: Fix a small bug in ban list handling --- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 801d3a4..3e41c55 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -526,6 +526,8 @@ namespace OpenSim.Region.CoreModules.World.Land // and only packet in a transaction if (entries.Count == 1 && entries[0].AgentID == UUID.Zero) { + m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); + return; } } -- cgit v1.1 From e62b3dba8a1b8c816d6b09dc1f14b915f1560afe Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 00:11:41 +0000 Subject: reinstate IAttachmentsModule.UpdateAttachmentPosition() since this is being used by a 3rd party region module and contains non-obvious attachment specific code There are no functional changes. UpdateAttachmentPosition() is adapted to the new approach of only saving attachment state on logout --- .../CoreModules/Avatar/Attachments/AttachmentsModule.cs | 16 ++++++++++++++++ .../Region/Framework/Interfaces/IAttachmentsModule.cs | 15 +++++++++------ OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 ++------- 3 files changed, 27 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1f49a01..360a014 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -484,6 +484,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } } + public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos) + { + // First we save the + // attachment point information, then we update the relative + // positioning. Then we have to mark the object as NOT an + // attachment. This is necessary in order to correctly save + // and retrieve GroupPosition information for the attachment. + // Finally, we restore the object's attachment status. + byte attachmentPoint = sog.GetAttachmentPoint(); + sog.UpdateGroupPosition(pos); + sog.RootPart.IsAttachment = false; + sog.AbsolutePosition = sog.RootPart.AttachedPos; + sog.SetAttachmentPoint(attachmentPoint); + sog.HasGroupChanged = true; + } + /// /// Update the attachment asset for the new sog details if they have changed. /// diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index b3576c5..6cc64c6 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -113,15 +113,18 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Update the user inventory to show a detach. /// - /// - /// A - /// - /// - /// A - /// + /// /param> + /// void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); /// + /// Update the position of an attachment. + /// + /// + /// + void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos); + + /// /// Update the user inventory with a changed attachment /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 78e5da3..a2ed54f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1281,13 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes { if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) { - // Set the new attachment point data in the object - byte attachmentPoint = group.GetAttachmentPoint(); - group.UpdateGroupPosition(pos); - group.RootPart.IsAttachment = false; - group.AbsolutePosition = group.RootPart.AttachedPos; - group.SetAttachmentPoint(attachmentPoint); - group.HasGroupChanged = true; + if (m_parentScene.AttachmentsModule != null) + m_parentScene.AttachmentsModule.UpdateAttachmentPosition(group, pos); } else { -- cgit v1.1 From b41164b620c9de49baee933728807376838123c5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 13 Dec 2010 21:35:40 -0800 Subject: This seems to get rid of the stuck PREJUMP animation, as reported by Justin in -dev. Also in this commit, a slight adjustment to the Velocity of SP -- this makes the avie walking feel less jerky for me. Will wait reports from others. --- .../Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 9 ++++++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index b8cdfc4..4865481 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -233,6 +233,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation // Falling long enough to trigger the animation return "FALLDOWN"; } + else if (m_animTickJump == -1) + { + m_animTickJump = 0; + return "STAND"; + } return m_movementAnimation; } @@ -279,6 +284,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation m_animTickJump = -1; return "JUMP"; } + else + return "JUMP"; } else { @@ -307,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation #endregion Ground Movement - return m_movementAnimation; + //return m_movementAnimation; } /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 30c9365..221f3bc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3203,8 +3203,11 @@ namespace OpenSim.Region.Framework.Scenes Vector3 force = m_forceToApply.Value; m_updateflag = true; -// movementvector = force; - Velocity = force; + + // The magic constant 0.855f seems to make walking feel less jerky, + // probably because it hackishly accounts for the overall latency of + // these Velocity updates -- Diva + Velocity = force * .855F; m_forceToApply = null; } -- cgit v1.1 From e47cc10674c2019bbe9b71ce30040ce6049df017 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Dec 2010 12:07:35 +0000 Subject: Null checking ParentGroup is not needed. It can't be null. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 221f3bc..62d7011 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1704,8 +1704,7 @@ namespace OpenSim.Region.Framework.Scenes // Reset sit target. if (part.GetAvatarOnSitTarget() == UUID) part.SitTargetAvatar = UUID.Zero; - if (part.ParentGroup != null) - part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); m_parentPosition = part.GetWorldPosition(); ControllingClient.SendClearFollowCamProperties(part.ParentUUID); @@ -1814,8 +1813,7 @@ namespace OpenSim.Region.Framework.Scenes sitOrientation = avSitOrientation; autopilot = false; } - if (part.ParentGroup != null) - part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); pos = part.AbsolutePosition + offset; //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) -- cgit v1.1 From 55e04e6c68766399695a27d071c9298d90eafe13 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 14 Dec 2010 08:11:49 -0800 Subject: Fixes mantis #5270 -- Map tiles for hyperlinks not showing in world map for grided sims. --- .../Grid/RemoteGridServiceConnector.cs | 109 ++++++++++++++++----- .../CoreModules/World/WorldMap/MapSearchModule.cs | 4 +- .../CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- 3 files changed, 90 insertions(+), 25 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 16e25e6..dfba0d6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs @@ -41,8 +41,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid { - public class RemoteGridServicesConnector : - GridServicesConnector, ISharedRegionModule, IGridService + public class RemoteGridServicesConnector : ISharedRegionModule, IGridService { private static readonly ILog m_log = LogManager.GetLogger( @@ -51,6 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid private bool m_Enabled = false; private IGridService m_LocalGridService; + private IGridService m_RemoteGridService; public RemoteGridServicesConnector() { @@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid get { return "RemoteGridServicesConnector"; } } - public override void Initialise(IConfigSource source) + public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) @@ -97,9 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return; } - base.Initialise(source); - m_LocalGridService = new LocalGridServicesConnector(source); + m_RemoteGridService = new GridServicesConnector(source); } public void PostInitialise() @@ -135,61 +134,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid #region IGridService - public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) + public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); if (msg == String.Empty) - return base.RegisterRegion(scopeID, regionInfo); + return m_RemoteGridService.RegisterRegion(scopeID, regionInfo); return msg; } - public override bool DeregisterRegion(UUID regionID) + public bool DeregisterRegion(UUID regionID) { if (m_LocalGridService.DeregisterRegion(regionID)) - return base.DeregisterRegion(regionID); + return m_RemoteGridService.DeregisterRegion(regionID); return false; } - public override List GetNeighbours(UUID scopeID, UUID regionID) + public List GetNeighbours(UUID scopeID, UUID regionID) { - return base.GetNeighbours(scopeID, regionID); + return m_RemoteGridService.GetNeighbours(scopeID, regionID); } - public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) + public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) { GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID); if (rinfo == null) - rinfo = base.GetRegionByUUID(scopeID, regionID); + rinfo = m_RemoteGridService.GetRegionByUUID(scopeID, regionID); return rinfo; } - public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y) + public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); if (rinfo == null) - rinfo = base.GetRegionByPosition(scopeID, x, y); + rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); return rinfo; } - public override GridRegion GetRegionByName(UUID scopeID, string regionName) + public GridRegion GetRegionByName(UUID scopeID, string regionName) { GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName); if (rinfo == null) - rinfo = base.GetRegionByName(scopeID, regionName); + rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName); return rinfo; } - public override List GetRegionsByName(UUID scopeID, string name, int maxNumber) + public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { List rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber); //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count); - List grinfo = base.GetRegionsByName(scopeID, name, maxNumber); + List grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber); if (grinfo != null) { @@ -202,13 +201,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return rinfo; } - // Let's not override GetRegionRange -- let's get them all from the grid server + public virtual List GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) + { + List rinfo = m_LocalGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionRange {0} found {1} regions", name, rinfo.Count); + List grinfo = m_RemoteGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); + + if (grinfo != null) + { + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionRange {0} found {1} regions", name, grinfo.Count); + foreach (GridRegion r in grinfo) + if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) + rinfo.Add(r); + } + + return rinfo; + } + + public List GetDefaultRegions(UUID scopeID) + { + List rinfo = m_LocalGridService.GetDefaultRegions(scopeID); + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultRegions {0} found {1} regions", name, rinfo.Count); + List grinfo = m_RemoteGridService.GetDefaultRegions(scopeID); + + if (grinfo != null) + { + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultRegions {0} found {1} regions", name, grinfo.Count); + foreach (GridRegion r in grinfo) + if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) + rinfo.Add(r); + } + + return rinfo; + } + + public List GetFallbackRegions(UUID scopeID, int x, int y) + { + List rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y); + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetFallbackRegions {0} found {1} regions", name, rinfo.Count); + List grinfo = m_RemoteGridService.GetFallbackRegions(scopeID, x, y); + + if (grinfo != null) + { + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetFallbackRegions {0} found {1} regions", name, grinfo.Count); + foreach (GridRegion r in grinfo) + if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) + rinfo.Add(r); + } + + return rinfo; + } + + public List GetHyperlinks(UUID scopeID) + { + List rinfo = m_LocalGridService.GetHyperlinks(scopeID); + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetHyperlinks {0} found {1} regions", name, rinfo.Count); + List grinfo = m_RemoteGridService.GetHyperlinks(scopeID); + + if (grinfo != null) + { + //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetHyperlinks {0} found {1} regions", name, grinfo.Count); + foreach (GridRegion r in grinfo) + if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) + rinfo.Add(r); + } + + return rinfo; + } - public override int GetRegionFlags(UUID scopeID, UUID regionID) + public int GetRegionFlags(UUID scopeID, UUID regionID) { int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID); if (flags == -1) - flags = base.GetRegionFlags(scopeID, regionID); + flags = m_RemoteGridService.GetRegionFlags(scopeID, regionID); return flags; } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 9f88517..bdd1a0b 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -93,13 +93,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } // try to fetch from GridServer - List regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); + List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); if (regionInfos == null) { m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region regionInfos = new List(); - GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); + GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName); if (info != null) regionInfos.Add(info); } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9869f4a..6d9afce 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -593,7 +593,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if (!m_blacklistedregions.ContainsKey(regionhandle)) m_blacklistedregions.Add(regionhandle, Environment.TickCount); } - m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString()); + //m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString()); } } -- cgit v1.1 From 4357288a94dd9253ddc570c38eabf0277d3ff973 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 14 Dec 2010 11:24:23 -0800 Subject: More on mantis #5270 --- OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 1ac8478..a1d9167 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -147,7 +147,10 @@ namespace OpenSim.Services.Connectors.Hypergrid public UUID GetMapImage(UUID regionID, string imageURL, string storagePath) { if (m_AssetService == null) + { + m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: No AssetService defined. Map tile not retrieved."); return m_HGMapImage; + } UUID mapTile = m_HGMapImage; string filename = string.Empty; @@ -167,8 +170,6 @@ namespace OpenSim.Services.Connectors.Hypergrid // !!! for now //info.RegionSettings.TerrainImageID = ass.FullID; - ass.Temporary = true; - ass.Local = true; ass.Data = imageData; m_AssetService.Store(ass); -- cgit v1.1 From 10ae5454cbc0bb5ffab518203023d76abdd762cd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 14 Dec 2010 12:16:51 -0800 Subject: Made the map thread request the map items asynchronously, as the name suggested -- but with a cap of 20 async requests max at any given time. --- .../CoreModules/World/WorldMap/WorldMapModule.cs | 80 +++++++++++++++++++--- 1 file changed, 71 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 6d9afce..e3ba190 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -33,6 +33,7 @@ using System.Drawing.Imaging; using System.IO; using System.Net; using System.Reflection; +using System.Runtime.Remoting.Messaging; using System.Threading; using log4net; using Nini.Config; @@ -413,11 +414,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } } + private int nAsyncRequests = 0; /// /// Processing thread main() loop for doing remote mapitem requests /// public void process() { + const int MAX_ASYNC_REQUESTS = 20; try { while (true) @@ -437,10 +440,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap dorequest = false; } - if (dorequest) + if (dorequest && !m_blacklistedregions.ContainsKey(st.regionhandle)) { - OSDMap response = RequestMapItemsAsync("", st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); - RequestMapItemsCompleted(response); + while (nAsyncRequests >= MAX_ASYNC_REQUESTS) // hit the break + Thread.Sleep(80); + + RequestMapItemsDelegate d = RequestMapItemsAsync; + d.BeginInvoke(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle, RequestMapItemsCompleted, null); + //OSDMap response = RequestMapItemsAsync(st.agentID, st.flags, st.EstateID, st.godlike, st.itemtype, st.regionhandle); + //RequestMapItemsCompleted(response); + Interlocked.Increment(ref nAsyncRequests); } } @@ -469,8 +478,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap /// Sends the mapitem response to the IClientAPI /// /// The OSDMap Response for the mapitem - private void RequestMapItemsCompleted(OSDMap response) + private void RequestMapItemsCompleted(IAsyncResult iar) { + AsyncResult result = (AsyncResult)iar; + RequestMapItemsDelegate icon = (RequestMapItemsDelegate)result.AsyncDelegate; + + OSDMap response = (OSDMap)icon.EndInvoke(iar); + + Interlocked.Decrement(ref nAsyncRequests); + + if (!response.ContainsKey("requestID")) + return; + UUID requestID = response["requestID"].AsUUID(); if (requestID != UUID.Zero) @@ -538,6 +557,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap EnqueueMapItemRequest(st); } + private delegate OSDMap RequestMapItemsDelegate(UUID id, uint flags, + uint EstateID, bool godlike, uint itemtype, ulong regionhandle); /// /// Does the actual remote mapitem request /// This should be called from an asynchronous thread @@ -552,9 +573,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap /// passed in from packet /// Region we're looking up /// - private OSDMap RequestMapItemsAsync(string httpserver, UUID id, uint flags, + private OSDMap RequestMapItemsAsync(UUID id, uint flags, uint EstateID, bool godlike, uint itemtype, ulong regionhandle) { + string httpserver = ""; bool blacklisted = false; lock (m_blacklistedregions) { @@ -638,7 +660,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap os = mapitemsrequest.GetRequestStream(); os.Write(buffer, 0, buffer.Length); //Send it os.Close(); - //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from Sim {0}", httpserver); + //m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver); } catch (WebException ex) { @@ -654,15 +676,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return responseMap; } + catch + { + m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver); + responseMap["connect"] = OSD.FromBoolean(false); + return responseMap; + } string response_mapItems_reply = null; { // get the response + StreamReader sr = null; try { WebResponse webResponse = mapitemsrequest.GetResponse(); if (webResponse != null) { - StreamReader sr = new StreamReader(webResponse.GetResponseStream()); + sr = new StreamReader(webResponse.GetResponseStream()); response_mapItems_reply = sr.ReadToEnd().Trim(); } else @@ -683,6 +712,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return responseMap; } + catch + { + m_log.DebugFormat("[WORLD MAP]: RequestMapItems failed for {0}", httpserver); + responseMap["connect"] = OSD.FromBoolean(false); + lock (m_blacklistedregions) + { + if (!m_blacklistedregions.ContainsKey(regionhandle)) + m_blacklistedregions.Add(regionhandle, Environment.TickCount); + } + + return responseMap; + } + finally + { + if (sr != null) + sr.Close(); + } + OSD rezResponse = null; try { @@ -691,14 +738,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap responseMap = (OSDMap)rezResponse; responseMap["requestID"] = OSD.FromUUID(requestID); } - catch (Exception) + catch (Exception ex) { - //m_log.InfoFormat("[OGP]: exception on parse of rez reply {0}", ex.Message); + m_log.InfoFormat("[WORLD MAP]: exception on parse of RequestMapItems reply from {0}: {1}", httpserver, ex.Message); responseMap["connect"] = OSD.FromBoolean(false); + lock (m_blacklistedregions) + { + if (!m_blacklistedregions.ContainsKey(regionhandle)) + m_blacklistedregions.Add(regionhandle, Environment.TickCount); + } return responseMap; } } + + if (!responseMap.ContainsKey(itemtype.ToString())) // remote sim doesnt have the stated region handle + { + if (!m_blacklistedregions.ContainsKey(regionhandle)) + { + m_log.DebugFormat("[WORLD MAP]: Remote sim does not have the stated region. Blacklisting."); + m_blacklistedregions.Add(regionhandle, Environment.TickCount); + } + } + return responseMap; } -- cgit v1.1 From ff8ff773e7a848eed14519a122ad118042549a8e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 14 Dec 2010 12:58:32 -0800 Subject: Relax a highly constraining lock on m_entityUpdates that may be preventing reprioritizations from actually happening. #LoginLag --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 253 +++++++++++---------- 1 file changed, 127 insertions(+), 126 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c934b9e..979dd47 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3557,107 +3557,109 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; - lock (m_entityUpdates.SyncRoot) + EntityUpdate update; + while (updatesThisCall < maxUpdates) { - EntityUpdate update; - while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) - { - if (update.Entity is SceneObjectPart) + lock (m_entityUpdates.SyncRoot) + if (!m_entityUpdates.TryDequeue(out update)) + break; + + if (update.Entity is SceneObjectPart) + { + SceneObjectPart part = (SceneObjectPart)update.Entity; + + // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client + // will never receive an update after a prim kill. Even then, keeping the kill record may be a good + // safety measure. + // + // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update + // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs + // updates and kills on different threads with different scheduling strategies, hence this protection. + // + // This doesn't appear to apply to child prims - a client will happily ignore these updates + // after the root prim has been deleted. + if (m_killRecord.Contains(part.LocalId)) { - SceneObjectPart part = (SceneObjectPart)update.Entity; - - // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client - // will never receive an update after a prim kill. Even then, keeping the kill record may be a good - // safety measure. - // - // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update - // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs - // updates and kills on different threads with different scheduling strategies, hence this protection. - // - // This doesn't appear to apply to child prims - a client will happily ignore these updates - // after the root prim has been deleted. - if (m_killRecord.Contains(part.LocalId)) - { - // m_log.WarnFormat( - // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", - // part.LocalId, Name); - continue; - } + // m_log.WarnFormat( + // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", + // part.LocalId, Name); + continue; + } - if (part.ParentGroup.IsAttachment && m_disableFacelights) + if (part.ParentGroup.IsAttachment && m_disableFacelights) + { + if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && + part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) { - if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && - part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) - { - part.Shape.LightEntry = false; - } + part.Shape.LightEntry = false; } } + } - ++updatesThisCall; + ++updatesThisCall; - #region UpdateFlags to packet type conversion + #region UpdateFlags to packet type conversion - PrimUpdateFlags updateFlags = update.Flags; + PrimUpdateFlags updateFlags = update.Flags; - bool canUseCompressed = true; - bool canUseImproved = true; + bool canUseCompressed = true; + bool canUseImproved = true; - // Compressed object updates only make sense for LL primitives - if (!(update.Entity is SceneObjectPart)) + // Compressed object updates only make sense for LL primitives + if (!(update.Entity is SceneObjectPart)) + { + canUseCompressed = false; + } + + if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) + { + canUseCompressed = false; + canUseImproved = false; + } + else + { + if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || + updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || + updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) { canUseCompressed = false; } - if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) + if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || + updateFlags.HasFlag(PrimUpdateFlags.ParentID) || + updateFlags.HasFlag(PrimUpdateFlags.Scale) || + updateFlags.HasFlag(PrimUpdateFlags.PrimData) || + updateFlags.HasFlag(PrimUpdateFlags.Text) || + updateFlags.HasFlag(PrimUpdateFlags.NameValue) || + updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || + updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || + updateFlags.HasFlag(PrimUpdateFlags.Sound) || + updateFlags.HasFlag(PrimUpdateFlags.Particles) || + updateFlags.HasFlag(PrimUpdateFlags.Material) || + updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || + updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || + updateFlags.HasFlag(PrimUpdateFlags.Joint)) { - canUseCompressed = false; canUseImproved = false; } - else - { - if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || - updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || - updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) - { - canUseCompressed = false; - } + } - if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || - updateFlags.HasFlag(PrimUpdateFlags.ParentID) || - updateFlags.HasFlag(PrimUpdateFlags.Scale) || - updateFlags.HasFlag(PrimUpdateFlags.PrimData) || - updateFlags.HasFlag(PrimUpdateFlags.Text) || - updateFlags.HasFlag(PrimUpdateFlags.NameValue) || - updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || - updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || - updateFlags.HasFlag(PrimUpdateFlags.Sound) || - updateFlags.HasFlag(PrimUpdateFlags.Particles) || - updateFlags.HasFlag(PrimUpdateFlags.Material) || - updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || - updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || - updateFlags.HasFlag(PrimUpdateFlags.Joint)) - { - canUseImproved = false; - } - } + #endregion UpdateFlags to packet type conversion - #endregion UpdateFlags to packet type conversion + #region Block Construction - #region Block Construction + // TODO: Remove this once we can build compressed updates + canUseCompressed = false; - // TODO: Remove this once we can build compressed updates - canUseCompressed = false; - - if (!canUseImproved && !canUseCompressed) + if (!canUseImproved && !canUseCompressed) + { + if (update.Entity is ScenePresence) + { + objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); + } + else { - if (update.Entity is ScenePresence) - { - objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); - } - else - { // if (update.Entity is SceneObjectPart && ((SceneObjectPart)update.Entity).IsAttachment) // { // SceneObjectPart sop = (SceneObjectPart)update.Entity; @@ -3686,71 +3688,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP // } // else // { - objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); + objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); // } - } - } - else if (!canUseImproved) - { - compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); - } - else - { - terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); } - - #endregion Block Construction + } + else if (!canUseImproved) + { + compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); + } + else + { + terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); } - #region Packet Sending + #endregion Block Construction + } + + #region Packet Sending - const float TIME_DILATION = 1.0f; - ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); + const float TIME_DILATION = 1.0f; + ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - if (objectUpdateBlocks.IsValueCreated) - { - List blocks = objectUpdateBlocks.Value; + if (objectUpdateBlocks.IsValueCreated) + { + List blocks = objectUpdateBlocks.Value; - ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + OutPacket(packet, ThrottleOutPacketType.Task, true); + } - if (compressedUpdateBlocks.IsValueCreated) - { - List blocks = compressedUpdateBlocks.Value; + if (compressedUpdateBlocks.IsValueCreated) + { + List blocks = compressedUpdateBlocks.Value; - ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; + ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + OutPacket(packet, ThrottleOutPacketType.Task, true); + } - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; - OutPacket(packet, ThrottleOutPacketType.Task, true); - } + OutPacket(packet, ThrottleOutPacketType.Task, true); } #endregion Packet Sending -- cgit v1.1 From c620e4c8228d275cfe9659d55ca9ec0c2d7c1b1a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 22:25:01 +0000 Subject: add infrastructure for groups module tests --- .../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs new file mode 100644 index 0000000..f9a736f --- /dev/null +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs @@ -0,0 +1,54 @@ +/* + * 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; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests +{ + /// + /// Basic groups module tests + /// + [TestFixture] + public class GroupsModuleTests + { + [Test] + public void TestBasic() + { + TestHelper.InMethod(); + } + } +} \ No newline at end of file -- cgit v1.1 From 42c9c30e4c3102d1f34e28353ddec23c854c5d35 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 22:57:36 +0000 Subject: Add mock group services connector and use this in tests --- .../XmlRpcGroups/IGroupsServicesConnector.cs | 4 +- .../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 11 + .../Common/Mock/MockGroupsServicesConnector.cs | 236 +++++++++++++++++++++ 3 files changed, 248 insertions(+), 3 deletions(-) create mode 100644 OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index a046e09..5c779de 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs @@ -27,14 +27,12 @@ using System; using System.Collections.Generic; - using OpenMetaverse; - using OpenSim.Framework; namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { - interface IGroupsServicesConnector + public interface IGroupsServicesConnector { UUID CreateGroup(UUID RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID); void UpdateGroup(UUID RequestingAgentID, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs index f9a736f..bc55b04 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs @@ -27,6 +27,7 @@ using System; using System.Reflection; +using Nini.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; @@ -49,6 +50,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests public void TestBasic() { TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Groups"); + config.Set("Enabled", true); + config.Set("Module", "GroupsModule"); + config.Set("DebugEnabled", true); + SceneSetupHelpers.SetupSceneModules( + scene, configSource, new object[] { new MockGroupsServicesConnector() }); } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs new file mode 100644 index 0000000..aa48754 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -0,0 +1,236 @@ +/* + * 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; +using System.Collections.Generic; +using System.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; + +namespace OpenSim.Tests.Common.Mock +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector + { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public string Name + { + get { return "MockGroupsServicesConnector"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource config) + { + } + + public void Close() + { + } + + public void AddRegion(Scene scene) + { + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + } + + public void PostInitialise() + { + } + + public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, + int membershipFee, bool openEnrollment, bool allowPublish, + bool maturePublish, UUID founderID) + { + return UUID.Zero; + } + + public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, + UUID insigniaID, int membershipFee, bool openEnrollment, + bool allowPublish, bool maturePublish) + { + } + + public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + string title, ulong powers) + { + } + + public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID) + { + } + + public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + string title, ulong powers) + { + } + + public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID GroupID, string GroupName) + { + return null; + } + + public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID) + { + return default(GroupProfileData); + } + + public void SetAgentActiveGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + } + + public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void SetAgentGroupInfo(UUID requestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile) + { + } + + public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID) + { + } + + public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) + { + return null; + } + + public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID) + { + } + + public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void RemoveAgentFromGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + } + + public void AddAgentToGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID) + { + } + + public List FindGroups(UUID requestingAgentID, string search) + { + return null; + } + + public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + return null; + } + + public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID AgentID) + { + return null; + } + + public List GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID) + { + return null; + } + + public List GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID) + { + return null; + } + + public List GetGroupRoles(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupMembers(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupRoleMembers(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public List GetGroupNotices(UUID requestingAgentID, UUID GroupID) + { + return null; + } + + public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID) + { + return null; + } + + public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket) + { + } + + public void ResetAgentGroupChatSessions(UUID agentID) + { + } + + public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID) + { + return false; + } + + public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) + { + return false; + } + + public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID) + { + } + + public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID) + { + } + } +} \ No newline at end of file -- cgit v1.1 From 81bccd6d132956e2de9e5ad473f87931df76cde8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:36:34 +0000 Subject: Start implementing a test for 'share with group' object functionality. Not yet complete. While implementing this, a bug was fixed in scene setup helpers where module RegionLoaded() was called immediately after AddRegion() instead of waiting for all AddRegions() to complete. Also, XmlRpcGroupsModule non-message functionality will now work without a message transfer module (as indicated in the comments but with a contradictory implementation) --- .../Scenes/Tests/SceneObjectUserGroupTests.cs | 87 ++++++++++++++++++++++ .../Avatar/XmlRpcGroups/GroupsModule.cs | 6 +- .../Common/Mock/MockGroupsServicesConnector.cs | 5 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 5 +- 4 files changed, 96 insertions(+), 7 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs new file mode 100644 index 0000000..bceacda --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -0,0 +1,87 @@ +/* + * 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; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.Avatar.InstantMessage; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + [TestFixture] + public class SceneObjectUserGroupTests + { + /// + /// Test share with group object functionality + /// + /// This test is not yet fully implemented + [Test] + public void TestShareWithGroup() + { + TestHelper.InMethod(); + log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + + IConfig startupConfig = configSource.AddConfig("Startup"); + startupConfig.Set("serverside_object_permissions", true); + + IConfig groupsConfig = configSource.AddConfig("Groups"); + groupsConfig.Set("Enabled", true); + groupsConfig.Set("Module", "GroupsModule"); + groupsConfig.Set("DebugEnabled", true); + + SceneSetupHelpers.SetupSceneModules( + scene, configSource, new object[] + { new PermissionsModule(), + new GroupsModule(), + new MockGroupsServicesConnector() }); + + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + IGroupsModule groupsModule = scene.RequestModuleInterface(); + + groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index ccf5289..4aab87f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -163,9 +163,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_msgTransferModule == null) { m_groupsEnabled = false; - m_log.Error("[GROUPS]: Could not get MessageTransferModule"); - Close(); - return; + m_log.Warn("[GROUPS]: Could not get MessageTransferModule"); } } @@ -1299,7 +1297,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is local, delivering directly", localClient.Name); localClient.SendInstantMessage(msg); } - else + else if (m_msgTransferModule != null) { if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: MsgTo ({0}) is not local, delivering via TransferModule", msgTo); m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Message Sent: {0}", success?"Succeeded":"Failed"); }); diff --git a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs index aa48754..6fb9df1 100644 --- a/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs +++ b/OpenSim/Tests/Common/Mock/MockGroupsServicesConnector.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class MockGroupsServicesConnector : ISharedRegionModule, IGroupsServicesConnector { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string Name { @@ -64,6 +64,7 @@ namespace OpenSim.Tests.Common.Mock public void AddRegion(Scene scene) { + m_log.DebugFormat("[MOCK GROUPS SERVICES CONNECTOR]: Adding to region {0}", scene.RegionInfo.RegionName); scene.RegisterModuleInterface(this); } @@ -174,7 +175,7 @@ namespace OpenSim.Tests.Common.Mock public List GetAgentGroupMemberships(UUID requestingAgentID, UUID AgentID) { - return null; + return new List(); } public List GetAgentGroupRoles(UUID requestingAgentID, UUID AgentID, UUID GroupID) diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 9d7733e..8b16496 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -424,9 +424,12 @@ namespace OpenSim.Tests.Common.Setup foreach (IRegionModuleBase module in newModules) { module.AddRegion(scene); - module.RegionLoaded(scene); scene.AddRegionModule(module.Name, module); } + + // RegionLoaded is fired after all modules have been appropriately added to all scenes + foreach (IRegionModuleBase module in newModules) + module.RegionLoaded(scene); scene.SetModuleInterfaces(); } -- cgit v1.1 From 92727ad596a46990d76aad2cf0c75083df2f9c4a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:41:36 +0000 Subject: minor: disable debug logging for previous test --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index bceacda..c78038f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void TestShareWithGroup() { TestHelper.InMethod(); - log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); -- cgit v1.1 From 3643be1c974971fcfab8a1dff2e4a7acb9ec07e1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 14 Dec 2010 23:46:02 +0000 Subject: Rename SceneObjectUserTests to SceneObjectDeRezTests to better reflect its contents --- .../Scenes/Tests/SceneObjectDeRezTests.cs | 129 +++++++++++++++++++++ .../Framework/Scenes/Tests/SceneObjectUserTests.cs | 129 --------------------- 2 files changed, 129 insertions(+), 129 deletions(-) create mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs delete mode 100644 OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs new file mode 100644 index 0000000..b3b99f4 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -0,0 +1,129 @@ +/* + * 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; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Tests manipulation of scene objects by users. + /// + /// + /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. + /// FIXME: These tests are very incomplete - they only test for a few conditions. + [TestFixture] + public class SceneObjectUserTests + { + /// + /// Test deleting an object from a scene. + /// + [Test] + public void TestDeRezSceneObject() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Null); + } + + /// + /// Test deleting an object from a scene where the deleter is not the owner + /// + /// + /// This test assumes that the deleter is not a god. + [Test] + public void TestDeRezSceneObjectNotOwner() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs deleted file mode 100644 index b3b99f4..0000000 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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; -using System.Collections.Generic; -using System.Reflection; -using Nini.Config; -using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Framework.Communications; -using OpenSim.Region.CoreModules.World.Permissions; -using OpenSim.Region.Framework.Scenes; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; -using OpenSim.Tests.Common.Setup; - -namespace OpenSim.Region.Framework.Scenes.Tests -{ - /// - /// Tests manipulation of scene objects by users. - /// - /// - /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. - /// FIXME: These tests are very incomplete - they only test for a few conditions. - [TestFixture] - public class SceneObjectUserTests - { - /// - /// Test deleting an object from a scene. - /// - [Test] - public void TestDeRezSceneObject() - { - TestHelper.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - - TestScene scene = SceneSetupHelpers.SetupScene(); - IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Startup"); - config.Set("serverside_object_permissions", true); - SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); - TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); - - // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. - AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; - - SceneObjectPart part - = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); - part.Name = "obj1"; - scene.AddNewSceneObject(new SceneObjectGroup(part), false); - List localIds = new List(); - localIds.Add(part.LocalId); - - scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); - sogd.InventoryDeQueueAndDelete(); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - Assert.That(retrievedPart, Is.Null); - } - - /// - /// Test deleting an object from a scene where the deleter is not the owner - /// - /// - /// This test assumes that the deleter is not a god. - [Test] - public void TestDeRezSceneObjectNotOwner() - { - TestHelper.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); - UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); - - TestScene scene = SceneSetupHelpers.SetupScene(); - IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Startup"); - config.Set("serverside_object_permissions", true); - SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); - TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); - - // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. - AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; - sogd.Enabled = false; - - SceneObjectPart part - = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); - part.Name = "obj1"; - scene.AddNewSceneObject(new SceneObjectGroup(part), false); - List localIds = new List(); - localIds.Add(part.LocalId); - - scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); - sogd.InventoryDeQueueAndDelete(); - - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); - } - } -} \ No newline at end of file -- cgit v1.1 From a4309578e24e57f596a881ba5e55b81cca74c3ec Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 14 Dec 2010 16:04:28 -0800 Subject: Another stab at #LoginLag. Looking forward to hear the feedback! This makes updates for self movement as absolute top priority, going in to the unthrottled category. Self only, not other avies. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 979dd47..2a59a0c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3553,6 +3553,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> objectUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> compressedUpdateBlocks = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseUpdateBlocks = new OpenSim.Framework.Lazy>(); + OpenSim.Framework.Lazy> terseAgentUpdateBlocks = new OpenSim.Framework.Lazy>(); if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; @@ -3698,7 +3699,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); + if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId) + // Self updates go into a special list + terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); + else + // Everything else goes here + terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); } #endregion Block Construction @@ -3708,7 +3714,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP const float TIME_DILATION = 1.0f; ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - + + if (terseAgentUpdateBlocks.IsValueCreated) + { + List blocks = terseAgentUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Unknown, true); + } + if (objectUpdateBlocks.IsValueCreated) { List blocks = objectUpdateBlocks.Value; -- cgit v1.1 From 6b135ee371a0a78e299357b1c7086c2949059991 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 15 Dec 2010 00:14:43 +0000 Subject: fix mistake in last change of local.include --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index b3b99f4..39116b6 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -43,13 +43,14 @@ using OpenSim.Tests.Common.Setup; namespace OpenSim.Region.Framework.Scenes.Tests { /// - /// Tests manipulation of scene objects by users. + /// Tests derez of scene objects by users. /// - /// + /// /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. - /// FIXME: These tests are very incomplete - they only test for a few conditions. + /// TODO: These tests are very incomplete - they only test for a few conditions. + /// [TestFixture] - public class SceneObjectUserTests + public class SceneObjectDeRezTests { /// /// Test deleting an object from a scene. @@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); sogd.InventoryDeQueueAndDelete(); + // Object should still be in the scene. SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); } -- cgit v1.1