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/Capabilities/Caps.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Capabilities/Caps.cs')
-rw-r--r-- | OpenSim/Capabilities/Caps.cs | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs index 049afab..7492602 100644 --- a/OpenSim/Capabilities/Caps.cs +++ b/OpenSim/Capabilities/Caps.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | ||
33 | using log4net; | 34 | using log4net; |
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
@@ -63,7 +64,7 @@ namespace OpenSim.Framework.Capabilities | |||
63 | 64 | ||
64 | private CapsHandlers m_capsHandlers; | 65 | private CapsHandlers m_capsHandlers; |
65 | 66 | ||
66 | private Dictionary<string, PollServiceEventArgs> m_pollServiceHandlers | 67 | private Dictionary<string, PollServiceEventArgs> m_pollServiceHandlers |
67 | = new Dictionary<string, PollServiceEventArgs>(); | 68 | = new Dictionary<string, PollServiceEventArgs>(); |
68 | 69 | ||
69 | private Dictionary<string, string> m_externalCapsHandlers = new Dictionary<string, string>(); | 70 | private Dictionary<string, string> m_externalCapsHandlers = new Dictionary<string, string>(); |
@@ -71,6 +72,7 @@ namespace OpenSim.Framework.Capabilities | |||
71 | private IHttpServer m_httpListener; | 72 | private IHttpServer m_httpListener; |
72 | private UUID m_agentID; | 73 | private UUID m_agentID; |
73 | private string m_regionName; | 74 | private string m_regionName; |
75 | private ManualResetEvent m_capsActive = new ManualResetEvent(false); | ||
74 | 76 | ||
75 | public UUID AgentID | 77 | public UUID AgentID |
76 | { | 78 | { |
@@ -134,8 +136,14 @@ namespace OpenSim.Framework.Capabilities | |||
134 | } | 136 | } |
135 | 137 | ||
136 | m_agentID = agent; | 138 | m_agentID = agent; |
137 | m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL); | 139 | m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort); |
138 | m_regionName = regionName; | 140 | m_regionName = regionName; |
141 | m_capsActive.Reset(); | ||
142 | } | ||
143 | |||
144 | ~Caps() | ||
145 | { | ||
146 | m_capsActive.Dispose(); | ||
139 | } | 147 | } |
140 | 148 | ||
141 | /// <summary> | 149 | /// <summary> |
@@ -152,7 +160,7 @@ namespace OpenSim.Framework.Capabilities | |||
152 | public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler) | 160 | public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler) |
153 | { | 161 | { |
154 | // m_log.DebugFormat( | 162 | // m_log.DebugFormat( |
155 | // "[CAPS]: Registering handler with name {0}, url {1} for {2}", | 163 | // "[CAPS]: Registering handler with name {0}, url {1} for {2}", |
156 | // capName, pollServiceHandler.Url, m_agentID, m_regionName); | 164 | // capName, pollServiceHandler.Url, m_agentID, m_regionName); |
157 | 165 | ||
158 | m_pollServiceHandlers.Add(capName, pollServiceHandler); | 166 | m_pollServiceHandlers.Add(capName, pollServiceHandler); |
@@ -162,7 +170,7 @@ namespace OpenSim.Framework.Capabilities | |||
162 | // uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | 170 | // uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; |
163 | // string protocol = "http"; | 171 | // string protocol = "http"; |
164 | // string hostName = m_httpListenerHostName; | 172 | // string hostName = m_httpListenerHostName; |
165 | // | 173 | // |
166 | // if (MainServer.Instance.UseSSL) | 174 | // if (MainServer.Instance.UseSSL) |
167 | // { | 175 | // { |
168 | // hostName = MainServer.Instance.SSLCommonName; | 176 | // hostName = MainServer.Instance.SSLCommonName; |
@@ -230,7 +238,7 @@ namespace OpenSim.Framework.Capabilities | |||
230 | string hostName = m_httpListenerHostName; | 238 | string hostName = m_httpListenerHostName; |
231 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; | 239 | uint port = (MainServer.Instance == null) ? 0 : MainServer.Instance.Port; |
232 | string protocol = "http"; | 240 | string protocol = "http"; |
233 | 241 | ||
234 | if (MainServer.Instance.UseSSL) | 242 | if (MainServer.Instance.UseSSL) |
235 | { | 243 | { |
236 | hostName = MainServer.Instance.SSLCommonName; | 244 | hostName = MainServer.Instance.SSLCommonName; |
@@ -255,5 +263,16 @@ namespace OpenSim.Framework.Capabilities | |||
255 | 263 | ||
256 | return caps; | 264 | return caps; |
257 | } | 265 | } |
266 | |||
267 | public void Activate() | ||
268 | { | ||
269 | m_capsActive.Set(); | ||
270 | } | ||
271 | |||
272 | public bool WaitForActivation() | ||
273 | { | ||
274 | // Wait for 30s. If that elapses, return false and run without caps | ||
275 | return m_capsActive.WaitOne(120000); | ||
276 | } | ||
258 | } | 277 | } |
259 | } \ No newline at end of file | 278 | } \ No newline at end of file |