From 686f44c575312950b96413380e7506523d44090f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Aug 2010 18:30:07 +0100 Subject: minor: change "no [GridInfo] config" warning to refer to "configuration files" rather than "OpenSim.ini" --- OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index d1233dc..b07d447 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs @@ -111,7 +111,7 @@ namespace OpenSim.Server.Handlers.Grid private void IssueWarning() { - _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your OpenSim.ini"); + _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your configuration files"); _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:"); foreach (string k in _info.Keys) -- cgit v1.1 From 576faee203126e42b80050867da3ae6769009f06 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Aug 2010 23:17:29 +0100 Subject: minor: change some logging levels --- OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index b07d447..cdab49e 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs @@ -102,11 +102,10 @@ namespace OpenSim.Server.Handlers.Grid } catch (Exception) { - _log.Debug("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); + _log.Warn("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); } _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count); - } private void IssueWarning() @@ -125,7 +124,7 @@ namespace OpenSim.Server.Handlers.Grid XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - _log.Info("[GRID INFO SERVICE]: Request for grid info"); + _log.Debug("[GRID INFO SERVICE]: Request for grid info"); foreach (string k in _info.Keys) { -- cgit v1.1 From 251be8a1be55ecdacc36b1d01d17c4ac6da45c60 Mon Sep 17 00:00:00 2001 From: Marck Date: Tue, 10 Aug 2010 22:39:03 +0200 Subject: Prettify console output for long avatar names. --- OpenSim/Region/Application/OpenSim.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 501d47f..c541249 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -418,7 +418,7 @@ namespace OpenSim { MainConsole.Instance.Output( String.Format( - "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", + "Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}", presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); // kick client... @@ -861,7 +861,7 @@ namespace OpenSim MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); MainConsole.Instance.Output( - String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname", + String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname", "Agent ID", "Root/Child", "Region", "Position")); foreach (ScenePresence presence in agents) @@ -880,7 +880,7 @@ namespace OpenSim MainConsole.Instance.Output( String.Format( - "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", + "{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", presence.Firstname, presence.Lastname, presence.UUID, -- cgit v1.1 From c98c6a2930af5112fe2afdedcb0ccbb76e59d218 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 11 Aug 2010 20:38:10 -0700 Subject: File wants to be committed --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 74b10c3..33aa8ee 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3313,7 +3313,7 @@ namespace OpenSim.Region.Framework.Scenes texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); tex.FaceTextures[face].RGBA = texcolor; UpdateTexture(tex); - TriggerScriptChangedEvent(Changed.COLOR); + TriggerScriptChangedEvent(Changed.COLOR); return; } else if (face == ALL_SIDES) @@ -3335,7 +3335,7 @@ namespace OpenSim.Region.Framework.Scenes tex.DefaultTexture.RGBA = texcolor; } UpdateTexture(tex); - TriggerScriptChangedEvent(Changed.COLOR); + TriggerScriptChangedEvent(Changed.COLOR); return; } } -- cgit v1.1 From 39a748b47a5eb8020f167287c84a91bee0881cca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 20:23:53 +0100 Subject: refactor: Use SOP.Flags rather than SOP.ObjectFlags --- OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs | 4 ++-- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 4 ++-- OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs | 4 ++-- OpenSim/Data/Tests/RegionTests.cs | 8 ++++---- .../Framework/InventoryAccess/InventoryAccessModule.cs | 4 ++-- OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 6 +++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------ 9 files changed, 25 insertions(+), 25 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs index 7c176c7..7d017a6 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs @@ -1017,7 +1017,7 @@ VALUES prim.SitName = (string)primRow["SitName"]; prim.TouchName = (string)primRow["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]); prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); prim.GroupID = new UUID((Guid)primRow["GroupID"]); @@ -1408,7 +1408,7 @@ VALUES parameters.Add(_Database.CreateParameter("SitName", prim.SitName)); parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName)); // permissions - parameters.Add(_Database.CreateParameter("ObjectFlags", prim.ObjectFlags)); + parameters.Add(_Database.CreateParameter("ObjectFlags", (uint)prim.Flags)); parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID)); parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID)); parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID)); diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index d8debc5..1edcb5d 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL prim.SitName = (string)row["SitName"]; prim.TouchName = (string)row["TouchName"]; // Permissions - prim.ObjectFlags = (uint)(int)row["ObjectFlags"]; + prim.Flags = (PrimFlags)(int)row["ObjectFlags"]; prim.OwnerMask = (uint)(int)row["OwnerMask"]; prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"]; prim.GroupMask = (uint)(int)row["GroupMask"]; @@ -1414,7 +1414,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("SitName", prim.SitName); cmd.Parameters.AddWithValue("TouchName", prim.TouchName); // permissions - cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); + cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags); cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs index eb78037..289fd94 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs @@ -1187,7 +1187,7 @@ namespace OpenSim.Data.SQLiteLegacy prim.SitName = (String) row["SitName"]; prim.TouchName = (String) row["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]); prim.CreatorID = new UUID((String) row["CreatorID"]); prim.OwnerID = new UUID((String) row["OwnerID"]); prim.GroupID = new UUID((String) row["GroupID"]); @@ -1521,7 +1521,7 @@ namespace OpenSim.Data.SQLiteLegacy row["SitName"] = prim.SitName; row["TouchName"] = prim.TouchName; // permissions - row["ObjectFlags"] = prim.ObjectFlags; + row["ObjectFlags"] = (uint)prim.Flags; row["CreatorID"] = prim.CreatorID.ToString(); row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index eeffdda..3cd9e0b 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs @@ -317,7 +317,7 @@ namespace OpenSim.Data.Tests sop.CreatorID = creator; sop.InventorySerial = iserial; sop.TaskInventory = dic; - sop.ObjectFlags = objf; + sop.Flags = (PrimFlags)objf; sop.Name = name; sop.Material = material; sop.ScriptAccessPin = pin; @@ -350,7 +350,7 @@ namespace OpenSim.Data.Tests // Modified in-class // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))"); Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))"); - Assert.That(objf,Is.EqualTo(sop.ObjectFlags), "Assert.That(objf,Is.EqualTo(sop.ObjectFlags))"); + Assert.That(objf, Is.EqualTo((uint)sop.Flags), "Assert.That(objf,Is.EqualTo(sop.Flags))"); Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))"); Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))"); Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))"); @@ -373,7 +373,7 @@ namespace OpenSim.Data.Tests Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); // This is necessary or object will not be inserted in DB - sop.ObjectFlags = 0; + sop.Flags = PrimFlags.None; SceneObjectGroup sog = new SceneObjectGroup(sop); @@ -398,7 +398,7 @@ namespace OpenSim.Data.Tests Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))"); //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))"); Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))"); - //Assert.That(objf,Is.EqualTo(p.ObjectFlags), "Assert.That(objf,Is.EqualTo(p.ObjectFlags))"); + //Assert.That(objf, Is.EqualTo((uint)p.Flags), "Assert.That(objf,Is.EqualTo(p.Flags))"); Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))"); Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))"); Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))"); diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 1a7da61..eef0c73 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -543,7 +543,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (attachment) { - group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; + group.RootPart.Flags |= PrimFlags.Phantom; group.RootPart.IsAttachment = true; } diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index 00f6918..c489972 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers xmlobject.AppendChild(node); node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); - node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags); + node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags); xmlobject.AppendChild(node); node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", ""); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0eb28f4..afdb95b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1897,7 +1897,7 @@ namespace OpenSim.Region.Framework.Scenes AddRestoredSceneObject(group, true, true); SceneObjectPart rootPart = group.GetChildPart(group.UUID); - rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; + rootPart.Flags &= ~PrimFlags.Scripted; rootPart.TrimPermissions(); group.CheckSculptAndLoad(); //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); @@ -2184,7 +2184,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart part in group.Children.Values) { - if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0)) + if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0)) { PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? } @@ -4852,7 +4852,7 @@ namespace OpenSim.Region.Framework.Scenes } // turn the proxy non-physical, which also stops its client-side interpolation - bool wasUsingPhysics = ((jointProxyObject.ObjectFlags & (uint)PrimFlags.Physics) != 0); + bool wasUsingPhysics = ((jointProxyObject.Flags & PrimFlags.Physics) != 0); if (wasUsingPhysics) { jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3670080..117f869 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1322,9 +1322,9 @@ namespace OpenSim.Region.Framework.Scenes public void aggregateScriptEvents() { - uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags(); + PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags(); - scriptEvents aggregateScriptEvents=0; + scriptEvents aggregateScriptEvents = 0; lock (m_parts) { @@ -1333,7 +1333,7 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) continue; if (part != RootPart) - part.ObjectFlags = objectflagupdate; + part.Flags = objectflagupdate; aggregateScriptEvents |= part.AggregateScriptEvents; } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 33aa8ee..2ad4223 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Framework.Scenes public void AddFlag(PrimFlags flag) { // PrimFlags prevflag = Flags; - if ((ObjectFlags & (uint) flag) == 0) + if ((Flags & flag) == 0) { //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); Flags |= flag; @@ -1607,7 +1607,7 @@ namespace OpenSim.Region.Framework.Scenes dupe.Velocity = new Vector3(0, 0, 0); dupe.Acceleration = new Vector3(0, 0, 0); dupe.AngularVelocity = new Vector3(0, 0, 0); - dupe.ObjectFlags = ObjectFlags; + dupe.Flags = Flags; dupe._ownershipCost = _ownershipCost; dupe._objectSaleType = _objectSaleType; @@ -1644,7 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived); } - bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); + bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0); dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } @@ -4271,9 +4271,9 @@ namespace OpenSim.Region.Framework.Scenes public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD) { - bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); - bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0); - bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0); + bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0); + bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0); + bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0); bool wasVD = VolumeDetectActive; if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD)) -- cgit v1.1 From 5f5c65e4bae1f2a84d6972697d0413137f6b1da1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 20:34:46 +0100 Subject: refactor: move more map tile generation code from scene to IWorldMapModule --- OpenSim/Region/Application/OpenSimBase.cs | 8 +++++-- .../CoreModules/World/WorldMap/WorldMapModule.cs | 17 ++++++++++++-- .../Region/Framework/Interfaces/IWorldMapModule.cs | 5 +++- OpenSim/Region/Framework/Scenes/Scene.cs | 27 ---------------------- 4 files changed, 25 insertions(+), 32 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f535fe8..e148cde 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -347,9 +347,13 @@ namespace OpenSim // Prims have to be loaded after module configuration since some modules may be invoked during the load scene.LoadPrimsFromStorage(regionInfo.originRegionID); - // moved these here as the terrain texture has to be created after the modules are initialized + // moved these here as the map texture has to be created after the modules are initialized // and has to happen before the region is registered with the grid. - scene.CreateTerrainTexture(); + IWorldMapModule mapModule = scene.RequestModuleInterface(); + if (mapModule != null) + mapModule.GenerateMaptile(); + else + m_log.WarnFormat("[STARTUP]: No map module available to generate map tile"); // TODO : Try setting resource for region xstats here on scene MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9d9967a..f036d85 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1000,11 +1000,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return responsemap; } - public void RegenerateMaptile(byte[] data) + public void GenerateMaptile() { + // Cannot create a map for a nonexistant heightmap + if (m_scene.Heightmap == null) + return; + + //create a texture asset of the terrain + IMapImageGenerator terrain = m_scene.RequestModuleInterface(); + if (terrain == null) + return; + + byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png"); + if (data == null) + return; + UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; - m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); + m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs index ac6afed..d6e31f4 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs @@ -29,6 +29,9 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IWorldMapModule { - void RegenerateMaptile(byte[] data); + /// + /// Generate a map tile for the scene. a terrain texture for this scene + /// + void GenerateMaptile(); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index afdb95b..4d5c1e7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1812,33 +1812,6 @@ namespace OpenSim.Region.Framework.Scenes } - /// - /// Create a terrain texture for this scene - /// - public void CreateTerrainTexture() - { - //create a texture asset of the terrain - IMapImageGenerator terrain = RequestModuleInterface(); - - // Cannot create a map for a nonexistant heightmap yet. - if (Heightmap == null) - return; - - if (terrain == null) - return; - - byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png"); - if (data != null) - { - IWorldMapModule mapModule = RequestModuleInterface(); - - if (mapModule != null) - mapModule.RegenerateMaptile(data); - else - m_log.DebugFormat("[SCENE]: MapModule is null, can't save maptile"); - } - } - #endregion #region Load Land -- cgit v1.1 From fd23f270c6914b7aa628f96daa9608745d3a20b3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:01:10 +0100 Subject: refactor: remove Scene.SetRootAgentScene() in favour of existing event with same name --- .../Avatar/Inventory/Transfer/InventoryTransferModule.cs | 15 ++++++++------- .../Framework/Interfaces/IInventoryTransferModule.cs | 3 +-- OpenSim/Region/Framework/Scenes/Scene.cs | 11 ----------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 4 files changed, 10 insertions(+), 21 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 2f1e9dd..8b77a5f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -82,6 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; } public void RegionLoaded(Scene scene) @@ -98,9 +99,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; } } - } public void RemoveRegion(Scene scene) @@ -108,6 +109,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; m_Scenelist.Remove(scene); } @@ -136,6 +138,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer // Inventory giving is conducted via instant message client.OnInstantMessage += OnInstantMessage; } + + protected void OnSetRootAgentScene(UUID id, Scene scene) + { + m_AgentRegions[id] = scene; + } private Scene FindClientScene(UUID agentId) { @@ -160,7 +167,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (scene == null) // Something seriously wrong here. return; - if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) { //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0])); @@ -346,11 +352,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer } } - public void SetRootAgentScene(UUID agentID, Scene scene) - { - m_AgentRegions[agentID] = scene; - } - public bool NeedSceneCacheClear(UUID agentID, Scene scene) { if (!m_AgentRegions.ContainsKey(agentID)) diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs index 2390ff4..1e92fde 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs @@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces /// public interface IInventoryTransferModule { - void SetRootAgentScene(UUID agentID, Scene scene); bool NeedSceneCacheClear(UUID agentID, Scene scene); } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4d5c1e7..631046a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4487,17 +4487,6 @@ namespace OpenSim.Region.Framework.Scenes client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } - public void SetRootAgentScene(UUID agentID) - { - IInventoryTransferModule inv = RequestModuleInterface(); - if (inv == null) - return; - - inv.SetRootAgentScene(agentID, this); - - EventManager.TriggerSetRootAgentScene(agentID, this); - } - public bool NeedSceneCacheClear(UUID agentID) { IInventoryTransferModule inv = RequestModuleInterface(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 14d7d6a..08c6e27 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -821,7 +821,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; - m_scene.SetRootAgentScene(m_uuid); + m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); // Moved this from SendInitialData to ensure that m_appearance is initialized // before the inventory is processed in MakeRootAgent. This fixes a race condition -- cgit v1.1 From b51534852f409bc02034ab2242bd4544d82392b2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:07:45 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 653f856..69ab33d 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // private int m_stipend = 1000; - private int ObjectCapacity = 45000; +// private int ObjectCapacity = 45000; private int ObjectCount = 0; private int PriceEnergyUnit = 0; private int PriceGroupCreate = 0; -- cgit v1.1 From 5d20f04e08c65b37bbdda187c30ce038872307ab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:18:26 +0100 Subject: refactor: move Scene.TerrainUnAcked() handling into TerrainModule --- OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 9 ++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 8 -------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 2c5e444..cb80111 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -586,8 +586,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain client.OnModifyTerrain += client_OnModifyTerrain; client.OnBakeTerrain += client_OnBakeTerrain; client.OnLandUndo += client_OnLandUndo; + client.OnUnackedTerrain += client_OnUnackedTerrain; } - + /// /// Checks to see if the terrain has been modified since last check /// but won't attempt to limit those changes to the limits specified in the estate settings @@ -808,6 +809,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter } } + + protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY) + { + //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); + client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised()); + } private void StoreUndoState() { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 631046a..50f6b71 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2770,7 +2770,6 @@ namespace OpenSim.Region.Framework.Scenes public virtual void SubscribeToClientTerrainEvents(IClientAPI client) { client.OnRegionHandShakeReply += SendLayerData; - client.OnUnackedTerrain += TerrainUnAcked; } public virtual void SubscribeToClientPrimEvents(IClientAPI client) @@ -2901,7 +2900,6 @@ namespace OpenSim.Region.Framework.Scenes public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) { client.OnRegionHandShakeReply -= SendLayerData; - client.OnUnackedTerrain -= TerrainUnAcked; } public virtual void UnSubscribeToClientPrimEvents(IClientAPI client) @@ -4481,12 +4479,6 @@ namespace OpenSim.Region.Framework.Scenes client.SendRegionHandle(regionID, handle); } - public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) - { - //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); - client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); - } - public bool NeedSceneCacheClear(UUID agentID) { IInventoryTransferModule inv = RequestModuleInterface(); -- cgit v1.1 From feba3164af384371ecb21b21edba1f7045e1939c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:19:32 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index fecb73f..7c4f689 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders -- cgit v1.1 From b30635a454a2d4c8753023efaeb41118be1ef40e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:39:43 +0100 Subject: Establish new Objects/BuySellModule Move Scene.ObjectSaleInfo() to this --- .../World/Objects/BuySell/BuySellModule.cs | 98 ++++++++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 23 +---- 2 files changed, 99 insertions(+), 22 deletions(-) create mode 100644 OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs new file mode 100644 index 0000000..326eea9 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -0,0 +1,98 @@ +/* + * 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 OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.CoreModules.World.Objects.BuySell +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] + public class BuySellModule : INonSharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected Scene m_scene = null; + + public string Name { get { return "Object BuySell Module"; } } + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) {} + + public void AddRegion(Scene scene) + { + m_scene = scene; + m_scene.EventManager.OnNewClient += SubscribeToClientEvents; + } + + public void RemoveRegion(Scene scene) + { + m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; + } + + public void RegionLoaded(Scene scene) {} + + public void Close() + { + RemoveRegion(m_scene); + } + + public void SubscribeToClientEvents(IClientAPI client) + { + client.OnObjectSaleInfo += ObjectSaleInfo; + } + + protected void ObjectSaleInfo( + IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) + { + SceneObjectPart part = m_scene.GetSceneObjectPart(localID); + if (part == null || part.ParentGroup == null) + return; + + if (part.ParentGroup.IsDeleted) + return; + + part = part.ParentGroup.RootPart; + + part.ObjectSaleType = saleType; + part.SalePrice = salePrice; + + part.ParentGroup.HasGroupChanged = true; + + part.GetProperties(client); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 50f6b71..b6def14 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2809,8 +2809,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnUndo += m_sceneGraph.HandleUndo; client.OnRedo += m_sceneGraph.HandleRedo; client.OnObjectDescription += m_sceneGraph.PrimDescription; - client.OnObjectDrop += m_sceneGraph.DropObject; - client.OnObjectSaleInfo += ObjectSaleInfo; + client.OnObjectDrop += m_sceneGraph.DropObject; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; client.OnObjectOwner += ObjectOwner; } @@ -2938,7 +2937,6 @@ namespace OpenSim.Region.Framework.Scenes client.OnRedo -= m_sceneGraph.HandleRedo; client.OnObjectDescription -= m_sceneGraph.PrimDescription; client.OnObjectDrop -= m_sceneGraph.DropObject; - client.OnObjectSaleInfo -= ObjectSaleInfo; client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable; client.OnObjectOwner -= ObjectOwner; } @@ -4488,25 +4486,6 @@ namespace OpenSim.Region.Framework.Scenes return inv.NeedSceneCacheClear(agentID, this); } - public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) - { - SceneObjectPart part = GetSceneObjectPart(localID); - if (part == null || part.ParentGroup == null) - return; - - if (part.ParentGroup.IsDeleted) - return; - - part = part.ParentGroup.RootPart; - - part.ObjectSaleType = saleType; - part.SalePrice = salePrice; - - part.ParentGroup.HasGroupChanged = true; - - part.GetProperties(client); - } - public bool PerformObjectBuy(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType) { -- cgit v1.1 From 9d84dfb687f3387773f67497d4c39386636853fa Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 21:44:44 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index a895d6e..032e55a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { string deadAvatarMessage; ScenePresence killingAvatar = null; - string killingAvatarMessage; +// string killingAvatarMessage; if (killerObjectLocalID == 0) deadAvatarMessage = "You committed suicide!"; @@ -118,14 +118,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID)); else { - killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); +// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); } } } else { - killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); +// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); } } -- cgit v1.1 From e89f0b3f71dc8bd439fcfc23d12b305369eac36b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 22:29:42 +0100 Subject: refactor: move Scene.PerformObjectBuy into BuySellModule --- .../World/Objects/BuySell/BuySellModule.cs | 169 ++++++++++++++++++++- .../Region/Framework/Interfaces/IBuySellModule.cs | 47 ++++++ .../Region/Framework/Interfaces/ICloudModule.cs | 3 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 159 ------------------- .../World/MoneyModule/SampleMoneyModule.cs | 15 +- 6 files changed, 222 insertions(+), 173 deletions(-) create mode 100644 OpenSim/Region/Framework/Interfaces/IBuySellModule.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 326eea9..b0ddd8f 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -37,15 +37,17 @@ using OpenSim.Framework; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Scenes.Serialization; namespace OpenSim.Region.CoreModules.World.Objects.BuySell { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] - public class BuySellModule : INonSharedRegionModule + public class BuySellModule : IBuySellModule, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; + protected IDialogModule m_dialogModule; public string Name { get { return "Object BuySell Module"; } } public Type ReplaceableInterface { get { return null; } } @@ -55,6 +57,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell public void AddRegion(Scene scene) { m_scene = scene; + m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += SubscribeToClientEvents; } @@ -63,7 +66,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; } - public void RegionLoaded(Scene scene) {} + public void RegionLoaded(Scene scene) + { + m_dialogModule = scene.RequestModuleInterface(); + } public void Close() { @@ -93,6 +99,165 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell part.ParentGroup.HasGroupChanged = true; part.GetProperties(client); + } + + public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType) + { + SceneObjectPart part = m_scene.GetSceneObjectPart(localID); + + if (part == null) + return false; + + if (part.ParentGroup == null) + return false; + + SceneObjectGroup group = part.ParentGroup; + + switch (saleType) + { + case 1: // Sell as original (in-place sale) + uint effectivePerms = group.GetEffectivePermissions(); + + if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); + return false; + } + + group.SetOwnerId(remoteClient.AgentId); + group.SetRootPartOwner(part, remoteClient.AgentId, remoteClient.ActiveGroupId); + + List partList = new List(group.Children.Values); + + if (m_scene.Permissions.PropagatePermissions()) + { + foreach (SceneObjectPart child in partList) + { + child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); + child.TriggerScriptChangedEvent(Changed.OWNER); + child.ApplyNextOwnerPermissions(); + } + } + + part.ObjectSaleType = 0; + part.SalePrice = 10; + + group.HasGroupChanged = true; + part.GetProperties(remoteClient); + part.TriggerScriptChangedEvent(Changed.OWNER); + group.ResumeScripts(); + part.ScheduleFullUpdate(); + + break; + + case 2: // Sell a copy + Vector3 inventoryStoredPosition = new Vector3 + (((group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X) + , + (group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X, + group.AbsolutePosition.Z); + + Vector3 originalPosition = group.AbsolutePosition; + + group.AbsolutePosition = inventoryStoredPosition; + + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); + group.AbsolutePosition = originalPosition; + + uint perms = group.GetEffectivePermissions(); + + if ((perms & (uint)PermissionMask.Transfer) == 0) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); + return false; + } + + AssetBase asset = m_scene.CreateAsset( + group.GetPartName(localID), + group.GetPartDescription(localID), + (sbyte)AssetType.Object, + Utils.StringToBytes(sceneObjectXml), + group.OwnerID); + m_scene.AssetService.Store(asset); + + InventoryItemBase item = new InventoryItemBase(); + item.CreatorId = part.CreatorID.ToString(); + + item.ID = UUID.Random(); + item.Owner = remoteClient.AgentId; + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; + item.InvType = (int)InventoryType.Object; + item.Folder = categoryID; + + uint nextPerms=(perms & 7) << 13; + if ((nextPerms & (uint)PermissionMask.Copy) == 0) + perms &= ~(uint)PermissionMask.Copy; + if ((nextPerms & (uint)PermissionMask.Transfer) == 0) + perms &= ~(uint)PermissionMask.Transfer; + if ((nextPerms & (uint)PermissionMask.Modify) == 0) + perms &= ~(uint)PermissionMask.Modify; + + item.BasePermissions = perms & part.NextOwnerMask; + item.CurrentPermissions = perms & part.NextOwnerMask; + item.NextPermissions = part.NextOwnerMask; + item.EveryOnePermissions = part.EveryoneMask & + part.NextOwnerMask; + item.GroupPermissions = part.GroupMask & + part.NextOwnerMask; + item.CurrentPermissions |= 16; // Slam! + item.CreationDate = Util.UnixTimeSinceEpoch(); + + if (m_scene.InventoryService.AddItem(item)) + { + remoteClient.SendInventoryItemCreateUpdate(item, 0); + } + else + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); + return false; + } + break; + + case 3: // Sell contents + List invList = part.Inventory.GetInventoryList(); + + bool okToSell = true; + + foreach (UUID invID in invList) + { + TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); + if ((item1.CurrentPermissions & + (uint)PermissionMask.Transfer) == 0) + { + okToSell = false; + break; + } + } + + if (!okToSell) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser( + remoteClient, "This item's inventory doesn't appear to be for sale"); + return false; + } + + if (invList.Count > 0) + m_scene.MoveTaskInventoryItems(remoteClient.AgentId, part.Name, part, invList); + break; + } + + return true; } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs new file mode 100644 index 0000000..0132bae --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs @@ -0,0 +1,47 @@ +/* + * 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 OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface IBuySellModule + { + /// + /// Try to buy an object + /// + /// + /// + /// + /// + /// + /// True on a successful purchase, false on failure + /// + bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType); + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index f8a5bad..7296ac3 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - namespace OpenSim.Region.Framework.Interfaces { public interface ICloudModule : IRegionModule @@ -35,4 +34,4 @@ namespace OpenSim.Region.Framework.Interfaces /// float CloudCover(int x, int y, int z); } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 01edf51..4f5a65e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -670,7 +670,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Create a new asset data structure. /// - private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID) + public AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID) { AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID.ToString()); asset.Description = description; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b6def14..5f6748e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4486,165 +4486,6 @@ namespace OpenSim.Region.Framework.Scenes return inv.NeedSceneCacheClear(agentID, this); } - public bool PerformObjectBuy(IClientAPI remoteClient, UUID categoryID, - uint localID, byte saleType) - { - SceneObjectPart part = GetSceneObjectPart(localID); - - if (part == null) - return false; - - if (part.ParentGroup == null) - return false; - - SceneObjectGroup group = part.ParentGroup; - - switch (saleType) - { - case 1: // Sell as original (in-place sale) - uint effectivePerms=group.GetEffectivePermissions(); - - if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) - { - m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); - return false; - } - - group.SetOwnerId(remoteClient.AgentId); - group.SetRootPartOwner(part, remoteClient.AgentId, - remoteClient.ActiveGroupId); - - List partList = - new List(group.Children.Values); - - if (Permissions.PropagatePermissions()) - { - foreach (SceneObjectPart child in partList) - { - child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); - child.TriggerScriptChangedEvent(Changed.OWNER); - child.ApplyNextOwnerPermissions(); - } - } - - part.ObjectSaleType = 0; - part.SalePrice = 10; - - group.HasGroupChanged = true; - part.GetProperties(remoteClient); - part.TriggerScriptChangedEvent(Changed.OWNER); - group.ResumeScripts(); - part.ScheduleFullUpdate(); - - break; - - case 2: // Sell a copy - - - Vector3 inventoryStoredPosition = new Vector3 - (((group.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : group.AbsolutePosition.X) - , - (group.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : group.AbsolutePosition.X, - group.AbsolutePosition.Z); - - Vector3 originalPosition = group.AbsolutePosition; - - group.AbsolutePosition = inventoryStoredPosition; - - string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); - group.AbsolutePosition = originalPosition; - - uint perms=group.GetEffectivePermissions(); - - if ((perms & (uint)PermissionMask.Transfer) == 0) - { - m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); - return false; - } - - AssetBase asset = CreateAsset( - group.GetPartName(localID), - group.GetPartDescription(localID), - (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml), - group.OwnerID); - AssetService.Store(asset); - - InventoryItemBase item = new InventoryItemBase(); - item.CreatorId = part.CreatorID.ToString(); - - item.ID = UUID.Random(); - item.Owner = remoteClient.AgentId; - item.AssetID = asset.FullID; - item.Description = asset.Description; - item.Name = asset.Name; - item.AssetType = asset.Type; - item.InvType = (int)InventoryType.Object; - item.Folder = categoryID; - - uint nextPerms=(perms & 7) << 13; - if ((nextPerms & (uint)PermissionMask.Copy) == 0) - perms &= ~(uint)PermissionMask.Copy; - if ((nextPerms & (uint)PermissionMask.Transfer) == 0) - perms &= ~(uint)PermissionMask.Transfer; - if ((nextPerms & (uint)PermissionMask.Modify) == 0) - perms &= ~(uint)PermissionMask.Modify; - - item.BasePermissions = perms & part.NextOwnerMask; - item.CurrentPermissions = perms & part.NextOwnerMask; - item.NextPermissions = part.NextOwnerMask; - item.EveryOnePermissions = part.EveryoneMask & - part.NextOwnerMask; - item.GroupPermissions = part.GroupMask & - part.NextOwnerMask; - item.CurrentPermissions |= 16; // Slam! - item.CreationDate = Util.UnixTimeSinceEpoch(); - - if (InventoryService.AddItem(item)) - remoteClient.SendInventoryItemCreateUpdate(item, 0); - else - { - m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); - return false; - } - break; - - case 3: // Sell contents - List invList = part.Inventory.GetInventoryList(); - - bool okToSell = true; - - foreach (UUID invID in invList) - { - TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); - if ((item1.CurrentPermissions & - (uint)PermissionMask.Transfer) == 0) - { - okToSell = false; - break; - } - } - - if (!okToSell) - { - m_dialogModule.SendAlertToUser( - remoteClient, "This item's inventory doesn't appear to be for sale"); - return false; - } - - if (invList.Count > 0) - MoveTaskInventoryItems(remoteClient.AgentId, part.Name, - part, invList); - break; - } - - return true; - } - public void CleanTempObjects() { List objs = GetEntities(); diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 69ab33d..61cbb90 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -72,8 +72,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule private IConfigSource m_gConfig; - - /// /// Region UUIDS indexed by AgentID /// @@ -267,13 +265,11 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false); } - } private void GetClientFunds(IClientAPI client) { CheckExistAndRefreshFunds(client.AgentId); - } /// @@ -815,7 +811,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false); return; } - s.PerformObjectBuy(remoteClient, categoryID, localID, saleType); + + IBuySellModule module = s.RequestModuleInterface(); + if (module != null) + module.BuyObject(remoteClient, categoryID, localID, saleType); } } @@ -825,7 +824,5 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule RegionMoneyRequest = 1, Gift = 2, Purchase = 3 - } - - -} + } +} \ No newline at end of file -- cgit v1.1 From ab6dc478188e1609d9656e65d410d08270066bf0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 23:15:11 +0100 Subject: refactor: move binary statistics logging from scene into separate region module --- .../Statistics/Logging/BinaryLoggingModule.cs | 169 +++++++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 9 +- OpenSim/Region/Framework/Scenes/Scene.cs | 113 +------------- 3 files changed, 181 insertions(+), 110 deletions(-) create mode 100644 OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs new file mode 100644 index 0000000..b75a700 --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs @@ -0,0 +1,169 @@ +/* + * 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.IO; +using System.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.CoreModules.Avatar.Attachments +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BinaryLoggingModule")] + public class BinaryLoggingModule : INonSharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected bool m_collectStats; + protected Scene m_scene = null; + + public string Name { get { return "Binary Statistics Logging Module"; } } + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) + { + try + { + IConfig statConfig = source.Configs["Statistics.Binary"]; + if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) + { + if (statConfig.Contains("collect_region_stats")) + { + if (statConfig.GetBoolean("collect_region_stats")) + { + m_collectStats = true; + } + } + if (statConfig.Contains("region_stats_period_seconds")) + { + m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); + } + if (statConfig.Contains("stats_dir")) + { + m_statsDir = statConfig.GetString("stats_dir"); + } + } + } + catch + { + // if it doesn't work, we don't collect anything + } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + if (m_collectStats) + m_scene.StatsReporter.OnSendStatsResult += LogSimStats; + } + + public void Close() + { + } + + public class StatLogger + { + public DateTime StartTime; + public string Path; + public System.IO.BinaryWriter Log; + } + + static StatLogger m_statLog = null; + static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); + static string m_statsDir = String.Empty; + static Object m_statLockObject = new Object(); + + private void LogSimStats(SimStats stats) + { + SimStatsPacket pack = new SimStatsPacket(); + pack.Region = new SimStatsPacket.RegionBlock(); + pack.Region.RegionX = stats.RegionX; + pack.Region.RegionY = stats.RegionY; + pack.Region.RegionFlags = stats.RegionFlags; + pack.Region.ObjectCapacity = stats.ObjectCapacity; + //pack.Region = //stats.RegionBlock; + pack.Stat = stats.StatsBlock; + pack.Header.Reliable = false; + + // note that we are inside the reporter lock when called + DateTime now = DateTime.Now; + + // hide some time information into the packet + pack.Header.Sequence = (uint)now.Ticks; + + lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here + { + try + { + if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod) + { + // First log file or time has expired, start writing to a new log file + if (m_statLog != null && m_statLog.Log != null) + { + m_statLog.Log.Close(); + } + m_statLog = new StatLogger(); + m_statLog.StartTime = now; + m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") + + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss")); + m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write)); + } + + // Write the serialized data to disk + if (m_statLog != null && m_statLog.Log != null) + m_statLog.Log.Write(pack.ToBytes()); + } + catch (Exception ex) + { + m_log.Error("statistics gathering failed: " + ex.Message, ex); + if (m_statLog != null && m_statLog.Log != null) + { + m_statLog.Log.Close(); + } + m_statLog = null; + } + } + return; + } + } +} diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 4f5a65e..9963225 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -834,7 +834,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence presence; if (TryGetScenePresence(remoteClient.AgentId, out presence)) { - byte[] data = null; +// byte[] data = null; AssetBase asset = new AssetBase(); asset.FullID = olditemID; @@ -842,8 +842,10 @@ namespace OpenSim.Region.Framework.Scenes asset.Name = name; asset.Description = description; - CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); - + CreateNewInventoryItem( + remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, + (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, + (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); } else { @@ -876,7 +878,6 @@ namespace OpenSim.Region.Framework.Scenes InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs); } - /// /// Send the details of a prim's inventory to the client. /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5f6748e..f62851a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -481,73 +481,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - #region BinaryStats - - public class StatLogger - { - public DateTime StartTime; - public string Path; - public System.IO.BinaryWriter Log; - } - static StatLogger m_statLog = null; - static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); - static string m_statsDir = String.Empty; - static Object m_statLockObject = new Object(); - private void LogSimStats(SimStats stats) - { - SimStatsPacket pack = new SimStatsPacket(); - pack.Region = new SimStatsPacket.RegionBlock(); - pack.Region.RegionX = stats.RegionX; - pack.Region.RegionY = stats.RegionY; - pack.Region.RegionFlags = stats.RegionFlags; - pack.Region.ObjectCapacity = stats.ObjectCapacity; - //pack.Region = //stats.RegionBlock; - pack.Stat = stats.StatsBlock; - pack.Header.Reliable = false; - - // note that we are inside the reporter lock when called - DateTime now = DateTime.Now; - - // hide some time information into the packet - pack.Header.Sequence = (uint)now.Ticks; - - lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here - { - try - { - if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod) - { - // First log file or time has expired, start writing to a new log file - if (m_statLog != null && m_statLog.Log != null) - { - m_statLog.Log.Close(); - } - m_statLog = new StatLogger(); - m_statLog.StartTime = now; - m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") - + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss")); - m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write)); - } - - // Write the serialized data to disk - if (m_statLog != null && m_statLog.Log != null) - m_statLog.Log.Write(pack.ToBytes()); - } - catch (Exception ex) - { - m_log.Error("statistics gathering failed: " + ex.Message, ex); - if (m_statLog != null && m_statLog.Log != null) - { - m_statLog.Log.Close(); - } - m_statLog = null; - } - } - return; - } - - #endregion - #region Constructors public Scene(RegionInfo regInfo, AgentCircuitManager authen, @@ -752,38 +685,6 @@ namespace OpenSim.Region.Framework.Scenes } m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); - - #region BinaryStats - - try - { - IConfig statConfig = m_config.Configs["Statistics.Binary"]; - if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) - { - if (statConfig.Contains("collect_region_stats")) - { - if (statConfig.GetBoolean("collect_region_stats")) - { - // if enabled, add us to the event. If not enabled, I won't get called - StatsReporter.OnSendStatsResult += LogSimStats; - } - } - if (statConfig.Contains("region_stats_period_seconds")) - { - m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); - } - if (statConfig.Contains("stats_dir")) - { - m_statsDir = statConfig.GetString("stats_dir"); - } - } - } - catch - { - // if it doesn't work, we don't collect anything - } - - #endregion BinaryStats } catch { @@ -2652,7 +2553,7 @@ namespace OpenSim.Region.Framework.Scenes if (!VerifyClient(aCircuit, ep, out vialogin)) { // uh-oh, this is fishy - m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", + m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", client.AgentId, client.SessionId, ep.ToString()); try { @@ -2660,13 +2561,13 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); + m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); } return; } } - m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); + m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); ScenePresence sp = CreateAndAddScenePresence(client); if (aCircuit != null) @@ -2695,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes // Do the verification here if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) { - m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); if (userVerification != null && ep != null) @@ -2705,11 +2606,11 @@ namespace OpenSim.Region.Framework.Scenes if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString())) { // uh-oh, this is fishy - m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); return false; } else - m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); } } @@ -2740,7 +2641,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); + m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); } } else -- cgit v1.1 From c64bef146bd66a4044e1bd3cd367ff392c1495bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 23:18:05 +0100 Subject: minor: remove mono compiler warnings --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5473d23..c11b9a2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6295,7 +6295,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; +// ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; ObjectDuplicate handlerObjectDuplicate = null; @@ -11668,8 +11668,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { StringBuilder sb = new StringBuilder(); sb.Append("["); - if (this.priority != null) - sb.Append(this.priority.ToString()); + sb.Append(this.priority.ToString()); sb.Append(","); if (this.value != null) sb.Append(this.value.ToString()); -- cgit v1.1 From 8acb401a1455430336c41ac9becb0c16390612f0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Aug 2010 23:28:28 +0100 Subject: minor: remove mono compiler warnings --- .../EntityTransfer/EntityTransferModule.cs | 26 ++++++++-------- .../Framework/InventoryAccess/HGAssetMapper.cs | 2 +- .../InventoryAccess/HGInventoryAccessModule.cs | 4 +-- .../CoreModules/Framework/Library/LibraryModule.cs | 16 +++++----- .../InterGrid/OpenGridProtocolModule.cs | 35 +++++++++++----------- .../Inventory/RemoteInventoryServiceConnector.cs | 5 ++-- .../Inventory/RemoteXInventoryServiceConnector.cs | 5 ++-- .../CoreModules/World/Land/LandManagementModule.cs | 12 ++++---- .../World/Objects/BuySell/BuySellModule.cs | 2 +- .../CoreModules/World/WorldMap/MapSearchModule.cs | 18 +++++------ 10 files changed, 62 insertions(+), 63 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ab1cfc3..364d340 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -1265,18 +1265,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return handles; } - private void Dump(string msg, List handles) - { - m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); - foreach (ulong handle in handles) - { - uint x, y; - Utils.LongToUInts(handle, out x, out y); - x = x / Constants.RegionSize; - y = y / Constants.RegionSize; - m_log.InfoFormat("({0}, {1})", x, y); - } - } +// private void Dump(string msg, List handles) +// { +// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); +// foreach (ulong handle in handles) +// { +// uint x, y; +// Utils.LongToUInts(handle, out x, out y); +// x = x / Constants.RegionSize; +// y = y / Constants.RegionSize; +// m_log.InfoFormat("({0}, {1})", x, y); +// } +// } #endregion diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index b13b9d8..ccb892e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess try { asset1.ID = url + "/" + asset.ID; - UUID temp = UUID.Zero; +// UUID temp = UUID.Zero; // TODO: if the creator is local, stick this grid's URL in front //if (UUID.TryParse(asset.Metadata.CreatorID, out temp)) // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 8ccc941..c673b31 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess get { return m_assMapper; } } - private bool m_Initialized = false; +// private bool m_Initialized = false; #region INonSharedRegionModule diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 9c20d68..d570608 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library private static bool m_HasRunOnce = false; private bool m_Enabled = false; - private string m_LibraryName = "OpenSim Library"; +// private string m_LibraryName = "OpenSim Library"; private Scene m_Scene; private ILibraryService m_Library; @@ -212,13 +212,13 @@ namespace OpenSim.Region.CoreModules.Framework.Library } } - private void DumpLibrary() - { - InventoryFolderImpl lib = m_Library.LibraryRootFolder; - - m_log.DebugFormat(" - folder {0}", lib.Name); - DumpFolder(lib); - } +// private void DumpLibrary() +// { +// InventoryFolderImpl lib = m_Library.LibraryRootFolder; +// +// m_log.DebugFormat(" - folder {0}", lib.Name); +// DumpFolder(lib); +// } // // private void DumpLibrary() // { diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index e95d2f8..87a0a8d 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.InterGrid private string httpsCN = ""; private bool httpSSL = false; private uint httpsslport = 0; - private bool GridMode = false; +// private bool GridMode = false; #region IRegionModule Members @@ -126,10 +126,10 @@ namespace OpenSim.Region.CoreModules.InterGrid } - if (startupcfg != null) - { - GridMode = enabled = startupcfg.GetBoolean("gridmode", false); - } +// if (startupcfg != null) +// { +// GridMode = enabled = startupcfg.GetBoolean("gridmode", false); +// } if (cfg != null) { @@ -1213,18 +1213,19 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - private string CreateRandomStr(int len) - { - Random rnd = new Random(Environment.TickCount); - string returnstring = ""; - string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; - - for (int i = 0; i < len; i++) - { - returnstring += chars.Substring(rnd.Next(chars.Length), 1); - } - return returnstring; - } +// private string CreateRandomStr(int len) +// { +// Random rnd = new Random(Environment.TickCount); +// string returnstring = ""; +// string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; +// +// for (int i = 0; i < len; i++) +// { +// returnstring += chars.Substring(rnd.Next(chars.Length), 1); +// } +// return returnstring; +// } + // Temporary hack to allow teleporting to and from Vaak private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index aa3b30d..153aeec 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -32,7 +32,6 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Statistics; - using OpenSim.Services.Connectors; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private bool m_Enabled = false; private bool m_Initialized = false; - private Scene m_Scene; +// private Scene m_Scene; private InventoryServicesConnector m_RemoteConnector; public Type ReplaceableInterface @@ -105,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { - m_Scene = scene; +// m_Scene = scene; //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); if (!m_Enabled) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 277060d..ada26cc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs @@ -32,7 +32,6 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Statistics; - using OpenSim.Services.Connectors; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private bool m_Enabled = false; private bool m_Initialized = false; - private Scene m_Scene; +// private Scene m_Scene; private XInventoryServicesConnector m_RemoteConnector; public Type ReplaceableInterface @@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { - m_Scene = scene; +// m_Scene = scene; //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); if (!m_Enabled) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 31aa017..15dc301 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -139,12 +139,12 @@ namespace OpenSim.Region.CoreModules.World.Land { } - private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) - { - ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); - reason = "You are not allowed to enter this sim."; - return nearestParcel != null; - } +// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) +// { +// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); +// reason = "You are not allowed to enter this sim."; +// return nearestParcel != null; +// } void EventManagerOnNewClient(IClientAPI client) { diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index b0ddd8f..62abd4c 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] public class BuySellModule : IBuySellModule, INonSharedRegionModule { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; protected IDialogModule m_dialogModule; diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index a1a4f9e..9f88517 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -138,14 +138,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap remoteClient.SendMapBlock(blocks, 2); } - private Scene GetClientScene(IClientAPI client) - { - foreach (Scene s in m_scenes) - { - if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle) - return s; - } - return m_scene; - } +// private Scene GetClientScene(IClientAPI client) +// { +// foreach (Scene s in m_scenes) +// { +// if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle) +// return s; +// } +// return m_scene; +// } } } -- cgit v1.1 From 8eeb3f2fd21c05f0bfd141e333f34c4c69e8865b Mon Sep 17 00:00:00 2001 From: randomhuman Date: Fri, 13 Aug 2010 16:08:43 +0100 Subject: Updated the create_region command in the RemoteAdmin plugin to properly support estates without seeking further input on the console. --- .../LoadRegions/LoadRegionsPlugin.cs | 2 + .../RemoteController/RemoteAdminPlugin.cs | 92 +++++++++++++++------- OpenSim/Region/Application/OpenSim.cs | 10 ++- OpenSim/Region/Application/OpenSimBase.cs | 54 +++++++++++++ .../Region/ClientStack/RegionApplicationBase.cs | 5 ++ OpenSim/Region/Framework/Scenes/Scene.cs | 39 --------- 6 files changed, 134 insertions(+), 68 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 1e85a22..b16f46c 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -122,7 +122,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + ")"); + m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); + regionsToLoad[i].EstateSettings.Save(); if (scene != null) { m_newRegionCreatedHandler = OnNewRegionCreated; diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 7e4a8e8..da3d3c2 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -444,12 +444,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// desired region X coordinate (integer) /// region_y /// desired region Y coordinate (integer) - /// region_master_first - /// firstname of region master - /// region_master_last - /// lastname of region master - /// region_master_uuid - /// explicit UUID to use for master avatar (optional) + /// estate_owner_first + /// firstname of estate owner (formerly region master) + /// (required if new estate is being created, optional otherwise) + /// estate_owner_last + /// lastname of estate owner (formerly region master) + /// (required if new estate is being created, optional otherwise) + /// estate_owner_uuid + /// explicit UUID to use for estate owner (optional) /// listen_ip /// internal IP address (dotted quad) /// listen_port @@ -465,6 +467,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// enable_voice /// if true, enable voice on all parcels, /// ('true' or 'false') (optional, default: false) + /// estate_name + /// the name of the estate to join (or to create if it doesn't + /// already exist) /// /// /// XmlRpcCreateRegionMethod returns @@ -503,9 +508,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController { "password", "region_name", - "region_master_first", "region_master_last", - "region_master_password", - "listen_ip", "external_address" + "listen_ip", "external_address", + "estate_name" }); CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); @@ -576,18 +580,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController region.ExternalHostName = (string) requestData["external_address"]; - string masterFirst = (string) requestData["region_master_first"]; - string masterLast = (string) requestData["region_master_last"]; - string masterPassword = (string) requestData["region_master_password"]; - - UUID userID = UUID.Zero; - if (requestData.ContainsKey("region_master_uuid")) - { - // ok, client wants us to use an explicit UUID - // regardless of what the avatar name provided - userID = new UUID((string) requestData["estate_owner_uuid"]); - } - bool persist = Convert.ToBoolean((string) requestData["persist"]); if (persist) { @@ -622,7 +614,55 @@ namespace OpenSim.ApplicationPlugins.RemoteController { region.Persistent = false; } - + + // Set the estate + + // Check for an existing estate + List estateIDs = m_application.StorageManager.EstateDataStore.GetEstates((string) requestData["estate_name"]); + if (estateIDs.Count < 1) + { + UUID userID = UUID.Zero; + if (requestData.ContainsKey("estate_owner_uuid")) + { + // ok, client wants us to use an explicit UUID + // regardless of what the avatar name provided + userID = new UUID((string) requestData["estate_owner_uuid"]); + } + else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last")) + { + // We need to look up the UUID for the avatar with the provided name. + string ownerFirst = (string) requestData["estate_owner_first"]; + string ownerLast = (string) requestData["estate_owner_last"]; + + Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene; + IUserAccountService accountService = currentOrFirst.UserAccountService; + UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, + ownerFirst, ownerLast); + userID = user.PrincipalID; + } + else + { + throw new Exception("Estate owner details not provided."); + } + + // Create a new estate with the name provided + region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(region.RegionID, true); + + region.EstateSettings.EstateName = (string) requestData["estate_name"]; + region.EstateSettings.EstateOwner = userID; + // Persistence does not seem to effect the need to save a new estate + region.EstateSettings.Save(); + } + else + { + int estateID = estateIDs[0]; + + region.EstateSettings = m_application.StorageManager.EstateDataStore.LoadEstateSettings(estateID); + + if (!m_application.StorageManager.EstateDataStore.LinkRegion(region.RegionID, estateID)) + throw new Exception("Failed to join estate."); + } + // Create the region and perform any initial initialization IScene newScene; @@ -631,9 +671,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // If an access specification was provided, use it. // Otherwise accept the default. newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess); - newScene.RegionInfo.EstateSettings.EstateOwner = userID; - if (persist) - newScene.RegionInfo.EstateSettings.Save(); + newScene.RegionInfo.EstateSettings.Save(); // enable voice on newly created region if // requested by either the XmlRpc request or the @@ -1497,7 +1535,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (destinationFolder.Type != (short)AssetType.Clothing) { destinationFolder = new InventoryFolderBase(); - + destinationFolder.ID = UUID.Random(); destinationFolder.Name = "Clothing"; destinationFolder.Owner = destination; @@ -2982,7 +3020,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// private bool ChangeUserPassword(string firstName, string lastName, string password) { - Scene scene = m_application.SceneManager.CurrentOrFirstScene; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; IUserAccountService userAccountService = scene.UserAccountService; IAuthenticationService authenticationService = scene.AuthenticationService; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index c541249..d9ec287 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -530,7 +530,10 @@ namespace OpenSim regionFile = cmd[3]; IScene scene; - CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); + RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source); + PopulateRegionEstateInfo(regInfo); + CreateRegion(regInfo, true, out scene); + regInfo.EstateSettings.Save(); } else if (cmd[3].EndsWith(".ini")) { @@ -541,7 +544,10 @@ namespace OpenSim regionFile = cmd[3]; IScene scene; - CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene); + RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]); + PopulateRegionEstateInfo(regInfo); + CreateRegion(regInfo, true, out scene); + regInfo.EstateSettings.Save(); } else { diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index e148cde..eb18e83 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -790,6 +790,60 @@ namespace OpenSim { regionnum = m_sceneManager.Scenes.Count; } + + /// + /// Load the estate information for the provided RegionInfo object. + /// + /// + /// A + /// + public void PopulateRegionEstateInfo(RegionInfo regInfo) + { + if (m_storageManager.EstateDataStore != null) + { + regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false); + } + + if (regInfo.EstateSettings.EstateID == 0) // No record at all + { + MainConsole.Instance.Output("Your region is not part of an estate."); + while (true) + { + string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() {"yes", "no"}); + if (response == "no") + { + // Create a new estate + regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true); + + regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); + //regInfo.EstateSettings.Save(); + break; + } + else + { + response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); + if (response == "None") + continue; + + List estateIDs = m_storageManager.EstateDataStore.GetEstates(response); + if (estateIDs.Count < 1) + { + MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); + continue; + } + + int estateID = estateIDs[0]; + + regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); + + if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID)) + break; + + MainConsole.Instance.Output("Joining the estate failed. Please try again."); + } + } + } + } } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index e683821..46b68ec 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -58,6 +58,11 @@ namespace OpenSim.Region.ClientStack protected StorageManager m_storageManager; + public StorageManager StorageManager + { + get { return m_storageManager; } + } + protected ClientStackManager m_clientStackManager; public SceneManager SceneManager diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f62851a..18705a8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -544,45 +544,6 @@ namespace OpenSim.Region.Framework.Scenes if (m_storageManager.EstateDataStore != null) { m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); - if (m_regInfo.EstateSettings.EstateID == 0) // No record at all - { - MainConsole.Instance.Output("Your region is not part of an estate."); - while (true) - { - string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() {"yes", "no"}); - if (response == "no") - { - // Create a new estate - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true); - - m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName); - m_regInfo.EstateSettings.Save(); - break; - } - else - { - response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); - if (response == "None") - continue; - - List estateIDs = m_storageManager.EstateDataStore.GetEstates(response); - if (estateIDs.Count < 1) - { - MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); - continue; - } - - int estateID = estateIDs[0]; - - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); - - if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID)) - break; - - MainConsole.Instance.Output("Joining the estate failed. Please try again."); - } - } - } } #endregion Region Settings -- cgit v1.1 From ae43a07f3bf5bd91e4ae7ed9b82c44d610b72044 Mon Sep 17 00:00:00 2001 From: Marck Date: Tue, 10 Aug 2010 16:07:21 +0200 Subject: Configuration files can read include files from relative paths. --- OpenSim/Region/Application/ConfigurationLoader.cs | 12 +++++++++++- OpenSim/Tools/Configger/ConfigurationLoader.cs | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 09f7bea..e69e3fc 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -211,7 +211,17 @@ namespace OpenSim else { string basepath = Path.GetFullPath(Util.configDir()); - string path = Path.Combine(basepath, file); + // Resolve relative paths with wildcards + string chunkWithoutWildcards = file; + string chunkWithWildcards = string.Empty; + int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); + if (wildcardIndex != -1) + { + chunkWithoutWildcards = file.Substring(0, wildcardIndex); + chunkWithWildcards = file.Substring(wildcardIndex); + } + string path = Path.Combine(basepath, chunkWithoutWildcards); + path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); foreach (string p in paths) { diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index e74debb..8e71b42 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs @@ -141,7 +141,17 @@ namespace OpenSim.Tools.Configger else { string basepath = Path.GetFullPath("."); - string path = Path.Combine(basepath, file); + // Resolve relative paths with wildcards + string chunkWithoutWildcards = file; + string chunkWithWildcards = string.Empty; + int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); + if (wildcardIndex != -1) + { + chunkWithoutWildcards = file.Substring(0, wildcardIndex); + chunkWithWildcards = file.Substring(wildcardIndex); + } + string path = Path.Combine(basepath, chunkWithoutWildcards); + path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); foreach (string p in paths) { -- cgit v1.1 From fcc83f2305f6da6fc93b6f94ef7dbd4a1737568a Mon Sep 17 00:00:00 2001 From: Marck Date: Wed, 11 Aug 2010 16:31:26 +0200 Subject: Unit test for ConfigurationLoader. Adds a new test assembly for OpenSim. --- OpenSim/Tests/ConfigurationLoaderTest.cs | 143 +++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 OpenSim/Tests/ConfigurationLoaderTest.cs (limited to 'OpenSim') diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs new file mode 100644 index 0000000..4262c95 --- /dev/null +++ b/OpenSim/Tests/ConfigurationLoaderTest.cs @@ -0,0 +1,143 @@ +/* + * 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.IO; +using Nini.Config; +using NUnit.Framework; +using OpenSim.Framework; + +namespace OpenSim.Tests +{ + [TestFixture] + public class ConfigurationLoaderTests + { + private const string m_testSubdirectory = "test"; + private string m_basePath; + private string m_workingDirectory; + private IConfigSource m_config; + + /// + /// Set up a test directory. + /// + [SetUp] + public void SetUp() + { + m_basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + string path = Path.Combine(m_basePath, m_testSubdirectory); + Directory.CreateDirectory(path); + m_workingDirectory = Directory.GetCurrentDirectory(); + Directory.SetCurrentDirectory(path); + } + + /// + /// Remove the test directory. + /// + [TearDown] + public void TearDown() + { + Directory.SetCurrentDirectory(m_workingDirectory); + Directory.Delete(m_basePath, true); + } + + /// + /// Test the including of ini files with absolute and relative paths. + /// + [Test] + public void IncludeTests() + { + const string mainIniFile = "OpenSim.ini"; + m_config = new IniConfigSource(); + + // Create ini files in a directory structure + IniConfigSource ini; + IConfig config; + + ini = new IniConfigSource(); + config = ini.AddConfig("IncludeTest"); + config.Set("Include-absolute", "absolute/*/config/*.ini"); + config.Set("Include-relative", "../" + m_testSubdirectory + "/relative/*/config/*.ini"); + CreateIni(mainIniFile, ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute1").Set("name1", "value1"); + CreateIni("absolute/one/config/setting.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute2").Set("name2", 2.3); + CreateIni("absolute/two/config/setting1.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute2").Set("name3", "value3"); + CreateIni("absolute/two/config/setting2.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative1").Set("name4", "value4"); + CreateIni("relative/one/config/setting.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative2").Set("name5", true); + CreateIni("relative/two/config/setting1.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative2").Set("name6", 6); + CreateIni("relative/two/config/setting2.ini", ini); + + // Prepare call to ConfigurationLoader.LoadConfigSettings() + ConfigurationLoader cl = new ConfigurationLoader(); + IConfigSource argvSource = new IniConfigSource(); + argvSource.AddConfig("Startup").Set("inifile", mainIniFile); + ConfigSettings configSettings; + NetworkServersInfo networkInfo; + + OpenSimConfigSource source = cl.LoadConfigSettings(argvSource, out configSettings, out networkInfo); + + // Remove default config + config = source.Source.Configs["Startup"]; + source.Source.Configs.Remove(config); + config = source.Source.Configs["Network"]; + source.Source.Configs.Remove(config); + + // Finally, we are able to check the result + Assert.AreEqual(m_config.ToString(), source.Source.ToString(), + "Configuration with includes does not contain all settings."); + // The following would be preferable but fails due to a type mismatch which I am not able to resolve + //CollectionAssert.AreEquivalent(m_config.Configs, source.Source.Configs, + // String.Format("Configuration with includes does not contain all settings.\nAll settings:\n{0}\nSettings read:\n{1}", m_config, source.Source)); + } + + private void CreateIni(string filepath, IniConfigSource source) + { + string path = Path.GetDirectoryName(filepath); + if (path != string.Empty) + { + Directory.CreateDirectory(path); + } + source.Save(filepath); + m_config.Merge(source); + } + } +} -- cgit v1.1 From 1463691cb6d022efbb2a0c5742a032f03a940cee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Aug 2010 00:48:12 +0100 Subject: In EventQueueHelper.uintToByteArray, fetch big end-ian bytes directly from libomv rather than little endian then swapping This avoids a problem with failing to swap on big-endian machines. This addresses http://opensimulator.org/mantis/view.php?id=4849 Thanks to Valy- for pointing this out and submitting a suggestion patch --- .../CoreModules/Framework/EventQueue/EventQueueHelper.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index efa60bb..53a2a7d 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs @@ -54,12 +54,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue } private static byte[] uintToByteArray(uint uIntValue) - { - byte[] resultbytes = Utils.UIntToBytes(uIntValue); - if (BitConverter.IsLittleEndian) - Array.Reverse(resultbytes); - - return resultbytes; + { + byte[] result = new byte[4]; + Utils.UIntToBytesBig(uIntValue, result, 0); + return result; } public static OSD buildEvent(string eventName, OSD eventBody) -- cgit v1.1 From 46d0690b3166c3367457ad248fb1a65f41b88fb0 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 13 Aug 2010 16:56:01 -0700 Subject: * Fixed a casing typo for Simian profile data * Minor logging tweak in Simian asset connector --- OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 7a420e4..616b5a7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -184,7 +184,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } catch (Exception ex) { - m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message); + m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset HEAD from " + url + " failed: " + ex.Message); } return metadata; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index 704790e..d30d880 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs @@ -326,7 +326,7 @@ namespace OpenSim.Services.Connectors.SimianGrid try { interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap; - client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString()); + client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["Languages"].AsString()); } catch { } } -- cgit v1.1 From d806741e9d244ab254f33c99f75eb6da96db1ebd Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 13 Aug 2010 17:39:45 -0700 Subject: * Cleaned up the magic UUID definitions in AvatarWearable.cs --- OpenSim/Framework/AvatarWearable.cs | 39 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 87d9e61..30c5172 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -34,8 +34,23 @@ namespace OpenSim.Framework { public class AvatarWearable { - public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000"); - public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000"); + public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); + public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + + public static readonly UUID DEFAULT_HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); + public static readonly UUID DEFAULT_HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); + + public static readonly UUID DEFAULT_SKIN_ITEM = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); + public static readonly UUID DEFAULT_SKIN_ASSET = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); + + public static readonly UUID DEFAULT_SHIRT_ITEM = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); + public static readonly UUID DEFAULT_SHIRT_ASSET = new UUID("00000000-38f9-1111-024e-222222111110"); + + public static readonly UUID DEFAULT_PANTS_ITEM = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); + public static readonly UUID DEFAULT_PANTS_ASSET = new UUID("00000000-38f9-1111-024e-222222111120"); + + public UUID AssetID; + public UUID ItemID; public AvatarWearable() { @@ -58,24 +73,24 @@ namespace OpenSim.Framework } // Body - defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); - defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + defaultWearables[0].ItemID = DEFAULT_BODY_ITEM; + defaultWearables[0].AssetID = DEFAULT_BODY_ASSET; // Hair - defaultWearables[2].ItemID = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); - defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); + defaultWearables[2].ItemID = DEFAULT_HAIR_ITEM; + defaultWearables[2].AssetID = DEFAULT_HAIR_ASSET; // Skin - defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); - defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); + defaultWearables[1].ItemID = DEFAULT_SKIN_ITEM; + defaultWearables[1].AssetID = DEFAULT_SKIN_ASSET; // Shirt - defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); - defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110"); + defaultWearables[4].ItemID = DEFAULT_SHIRT_ITEM; + defaultWearables[4].AssetID = DEFAULT_SHIRT_ASSET; // Pants - defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); - defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120"); + defaultWearables[5].ItemID = DEFAULT_PANTS_ITEM; + defaultWearables[5].AssetID = DEFAULT_PANTS_ASSET; return defaultWearables; } -- cgit v1.1 From d5c24241b7bcbe22fe22e1b7b0057f1105070131 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 15 Aug 2010 17:25:27 -0700 Subject: Thanks Marck for the patch to mantis #4941 (shortening avies' names on HG) --- OpenSim/Services/HypergridService/GatekeeperService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 3aaafe8..6f041da 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -259,7 +259,16 @@ namespace OpenSim.Services.HypergridService if (account == null && !aCircuit.lastname.StartsWith("@")) { aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; - aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + try + { + Uri uri = new Uri(aCircuit.ServiceURLs["HomeURI"].ToString()); + aCircuit.lastname = "@" + uri.Host; // + ":" + uri.Port; + } + catch + { + m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed HomeURI (this should never happen): {0}", aCircuit.ServiceURLs["HomeURI"]); + aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + } } // -- cgit v1.1 From 30d0bf42071bf07f3f2ad30aa75126436e9360ae Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 15 Aug 2010 21:08:37 +0200 Subject: Fix SQLite database plugin for UserAccountData queries with a single word. --- OpenSim/Data/SQLite/SQLiteUserAccountData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 893f105..2706aea 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs @@ -66,7 +66,7 @@ namespace OpenSim.Data.SQLite if (words.Length == 1) { - cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", + cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", m_Realm, scopeID.ToString(), words[0]); } else -- cgit v1.1 From 5d29c0ec9d917c9edd251f8bf171c44e6922c4cf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 15 Aug 2010 18:10:54 -0700 Subject: Addresses mantis #4929. Agent was being logged off the grid too soon -- things may still fail. --- .../Framework/EntityTransfer/EntityTransferModule.cs | 15 +++++++++++++-- .../Framework/EntityTransfer/HGEntityTransferModule.cs | 14 ++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 364d340..607219e 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -307,7 +307,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string reason = String.Empty; // Let's create an agent there if one doesn't exist yet. - if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason)) + bool logout = false; + if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) { sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", reason)); @@ -434,8 +435,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it CrossAttachmentsIntoNewRegion(finalDestination, sp, true); + // Well, this is it. The agent is over there. + KillEntity(sp.Scene, sp.LocalId); + // May need to logout or other cleanup + AgentHasMovedAway(sp.ControllingClient.SessionId, logout); + // Now let's make it officially a child agent sp.MakeChildAgent(); @@ -483,8 +489,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } - protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { + logout = false; return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); } @@ -500,6 +507,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } + protected virtual void AgentHasMovedAway(UUID sessionID, bool logout) + { + } + protected void KillEntity(Scene scene, uint localID) { scene.SendKillObject(localID); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 7d26e3f..d49d18d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -140,9 +140,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return false; } - protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + protected override void AgentHasMovedAway(UUID sessionID, bool logout) + { + if (logout) + // Log them out of this grid + m_aScene.PresenceService.LogoutAgent(sessionID); + } + + protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { reason = string.Empty; + logout = false; int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) { @@ -152,9 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); - if (success) - // Log them out of this grid - m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID); + logout = success; return success; } -- cgit v1.1 From a5044e08fb3f42588c5a64013a57120cbd9de3e3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 15 Aug 2010 18:13:09 -0700 Subject: Better comment (related to previous commit) --- .../CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index d49d18d..1ac7508 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -160,7 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); - logout = success; + logout = success; // flag for later logout from this grid; this is an HG TP return success; } -- cgit v1.1 From f219e320bc3eedec860bcd1137bf705f4af12865 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 08:51:56 -0700 Subject: Increased the timeout on AgentUpdate to 30 sec and improved error message to try to catch some weirdnesses going on in HG TPs (and maybe non-HG TPs too). --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 32f02fb..6244565 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.Simulation HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); ChildUpdateRequest.Method = "PUT"; ChildUpdateRequest.ContentType = "application/json"; - ChildUpdateRequest.Timeout = 10000; + ChildUpdateRequest.Timeout = 30000; //ChildUpdateRequest.KeepAlive = false; // Fill it in @@ -334,7 +334,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate {0}", ex.Message); + m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message); // ignore, really } finally -- cgit v1.1 From 77de28965ae5fc6de3c60a28ce7d4e59643a2a70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 11:33:59 -0700 Subject: Work on TeleportStart: renamed method from TeleportLocationStart to TeleportStart, and now sending this upon all teleports, not just some, and in the right place (EntityTransferModule). --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 2 +- .../Client/Sirikata/ClientStack/SirikataClientView.cs | 2 +- OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | 2 +- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 19 +++++++++++++++---- .../Framework/EntityTransfer/EntityTransferModule.cs | 10 ++++------ .../World/Estate/EstateManagementModule.cs | 3 --- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 2 +- .../InternetRelayClientView/Server/IRCClientView.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 2 +- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 1 - .../Shared/Api/Implementation/OSSL_Api.cs | 2 -- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- 13 files changed, 27 insertions(+), 24 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 65921a2..5e16347 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1015,7 +1015,7 @@ namespace OpenSim.Client.MXP.ClientStack // Need to translate to MXP somehow } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { // Need to translate to MXP somehow } diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index b808e95..1c702d2 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -573,7 +573,7 @@ namespace OpenSim.Client.Sirikata.ClientStack throw new System.NotImplementedException(); } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { throw new System.NotImplementedException(); } diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index a6c490b..e954aa3 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -579,7 +579,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack throw new System.NotImplementedException(); } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { throw new System.NotImplementedException(); } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index db74548..81f99b0 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1011,7 +1011,7 @@ namespace OpenSim.Framework uint flags, string capsURL); void SendTeleportFailed(string reason); - void SendTeleportLocationStart(); + void SendTeleportStart(uint flags); void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); void SendPayPrice(UUID objectID, int[] payPrice); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c11b9a2..bb9e6d4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1432,16 +1432,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { - //TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); - TeleportStartPacket tpStart = new TeleportStartPacket(); - tpStart.Info.TeleportFlags = 16; // Teleport via location + TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); + //TeleportStartPacket tpStart = new TeleportStartPacket(); + tpStart.Info.TeleportFlags = flags; //16; // Teleport via location // Hack to get this out immediately and skip throttles OutPacket(tpStart, ThrottleOutPacketType.Unknown); } + public void SendTeleportProgress(uint flags, string message) + { + TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress); + tpProgress.AgentData.AgentID = this.AgentId; + tpProgress.Info.TeleportFlags = flags; + tpProgress.Info.Message = Util.StringToBytes256(message); + + // Hack to get this out immediately and skip throttles + OutPacket(tpProgress, ThrottleOutPacketType.Unknown); + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 607219e..751d49a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -174,9 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer position.Z = newPosZ; } - // Only send this if the event queue is null - if (eq == null) - sp.ControllingClient.SendTeleportLocationStart(); + sp.ControllingClient.SendTeleportStart(teleportFlags); sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); sp.Teleport(position); @@ -257,9 +255,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer ulong destinationHandle = finalDestination.RegionHandle; - if (eq == null) - sp.ControllingClient.SendTeleportLocationStart(); - // Let's do DNS resolution only once in this process, please! // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, // it's actually doing a lot of work. @@ -277,6 +272,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return; } + sp.ControllingClient.SendTeleportStart(teleportFlags); + // the avatar.Close below will clear the child region list. We need this below for (possibly) // closing the child agents, so save it here (we need a copy as it is Clear()-ed). //List childRegions = new List(avatar.GetKnownRegionList()); @@ -320,6 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) { + #region IP Translation for NAT IClientIPEndpoint ipepClient; if (sp.ClientView.TryGet(out ipepClient)) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 940b535..51f2c41 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -343,7 +343,6 @@ namespace OpenSim.Region.CoreModules.World.Estate { if (!s.IsChildAgent) { - s.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(user, s.ControllingClient); } } @@ -478,7 +477,6 @@ namespace OpenSim.Region.CoreModules.World.Estate ScenePresence s = m_scene.GetScenePresence(prey); if (s != null) { - s.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(prey, s.ControllingClient); } } @@ -498,7 +496,6 @@ namespace OpenSim.Region.CoreModules.World.Estate // Also make sure they are actually in the region if (p != null && !p.IsChildAgent) { - p.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(p.UUID, p.ControllingClient); } } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index f6e6163..3f5aa46 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -520,7 +520,7 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) { } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index ee7aa2da..19bb002 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1035,7 +1035,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 2e0450c..944bac6 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -611,7 +611,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) { } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 32e46ec..b21e532 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4070,7 +4070,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_host.OwnerID == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { - presence.ControllingClient.SendTeleportLocationStart(); World.TeleportClientHome(agentId, presence.ControllingClient); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 01b64eb..a529a94 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -664,7 +664,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api regionName = regInfo.RegionName; } } - presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionName, new Vector3((float)position.x, (float)position.y, (float)position.z), new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); @@ -696,7 +695,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { - presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionHandle, new Vector3((float)position.x, (float)position.y, (float)position.z), new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 999cf5e..0dee374 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -614,7 +614,7 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) { } -- cgit v1.1 From a8b80ef800e78d9fa321bc2388b4d8336f454b1d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 11:39:46 -0700 Subject: Added SendTeleportProgress to IClientAPI. Ya know what that means... 8 files affected. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 4 ++++ OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | 5 +++++ OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | 5 +++++ OpenSim/Framework/IClientAPI.cs | 2 ++ OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 4 ++++ .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 4 ++++ OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 4 ++++ OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++++ 8 files changed, 32 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 5e16347..b5b2508 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1020,6 +1020,10 @@ namespace OpenSim.Client.MXP.ClientStack // Need to translate to MXP somehow } + public void SendTeleportProgress(uint flags, string message) + { + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { // Need to translate to MXP somehow diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 1c702d2..c1e281a 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -578,6 +578,11 @@ namespace OpenSim.Client.Sirikata.ClientStack throw new System.NotImplementedException(); } + public void SendTeleportProgress(uint flags, string message) + { + throw new System.NotImplementedException(); + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { throw new System.NotImplementedException(); diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index e954aa3..99a46dc 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -584,6 +584,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack throw new System.NotImplementedException(); } + public void SendTeleportProgress(uint flags, string message) + { + throw new System.NotImplementedException(); + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { throw new System.NotImplementedException(); diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 81f99b0..94815cd 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1012,6 +1012,8 @@ namespace OpenSim.Framework void SendTeleportFailed(string reason); void SendTeleportStart(uint flags); + void SendTeleportProgress(uint flags, string message); + void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); void SendPayPrice(UUID objectID, int[] payPrice); diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 3f5aa46..268612e 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -524,6 +524,10 @@ namespace OpenSim.Region.Examples.SimpleModule { } + public virtual void SendTeleportProgress(uint flags, string message) + { + } + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 19bb002..6793ef6 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1040,6 +1040,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } + public void SendTeleportProgress(uint flags, string message) + { + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 944bac6..fae12b6 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -615,6 +615,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } + public virtual void SendTeleportProgress(uint flags, string message) + { + } + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 0dee374..e46f9b7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -618,6 +618,10 @@ namespace OpenSim.Tests.Common.Mock { } + public void SendTeleportProgress(uint flags, string message) + { + } + public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { } -- cgit v1.1 From 69ad04cdf6ca899877a38fd4f9248f4107e3a7ce Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 12:03:13 -0700 Subject: Attempt at sending TeleportProgress, but it doesn't seem to be doing anything at all. Left it commented, just as a reminder for where those messages could be sent. --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 751d49a..bb98dba 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -317,6 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) { + //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); #region IP Translation for NAT IClientIPEndpoint ipepClient; @@ -395,6 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.Position = position; SetCallbackURL(agent, sp.Scene.RegionInfo); + //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); + if (!UpdateAgent(reg, finalDestination, agent)) { // Region doesn't take it -- cgit v1.1 From d7824b86d97bf3b219b67c8908eb28ba0f3edbeb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 16 Aug 2010 14:36:20 -0700 Subject: Fixes mantis #4954 for the xml-rpc calls of the UserAgentServiceConnector. Basically, let's not let the xml-rpc library do the DNS conversion... --- .../Connectors/Hypergrid/UserAgentServiceConnector.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 96d2605..69dff3c 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -53,9 +53,20 @@ namespace OpenSim.Services.Connectors.Hypergrid MethodBase.GetCurrentMethod().DeclaringType); string m_ServerURL; + Uri m_Uri; public UserAgentServiceConnector(string url) { m_ServerURL = url; + try + { + m_Uri = new Uri(m_ServerURL); + IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); + m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port; + } + catch (Exception e) + { + m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); + } } public UserAgentServiceConnector(IConfigSource config) @@ -373,7 +384,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (response.IsFault) { - m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); reason = "XMLRPC Fault"; return false; } @@ -403,7 +414,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response."); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetBoolResponse response."); if (hash.ContainsKey("result") && hash["result"] != null) m_log.ErrorFormat("Reply was ", (string)hash["result"]); reason = "Exception: " + e.Message; -- cgit v1.1 From a8c0b131f9aa62d4b6260fd37f89014e55b457cf Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 17 Aug 2010 13:50:04 -0700 Subject: * Changed a few OSD.FromBinary() calls to the more accurate OSD.FromULong() to fix the build --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 +- OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs | 2 +- OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index bb9e6d4..1d3bdf3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3033,7 +3033,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { OSDMap GroupDataMap = new OSDMap(6); OSDMap NewGroupDataMap = new OSDMap(1); - GroupDataMap.Add("GroupPowers", OSD.FromBinary(m.GroupPowers)); + GroupDataMap.Add("GroupPowers", OSD.FromULong(m.GroupPowers)); GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices)); GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle)); GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID)); diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index 53a2a7d..e9bcae3 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue info.Add("SimAccess", OSD.FromInteger(simAccess)); info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); - info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation + info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation OSDArray infoArr = new OSDArray(); infoArr.Add(info); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 3f15b69..2969503 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1129,7 +1129,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups OSDMap NewGroupDataMap = new OSDMap(1); GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID)); - GroupDataMap.Add("GroupPowers", OSD.FromBinary(membership.GroupPowers)); + GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers)); GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices)); GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture)); GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution)); -- cgit v1.1