diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Framework/Client | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Client/IClientIPEndpoint.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/ClientInfo.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/ClientManager.cs | 48 |
3 files changed, 10 insertions, 50 deletions
diff --git a/OpenSim/Framework/Client/IClientIPEndpoint.cs b/OpenSim/Framework/Client/IClientIPEndpoint.cs index 2b99bf0..2194616 100644 --- a/OpenSim/Framework/Client/IClientIPEndpoint.cs +++ b/OpenSim/Framework/Client/IClientIPEndpoint.cs | |||
@@ -34,6 +34,6 @@ namespace OpenSim.Framework.Client | |||
34 | { | 34 | { |
35 | public interface IClientIPEndpoint | 35 | public interface IClientIPEndpoint |
36 | { | 36 | { |
37 | IPAddress EndPoint { get; } | 37 | IPEndPoint RemoteEndPoint { get; } |
38 | } | 38 | } |
39 | } | 39 | } |
diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs index 98e4465..a1ca9bc 100644 --- a/OpenSim/Framework/ClientInfo.cs +++ b/OpenSim/Framework/ClientInfo.cs | |||
@@ -36,14 +36,8 @@ namespace OpenSim.Framework | |||
36 | public readonly DateTime StartedTime = DateTime.Now; | 36 | public readonly DateTime StartedTime = DateTime.Now; |
37 | public AgentCircuitData agentcircuit = null; | 37 | public AgentCircuitData agentcircuit = null; |
38 | 38 | ||
39 | public Dictionary<uint, byte[]> needAck; | ||
40 | |||
41 | public List<byte[]> out_packets = new List<byte[]>(); | ||
42 | public Dictionary<uint, uint> pendingAcks = new Dictionary<uint,uint>(); | ||
43 | public EndPoint proxyEP; | 39 | public EndPoint proxyEP; |
44 | 40 | ||
45 | public uint sequence; | ||
46 | public byte[] usecircuit; | ||
47 | public EndPoint userEP; | 41 | public EndPoint userEP; |
48 | 42 | ||
49 | public int resendThrottle; | 43 | public int resendThrottle; |
@@ -59,9 +53,5 @@ namespace OpenSim.Framework | |||
59 | public int targetThrottle; | 53 | public int targetThrottle; |
60 | 54 | ||
61 | public int maxThrottle; | 55 | public int maxThrottle; |
62 | |||
63 | public Dictionary<string, int> SyncRequests = new Dictionary<string,int>(); | ||
64 | public Dictionary<string, int> AsyncRequests = new Dictionary<string,int>(); | ||
65 | public Dictionary<string, int> GenericRequests = new Dictionary<string,int>(); | ||
66 | } | 56 | } |
67 | } | 57 | } |
diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index baff2f4..45c54e4 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs | |||
@@ -27,10 +27,8 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
31 | using System.Net; | 30 | using System.Net; |
32 | using OpenMetaverse; | 31 | using OpenMetaverse; |
33 | using OpenMetaverse.Packets; | ||
34 | 32 | ||
35 | namespace OpenSim.Framework | 33 | namespace OpenSim.Framework |
36 | { | 34 | { |
@@ -76,20 +74,16 @@ namespace OpenSim.Framework | |||
76 | { | 74 | { |
77 | lock (m_syncRoot) | 75 | lock (m_syncRoot) |
78 | { | 76 | { |
79 | if (m_dict1.ContainsKey(value.AgentId) || m_dict2.ContainsKey(value.RemoteEndPoint)) | 77 | // allow self healing |
80 | return false; | 78 | // if (m_dict1.ContainsKey(value.AgentId) || m_dict2.ContainsKey(value.RemoteEndPoint)) |
79 | // return false; | ||
81 | 80 | ||
82 | m_dict1[value.AgentId] = value; | 81 | m_dict1[value.AgentId] = value; |
83 | m_dict2[value.RemoteEndPoint] = value; | 82 | m_dict2[value.RemoteEndPoint] = value; |
84 | 83 | ||
85 | IClientAPI[] oldArray = m_array; | 84 | // dict1 is the master |
86 | int oldLength = oldArray.Length; | 85 | IClientAPI[] newArray = new IClientAPI[m_dict1.Count]; |
87 | 86 | m_dict1.Values.CopyTo(newArray, 0); | |
88 | IClientAPI[] newArray = new IClientAPI[oldLength + 1]; | ||
89 | for (int i = 0; i < oldLength; i++) | ||
90 | newArray[i] = oldArray[i]; | ||
91 | newArray[oldLength] = value; | ||
92 | |||
93 | m_array = newArray; | 87 | m_array = newArray; |
94 | } | 88 | } |
95 | 89 | ||
@@ -112,22 +106,12 @@ namespace OpenSim.Framework | |||
112 | m_dict1.Remove(key); | 106 | m_dict1.Remove(key); |
113 | m_dict2.Remove(value.RemoteEndPoint); | 107 | m_dict2.Remove(value.RemoteEndPoint); |
114 | 108 | ||
115 | IClientAPI[] oldArray = m_array; | 109 | IClientAPI[] newArray = new IClientAPI[m_dict1.Count]; |
116 | int oldLength = oldArray.Length; | 110 | m_dict1.Values.CopyTo(newArray, 0); |
117 | |||
118 | IClientAPI[] newArray = new IClientAPI[oldLength - 1]; | ||
119 | int j = 0; | ||
120 | for (int i = 0; i < oldLength; i++) | ||
121 | { | ||
122 | if (oldArray[i] != value) | ||
123 | newArray[j++] = oldArray[i]; | ||
124 | } | ||
125 | |||
126 | m_array = newArray; | 111 | m_array = newArray; |
127 | return true; | 112 | return true; |
128 | } | 113 | } |
129 | } | 114 | } |
130 | |||
131 | return false; | 115 | return false; |
132 | } | 116 | } |
133 | 117 | ||
@@ -197,25 +181,11 @@ namespace OpenSim.Framework | |||
197 | } | 181 | } |
198 | 182 | ||
199 | /// <summary> | 183 | /// <summary> |
200 | /// Performs a given task in parallel for each of the elements in the | ||
201 | /// collection | ||
202 | /// </summary> | ||
203 | /// <param name="action">Action to perform on each element</param> | ||
204 | public void ForEach(Action<IClientAPI> action) | ||
205 | { | ||
206 | IClientAPI[] localArray = m_array; | ||
207 | Parallel.For(0, localArray.Length, | ||
208 | delegate(int i) | ||
209 | { action(localArray[i]); } | ||
210 | ); | ||
211 | } | ||
212 | |||
213 | /// <summary> | ||
214 | /// Performs a given task synchronously for each of the elements in | 184 | /// Performs a given task synchronously for each of the elements in |
215 | /// the collection | 185 | /// the collection |
216 | /// </summary> | 186 | /// </summary> |
217 | /// <param name="action">Action to perform on each element</param> | 187 | /// <param name="action">Action to perform on each element</param> |
218 | public void ForEachSync(Action<IClientAPI> action) | 188 | public void ForEach(Action<IClientAPI> action) |
219 | { | 189 | { |
220 | IClientAPI[] localArray = m_array; | 190 | IClientAPI[] localArray = m_array; |
221 | for (int i = 0; i < localArray.Length; i++) | 191 | for (int i = 0; i < localArray.Length; i++) |