From 79e166e9aaf56b6798e27201962f6e109925c697 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 19 Jun 2017 05:22:38 +0100 Subject: revert EnvironmentTick back to orignal clock, since change may cause issues on some code paths. Clean a bit get mesh and get texture throttle --- OpenSim/Framework/Util.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a855767..af14939 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2967,9 +2967,9 @@ namespace OpenSim.Framework /// public static Int32 EnvironmentTickCount() { - double now = GetTimeStampMS(); - return (int)now; + return Environment.TickCount & EnvironmentTickCountMask; } + const Int32 EnvironmentTickCountMask = 0x3fffffff; /// @@ -2994,8 +2994,7 @@ namespace OpenSim.Framework /// subtraction of passed prevValue from current Environment.TickCount public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) { - double now = GetTimeStampMS(); - return EnvironmentTickCountSubtract((int)now, prevValue); + return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue); } // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount -- cgit v1.1 From b0a0163253e14514289578d31e83ce0afe9b91a3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 28 Jun 2017 01:29:49 +0100 Subject: BUG FIX: change lludp hovertext utf-8 cut point. Thx djphil --- OpenSim/Framework/Util.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index af14939..ed24452 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2221,9 +2221,9 @@ namespace OpenSim.Framework // might have gotten an oversized array even after the string trim byte[] data = UTF8.GetBytes(str); - if (data.Length > 256) + if (data.Length > 255) //play safe { - int cut = 255; + int cut = 254; if((data[cut] & 0x80 ) != 0 ) { while(cut > 0 && (data[cut] & 0xc0) != 0xc0) @@ -2325,7 +2325,7 @@ namespace OpenSim.Framework if (data.Length > MaxLength) { - int cut = MaxLength -1 ; + int cut = MaxLength - 1 ; if((data[cut] & 0x80 ) != 0 ) { while(cut > 0 && (data[cut] & 0xc0) != 0xc0) -- cgit v1.1 From 40b16f1705bd6361d7fd0cd2bc458ae9ea381bf1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 10 Jul 2017 22:01:38 +0100 Subject: SimpleAngularDistance update prioritization scheme ameks no sense without ordered dequeue of the updates --- OpenSim/Framework/PriorityQueue.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index 5b9185e..22ffcdc 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs @@ -216,6 +216,27 @@ namespace OpenSim.Framework return false; } + public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue) + { + // If there is anything in imediate queues, return it first no + // matter what else. Breaks fairness. But very useful. + for (int iq = 0; iq < NumberOfQueues; iq++) + { + if (m_heaps[iq].Count > 0) + { + MinHeapItem item = m_heaps[iq].RemoveMin(); + m_lookupTable.Remove(item.Value.Entity.LocalId); + timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); + value = item.Value; + return true; + } + } + + timeinqueue = 0; + value = default(EntityUpdate); + return false; + } + /// /// Reapply the prioritization function to each of the updates currently /// stored in the priority queues. -- cgit v1.1 From aff9c345dddfa290222ceaf42b6c452a590a2276 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 12 Jul 2017 07:27:21 +0100 Subject: osSetParcelDetails: add more land update code --- OpenSim/Framework/ILandChannel.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ILandChannel.cs b/OpenSim/Framework/ILandChannel.cs index 12a8228..8667837 100644 --- a/OpenSim/Framework/ILandChannel.cs +++ b/OpenSim/Framework/ILandChannel.cs @@ -88,6 +88,7 @@ namespace OpenSim.Region.Framework.Interfaces bool IsForcefulBansAllowed(); void UpdateLandObject(int localID, LandData data); + void SendParcelsOverlay(IClientAPI client); void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient); void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); -- cgit v1.1 From bd249bdf5b175ee6d84588a777444f2b89d7df1e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 13 Jul 2017 04:14:33 +0100 Subject: replace the wrong libOMV user modifiable Utils.EnUSCulture by our own no User modifiable Culture.FormatProvider, and also for internal coerence. We do use the libomv on other code paths, so that must be fixed --- OpenSim/Framework/PhysicsInertia.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/PhysicsInertia.cs b/OpenSim/Framework/PhysicsInertia.cs index af70634..6e15791 100644 --- a/OpenSim/Framework/PhysicsInertia.cs +++ b/OpenSim/Framework/PhysicsInertia.cs @@ -64,25 +64,25 @@ namespace OpenSim.Framework private void XWfloat(string name, float f) { - writer.WriteElementString(name, f.ToString(Utils.EnUsCulture)); + writer.WriteElementString(name, f.ToString(Culture.FormatProvider)); } private void XWVector(string name, Vector3 vec) { writer.WriteStartElement(name); - writer.WriteElementString("X", vec.X.ToString(Utils.EnUsCulture)); - writer.WriteElementString("Y", vec.Y.ToString(Utils.EnUsCulture)); - writer.WriteElementString("Z", vec.Z.ToString(Utils.EnUsCulture)); + writer.WriteElementString("X", vec.X.ToString(Culture.FormatProvider)); + writer.WriteElementString("Y", vec.Y.ToString(Culture.FormatProvider)); + writer.WriteElementString("Z", vec.Z.ToString(Culture.FormatProvider)); writer.WriteEndElement(); } private void XWVector4(string name, Vector4 quat) { writer.WriteStartElement(name); - writer.WriteElementString("X", quat.X.ToString(Utils.EnUsCulture)); - writer.WriteElementString("Y", quat.Y.ToString(Utils.EnUsCulture)); - writer.WriteElementString("Z", quat.Z.ToString(Utils.EnUsCulture)); - writer.WriteElementString("W", quat.W.ToString(Utils.EnUsCulture)); + writer.WriteElementString("X", quat.X.ToString(Culture.FormatProvider)); + writer.WriteElementString("Y", quat.Y.ToString(Culture.FormatProvider)); + writer.WriteElementString("Z", quat.Z.ToString(Culture.FormatProvider)); + writer.WriteElementString("W", quat.W.ToString(Culture.FormatProvider)); writer.WriteEndElement(); } -- cgit v1.1 From 8b16131206818329e973faec3a9861fca37f0073 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 13 Jul 2017 20:21:18 +0100 Subject: add Util.GetTimeStamp() that returns the stamp in seconds; use it on ubOde; separed land collsions dispatch from the others... --- OpenSim/Framework/Util.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index ed24452..a42dcc6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -156,12 +156,14 @@ namespace OpenSim.Framework public static readonly int MAX_THREADPOOL_LEVEL = 3; public static double TimeStampClockPeriodMS; + public static double TimeStampClockPeriod; static Util() { LogThreadPool = 0; LogOverloads = true; - TimeStampClockPeriodMS = 1000.0D / (double)Stopwatch.Frequency; + TimeStampClockPeriod = 1.0D/ (double)Stopwatch.Frequency; + TimeStampClockPeriodMS = 1e3 * TimeStampClockPeriod; m_log.InfoFormat("[UTIL] TimeStamp clock with period of {0}ms", Math.Round(TimeStampClockPeriodMS,6,MidpointRounding.AwayFromZero)); } @@ -3016,6 +3018,11 @@ namespace OpenSim.Framework // returns a timestamp in ms as double // using the time resolution avaiable to StopWatch + public static double GetTimeStamp() + { + return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriod; + } + public static double GetTimeStampMS() { return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriodMS; -- cgit v1.1