diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/UserServer/MessageServersConnector.cs | 93 |
1 files changed, 92 insertions, 1 deletions
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs index 61f125e..6659617 100644 --- a/OpenSim/Grid/UserServer/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs | |||
@@ -57,7 +57,13 @@ namespace OpenSim.Grid.UserServer | |||
57 | public float positionZ; | 57 | public float positionZ; |
58 | public string firstname; | 58 | public string firstname; |
59 | public string lastname; | 59 | public string lastname; |
60 | }; | 60 | } |
61 | |||
62 | public delegate void AgentLocationDelegate(UUID agentID, UUID regionID, ulong regionHandle); | ||
63 | public delegate void AgentLeavingDelegate(UUID agentID, UUID regionID, ulong regionHandle); | ||
64 | public delegate void RegionStartupDelegate(UUID regionID); | ||
65 | public delegate void RegionShutdownDelegate(UUID regionID); | ||
66 | |||
61 | 67 | ||
62 | public class MessageServersConnector | 68 | public class MessageServersConnector |
63 | { | 69 | { |
@@ -70,6 +76,11 @@ namespace OpenSim.Grid.UserServer | |||
70 | 76 | ||
71 | Thread m_NotifyThread; | 77 | Thread m_NotifyThread; |
72 | 78 | ||
79 | public event AgentLocationDelegate OnAgentLocation; | ||
80 | public event AgentLeavingDelegate OnAgentLeaving; | ||
81 | public event RegionStartupDelegate OnRegionStartup; | ||
82 | public event RegionShutdownDelegate OnRegionShutdown; | ||
83 | |||
73 | public MessageServersConnector() | 84 | public MessageServersConnector() |
74 | { | 85 | { |
75 | MessageServers = new Dictionary<string, MessageServerInfo>(); | 86 | MessageServers = new Dictionary<string, MessageServerInfo>(); |
@@ -337,5 +348,85 @@ namespace OpenSim.Grid.UserServer | |||
337 | } | 348 | } |
338 | } | 349 | } |
339 | } | 350 | } |
351 | |||
352 | public XmlRpcResponse RegionStartup(XmlRpcRequest request) | ||
353 | { | ||
354 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
355 | Hashtable result = new Hashtable(); | ||
356 | |||
357 | UUID regionID; | ||
358 | if (UUID.TryParse((string)requestData["RegionUUID"], out regionID)) | ||
359 | { | ||
360 | if (OnRegionStartup != null) | ||
361 | OnRegionStartup(regionID); | ||
362 | |||
363 | result["responsestring"] = "TRUE"; | ||
364 | } | ||
365 | |||
366 | XmlRpcResponse response = new XmlRpcResponse(); | ||
367 | response.Value = result; | ||
368 | return response; | ||
369 | } | ||
370 | |||
371 | public XmlRpcResponse RegionShutdown(XmlRpcRequest request) | ||
372 | { | ||
373 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
374 | Hashtable result = new Hashtable(); | ||
375 | |||
376 | UUID regionID; | ||
377 | if (UUID.TryParse((string)requestData["RegionUUID"], out regionID)) | ||
378 | { | ||
379 | if (OnRegionShutdown != null) | ||
380 | OnRegionShutdown(regionID); | ||
381 | |||
382 | result["responsestring"] = "TRUE"; | ||
383 | } | ||
384 | |||
385 | XmlRpcResponse response = new XmlRpcResponse(); | ||
386 | response.Value = result; | ||
387 | return response; | ||
388 | } | ||
389 | |||
390 | public XmlRpcResponse AgentLocation(XmlRpcRequest request) | ||
391 | { | ||
392 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
393 | Hashtable result = new Hashtable(); | ||
394 | |||
395 | UUID agentID; | ||
396 | UUID regionID; | ||
397 | ulong regionHandle; | ||
398 | if (UUID.TryParse((string)requestData["AgentID"], out agentID) && UUID.TryParse((string)requestData["RegionUUID"], out regionID) && ulong.TryParse((string)requestData["RegionHandle"], out regionHandle)) | ||
399 | { | ||
400 | if (OnAgentLocation != null) | ||
401 | OnAgentLocation(agentID, regionID, regionHandle); | ||
402 | |||
403 | result["responsestring"] = "TRUE"; | ||
404 | } | ||
405 | |||
406 | XmlRpcResponse response = new XmlRpcResponse(); | ||
407 | response.Value = result; | ||
408 | return response; | ||
409 | } | ||
410 | |||
411 | public XmlRpcResponse AgentLeaving(XmlRpcRequest request) | ||
412 | { | ||
413 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
414 | Hashtable result = new Hashtable(); | ||
415 | |||
416 | UUID agentID; | ||
417 | UUID regionID; | ||
418 | ulong regionHandle; | ||
419 | if (UUID.TryParse((string)requestData["AgentID"], out agentID) && UUID.TryParse((string)requestData["RegionUUID"], out regionID) && ulong.TryParse((string)requestData["RegionHandle"], out regionHandle)) | ||
420 | { | ||
421 | if (OnAgentLeaving != null) | ||
422 | OnAgentLeaving(agentID, regionID, regionHandle); | ||
423 | |||
424 | result["responsestring"] = "TRUE"; | ||
425 | } | ||
426 | |||
427 | XmlRpcResponse response = new XmlRpcResponse(); | ||
428 | response.Value = result; | ||
429 | return response; | ||
430 | } | ||
340 | } | 431 | } |
341 | } | 432 | } |