diff options
author | lbsa71 | 2008-03-28 21:43:46 +0000 |
---|---|---|
committer | lbsa71 | 2008-03-28 21:43:46 +0000 |
commit | 7f11079f57faacedc2dc8e3f2005b483e7314726 (patch) | |
tree | 3df97ace353d92cea53fbaaf4063fa9b53c93730 /OpenSim/Grid/UserServer/Main.cs | |
parent | * Introduced common abstract UserDataBase provider (diff) | |
download | opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.zip opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.gz opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.bz2 opensim-SC-7f11079f57faacedc2dc8e3f2005b483e7314726.tar.xz |
* Refactored out common http handler operations
Diffstat (limited to 'OpenSim/Grid/UserServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 69 |
1 files changed, 26 insertions, 43 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index c103e22..19f037f 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -100,35 +100,41 @@ namespace OpenSim.Grid.UserServer | |||
100 | m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; | 100 | m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; |
101 | 101 | ||
102 | m_log.Info("[REGION]: Starting HTTP process"); | 102 | m_log.Info("[REGION]: Starting HTTP process"); |
103 | BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); | 103 | |
104 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | ||
105 | AddHttpHandlers(); | ||
106 | m_httpServer.Start(); | ||
104 | 107 | ||
105 | httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | 108 | m_log.Info("[SERVER]: Userserver 0.5 - Startup complete"); |
109 | } | ||
106 | 110 | ||
107 | httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); | 111 | protected void AddHttpHandlers() |
112 | { | ||
113 | m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | ||
114 | |||
115 | m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); | ||
108 | 116 | ||
109 | httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); | 117 | m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); |
110 | 118 | ||
111 | httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); | 119 | m_httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); |
112 | httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); | 120 | m_httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); |
113 | httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar); | 121 | m_httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar); |
114 | httpServer.AddXmlRPCHandler("add_new_user_friend", m_userManager.XmlRpcResponseXmlRPCAddUserFriend); | 122 | m_httpServer.AddXmlRPCHandler("add_new_user_friend", m_userManager.XmlRpcResponseXmlRPCAddUserFriend); |
115 | httpServer.AddXmlRPCHandler("remove_user_friend", m_userManager.XmlRpcResponseXmlRPCRemoveUserFriend); | 123 | m_httpServer.AddXmlRPCHandler("remove_user_friend", m_userManager.XmlRpcResponseXmlRPCRemoveUserFriend); |
116 | httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); | 124 | m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); |
117 | httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); | 125 | m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); |
118 | httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); | 126 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); |
119 | 127 | ||
120 | // Message Server ---> User Server | 128 | // Message Server ---> User Server |
121 | httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer); | 129 | m_httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer); |
122 | httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion); | 130 | m_httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion); |
123 | httpServer.AddXmlRPCHandler("deregister_messageserver", m_messagesService.XmlRPCDeRegisterMessageServer); | 131 | m_httpServer.AddXmlRPCHandler("deregister_messageserver", m_messagesService.XmlRPCDeRegisterMessageServer); |
124 | 132 | ||
125 | 133 | ||
126 | httpServer.AddStreamHandler( | 134 | m_httpServer.AddStreamHandler( |
127 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); | 135 | new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); |
128 | 136 | ||
129 | httpServer.AddXmlRPCHandler("update_user_profile", m_userManager.XmlRpcResponseXmlRPCUpdateUserProfile); | 137 | m_httpServer.AddXmlRPCHandler("update_user_profile", m_userManager.XmlRpcResponseXmlRPCUpdateUserProfile); |
130 | httpServer.Start(); | ||
131 | m_log.Info("[SERVER]: Userserver 0.5 - Startup complete"); | ||
132 | } | 138 | } |
133 | 139 | ||
134 | public void do_create(string what) | 140 | public void do_create(string what) |
@@ -239,28 +245,5 @@ namespace OpenSim.Grid.UserServer | |||
239 | m_messagesService.TellMessageServersAboutUser( agentID, sessionID, RegionID, regionhandle, positionX, | 245 | m_messagesService.TellMessageServersAboutUser( agentID, sessionID, RegionID, regionhandle, positionX, |
240 | positionY, positionZ, firstname, lastname); | 246 | positionY, positionZ, firstname, lastname); |
241 | } | 247 | } |
242 | |||
243 | /*private void ConfigDB(IGenericConfig configData) | ||
244 | { | ||
245 | try | ||
246 | { | ||
247 | string attri = String.Empty; | ||
248 | attri = configData.GetAttribute("DataBaseProvider"); | ||
249 | if (attri == String.Empty) | ||
250 | { | ||
251 | StorageDll = "OpenSim.Framework.Data.DB4o.dll"; | ||
252 | configData.SetAttribute("DataBaseProvider", "OpenSim.Framework.Data.DB4o.dll"); | ||
253 | } | ||
254 | else | ||
255 | { | ||
256 | StorageDll = attri; | ||
257 | } | ||
258 | configData.Commit(); | ||
259 | } | ||
260 | catch | ||
261 | { | ||
262 | |||
263 | } | ||
264 | }*/ | ||
265 | } | 248 | } |
266 | } | 249 | } |