From 37ae6451f9ddb2e07402a5e79a9ab58668781104 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 3 Oct 2011 23:25:09 +0100 Subject: [PATCH 1/5] Remove vestigal RegionStatus.SlaveScene. This appears to be code clutter since the code that uses this has long gone. --- OpenSim/Framework/IScene.cs | 3 - .../ClientStack/Linden/UDP/LLUDPServer.cs | 22 ++--- OpenSim/Region/Framework/Scenes/Scene.cs | 91 +++++++++---------- 3 files changed, 51 insertions(+), 65 deletions(-) diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index 8f7a2e5b4e..e0cb897e40 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -33,15 +33,12 @@ namespace OpenSim.Framework { public delegate void restart(RegionInfo thisRegion); - //public delegate void regionup (RegionInfo thisRegion); - public enum RegionStatus : int { Down = 0, Up = 1, Crashed = 2, Starting = 3, - SlaveScene = 4 }; /// diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index f2388cdf54..304efe6608 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -929,25 +929,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP UUID sessionID = useCircuitCode.CircuitCode.SessionID; uint circuitCode = useCircuitCode.CircuitCode.Code; - if (m_scene.RegionStatus != RegionStatus.SlaveScene) + AuthenticateResponse sessionInfo; + if (IsClientAuthorized(useCircuitCode, out sessionInfo)) { - AuthenticateResponse sessionInfo; - if (IsClientAuthorized(useCircuitCode, out sessionInfo)) - { - AddClient(circuitCode, agentID, sessionID, remoteEndPoint, sessionInfo); - } - else - { - // Don't create circuits for unauthorized clients - m_log.WarnFormat( - "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}", - useCircuitCode.CircuitCode.ID, useCircuitCode.CircuitCode.Code, remoteEndPoint); - } + AddClient(circuitCode, agentID, sessionID, remoteEndPoint, sessionInfo); } else { - // Slave regions don't accept new clients - m_log.Debug("[LLUDPSERVER]: Slave region " + m_scene.RegionInfo.RegionName + " ignoring UseCircuitCode packet"); + // Don't create circuits for unauthorized clients + m_log.WarnFormat( + "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}", + useCircuitCode.CircuitCode.ID, useCircuitCode.CircuitCode.Code, remoteEndPoint); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index eadec09df3..88b682bf8b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1278,56 +1278,53 @@ namespace OpenSim.Region.Framework.Scenes tempOnRezMS = Util.EnvironmentTickCountSubtract(tmpTempOnRezMS); } - if (RegionStatus != RegionStatus.SlaveScene) + if (Frame % m_update_events == 0) { - if (Frame % m_update_events == 0) - { - int evMS = Util.EnvironmentTickCount(); - UpdateEvents(); - eventMS = Util.EnvironmentTickCountSubtract(evMS); ; - } - - if (Frame % m_update_backup == 0) - { - int backMS = Util.EnvironmentTickCount(); - UpdateStorageBackup(); - backupMS = Util.EnvironmentTickCountSubtract(backMS); - } - - if (Frame % m_update_terrain == 0) - { - int terMS = Util.EnvironmentTickCount(); - UpdateTerrain(); - terrainMS = Util.EnvironmentTickCountSubtract(terMS); - } - - //if (Frame % m_update_land == 0) - //{ - // int ldMS = Util.EnvironmentTickCount(); - // UpdateLand(); - // landMS = Util.EnvironmentTickCountSubtract(ldMS); - //} - - frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); - otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; - lastCompletedFrame = Util.EnvironmentTickCount(); - - // if (Frame%m_update_avatars == 0) - // UpdateInWorldTime(); - StatsReporter.AddPhysicsFPS(physicsFPS); - StatsReporter.AddTimeDilation(TimeDilation); - StatsReporter.AddFPS(1); - StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount()); - StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount()); - StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount()); - StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount()); - StatsReporter.addFrameMS(frameMS); - StatsReporter.addPhysicsMS(physicsMS + physicsMS2); - StatsReporter.addOtherMS(otherMS); - StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); - StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); + int evMS = Util.EnvironmentTickCount(); + UpdateEvents(); + eventMS = Util.EnvironmentTickCountSubtract(evMS); ; } + if (Frame % m_update_backup == 0) + { + int backMS = Util.EnvironmentTickCount(); + UpdateStorageBackup(); + backupMS = Util.EnvironmentTickCountSubtract(backMS); + } + + if (Frame % m_update_terrain == 0) + { + int terMS = Util.EnvironmentTickCount(); + UpdateTerrain(); + terrainMS = Util.EnvironmentTickCountSubtract(terMS); + } + + //if (Frame % m_update_land == 0) + //{ + // int ldMS = Util.EnvironmentTickCount(); + // UpdateLand(); + // landMS = Util.EnvironmentTickCountSubtract(ldMS); + //} + + frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); + otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; + lastCompletedFrame = Util.EnvironmentTickCount(); + + // if (Frame%m_update_avatars == 0) + // UpdateInWorldTime(); + StatsReporter.AddPhysicsFPS(physicsFPS); + StatsReporter.AddTimeDilation(TimeDilation); + StatsReporter.AddFPS(1); + StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount()); + StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount()); + StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount()); + StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount()); + StatsReporter.addFrameMS(frameMS); + StatsReporter.addPhysicsMS(physicsMS + physicsMS2); + StatsReporter.addOtherMS(otherMS); + StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount()); + StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); + if (LoginsDisabled && Frame == 20) { // In 99.9% of cases it is a bad idea to manually force garbage collection. However, From 8a6e6866d9c6c60e4a2e4b980ca2e35ae3963d0d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 00:07:52 +0100 Subject: [PATCH 2/5] For llGetTexture(), if the face texture asset is in the inventory, return the inventory name rather than the asset UUID This is as per http://wiki.secondlife.com/wiki/LlGetTexture Applied patch in http://opensimulator.org/mantis/view.php?id=4552 with an additional break statement if an inventory item is found to exit early. Thanks Michelle Argus! --- .../Shared/Api/Implementation/LSL_Api.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9a26f4b79a..8291105b0b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1912,11 +1912,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); - return texface.TextureID.ToString(); + string texture = texface.TextureID.ToString(); + + lock (part.TaskInventory) + { + foreach (KeyValuePair inv in part.TaskInventory) + { + if (inv.Value.AssetID == texface.TextureID) + { + texture = inv.Value.Name.ToString(); + break; + } + } + } + + return texture; } else { From a8af0a5ba873dbb8c447e16b142ba7f5af715bdb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 00:15:48 +0100 Subject: [PATCH 3/5] Return NULL_KEY from llGetTexture if a non-existent face is indicated, rather than "" As per http://wiki.secondlife.com/wiki/LlGetTexture --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8291105b0b..5ede801083 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1935,7 +1935,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - return String.Empty; + return UUID.Zero.ToString(); } } From b98442dceccd416a493f19153f5daad2e173183e Mon Sep 17 00:00:00 2001 From: Pixel Tomsen Date: Sat, 1 Oct 2011 17:31:59 +0200 Subject: [PATCH 4/5] Animation-States Turning Left, Turning Right implemented/enabled http://opensimulator.org/mantis/view.php?id=3036 --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index e07d8b4308..e9e1845d4c 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -174,8 +174,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; - //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; - //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; + bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; + bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; @@ -317,6 +317,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation // Not walking if (move.Z < 0) return "CROUCH"; + else if (heldTurnLeft) + return "TURNLEFT"; + else if (heldTurnRight) + return "TURNRIGHT"; else return "STAND"; } From c7d0d71666a92b201d639511d062a7c22726b3c9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 00:37:02 +0100 Subject: [PATCH 5/5] trival tweak to trigger the continuous integration system --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5ede801083..f8327b93ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4240,8 +4240,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llCollisionSound(string impact_sound, double impact_volume) { - m_host.AddScriptLPS(1); + // TODO: Parameter check logic required. UUID soundId = UUID.Zero; if (!UUID.TryParse(impact_sound, out soundId))