aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs282
1 files changed, 141 insertions, 141 deletions
diff --git a/OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs b/OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs
index 2d3f414..9ff9cfc 100644
--- a/OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs
+++ b/OpenSim/Grid/UserServer/UserServerEventDispatchModule.cs
@@ -1,141 +1,141 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the 12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products 13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY 16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using log4net; 32using log4net;
33using log4net.Config; 33using log4net.Config;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Data; 35using OpenSim.Data;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
38using OpenSim.Framework.Communications.Cache; 38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
40using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
41using OpenSim.Framework.Statistics; 41using OpenSim.Framework.Statistics;
42using OpenSim.Grid.Communications.OGS1; 42using OpenSim.Grid.Communications.OGS1;
43using OpenSim.Grid.Framework; 43using OpenSim.Grid.Framework;
44using OpenSim.Grid.UserServer.Modules; 44using OpenSim.Grid.UserServer.Modules;
45 45
46namespace OpenSim.Grid.UserServer 46namespace OpenSim.Grid.UserServer
47{ 47{
48 //Do we actually need these event dispatchers? 48 //Do we actually need these event dispatchers?
49 //shouldn't the other modules just directly register event handlers to each other? 49 //shouldn't the other modules just directly register event handlers to each other?
50 public class UserServerEventDispatchModule 50 public class UserServerEventDispatchModule
51 { 51 {
52 protected UserManager m_userManager; 52 protected UserManager m_userManager;
53 protected MessageServersConnector m_messagesService; 53 protected MessageServersConnector m_messagesService;
54 protected UserLoginService m_loginService; 54 protected UserLoginService m_loginService;
55 55
56 public UserServerEventDispatchModule(UserManager userManager, MessageServersConnector messagesService, UserLoginService loginService) 56 public UserServerEventDispatchModule(UserManager userManager, MessageServersConnector messagesService, UserLoginService loginService)
57 { 57 {
58 m_userManager = userManager; 58 m_userManager = userManager;
59 m_messagesService = messagesService; 59 m_messagesService = messagesService;
60 m_loginService = loginService; 60 m_loginService = loginService;
61 } 61 }
62 62
63 public void Initialise(IGridServiceCore core) 63 public void Initialise(IGridServiceCore core)
64 { 64 {
65 } 65 }
66 66
67 public void PostInitialise() 67 public void PostInitialise()
68 { 68 {
69 m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation; 69 m_loginService.OnUserLoggedInAtLocation += NotifyMessageServersUserLoggedInToLocation;
70 m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; 70 m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff;
71 71
72 m_messagesService.OnAgentLocation += HandleAgentLocation; 72 m_messagesService.OnAgentLocation += HandleAgentLocation;
73 m_messagesService.OnAgentLeaving += HandleAgentLeaving; 73 m_messagesService.OnAgentLeaving += HandleAgentLeaving;
74 m_messagesService.OnRegionStartup += HandleRegionStartup; 74 m_messagesService.OnRegionStartup += HandleRegionStartup;
75 m_messagesService.OnRegionShutdown += HandleRegionShutdown; 75 m_messagesService.OnRegionShutdown += HandleRegionShutdown;
76 } 76 }
77 77
78 public void RegisterHandlers(BaseHttpServer httpServer) 78 public void RegisterHandlers(BaseHttpServer httpServer)
79 { 79 {
80 80
81 } 81 }
82 82
83 public void Close() 83 public void Close()
84 { 84 {
85 m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; 85 m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
86 } 86 }
87 87
88 #region Event Handlers 88 #region Event Handlers
89 public void NotifyMessageServersUserLoggOff(UUID agentID) 89 public void NotifyMessageServersUserLoggOff(UUID agentID)
90 { 90 {
91 m_messagesService.TellMessageServersAboutUserLogoff(agentID); 91 m_messagesService.TellMessageServersAboutUserLogoff(agentID);
92 } 92 }
93 93
94 public void NotifyMessageServersUserLoggedInToLocation(UUID agentID, UUID sessionID, UUID RegionID, 94 public void NotifyMessageServersUserLoggedInToLocation(UUID agentID, UUID sessionID, UUID RegionID,
95 ulong regionhandle, float positionX, float positionY, 95 ulong regionhandle, float positionX, float positionY,
96 float positionZ, string firstname, string lastname) 96 float positionZ, string firstname, string lastname)
97 { 97 {
98 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, positionX, 98 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, positionX,
99 positionY, positionZ, firstname, lastname); 99 positionY, positionZ, firstname, lastname);
100 } 100 }
101 101
102 public void HandleAgentLocation(UUID agentID, UUID regionID, ulong regionHandle) 102 public void HandleAgentLocation(UUID agentID, UUID regionID, ulong regionHandle)
103 { 103 {
104 m_userManager.HandleAgentLocation(agentID, regionID, regionHandle); 104 m_userManager.HandleAgentLocation(agentID, regionID, regionHandle);
105 } 105 }
106 106
107 public void HandleAgentLeaving(UUID agentID, UUID regionID, ulong regionHandle) 107 public void HandleAgentLeaving(UUID agentID, UUID regionID, ulong regionHandle)
108 { 108 {
109 m_userManager.HandleAgentLeaving(agentID, regionID, regionHandle); 109 m_userManager.HandleAgentLeaving(agentID, regionID, regionHandle);
110 } 110 }
111 111
112 public void HandleRegionStartup(UUID regionID) 112 public void HandleRegionStartup(UUID regionID)
113 { 113 {
114 // This might seem strange, that we send this back to the 114 // This might seem strange, that we send this back to the
115 // server it came from. But there is method to the madness. 115 // server it came from. But there is method to the madness.
116 // There can be multiple user servers on the same database, 116 // There can be multiple user servers on the same database,
117 // and each can have multiple messaging servers. So, we send 117 // and each can have multiple messaging servers. So, we send
118 // it to all known user servers, who send it to all known 118 // it to all known user servers, who send it to all known
119 // message servers. That way, we should be able to finally 119 // message servers. That way, we should be able to finally
120 // update presence to all regions and thereby all friends 120 // update presence to all regions and thereby all friends
121 // 121 //
122 m_userManager.HandleRegionStartup(regionID); 122 m_userManager.HandleRegionStartup(regionID);
123 m_messagesService.TellMessageServersAboutRegionShutdown(regionID); 123 m_messagesService.TellMessageServersAboutRegionShutdown(regionID);
124 } 124 }
125 125
126 public void HandleRegionShutdown(UUID regionID) 126 public void HandleRegionShutdown(UUID regionID)
127 { 127 {
128 // This might seem strange, that we send this back to the 128 // This might seem strange, that we send this back to the
129 // server it came from. But there is method to the madness. 129 // server it came from. But there is method to the madness.
130 // There can be multiple user servers on the same database, 130 // There can be multiple user servers on the same database,
131 // and each can have multiple messaging servers. So, we send 131 // and each can have multiple messaging servers. So, we send
132 // it to all known user servers, who send it to all known 132 // it to all known user servers, who send it to all known
133 // message servers. That way, we should be able to finally 133 // message servers. That way, we should be able to finally
134 // update presence to all regions and thereby all friends 134 // update presence to all regions and thereby all friends
135 // 135 //
136 m_userManager.HandleRegionShutdown(regionID); 136 m_userManager.HandleRegionShutdown(regionID);
137 m_messagesService.TellMessageServersAboutRegionShutdown(regionID); 137 m_messagesService.TellMessageServersAboutRegionShutdown(regionID);
138 } 138 }
139 #endregion 139 #endregion
140 } 140 }
141} 141}