diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 43 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | 2 |
3 files changed, 37 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0883913..2499460 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4340,15 +4340,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
4340 | /// Tell a single agent to disconnect from the region. | 4340 | /// Tell a single agent to disconnect from the region. |
4341 | /// </summary> | 4341 | /// </summary> |
4342 | /// <param name="agentID"></param> | 4342 | /// <param name="agentID"></param> |
4343 | /// <param name="childOnly"></param> | 4343 | /// <param name="force"> |
4344 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | 4344 | /// Force the agent to close even if it might be in the middle of some other operation. You do not want to |
4345 | /// force unless you are absolutely sure that the agent is dead and a normal close is not working. | ||
4346 | /// </param> | ||
4347 | public bool IncomingCloseAgent(UUID agentID, bool force) | ||
4345 | { | 4348 | { |
4346 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 4349 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
4347 | 4350 | ||
4348 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 4351 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
4349 | if (presence != null) | 4352 | if (presence != null) |
4350 | { | 4353 | { |
4351 | presence.ControllingClient.Close(); | 4354 | presence.ControllingClient.Close(true, force); |
4352 | return true; | 4355 | return true; |
4353 | } | 4356 | } |
4354 | 4357 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 593e1d3..af06250 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3560,23 +3560,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
3560 | } | 3560 | } |
3561 | 3561 | ||
3562 | /// <summary> | 3562 | /// <summary> |
3563 | /// Set the color of prim faces | 3563 | /// Set the color & alpha of prim faces |
3564 | /// </summary> | 3564 | /// </summary> |
3565 | /// <param name="color"></param> | ||
3566 | /// <param name="face"></param> | 3565 | /// <param name="face"></param> |
3567 | public void SetFaceColor(Vector3 color, int face) | 3566 | /// <param name="color"></param> |
3567 | /// <param name="alpha"></param> | ||
3568 | public void SetFaceColorAlpha(int face, Vector3 color, double ?alpha) | ||
3568 | { | 3569 | { |
3570 | Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f); | ||
3571 | float clippedAlpha = alpha.HasValue ? | ||
3572 | Util.Clip((float)alpha.Value, 0.0f, 1.0f) : 0; | ||
3573 | |||
3569 | // The only way to get a deep copy/ If we don't do this, we can | 3574 | // The only way to get a deep copy/ If we don't do this, we can |
3570 | // mever detect color changes further down. | 3575 | // never detect color changes further down. |
3571 | Byte[] buf = Shape.Textures.GetBytes(); | 3576 | Byte[] buf = Shape.Textures.GetBytes(); |
3572 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); | 3577 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); |
3573 | Color4 texcolor; | 3578 | Color4 texcolor; |
3574 | if (face >= 0 && face < GetNumberOfSides()) | 3579 | if (face >= 0 && face < GetNumberOfSides()) |
3575 | { | 3580 | { |
3576 | texcolor = tex.CreateFace((uint)face).RGBA; | 3581 | texcolor = tex.CreateFace((uint)face).RGBA; |
3577 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3582 | texcolor.R = clippedColor.X; |
3578 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3583 | texcolor.G = clippedColor.Y; |
3579 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3584 | texcolor.B = clippedColor.Z; |
3585 | if (alpha.HasValue) | ||
3586 | { | ||
3587 | texcolor.A = clippedAlpha; | ||
3588 | } | ||
3580 | tex.FaceTextures[face].RGBA = texcolor; | 3589 | tex.FaceTextures[face].RGBA = texcolor; |
3581 | UpdateTextureEntry(tex.GetBytes()); | 3590 | UpdateTextureEntry(tex.GetBytes()); |
3582 | return; | 3591 | return; |
@@ -3588,15 +3597,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
3588 | if (tex.FaceTextures[i] != null) | 3597 | if (tex.FaceTextures[i] != null) |
3589 | { | 3598 | { |
3590 | texcolor = tex.FaceTextures[i].RGBA; | 3599 | texcolor = tex.FaceTextures[i].RGBA; |
3591 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3600 | texcolor.R = clippedColor.X; |
3592 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3601 | texcolor.G = clippedColor.Y; |
3593 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3602 | texcolor.B = clippedColor.Z; |
3603 | if (alpha.HasValue) | ||
3604 | { | ||
3605 | texcolor.A = clippedAlpha; | ||
3606 | } | ||
3594 | tex.FaceTextures[i].RGBA = texcolor; | 3607 | tex.FaceTextures[i].RGBA = texcolor; |
3595 | } | 3608 | } |
3596 | texcolor = tex.DefaultTexture.RGBA; | 3609 | texcolor = tex.DefaultTexture.RGBA; |
3597 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3610 | texcolor.R = clippedColor.X; |
3598 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3611 | texcolor.G = clippedColor.Y; |
3599 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3612 | texcolor.B = clippedColor.Z; |
3613 | if (alpha.HasValue) | ||
3614 | { | ||
3615 | texcolor.A = clippedAlpha; | ||
3616 | } | ||
3600 | tex.DefaultTexture.RGBA = texcolor; | 3617 | tex.DefaultTexture.RGBA = texcolor; |
3601 | } | 3618 | } |
3602 | UpdateTextureEntry(tex.GetBytes()); | 3619 | UpdateTextureEntry(tex.GetBytes()); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 5758869..5faf131 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
141 | TestScene scene = new SceneHelpers().SetupScene(); | 141 | TestScene scene = new SceneHelpers().SetupScene(); |
142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); | 142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); |
143 | 143 | ||
144 | scene.IncomingCloseAgent(sp.UUID); | 144 | scene.IncomingCloseAgent(sp.UUID, false); |
145 | 145 | ||
146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); | 146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); |
147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); | 147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); |