diff options
author | MW | 2007-10-11 10:50:55 +0000 |
---|---|---|
committer | MW | 2007-10-11 10:50:55 +0000 |
commit | 86e5f82cb12dc5e854fe33526aee0ce899715410 (patch) | |
tree | 99066d2e40c53eb0355262c91704ecad6640208d /OpenSim/Region/Environment/Types/UpdateQueue.cs | |
parent | * Added FormatProvider to Culture (diff) | |
download | opensim-SC_OLD-86e5f82cb12dc5e854fe33526aee0ce899715410.zip opensim-SC_OLD-86e5f82cb12dc5e854fe33526aee0ce899715410.tar.gz opensim-SC_OLD-86e5f82cb12dc5e854fe33526aee0ce899715410.tar.bz2 opensim-SC_OLD-86e5f82cb12dc5e854fe33526aee0ce899715410.tar.xz |
Some changes to the sending of updates of SceneObjects to clients, that I did a few weeks ago but never committed (and never completely finished what I had planned).
Diffstat (limited to 'OpenSim/Region/Environment/Types/UpdateQueue.cs')
-rw-r--r-- | OpenSim/Region/Environment/Types/UpdateQueue.cs | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs index c1fb161..0d341ae 100644 --- a/OpenSim/Region/Environment/Types/UpdateQueue.cs +++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs | |||
@@ -1,51 +1,51 @@ | |||
1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
2 | using libsecondlife; | 2 | using libsecondlife; |
3 | using OpenSim.Region.Environment.Scenes; | 3 | using OpenSim.Region.Environment.Scenes; |
4 | 4 | ||
5 | namespace OpenSim.Region.Environment.Types | 5 | namespace OpenSim.Region.Environment.Types |
6 | { | 6 | { |
7 | public class UpdateQueue | 7 | public class UpdateQueue |
8 | { | 8 | { |
9 | private Queue<SceneObjectPart> m_queue; | 9 | private Queue<SceneObjectPart> m_queue; |
10 | 10 | ||
11 | private List<LLUUID> m_ids; | 11 | private List<LLUUID> m_ids; |
12 | 12 | ||
13 | public int Count | 13 | public int Count |
14 | { | 14 | { |
15 | get { return m_queue.Count; } | 15 | get { return m_queue.Count; } |
16 | } | 16 | } |
17 | 17 | ||
18 | public UpdateQueue() | 18 | public UpdateQueue() |
19 | { | 19 | { |
20 | m_queue = new Queue<SceneObjectPart>(); | 20 | m_queue = new Queue<SceneObjectPart>(); |
21 | m_ids = new List<LLUUID>(); | 21 | m_ids = new List<LLUUID>(); |
22 | } | 22 | } |
23 | 23 | ||
24 | public void Enqueue(SceneObjectPart part) | 24 | public void Enqueue(SceneObjectPart part) |
25 | { | 25 | { |
26 | lock (m_ids) | 26 | lock (m_ids) |
27 | { | 27 | { |
28 | if (!m_ids.Contains(part.UUID)) | 28 | if (!m_ids.Contains(part.UUID)) |
29 | { | 29 | { |
30 | m_ids.Add(part.UUID); | 30 | m_ids.Add(part.UUID); |
31 | m_queue.Enqueue(part); | 31 | m_queue.Enqueue(part); |
32 | } | 32 | } |
33 | } | 33 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | public SceneObjectPart Dequeue() | 36 | public SceneObjectPart Dequeue() |
37 | { | 37 | { |
38 | SceneObjectPart part = null; | 38 | SceneObjectPart part = null; |
39 | if (m_queue.Count > 0) | 39 | if (m_queue.Count > 0) |
40 | { | 40 | { |
41 | part = m_queue.Dequeue(); | 41 | part = m_queue.Dequeue(); |
42 | lock (m_ids) | 42 | lock (m_ids) |
43 | { | 43 | { |
44 | m_ids.Remove(part.UUID); | 44 | m_ids.Remove(part.UUID); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | return part; | 48 | return part; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | } \ No newline at end of file | 51 | } \ No newline at end of file |