diff --git a/LibreMetaverse/AgentManagerMovement.cs b/LibreMetaverse/AgentManagerMovement.cs index 08bc45cb..f12541d6 100644 --- a/LibreMetaverse/AgentManagerMovement.cs +++ b/LibreMetaverse/AgentManagerMovement.cs @@ -459,7 +459,7 @@ namespace OpenMetaverse Camera = new AgentCamera(); Client.Network.LoginProgress += Network_OnConnected; Client.Network.Disconnected += Network_OnDisconnected; - updateInterval = Settings.DEFAULT_AGENT_UPDATE_INTERVAL; + updateInterval = client.Settings.DEFAULT_AGENT_UPDATE_INTERVAL; } private void CleanupTimer() @@ -481,7 +481,10 @@ namespace OpenMetaverse if (e.Status == LoginStatus.Success) { CleanupTimer(); - updateTimer = new Timer(new TimerCallback(UpdateTimer_Elapsed), null, updateInterval, updateInterval); + if (Client.Settings.SEND_AGENT_UPDATES_REGULARLY) + { + updateTimer = new Timer(new TimerCallback(UpdateTimer_Elapsed), null, updateInterval, updateInterval); + } } } @@ -528,12 +531,13 @@ namespace OpenMetaverse if (Client.Self.SittingOn > 0) { - if (!Client.Network.CurrentSim.ObjectsPrimitives.ContainsKey(Client.Self.SittingOn)) + if (!Client.Network.CurrentSim.ObjectsPrimitives.TryGetValue(Client.Self.SittingOn, out var parent)) { Logger.Log("Attempted TurnToward but parent prim is not in dictionary", Helpers.LogLevel.Warning, Client); return false; } - else parentRot = Client.Network.CurrentSim.ObjectsPrimitives[Client.Self.SittingOn].Rotation; + + parentRot = parent.Rotation; } Quaternion between = Vector3.RotationBetween(Vector3.UnitX, Vector3.Normalize(target - Client.Self.SimPosition)); diff --git a/LibreMetaverse/Settings.cs b/LibreMetaverse/Settings.cs index 91d5b91b..0f345ff8 100644 --- a/LibreMetaverse/Settings.cs +++ b/LibreMetaverse/Settings.cs @@ -126,11 +126,11 @@ namespace OpenMetaverse public const int PING_INTERVAL = 2200; /// Number of milliseconds between sending camera updates - public const int DEFAULT_AGENT_UPDATE_INTERVAL = 500; + public int DEFAULT_AGENT_UPDATE_INTERVAL = 500; /// Number of milliseconds between updating the current /// positions of moving, non-accelerating and non-colliding objects - public const int INTERPOLATION_INTERVAL = 250; + public int INTERPOLATION_INTERVAL = 250; /// Millisecond interval between ticks, where all ACKs are /// sent out and the age of unACKed packets is checked @@ -182,9 +182,12 @@ namespace OpenMetaverse /// TerrainManager public bool STORE_LAND_PATCHES = false; - /// Enable/disable sending periodic camera updates + /// Enable/disable sending agent updates public bool SEND_AGENT_UPDATES = true; + /// Enable/disable sending periodic agent updates + public bool SEND_AGENT_UPDATES_REGULARLY = true; + /// Enable/disable automatically setting agent appearance at /// login and after sim crossing public bool SEND_AGENT_APPEARANCE = true; @@ -307,6 +310,11 @@ namespace OpenMetaverse #endregion #region Texture Pipeline + /// + /// Enable texture pipeline, will use a thread. + /// + public bool USE_TEXTURE_PIPELINE = true; + /// /// Download textures using GetTexture capability when available /// diff --git a/LibreMetaverse/TexturePipeline.cs b/LibreMetaverse/TexturePipeline.cs index 5180c992..f0999853 100644 --- a/LibreMetaverse/TexturePipeline.cs +++ b/LibreMetaverse/TexturePipeline.cs @@ -174,6 +174,9 @@ namespace OpenMetaverse if (_Running) return; + if (!_Client.Settings.USE_TEXTURE_PIPELINE) + return; + if (downloadMaster == null) { // Instantiate master thread that manages the request pool