From 651f9f47d0dec64e70bc257f4695313fad839b7a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 14:56:38 -0800 Subject: HG: Verify that the user is local --- OpenSim/Services/HypergridService/UserAgentService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index cdc560c..8538660 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -161,6 +161,14 @@ namespace OpenSim.Services.HypergridService { m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); + + if (m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID) == null) + { + m_log.WarnFormat("[USER AGENT SERVICE]: Someone attempted to lauch a foreign user from here {0} {1}", agentCircuit.firstname, agentCircuit.lastname); + reason = "Forbidden to launch your agents from here"; + return false; + } + // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); region.ServerURI = gatekeeper.ServerURI; -- cgit v1.1 From ddff2f246cb4862abcac5308ae2532c9828691fb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 15:17:26 -0800 Subject: Moved an external test into the method that uses those preconditions. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 30 +++++++++--------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 36d8c0b..526fab3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1161,10 +1161,10 @@ namespace OpenSim.Region.Framework.Scenes public void CompleteMovement(IClientAPI client, bool openChildAgents) { // DateTime startTime = DateTime.Now; - -// m_log.DebugFormat( -// "[SCENE PRESENCE]: Completing movement of {0} into region {1}", -// client.Name, Scene.RegionInfo.RegionName); + + m_log.DebugFormat( + "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}", + client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); Vector3 look = Velocity; if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) @@ -2383,9 +2383,7 @@ namespace OpenSim.Region.Framework.Scenes m_lastVelocity = Velocity; } - // followed suggestion from mic bowman. reversed the two lines below. - if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something - CheckForBorderCrossing(); + CheckForBorderCrossing(); CheckForSignificantMovement(); // sends update to the modules. } @@ -2741,7 +2739,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - if (IsChildAgent) + // Check that we we are not a child and have a physics actor or we're sitting on something + if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) return; Vector3 pos2 = AbsolutePosition; @@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Framework.Scenes if (!IsInTransit) { // Checks if where it's headed exists a region - bool needsTransit = false; if (m_scene.TestBorderCross(pos2, Cardinals.W)) { @@ -2828,7 +2826,7 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; AbsolutePosition = pos; -// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); AddToPhysicalScene(isFlying); } @@ -2861,22 +2859,16 @@ namespace OpenSim.Region.Framework.Scenes } } else - { - // We must remove the agent from the physical scene if it has been placed in transit. If we don't, - // then this method continues to be called from ScenePresence.Update() until the handover of the client between - // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms - // event queue polling response from the server), this results in the avatar pausing on the border - // for the handover period. - RemoveFromPhysicalScene(); - + { // This constant has been inferred from experimentation // I'm not sure what this value should be, so I tried a few values. timeStep = 0.04f; pos2 = AbsolutePosition; pos2.X = pos2.X + (vel.X * timeStep); pos2.Y = pos2.Y + (vel.Y * timeStep); - pos2.Z = pos2.Z + (vel.Z * timeStep); + // Don't touch the Z m_pos = pos2; + m_log.ErrorFormat("m_pos={0}", m_pos); } } -- cgit v1.1 From 219ec7ef20ccefb257be5ec650a13758b2a3cda3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 22 Dec 2011 08:18:03 -0800 Subject: Fixing a bug introduced yesterday. This put the precondition test inside CheckForBorderCrossing the right way. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 214 ++++++++++++----------- 1 file changed, 109 insertions(+), 105 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f02475..040cbfc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2736,137 +2736,141 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - // Check that we we are not a child and have a physics actor or we're sitting on something - if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) + // Check that we we are not a child + if (IsChildAgent) return; - Vector3 pos2 = AbsolutePosition; - Vector3 vel = Velocity; - int neighbor = 0; - int[] fix = new int[2]; + // We only do this if we have a physics actor or we're sitting on something + if (ParentID == 0 && PhysicsActor != null || ParentID != 0) + { + Vector3 pos2 = AbsolutePosition; + Vector3 vel = Velocity; + int neighbor = 0; + int[] fix = new int[2]; - float timeStep = 0.1f; - pos2.X = pos2.X + (vel.X*timeStep); - pos2.Y = pos2.Y + (vel.Y*timeStep); - pos2.Z = pos2.Z + (vel.Z*timeStep); + float timeStep = 0.1f; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + pos2.Z = pos2.Z + (vel.Z * timeStep); - if (!IsInTransit) - { - // Checks if where it's headed exists a region - bool needsTransit = false; - if (m_scene.TestBorderCross(pos2, Cardinals.W)) + if (!IsInTransit) { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + // Checks if where it's headed exists a region + bool needsTransit = false; + if (m_scene.TestBorderCross(pos2, Cardinals.W)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + } } - else + else if (m_scene.TestBorderCross(pos2, Cardinals.E)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); + } } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.E)) - { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + else if (m_scene.TestBorderCross(pos2, Cardinals.S)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); } - else - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); - } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.S)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); - } - // Makes sure avatar does not end up outside region - if (neighbor <= 0) - { - if (needsTransit) + // Makes sure avatar does not end up outside region + if (neighbor <= 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (needsTransit) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + + AddToPhysicalScene(isFlying); + } } } - } - else if (neighbor > 0) - { - if (!CrossToNewRegion()) + else if (neighbor > 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (!CrossToNewRegion()) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + AddToPhysicalScene(isFlying); + } } } } - } - else - { - // This constant has been inferred from experimentation - // I'm not sure what this value should be, so I tried a few values. - timeStep = 0.04f; - pos2 = AbsolutePosition; - pos2.X = pos2.X + (vel.X * timeStep); - pos2.Y = pos2.Y + (vel.Y * timeStep); - // Don't touch the Z - m_pos = pos2; - m_log.ErrorFormat("m_pos={0}", m_pos); - } + else + { + // This constant has been inferred from experimentation + // I'm not sure what this value should be, so I tried a few values. + timeStep = 0.04f; + pos2 = AbsolutePosition; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + // Don't touch the Z + m_pos = pos2; + m_log.DebugFormat("[SCENE PRESENCE]: In transit m_pos={0}", m_pos); + } + } } /// -- cgit v1.1 From 2347593dac0d435851fb1437b87c42a5fd4f9060 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:48:52 +0000 Subject: Harmonizing SP with Avination --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 96 ++++++++++++++---------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 040cbfc..c578fc0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is /// necessary. /// - protected List m_attachments = new List(); + private List m_attachments = new List(); public Object AttachmentsSyncLock { get; private set; } @@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes } } - m_pos = value; - ParentPosition = Vector3.Zero; + // Don't update while sitting + if (ParentID == 0) + { + m_pos = value; + ParentPosition = Vector3.Zero; + } //m_log.DebugFormat( // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", @@ -566,6 +570,13 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 OffsetPosition { get { return m_pos; } + set + { + // There is no offset position when not seated + if (ParentID == 0) + return; + m_pos = value; + } } /// @@ -2740,8 +2751,10 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - // We only do this if we have a physics actor or we're sitting on something - if (ParentID == 0 && PhysicsActor != null || ParentID != 0) + if (ParentID != 0) + return; + + if (!IsInTransit) { Vector3 pos2 = AbsolutePosition; Vector3 vel = Velocity; @@ -3100,30 +3113,28 @@ namespace OpenSim.Region.Framework.Scenes catch { } // Attachment objects - lock (m_attachments) + List attachments = GetAttachments(); + if (attachments.Count > 0) { - if (m_attachments.Count > 0) - { - cAgent.AttachmentObjects = new List(); - cAgent.AttachmentObjectStates = new List(); - // IScriptModule se = m_scene.RequestModuleInterface(); - InTransitScriptStates.Clear(); + cAgent.AttachmentObjects = new List(); + cAgent.AttachmentObjectStates = new List(); +// IScriptModule se = m_scene.RequestModuleInterface(); + InTransitScriptStates.Clear(); - foreach (SceneObjectGroup sog in m_attachments) - { - // We need to make a copy and pass that copy - // because of transfers withn the same sim - ISceneObject clone = sog.CloneForNewScene(); - // Attachment module assumes that GroupPosition holds the offsets...! - ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; - ((SceneObjectGroup)clone).IsAttachment = false; - cAgent.AttachmentObjects.Add(clone); - string state = sog.GetStateSnapshot(); - cAgent.AttachmentObjectStates.Add(state); - InTransitScriptStates.Add(state); - // Let's remove the scripts of the original object here - sog.RemoveScriptInstances(true); - } + foreach (SceneObjectGroup sog in attachments) + { + // We need to make a copy and pass that copy + // because of transfers withn the same sim + ISceneObject clone = sog.CloneForNewScene(); + // Attachment module assumes that GroupPosition holds the offsets...! + ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; + ((SceneObjectGroup)clone).IsAttachment = false; + cAgent.AttachmentObjects.Add(clone); + string state = sog.GetStateSnapshot(); + cAgent.AttachmentObjectStates.Add(state); + InTransitScriptStates.Add(state); + // Let's remove the scripts of the original object here + sog.RemoveScriptInstances(true); } } } @@ -3531,26 +3542,29 @@ namespace OpenSim.Region.Framework.Scenes /// The arguments for the event public void SendScriptEventToAttachments(string eventName, Object[] args) { - if (m_scriptEngines.Length == 0) - return; - - lock (m_attachments) + Util.FireAndForget(delegate(object x) { - foreach (SceneObjectGroup grp in m_attachments) + if (m_scriptEngines.Length == 0) + return; + + lock (m_attachments) { - // 16384 is CHANGED_ANIMATION - // - // Send this to all attachment root prims - // - foreach (IScriptModule m in m_scriptEngines) + foreach (SceneObjectGroup grp in m_attachments) { - if (m == null) // No script engine loaded - continue; + // 16384 is CHANGED_ANIMATION + // + // Send this to all attachment root prims + // + foreach (IScriptModule m in m_scriptEngines) + { + if (m == null) // No script engine loaded + continue; - m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); + m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); + } } } - } + }); } internal void PushForce(Vector3 impulse) -- cgit v1.1 From 6412349decb36a7278528477bacb5b71534ad657 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:51:51 +0000 Subject: Add a few comments, correct a merge artefact --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c578fc0..fc6eb6d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -570,6 +570,8 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 OffsetPosition { get { return m_pos; } + // Don't remove setter. It's not currently used in core but + // upcoming Avination code needs it. set { // There is no offset position when not seated @@ -2751,7 +2753,10 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - if (ParentID != 0) + // If we don't have a PhysActor, we can't cross anyway + // Also don't do this while sat, sitting avatars cross with the + // object they sit on. + if (ParentID != 0 || PhysActor == null) return; if (!IsInTransit) -- cgit v1.1 From 7f527814d524fe6b0fb5243dbdb558e5b661e4a5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:57:49 +0000 Subject: And a typo fix --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc6eb6d..3d1c1b5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2756,7 +2756,7 @@ namespace OpenSim.Region.Framework.Scenes // If we don't have a PhysActor, we can't cross anyway // Also don't do this while sat, sitting avatars cross with the // object they sit on. - if (ParentID != 0 || PhysActor == null) + if (ParentID != 0 || PhysicsActor == null) return; if (!IsInTransit) -- cgit v1.1 From 469955889ed5499ed1dbb8fcc224d6912c651d06 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 22 Dec 2011 09:30:06 -0800 Subject: Region crossings redone: (1) removed WaitForCallback. Now that we are passing the entire agent with attachs in one big message we don't necessarily need to wait for confirmation. The callback sometimes is problematic and it adds delay to the process. (2) Z velocity sent to the viewer = 0. This is an heuristic; the Z velocity usually is negative, and it makes the viewer move the avie down. This only matters while the agent is in transit and therefore not being physically simulated by neither region. As soon as the receiving region receives CompleteMovement from the viewer, the position and velocity get corrected. --- .../EntityTransfer/EntityTransferModule.cs | 71 ++++++++++------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 87f292c..b9d5d32 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -676,9 +676,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); - // distance to edge that will trigger crossing - - // distance into new region to place avatar const float enterDistance = 0.5f; @@ -960,29 +957,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); - - pos = pos + (agent.Velocity); - + + pos = pos + agent.Velocity; + Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0); + + agent.RemoveFromPhysicalScene(); SetInTransit(agent.UUID); - AgentData cAgent = new AgentData(); + + AgentData cAgent = new AgentData(); agent.CopyTo(cAgent); cAgent.Position = pos; if (isFlying) cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; - cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + - "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; - + + // We don't need the callback anymnore + cAgent.CallbackURI = String.Empty; + if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) { // region doesn't take it ReInstantiateScripts(agent); + agent.AddToPhysicalScene(isFlying); ResetFromTransit(agent.UUID); return agent; } - // Next, let's close the child agent connections that are too far away. - agent.CloseChildAgents(neighbourx, neighboury); - //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); agent.ControllingClient.RequestClientInfo(); @@ -999,11 +998,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); - + IEventQueue eq = agent.Scene.RequestModuleInterface(); if (eq != null) { - eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, + eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, capsPath, agent.UUID, agent.ControllingClient.SessionId); } else @@ -1011,32 +1010,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, capsPath); } - - if (!WaitForCallback(agent.UUID)) - { - m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent"); - ReInstantiateScripts(agent); - ResetFromTransit(agent.UUID); - - // Yikes! We should just have a ref to scene here. - //agent.Scene.InformClientOfNeighbours(agent); - EnableChildAgents(agent); - - return agent; - } - + + // SUCCESS! agent.MakeChildAgent(); - + ResetFromTransit(agent.UUID); + // now we have a child agent in this region. Request all interesting data about other (root) agents agent.SendOtherAgentsAvatarDataToMe(); agent.SendOtherAgentsAppearanceToMe(); - - // Backwards compatibility + + // Backwards compatibility. Best effort if (version == "Unknown" || version == string.Empty) { - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one..."); + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); + Thread.Sleep(3000); // wait a little now that we're not waiting for the callback CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); } + + + // Next, let's close the child agent connections that are too far away. + agent.CloseChildAgents(neighbourx, neighboury); AgentHasMovedAway(agent, false); @@ -1069,16 +1062,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; ScenePresence agent = icon.EndInvoke(iar); - // If the cross was successful, this agent is a child agent - if (agent.IsChildAgent) - agent.Reset(); - else // Not successful - agent.RestoreInCurrentScene(); + //// If the cross was successful, this agent is a child agent + //if (agent.IsChildAgent) + // agent.Reset(); + //else // Not successful + // agent.RestoreInCurrentScene(); // In any case agent.IsInTransit = false; - //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); } #endregion -- cgit v1.1 From 48113f0fc811f21f4a113176caa9dbd78c0d3446 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:44:52 +0000 Subject: Make it possible to force all prims to be phantom via the collidable_prim boolean setting in the OpenSim.ini config [Startup] section. Naturally, default is true. When set to false, "phantom" flags on prims can be set as usual but all prims remain phantom. This setting is for test purposes. This switch does not affect the collision of avatars with the terrain. --- OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 ++++- bin/OpenSimDefaults.ini | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6666328..96e6863 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -79,6 +79,14 @@ namespace OpenSim.Region.Framework.Scenes /// public bool m_physicalPrim; + /// + /// Controls whether prims can be collided with. + /// + /// + /// If this is set to false then prims cannot be subject to physics either. + /// + public bool CollidablePrims { get; private set; } + public float m_maxNonphys = 256; public float m_maxPhys = 10; public bool m_clampPrimSize; @@ -651,6 +659,7 @@ namespace OpenSim.Region.Framework.Scenes m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); + CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); if (RegionInfo.NonphysPrimMax > 0) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b29ecc6..8fd136d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) { + if (!ParentGroup.Scene.CollidablePrims) + return; + // m_log.DebugFormat( // "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", // Name, LocalId, UUID, m_physicalPrim); @@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup.Scene == null) return; - if (PhysActor == null) + if (ParentGroup.Scene.CollidablePrims && PhysActor == null) { // It's not phantom anymore. So make sure the physics engine get's knowledge of it PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 972efe4..3e7f8a6 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -181,6 +181,11 @@ ; ## PHYSICS ; ## + ; If true then prims can be collided with by avatars, other prims, etc. + ; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked. + ; Also, no prims are subject to physics. + collidable_prim = true + ; If true then prims can be made subject to physics (gravity, pushing, etc.). ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction physical_prim = true -- cgit v1.1 From f7dbdba447cf91b03749c09d24709b03bc9f7831 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:52:09 +0000 Subject: Remove unused m_physicalPrim parameter from SOG.ApplyPhysics() --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 1 - OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a3e4b46..1e2901b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes if (rot != null) sceneObject.UpdateGroupRotationR((Quaternion)rot); - //group.ApplyPhysics(m_physicalPrim); if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) { sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index abea788..0585477 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); } - ApplyPhysics(m_scene.m_physicalPrim); + ApplyPhysics(); // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // for the same object with very different properties. The caller must schedule the update. @@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Apply physics to this group /// - /// - public void ApplyPhysics(bool m_physicalPrim) + public void ApplyPhysics() { // Apply physics to the root prim m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); -- cgit v1.1 From 7ccd8f8f1d8accb0c5f67e9e3bc9a43fbbfd93e2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:57:50 +0000 Subject: rename Scene.m_physicalPrim to PhysicalPrims since its public and access external as a property --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 96e6863..b4972d6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a /// PhysicsScene in order to perform collision detection /// - public bool m_physicalPrim; + public bool PhysicalPrims { get; private set; } /// /// Controls whether prims can be collided with. @@ -658,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes //Animation states m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); - m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); + PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8fd136d..aea47e6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1742,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) { - if (!ParentGroup.Scene.m_physicalPrim && UsePhysics) + if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) return; if (IsJoint()) -- cgit v1.1 From 790ca65c84b8597b20f63ba48556c0fb2141a4f0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 20:22:15 +0000 Subject: Align default ODE_STEPSIZE with that already used through OpenSimDefaults.ini --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 04ba738..2194ff0 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin private const uint m_regionWidth = Constants.RegionSize; private const uint m_regionHeight = Constants.RegionSize; - private float ODE_STEPSIZE = 0.020f; + private float ODE_STEPSIZE = 0.0178f; private float metersInSpace = 29.9f; private float m_timeDilation = 1.0f; @@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f); mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f); - ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f); + ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE); m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); avDensity = physicsconfig.GetFloat("av_density", 80f); -- cgit v1.1 From 6b08c051a33d97d94d9c68d287926939f1a5d6b2 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 22 Dec 2011 15:31:51 -0800 Subject: Enables processing of hypergrid links through simiangrid services. Thanks otakup0pe --- .../SimianGrid/SimianGridServiceConnector.cs | 81 +++++++++++++++------- 1 file changed, 56 insertions(+), 25 deletions(-) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 918544f..67a65ff 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -341,26 +341,54 @@ namespace OpenSim.Services.Connectors.SimianGrid public List GetHyperlinks(UUID scopeID) { - // Hypergrid/linked regions are not supported - return new List(); + List foundRegions = new List(); + + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "GetScenes" }, + { "HyperGrid", "true" }, + { "Enabled", "1" } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); + + OSDArray array = response["Scenes"] as OSDArray; + if (array != null) + { + for (int i = 0; i < array.Count; i++) + { + GridRegion region = ResponseToGridRegion(array[i] as OSDMap); + if (region != null) + foundRegions.Add(region); + } + } + } + + return foundRegions; } - + public int GetRegionFlags(UUID scopeID, UUID regionID) { - const int REGION_ONLINE = 4; - NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "GetScene" }, { "SceneID", regionID.ToString() } }; - // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); + m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); if (response["Success"].AsBoolean()) { - return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0; + OSDMap extraData = response["ExtraData"] as OSDMap; + int enabled = response["Enabled"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.RegionOnline : 0; + int hypergrid = extraData["HyperGrid"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.Hyperlink : 0; + int flags = enabled | hypergrid; + m_log.DebugFormat("[SGGC] enabled - {0} hg - {1} flags - {2}", enabled, hypergrid, flags); + return flags; } else { @@ -411,24 +439,27 @@ namespace OpenSim.Services.Connectors.SimianGrid Vector3d minPosition = response["MinPosition"].AsVector3d(); region.RegionLocX = (int)minPosition.X; region.RegionLocY = (int)minPosition.Y; - - Uri httpAddress = response["Address"].AsUri(); - region.ExternalHostName = httpAddress.Host; - region.HttpPort = (uint)httpAddress.Port; - - region.ServerURI = extraData["ServerURI"].AsString(); - - IPAddress internalAddress; - IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); - if (internalAddress == null) - internalAddress = IPAddress.Any; - - region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); - region.TerrainImage = extraData["MapTexture"].AsUUID(); - region.Access = (byte)extraData["Access"].AsInteger(); - region.RegionSecret = extraData["RegionSecret"].AsString(); - region.EstateOwner = extraData["EstateOwner"].AsUUID(); - region.Token = extraData["Token"].AsString(); + + if ( ! extraData["HyperGrid"] ) { + Uri httpAddress = response["Address"].AsUri(); + region.ExternalHostName = httpAddress.Host; + region.HttpPort = (uint)httpAddress.Port; + + IPAddress internalAddress; + IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); + if (internalAddress == null) + internalAddress = IPAddress.Any; + + region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); + region.TerrainImage = extraData["MapTexture"].AsUUID(); + region.Access = (byte)extraData["Access"].AsInteger(); + region.RegionSecret = extraData["RegionSecret"].AsString(); + region.EstateOwner = extraData["EstateOwner"].AsUUID(); + region.Token = extraData["Token"].AsString(); + region.ServerURI = extraData["ServerURI"].AsString(); + } else { + region.ServerURI = response["Address"]; + } return region; } -- cgit v1.1 From f394cb2e8f1605809dbf3d5503b9ae00dc1f5180 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 22 Dec 2011 16:21:32 -0800 Subject: fix the UsesPhysics flag to reference the physics flag rather than the temponrez flag --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0585477..8860764 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes /// public bool UsesPhysics { - get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; } + get { return (RootPart.Flags & PrimFlags.Physics) != 0; } } /// -- cgit v1.1 From 456c89a7a30c5c2ec2e228beb717b9c611106364 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 22 Dec 2011 16:59:51 -0800 Subject: Fixes some problems with objects that attempt to cross a region boundary into a region that does not exist. This is particularly problematic for physical objects where the velocity continues to move them out of the region causing an infinite number of failed region crossings. The patch forces an object that fails a crossing to be non-physical and moves it back into the starting region. --- .../EntityTransfer/EntityTransferModule.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b9d5d32..098e5cb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1705,6 +1705,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer uint x = 0, y = 0; Utils.LongToUInts(newRegionHandle, out x, out y); GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); + + if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) + { + m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); + + // We are going to move the object back to the old position so long as the old position + // is in the region + oldGroupPosition.X = Util.Clamp(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1); + oldGroupPosition.Y = Util.Clamp(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1); + oldGroupPosition.Z = Util.Clamp(oldGroupPosition.Z,1.0f,4096.0f); + + grp.RootPart.GroupPosition = oldGroupPosition; + + // Need to turn off the physics flags, otherwise the object will continue to attempt to + // move out of the region creating an infinite loop of failed attempts to cross + grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false); + + grp.ScheduleGroupForFullUpdate(); + } + + + + + if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) { grp.RootPart.GroupPosition = oldGroupPosition; -- cgit v1.1 From c6ce464dbc64dc24878a8032412e82b02b9314f6 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Fri, 23 Dec 2011 10:13:32 -0800 Subject: remove the old region crossing handler --- .../Framework/EntityTransfer/EntityTransferModule.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 098e5cb..cbef6ce 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1724,16 +1724,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer grp.ScheduleGroupForFullUpdate(); } - - - - - - if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) - { - grp.RootPart.GroupPosition = oldGroupPosition; - grp.ScheduleGroupForFullUpdate(); - } } -- cgit v1.1 From 26bb95fe3d5239c183bc3b312ef05e73fc06749c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 23 Dec 2011 10:58:30 -0800 Subject: HG: AAdded a few missing /'s at the end of URLs --- OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 2 ++ .../Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index 7cfd6e8..ff1dd5f 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -53,7 +53,7 @@ namespace OpenSim.Services.Connectors public virtual string Helo() { - HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo"); + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); // Eventually we need to switch to HEAD /* req.Method = "HEAD"; */ diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 9573e21..99523a1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -86,6 +86,8 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAssetServiceConnector(string url) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + '/'; m_serverUrl = url; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 39df1f5..f828abb 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -92,7 +92,10 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianInventoryServiceConnector(string url) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + '/'; m_serverUrl = url; + } public void Initialise(IConfigSource source) -- cgit v1.1 From f9a1fd5748a0f33adad3b8b06702f9474dbf6908 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 23 Dec 2011 15:08:13 -0800 Subject: HG: one more adjustment with trailing /s --- .../CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 81b65c5..d20c9eb 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess public AssetBase FetchAsset(string url, UUID assetID) { - AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString()); + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + + AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString()); if (asset != null) { @@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { if (asset != null) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + // See long comment in AssetCache.AddAsset if (!asset.Temporary || asset.Local) { @@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess Copy(asset, asset1); try { - asset1.ID = url + "/" + asset.ID; + asset1.ID = url + asset.ID; } catch { -- cgit v1.1 From b6cfe15c7c0b3697709179cbbf32818576919642 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 24 Dec 2011 07:44:26 -0800 Subject: HG: more / love for Xmas --- OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 7 ++++-- .../Connectors/Asset/HGAssetServiceConnector.cs | 21 +++++++++++++++-- .../Connectors/Hypergrid/HeloServiceConnector.cs | 27 ++++++++++++++++++++-- prebuild.xml | 1 + 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index e9e2dca..1dea87e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs @@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP string assetServerURL = string.Empty; if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) { - m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); - AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); + if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) + assetServerURL = assetServerURL + "/"; + + m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); + AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); return; } } diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 5c31639..bb5d51f 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -29,7 +29,9 @@ using log4net; using Nini.Config; using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Reflection; +using System.Web; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors.Hypergrid; @@ -73,11 +75,26 @@ namespace OpenSim.Services.Connectors if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && assetUri.Scheme == Uri.UriSchemeHttp) { - url = "http://" + assetUri.Authority; - assetID = assetUri.LocalPath.Trim(new char[] {'/'}); + // Simian + if (assetUri.Query != string.Empty) + { + NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query); + assetID = qscoll["id"]; + if (assetID != null) + url = id.Replace(assetID, ""); // Malformed again, as simian expects + else + url = id; // !!! best effort + } + else // robust + { + url = "http://" + assetUri.Authority; + assetID = assetUri.LocalPath.Trim(new char[] { '/' }); + } + return true; } + m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id); return false; } diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index ff1dd5f..8ac89cc 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors public HeloServicesConnector(string serverURI) { - m_ServerURI = serverURI.TrimEnd('/'); + if (!serverURI.EndsWith("=")) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + // Simian sends malformed urls like this: + // http://valley.virtualportland.org/simtest/Grid/?id= + // + try + { + Uri uri = new Uri(serverURI + "xxx"); + if (uri.Query == string.Empty) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + serverURI = serverURI + "xxx"; + m_ServerURI = serverURI.Replace("?" + uri.Query, ""); + m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; + } + } + catch (UriFormatException e) + { + m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); + } + } } public virtual string Helo() { - HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); // Eventually we need to switch to HEAD /* req.Method = "HEAD"; */ diff --git a/prebuild.xml b/prebuild.xml index e951187..4ea4708 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -926,6 +926,7 @@ ../../../bin/ + -- cgit v1.1 From f36fe45fa7468dd6e785d523c5df38666140135f Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 25 Dec 2011 00:04:42 -0500 Subject: Add Copy task to Prebuild.exe (vsxxxx targets) --- Prebuild/COPYING | 130 +- Prebuild/NEWS | 400 ++-- Prebuild/Prebuild.exe | Bin 0 -> 226816 bytes Prebuild/README | 548 ++--- Prebuild/prebuild.xml | 6 +- Prebuild/scripts/SharpDevelop2.bat | 8 +- Prebuild/scripts/VS2008.bat | 8 +- Prebuild/scripts/VS2010.bat | 8 +- Prebuild/scripts/autotools.bat | 8 +- Prebuild/src/Core/Nodes/CleanFilesNode.cs | 158 +- Prebuild/src/Core/Nodes/CleanupNode.cs | 168 +- .../src/Core/Nodes/ConfigurationNodeCollection.cs | 142 +- Prebuild/src/Core/Nodes/DatabaseProjectNode.cs | 186 +- Prebuild/src/Core/Nodes/DatabaseReferenceNode.cs | 126 +- Prebuild/src/Core/Nodes/FileNode.cs | 9 +- Prebuild/src/Core/Nodes/FilesNode.cs | 34 + Prebuild/src/Core/Nodes/MatchNode.cs | 17 +- Prebuild/src/Core/Targets/AutotoolsTarget.cs | 2140 ++++++++++---------- Prebuild/src/Core/Targets/DebugTarget.cs | 2 +- Prebuild/src/Core/Targets/VS2010Target.cs | 276 +-- Prebuild/src/Core/Targets/VSGenericTarget.cs | 1894 ++++++++--------- Prebuild/src/Prebuild.cs | 2 +- Prebuild/src/data/prebuild-1.7.xsd | 700 +++---- Prebuild/src/data/prebuild-1.9.xsd | 672 +++--- bin/Prebuild.exe | Bin 228352 -> 226816 bytes 25 files changed, 3873 insertions(+), 3769 deletions(-) create mode 100755 Prebuild/Prebuild.exe diff --git a/Prebuild/COPYING b/Prebuild/COPYING index c57c080..d3cdf7e 100644 --- a/Prebuild/COPYING +++ b/Prebuild/COPYING @@ -1,65 +1,65 @@ -BSD License -Copyright (c)2004-2008 - -See AUTHORS file for list of copyright holders - -Dave Hudson (jendave@yahoo.com), -Matthew Holmes (matthew@wildfiregames.com) -Dan Moorehead (dan05a@gmail.com) -Rob Loach (http://www.robloach.net) -C.J. Adams-Collier (cjac@colliertech.org) - -http://dnpb.sourceforge.net -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. 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. - -3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "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 - COPYRIGHT OWNER OR 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. - ---- - -Portions of src/Core/Targets/AutotoolsTarget.cs -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +BSD License +Copyright (c)2004-2008 + +See AUTHORS file for list of copyright holders + +Dave Hudson (jendave@yahoo.com), +Matthew Holmes (matthew@wildfiregames.com) +Dan Moorehead (dan05a@gmail.com) +Rob Loach (http://www.robloach.net) +C.J. Adams-Collier (cjac@colliertech.org) + +http://dnpb.sourceforge.net +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. 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. + +3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "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 + COPYRIGHT OWNER OR 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. + +--- + +Portions of src/Core/Targets/AutotoolsTarget.cs +// Copyright (C) 2006 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Prebuild/NEWS b/Prebuild/NEWS index 3ab3108..bea28da 100644 --- a/Prebuild/NEWS +++ b/Prebuild/NEWS @@ -1,200 +1,200 @@ -Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop, and NAnt. - -Documentation and downloads are available at http://dnpb.sourceforge.net. - -Prebuild is licensed under the BSD license. - -[ XXXXXXX XX, XXX - 1.3.2 ] - + Added Keyfile signing to NAnt target and VS2005 target - + Updated XSD file to 1.7 - + Boo and VisualBasic Language support in VS2005 target - + Added basic Autotools target. It creates a non-recursive Autotools system. - ! Multiple files can be excluded from the Match node - ! VS2005 now handles .resx files correctly. - ! NAnt and Autotools now handle defines - ! NAnt and Autotools now handle resources - + Conditional XML variables can be passed through the command line. - + Added /install and /remove command line flags to install and remove assemblies from the GAC - + Many fixes to VS2005 target - -[ July 21, 2006 - 1.3.1 ] - ! VS2005 fixes from Rob Loach - ! NAnt fixes from Rob Loach and David Hudson - ! XML doc fixes from Rob Loach - + Added SharpDevelop2 target (really just uses VS2005 target) - ! Fixed bug with BuildEvents in Monodevelop target - + Passing /yes will default to answering yes to any warnings - -[ February 28, 2006 - 1.3 ] - + Added MonoDevelop target. - + Added NAnt target. - + Lots of fixes to all targets. - * Cleaned up the code using FXCop. - * Updated schema to 1.6 to fix a typo and add a new parameter. - * jendave is now the maintainer of the project. RobLoach has been added as a developer. - * Removed references to 'dnpb'. - + Added rudimentary support for pre- and post- build scripts - * Updated examples. - -[ August 5, 2004 - 1.2 ] - + Added Visual Studio Express (vs2005express) target contributed by Borrillis and modified for use with different languages - + Added the allowedgroups command line option followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags - + Added the filterGroups XML attribute to the project node and updated the scheme to v1.5 for this addition, it is used to specified the delimited list of filter groups to which a project belongs - * Modified the removedir command line option to allow for a pipe-delimited list of directory names - ! Modified the resource loading code to search for resourced without the prepended namespace (as Visual Studio .NET does it) to allow for it to be compiled with SharpDevelop as well - + Added the GenerateXmlDocFile boolean option to the Options XML element - * Changed the behavior of the XmlDocFile option so that if not specified it uses the assemblyName (without file extension) + .xml for the file name instead of just not generating the file since the new GenerateXmlDocFile takes care of this - -[ January 3, 2004 - 1.1 ] - ! Replaced regex use for more efficient manual parsing to allow use on non-windows platforms with Mono which has Regex problems - + Added the checkOsVars attribute to the root element for enabling interpolation for Enviroment variables in the form ${var}, otherwise no checking is performed for efficiency-sake - * Make the version attribute on the root element optional as it isn't used and not needed since the schema url contains the version - -[ December 30, 2004 - 1.1 ] - ! Applied Leed's fix for SharpDevelop references - + Rewrote much of the processing for better validation and without the use of a temp file - + Added support for configurations at the project level which are named All. They now apply changes to all Solution level defined configs - * Changed all spaces into tabs - + Added support for the None build action - * Replaced all sequence's in the XML schema for all's because the order doesn't matter since the xml file is loaded into an XmlDocument - -[ December 25, 2004 - 1.0 ] - + Added the /removedir option for cleaning directories like obj before file releases - + Changed WriteTempXml() and the new DeleteTempXml() methods to be compiled only in DEBUG builds - * Made path optional for Match elements (defaults to current directory) and updates schema for it - ! Fixed XML example in the readme.txt - + Added example xml files to docs directory - * Updated license.txt to add Dan Moorehead and update copyright years - + Updated prebuild.xml to take advantage of the default path attribute for match elements - + Updated Clean to delete the obj directories - -[ December 25, 2004 - 0.13 ] - + Added dnpb.exe so that it can be used to generate the project files - + Added dnpb.ico - * Added parameterless Write statement to Log for writing a single line - * Changed scehema to version 1.3 for support of icon attribute - * Added support for All configuration name under a Project node signifying common settings for all configurations - ! Fixed the SupressWarnings by adding the corresponding field to OptionsNode - * Wrote documentation in docs/readme.txt - * Added Dan Moorehead to copyrights and extended date from 2004 to 2004-2005 - * Updated prebuild.xml - * Optimized Log class - * Updated OutputUsage() - * /clean targets all by default - * No log file is used by default, /log without value specified uses default file name - + Added support for the /pause which pauses the utility after execution to observe output - - -[ September 27, 2004 - 0.12.2a ] - ! Fixed a nasty bug when trying to delete our temp file for pre-processing. - -[ September 15, 2004 - 0.12.2 ] - + Expanded platform identification, thanks to the NAnt guys for shedding some - light on how to properly check for UNIX platforms! Thanks guys! - * POSIX OS identifier changed to UNIX. Valid OS names are now "Win32", "UNIX", - and "Unknown". - ! Fixed SharpDevelop target to properly use the 'rootNamespace' attribute of - the Project tag. - + New command-line switch, /ppo, forces DNPB to pre-process the file and write - the pre-processed file. This allows you to test/debug your pre-processor - macros. No other processing will be done. You can specify a target file as - a paramter for the /ppo switch, or DNPB will write the file 'preprocessed.xml' - if you do not specify a file. - + The Match tag now has a 'buildAction' attribute which functions exactly like - the attribute of the same name for the File tag. - -[ August 5, 2004 - 0.12.1 ] - + Added environment variable expansion for all values. Environment variables - should be listed in the form ${VAR}. - -[ July 30, 2004 - 0.12.0 ] - + Added preprocessing via XML processing information tags. Available tags - are: ?>, ?>, and . The - current expression parser is very basic, but will be replaced with a more - capable parser over time. Current operators available are: =, !=, <, >, - <=, >=. Current test variables available: OS, RuntimeVersion, RuntimeMajor, - RuntimeMinor, RuntimeRevision. - -[ July 27, 2004 - 0.11.4 ] - + Added 'useRegex' attribute to the Match tag. Matches can now use regular - expressions to match filenames. - + Added the 'assemblyName' attribute to the Project tag. Projects can now - set their output assembly name. - ! Fixed several bugs in the way that Project tags inheirt their parent - Solutions configuration options. This operation should now work fully as - intended. - ! Due to some wierdness, Project Guid's are now stored as part of the Project - node and created at parse time. - -[ May 11, 2004 - 0.11.3 ] - ! Fixed a bug where I was writing the wrong property name for a projects root - namespace. - ! Removed a DEBUG statement I had left in the code in 0.11.2. - ! Fixed a bug in the VS2002 writer which caused the version variables to not - be overriden correctly. - + Added the rootNamespace property to the element, allowing you to - specify the root namespace. - * /target and /clean are now mutually exclusive command line switches, and - they both now take the all option. In the case of /target all, all build - file for all targets will be created. In the case of /clean all, the user - will be prompted to make sure they want to do it, and if so, will clean - all build files for all targets. - -[ April 22, 2004 - 0.11.2 ] - ! Fixed a bug with the /file command-line operator. Was using the unresolved - file path rather then the resolved one, was making the attempt to open the - dnpb file fail. - ! Fixed a bug in the schema that required at least 1 solution and 1 reference - path. We can do just fine with 0 of either of these. Some files may be all - statements and not have any tags. - ! Fixed a bug that caused the project references not to be written with the - SharpDevelop target. - * Changed the schema to version 1.2, allowing for Configuration nodes to exist - under project nodes. The inheritance of values is hierarchical. Meaning, if - you define a configuration named Debug at the Soltion level, and one by the - same name at the Project level, the one at the Project level will first - inherit the options of the Solution level configuration, then set it's own - options. If you define a configuration at the Project level and it does not - exist at the Solution level, it will be created at the Solution level. - * Project references should now work correctly across the board. Note that due - to a restriction in Visual Studio, you can only reference projects in the same - solution. - -[ April 21, 2004 - 0.11.1 ] - ! Fixed a problem with resolving paths in various targets. Was not properly - setting the CWD. - * Schema updated to 1.1, moving the ReferencePath element from the Options - element to the Project element. This makes more logical sense, given that - reference paths are resolved relative to the project path. Any prebuild.xml - file referecning verison 1.0 will fail! Please update to the 1.1 schema. - -[ April 19, 2004 - 0.11.0 ] - * Added several attributes across the code to make FxCop happy - ! Fixed bugs in reference paths being written in the VS targets. - ! Fixed a bug in ProjectNode which was doing two CWDStack.Push() calls instead of - a Push/Pop pair. Was wreaking havoc with tags. - ! Fixed some bugs in the path tracking, both the Project and Solution nodes now - have a FullPath property, which is the full path to the file resolved at load - time. This should fix all path relativity problems. - + Added new /clean switch, allowing the target to clean up any files it generated. - in accordance, the ITarget interface has been updated to support a new Clean() - method. - + Completed addition of the tag, to allow the referencing of external - prebuild.xml files. - + Added the runtime attribute to the Project element. This allows the developer - to specify which runtime a project should target (Mono or Microsoft). This is - of course ignored in certain targets like the Visual Studio targets. - + Added the SharpDevelop target. - -[ April 13, 2004 - 0.10.1a ] - + Added the buildAction attribute to the File node. This is needed for dnpb - to even be able to bootstrap itself (dnpb-1.0.xsd must be an embedded resource) - -[ April 13, 2004 - 0.10.1 ] - * First Release - -[ Key ] -* = Change or information -+ = Addition -! = Bug Fix - +Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop, and NAnt. + +Documentation and downloads are available at http://dnpb.sourceforge.net. + +Prebuild is licensed under the BSD license. + +[ XXXXXXX XX, XXX - 1.3.2 ] + + Added Keyfile signing to NAnt target and VS2005 target + + Updated XSD file to 1.7 + + Boo and VisualBasic Language support in VS2005 target + + Added basic Autotools target. It creates a non-recursive Autotools system. + ! Multiple files can be excluded from the Match node + ! VS2005 now handles .resx files correctly. + ! NAnt and Autotools now handle defines + ! NAnt and Autotools now handle resources + + Conditional XML variables can be passed through the command line. + + Added /install and /remove command line flags to install and remove assemblies from the GAC + + Many fixes to VS2005 target + +[ July 21, 2006 - 1.3.1 ] + ! VS2005 fixes from Rob Loach + ! NAnt fixes from Rob Loach and David Hudson + ! XML doc fixes from Rob Loach + + Added SharpDevelop2 target (really just uses VS2005 target) + ! Fixed bug with BuildEvents in Monodevelop target + + Passing /yes will default to answering yes to any warnings + +[ February 28, 2006 - 1.3 ] + + Added MonoDevelop target. + + Added NAnt target. + + Lots of fixes to all targets. + * Cleaned up the code using FXCop. + * Updated schema to 1.6 to fix a typo and add a new parameter. + * jendave is now the maintainer of the project. RobLoach has been added as a developer. + * Removed references to 'dnpb'. + + Added rudimentary support for pre- and post- build scripts + * Updated examples. + +[ August 5, 2004 - 1.2 ] + + Added Visual Studio Express (vs2005express) target contributed by Borrillis and modified for use with different languages + + Added the allowedgroups command line option followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags + + Added the filterGroups XML attribute to the project node and updated the scheme to v1.5 for this addition, it is used to specified the delimited list of filter groups to which a project belongs + * Modified the removedir command line option to allow for a pipe-delimited list of directory names + ! Modified the resource loading code to search for resourced without the prepended namespace (as Visual Studio .NET does it) to allow for it to be compiled with SharpDevelop as well + + Added the GenerateXmlDocFile boolean option to the Options XML element + * Changed the behavior of the XmlDocFile option so that if not specified it uses the assemblyName (without file extension) + .xml for the file name instead of just not generating the file since the new GenerateXmlDocFile takes care of this + +[ January 3, 2004 - 1.1 ] + ! Replaced regex use for more efficient manual parsing to allow use on non-windows platforms with Mono which has Regex problems + + Added the checkOsVars attribute to the root element for enabling interpolation for Enviroment variables in the form ${var}, otherwise no checking is performed for efficiency-sake + * Make the version attribute on the root element optional as it isn't used and not needed since the schema url contains the version + +[ December 30, 2004 - 1.1 ] + ! Applied Leed's fix for SharpDevelop references + + Rewrote much of the processing for better validation and without the use of a temp file + + Added support for configurations at the project level which are named All. They now apply changes to all Solution level defined configs + * Changed all spaces into tabs + + Added support for the None build action + * Replaced all sequence's in the XML schema for all's because the order doesn't matter since the xml file is loaded into an XmlDocument + +[ December 25, 2004 - 1.0 ] + + Added the /removedir option for cleaning directories like obj before file releases + + Changed WriteTempXml() and the new DeleteTempXml() methods to be compiled only in DEBUG builds + * Made path optional for Match elements (defaults to current directory) and updates schema for it + ! Fixed XML example in the readme.txt + + Added example xml files to docs directory + * Updated license.txt to add Dan Moorehead and update copyright years + + Updated prebuild.xml to take advantage of the default path attribute for match elements + + Updated Clean to delete the obj directories + +[ December 25, 2004 - 0.13 ] + + Added dnpb.exe so that it can be used to generate the project files + + Added dnpb.ico + * Added parameterless Write statement to Log for writing a single line + * Changed scehema to version 1.3 for support of icon attribute + * Added support for All configuration name under a Project node signifying common settings for all configurations + ! Fixed the SupressWarnings by adding the corresponding field to OptionsNode + * Wrote documentation in docs/readme.txt + * Added Dan Moorehead to copyrights and extended date from 2004 to 2004-2005 + * Updated prebuild.xml + * Optimized Log class + * Updated OutputUsage() + * /clean targets all by default + * No log file is used by default, /log without value specified uses default file name + + Added support for the /pause which pauses the utility after execution to observe output + + +[ September 27, 2004 - 0.12.2a ] + ! Fixed a nasty bug when trying to delete our temp file for pre-processing. + +[ September 15, 2004 - 0.12.2 ] + + Expanded platform identification, thanks to the NAnt guys for shedding some + light on how to properly check for UNIX platforms! Thanks guys! + * POSIX OS identifier changed to UNIX. Valid OS names are now "Win32", "UNIX", + and "Unknown". + ! Fixed SharpDevelop target to properly use the 'rootNamespace' attribute of + the Project tag. + + New command-line switch, /ppo, forces DNPB to pre-process the file and write + the pre-processed file. This allows you to test/debug your pre-processor + macros. No other processing will be done. You can specify a target file as + a paramter for the /ppo switch, or DNPB will write the file 'preprocessed.xml' + if you do not specify a file. + + The Match tag now has a 'buildAction' attribute which functions exactly like + the attribute of the same name for the File tag. + +[ August 5, 2004 - 0.12.1 ] + + Added environment variable expansion for all values. Environment variables + should be listed in the form ${VAR}. + +[ July 30, 2004 - 0.12.0 ] + + Added preprocessing via XML processing information tags. Available tags + are: ?>, ?>, and . The + current expression parser is very basic, but will be replaced with a more + capable parser over time. Current operators available are: =, !=, <, >, + <=, >=. Current test variables available: OS, RuntimeVersion, RuntimeMajor, + RuntimeMinor, RuntimeRevision. + +[ July 27, 2004 - 0.11.4 ] + + Added 'useRegex' attribute to the Match tag. Matches can now use regular + expressions to match filenames. + + Added the 'assemblyName' attribute to the Project tag. Projects can now + set their output assembly name. + ! Fixed several bugs in the way that Project tags inheirt their parent + Solutions configuration options. This operation should now work fully as + intended. + ! Due to some wierdness, Project Guid's are now stored as part of the Project + node and created at parse time. + +[ May 11, 2004 - 0.11.3 ] + ! Fixed a bug where I was writing the wrong property name for a projects root + namespace. + ! Removed a DEBUG statement I had left in the code in 0.11.2. + ! Fixed a bug in the VS2002 writer which caused the version variables to not + be overriden correctly. + + Added the rootNamespace property to the element, allowing you to + specify the root namespace. + * /target and /clean are now mutually exclusive command line switches, and + they both now take the all option. In the case of /target all, all build + file for all targets will be created. In the case of /clean all, the user + will be prompted to make sure they want to do it, and if so, will clean + all build files for all targets. + +[ April 22, 2004 - 0.11.2 ] + ! Fixed a bug with the /file command-line operator. Was using the unresolved + file path rather then the resolved one, was making the attempt to open the + dnpb file fail. + ! Fixed a bug in the schema that required at least 1 solution and 1 reference + path. We can do just fine with 0 of either of these. Some files may be all + statements and not have any tags. + ! Fixed a bug that caused the project references not to be written with the + SharpDevelop target. + * Changed the schema to version 1.2, allowing for Configuration nodes to exist + under project nodes. The inheritance of values is hierarchical. Meaning, if + you define a configuration named Debug at the Soltion level, and one by the + same name at the Project level, the one at the Project level will first + inherit the options of the Solution level configuration, then set it's own + options. If you define a configuration at the Project level and it does not + exist at the Solution level, it will be created at the Solution level. + * Project references should now work correctly across the board. Note that due + to a restriction in Visual Studio, you can only reference projects in the same + solution. + +[ April 21, 2004 - 0.11.1 ] + ! Fixed a problem with resolving paths in various targets. Was not properly + setting the CWD. + * Schema updated to 1.1, moving the ReferencePath element from the Options + element to the Project element. This makes more logical sense, given that + reference paths are resolved relative to the project path. Any prebuild.xml + file referecning verison 1.0 will fail! Please update to the 1.1 schema. + +[ April 19, 2004 - 0.11.0 ] + * Added several attributes across the code to make FxCop happy + ! Fixed bugs in reference paths being written in the VS targets. + ! Fixed a bug in ProjectNode which was doing two CWDStack.Push() calls instead of + a Push/Pop pair. Was wreaking havoc with tags. + ! Fixed some bugs in the path tracking, both the Project and Solution nodes now + have a FullPath property, which is the full path to the file resolved at load + time. This should fix all path relativity problems. + + Added new /clean switch, allowing the target to clean up any files it generated. + in accordance, the ITarget interface has been updated to support a new Clean() + method. + + Completed addition of the tag, to allow the referencing of external + prebuild.xml files. + + Added the runtime attribute to the Project element. This allows the developer + to specify which runtime a project should target (Mono or Microsoft). This is + of course ignored in certain targets like the Visual Studio targets. + + Added the SharpDevelop target. + +[ April 13, 2004 - 0.10.1a ] + + Added the buildAction attribute to the File node. This is needed for dnpb + to even be able to bootstrap itself (dnpb-1.0.xsd must be an embedded resource) + +[ April 13, 2004 - 0.10.1 ] + * First Release + +[ Key ] +* = Change or information ++ = Addition +! = Bug Fix + diff --git a/Prebuild/Prebuild.exe b/Prebuild/Prebuild.exe new file mode 100755 index 0000000..bdb25b6 Binary files /dev/null and b/Prebuild/Prebuild.exe differ diff --git a/Prebuild/README b/Prebuild/README index e8a2d69..2b05fb5 100644 --- a/Prebuild/README +++ b/Prebuild/README @@ -1,274 +1,274 @@ -Prebuild Instructions - -Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt. - -_______________________________________________________________________________ -Overview - -Prebuild can be either be run from the command line to generate the -project and make files or you can execute the included batch (*.bat) -and Unix Shell script (*.sh) files. - -_______________________________________________________________________________ -The currently supported developement tools and their associated batch -and shell script files. - -Visual Studio .NET 2005 (VS2005.bat) -Visual Studio .NET 2003 (VS2003.bat) -Visual Studio .NET 2002 (VS2002.bat) -SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ -SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ -MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/ -NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/ -Autotools (autotools.bat and autotools.sh) - http://en.wikipedia.org/wiki/GNU_build_system - -Notes: - -A Unix Shell script is provided for MonoDevelop, as it does not run on -Windows at this time. - -Visual Studio .NET 2005 and the Visual Express IDE's can import -solutions from older versions of Visual Studio .NET. - -Makefiles are not currently supported. - -_______________________________________________________________________________ -Command Line Syntax: - -Example: -> Prebuild /target vs2003 - -This will generate the project files for Visual Studio.NET 2003 and -place the redirect the log to a file named PrebuildLog.txt in the -parent directory - - -The syntax structure is as below, where commandParameter is optional -depending on the command and you can provide several option-value -pairs. - -Note: The '> ' signifies the command prompt, do not enter this literally - -> Prebuild /