From ff0ccf9c67e3840c39729e1ce9677b96e0cfd472 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 7 Aug 2016 14:30:27 +0100 Subject: several changes related to culling option --- OpenSim/Framework/IClientAPI.cs | 52 +++++++++++++++----------------------- OpenSim/Framework/PriorityQueue.cs | 12 ++++----- 2 files changed, 26 insertions(+), 38 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 018f194..0140733 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -585,10 +585,10 @@ namespace OpenSim.Framework public float dwell; } - public class IEntityUpdate + public class EntityUpdate { private ISceneEntity m_entity; - private uint m_flags; + private PrimUpdateFlags m_flags; private int m_updateTime; public ISceneEntity Entity @@ -596,7 +596,7 @@ namespace OpenSim.Framework get { return m_entity; } } - public uint Flags + public PrimUpdateFlags Flags { get { return m_flags; } } @@ -606,23 +606,31 @@ namespace OpenSim.Framework get { return m_updateTime; } } - public virtual void Update(IEntityUpdate update) + public virtual void Update(EntityUpdate update) { - m_flags |= update.Flags; + PrimUpdateFlags updateFlags = update.Flags; + if(updateFlags.HasFlag(PrimUpdateFlags.CancelKill)) + m_flags = PrimUpdateFlags.FullUpdate; + else if(m_flags.HasFlag(PrimUpdateFlags.Kill)) + return; + else if(updateFlags.HasFlag(PrimUpdateFlags.Kill)) + m_flags = PrimUpdateFlags.Kill; + else + m_flags |= updateFlags; // Use the older of the updates as the updateTime if (Util.EnvironmentTickCountCompare(UpdateTime, update.UpdateTime) > 0) m_updateTime = update.UpdateTime; } - public IEntityUpdate(ISceneEntity entity, uint flags) + public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags) { m_entity = entity; m_flags = flags; m_updateTime = Util.EnvironmentTickCount(); } - public IEntityUpdate(ISceneEntity entity, uint flags, Int32 updateTime) + public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, Int32 updateTime) { m_entity = entity; m_flags = flags; @@ -630,29 +638,6 @@ namespace OpenSim.Framework } } - public class EntityUpdate : IEntityUpdate - { - private float m_timeDilation; - - public float TimeDilation - { - get { return m_timeDilation; } - } - - public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, float timedilation) - : base(entity, (uint)flags) - { - // Flags = flags; - m_timeDilation = timedilation; - } - - public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, float timedilation, Int32 updateTime) - : base(entity,(uint)flags,updateTime) - { - m_timeDilation = timedilation; - } - } - public class PlacesReplyData { public UUID OwnerID; @@ -701,9 +686,12 @@ namespace OpenSim.Framework ExtraData = 1 << 20, Sound = 1 << 21, Joint = 1 << 22, - FullUpdate = UInt32.MaxValue + FullUpdate = 0x3fffffff, + CancelKill = 0x7fffffff, + Kill = 0x80000000 } +/* included in .net 4.0 public static class PrimUpdateFlagsExtensions { public static bool HasFlag(this PrimUpdateFlags updateFlags, PrimUpdateFlags flag) @@ -711,7 +699,7 @@ namespace OpenSim.Framework return (updateFlags & flag) == flag; } } - +*/ public interface IClientAPI { Vector3 StartPos { get; set; } diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index 4f05f65..fec01da 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs @@ -113,7 +113,7 @@ namespace OpenSim.Framework /// /// Enqueue an item into the specified priority queue /// - public bool Enqueue(uint pqueue, IEntityUpdate value) + public bool Enqueue(uint pqueue, EntityUpdate value) { LookupItem lookup; @@ -154,7 +154,7 @@ namespace OpenSim.Framework /// oldest item from the next queue in order to provide fair access to /// all of the queues /// - public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue) + public bool TryDequeue(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. @@ -212,7 +212,7 @@ namespace OpenSim.Framework } timeinqueue = 0; - value = default(IEntityUpdate); + value = default(EntityUpdate); return false; } @@ -270,8 +270,8 @@ namespace OpenSim.Framework #region MinHeapItem private struct MinHeapItem : IComparable { - private IEntityUpdate value; - internal IEntityUpdate Value { + private EntityUpdate value; + internal EntityUpdate Value { get { return this.value; } @@ -307,7 +307,7 @@ namespace OpenSim.Framework this.pqueue = pqueue; } - internal MinHeapItem(uint pqueue, UInt64 entryorder, IEntityUpdate value) + internal MinHeapItem(uint pqueue, UInt64 entryorder, EntityUpdate value) { this.entrytime = Util.EnvironmentTickCount(); this.entryorder = entryorder; -- cgit v1.1 From a30f75cfdc7e22ae108d2e48597c80166680a45d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 7 Aug 2016 20:53:38 +0100 Subject: fix entity update flags update --- OpenSim/Framework/IClientAPI.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 0140733..848d574 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -606,21 +606,20 @@ namespace OpenSim.Framework get { return m_updateTime; } } - public virtual void Update(EntityUpdate update) + public virtual void Update(EntityUpdate oldupdate) { - PrimUpdateFlags updateFlags = update.Flags; - if(updateFlags.HasFlag(PrimUpdateFlags.CancelKill)) + // we are on the new one + PrimUpdateFlags updateFlags = oldupdate.Flags; + if(m_flags.HasFlag(PrimUpdateFlags.CancelKill)) m_flags = PrimUpdateFlags.FullUpdate; - else if(m_flags.HasFlag(PrimUpdateFlags.Kill)) - return; else if(updateFlags.HasFlag(PrimUpdateFlags.Kill)) - m_flags = PrimUpdateFlags.Kill; - else + return; + else // kill case will just merge in m_flags |= updateFlags; // Use the older of the updates as the updateTime - if (Util.EnvironmentTickCountCompare(UpdateTime, update.UpdateTime) > 0) - m_updateTime = update.UpdateTime; + if (Util.EnvironmentTickCountCompare(UpdateTime, oldupdate.UpdateTime) > 0) + m_updateTime = oldupdate.UpdateTime; } public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags) -- cgit v1.1 From b64f25e631a0ec5681ddff050dc9bead5e0a7c8b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 13 Aug 2016 00:16:50 +0100 Subject: add a missing cast to ulong in RegionGridLocToHandle (mantis: 7994) --- OpenSim/Framework/Util.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 5250d30..96b91ff 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -382,7 +382,8 @@ namespace OpenSim.Framework public static ulong RegionGridLocToHandle(uint X, uint Y) { - ulong handle = X << 40; // shift to higher half and mult by 256) + ulong handle = X; + handle <<= 40; // shift to higher half and mult by 256) handle |= (Y << 8); // mult by 256) return handle; } -- cgit v1.1 From ac542715f1712eaba298a0a8e42c3ce9b0c7f24a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 18 Aug 2016 12:45:11 +0100 Subject: add caps HomeLocation ; add client SendAlertMessage(string message, string info), where info in info message field. only minimal testing done --- OpenSim/Framework/IClientAPI.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 848d574..c046010 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1256,9 +1256,11 @@ namespace OpenSim.Framework void SendAttachedSoundGainChange(UUID objectID, float gain); void SendNameReply(UUID profileId, string firstname, string lastname); - void SendAlertMessage(string message); + void SendAlertMessage(string message); + void SendAlertMessage(string message, string into); void SendAgentAlertMessage(string message, bool modal); + void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url); /// -- cgit v1.1