aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/UserServer/Main.cs')
-rw-r--r--OpenSim/Grid/UserServer/Main.cs46
1 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 00b7f76..79524b4 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -48,10 +48,10 @@ namespace OpenSim.Grid.UserServer
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 private UserConfig Cfg; 50 private UserConfig Cfg;
51 51
52 public UserManager m_userManager; 52 public UserManager m_userManager;
53 public UserLoginService m_loginService; 53 public UserLoginService m_loginService;
54 public MessageServersConnector m_messagesService; 54 public MessageServersConnector m_messagesService;
55 55
56 private LLUUID m_lastCreatedUser = LLUUID.Random(); 56 private LLUUID m_lastCreatedUser = LLUUID.Random();
57 57
@@ -87,13 +87,13 @@ namespace OpenSim.Grid.UserServer
87 public void Startup() 87 public void Startup()
88 { 88 {
89 Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); 89 Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml")));
90 90
91 m_stats = StatsManager.StartCollectingUserStats(); 91 m_stats = StatsManager.StartCollectingUserStats();
92 92
93 m_log.Info("[REGION]: Establishing data connection"); 93 m_log.Info("[REGION]: Establishing data connection");
94 m_userManager = new UserManager(); 94 m_userManager = new UserManager();
95 m_userManager._config = Cfg; 95 m_userManager._config = Cfg;
96 m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); 96 m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect);
97 97
98 m_loginService = new UserLoginService( 98 m_loginService = new UserLoginService(
99 m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); 99 m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg);
@@ -104,7 +104,7 @@ namespace OpenSim.Grid.UserServer
104 m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; 104 m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff;
105 105
106 m_log.Info("[REGION]: Starting HTTP process"); 106 m_log.Info("[REGION]: Starting HTTP process");
107 107
108 m_httpServer = new BaseHttpServer(Cfg.HttpPort); 108 m_httpServer = new BaseHttpServer(Cfg.HttpPort);
109 AddHttpHandlers(); 109 AddHttpHandlers();
110 m_httpServer.Start(); 110 m_httpServer.Start();
@@ -117,7 +117,7 @@ namespace OpenSim.Grid.UserServer
117 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 117 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
118 118
119 m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); 119 m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin);
120 120
121 m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); 121 m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod);
122 122
123 m_httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); 123 m_httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName);
@@ -128,7 +128,7 @@ namespace OpenSim.Grid.UserServer
128 m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); 128 m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms);
129 m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); 129 m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList);
130 m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); 130 m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID);
131 131
132 // Message Server ---> User Server 132 // Message Server ---> User Server
133 m_httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer); 133 m_httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer);
134 m_httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion); 134 m_httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion);
@@ -163,17 +163,17 @@ namespace OpenSim.Grid.UserServer
163 { 163 {
164 m_log.ErrorFormat( 164 m_log.ErrorFormat(
165 "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); 165 "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname);
166 166
167 break; 167 break;
168 } 168 }
169 169
170 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); 170 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty);
171 171
172 LLUUID userID = new LLUUID(); 172 LLUUID userID = new LLUUID();
173 try 173 try
174 { 174 {
175 userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); 175 userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
176 } 176 }
177 catch (Exception ex) 177 catch (Exception ex)
178 { 178 {
179 m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); 179 m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString());
@@ -181,31 +181,31 @@ namespace OpenSim.Grid.UserServer
181 181
182 try 182 try
183 { 183 {
184 bool created 184 bool created
185 = SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( 185 = SynchronousRestObjectPoster.BeginPostObject<Guid, bool>(
186 "POST", m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); 186 "POST", m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID);
187 187
188 if (!created) 188 if (!created)
189 { 189 {
190 throw new Exception( 190 throw new Exception(
191 String.Format( 191 String.Format(
192 "The inventory creation request for user {0} did not succeed." 192 "The inventory creation request for user {0} did not succeed."
193 + " Please contact your inventory service provider for more information.", 193 + " Please contact your inventory service provider for more information.",
194 userID)); 194 userID));
195 } 195 }
196 196
197 } 197 }
198 catch (WebException) 198 catch (WebException)
199 { 199 {
200 m_log.ErrorFormat( 200 m_log.ErrorFormat(
201 "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", 201 "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}",
202 m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); 202 m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID);
203 } 203 }
204 catch (Exception e) 204 catch (Exception e)
205 { 205 {
206 m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); 206 m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e);
207 } 207 }
208 208
209 m_lastCreatedUser = userID; 209 m_lastCreatedUser = userID;
210 break; 210 break;
211 } 211 }
@@ -214,7 +214,7 @@ namespace OpenSim.Grid.UserServer
214 public override void RunCmd(string cmd, string[] cmdparams) 214 public override void RunCmd(string cmd, string[] cmdparams)
215 { 215 {
216 base.RunCmd(cmd, cmdparams); 216 base.RunCmd(cmd, cmdparams);
217 217
218 switch (cmd) 218 switch (cmd)
219 { 219 {
220 case "help": 220 case "help":
@@ -223,7 +223,7 @@ namespace OpenSim.Grid.UserServer
223 223
224 case "create": 224 case "create":
225 do_create(cmdparams[0]); 225 do_create(cmdparams[0]);
226 break; 226 break;
227 227
228 case "test-inventory": 228 case "test-inventory":
229 // RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>(); 229 // RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>();
@@ -242,10 +242,10 @@ namespace OpenSim.Grid.UserServer
242 public override void Shutdown() 242 public override void Shutdown()
243 { 243 {
244 m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; 244 m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation;
245 245
246 base.Shutdown(); 246 base.Shutdown();
247 } 247 }
248 248
249 public void TestResponse(List<InventoryFolderBase> resp) 249 public void TestResponse(List<InventoryFolderBase> resp)
250 { 250 {
251 m_console.Notice("response got"); 251 m_console.Notice("response got");
@@ -257,10 +257,10 @@ namespace OpenSim.Grid.UserServer
257 } 257 }
258 258
259 public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, 259 public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID,
260 ulong regionhandle, float positionX, float positionY, 260 ulong regionhandle, float positionX, float positionY,
261 float positionZ, string firstname, string lastname) 261 float positionZ, string firstname, string lastname)
262 { 262 {
263 263
264 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, positionX, 264 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, positionX,
265 positionY, positionZ, firstname, lastname); 265 positionY, positionZ, firstname, lastname);
266 } 266 }