aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authorTeravus Ovares2008-02-25 06:33:14 +0000
committerTeravus Ovares2008-02-25 06:33:14 +0000
commitb831a91852b34473f993f9a3e88ddd4e0c8455ca (patch)
tree3c61bfa3800274fed804812b6145f2d5388626bb /OpenSim/Grid
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-b831a91852b34473f993f9a3e88ddd4e0c8455ca.zip
opensim-SC_OLD-b831a91852b34473f993f9a3e88ddd4e0c8455ca.tar.gz
opensim-SC_OLD-b831a91852b34473f993f9a3e88ddd4e0c8455ca.tar.bz2
opensim-SC_OLD-b831a91852b34473f993f9a3e88ddd4e0c8455ca.tar.xz
* Message Server Linkages (still not ready for use so don't start it yet)
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r--OpenSim/Grid/MessagingServer/Main.cs37
-rw-r--r--OpenSim/Grid/MessagingServer/MessageService.cs104
-rw-r--r--OpenSim/Grid/UserServer/Main.cs1
-rw-r--r--OpenSim/Grid/UserServer/MessageServersConnector.cs10
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs9
5 files changed, 146 insertions, 15 deletions
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs
index 6ac70f0..5a383ef 100644
--- a/OpenSim/Grid/MessagingServer/Main.cs
+++ b/OpenSim/Grid/MessagingServer/Main.cs
@@ -44,6 +44,7 @@ namespace OpenSim.Grid.MessagingServer
44 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 private MessageServerConfig Cfg; 46 private MessageServerConfig Cfg;
47 private MessageService msgsvc;
47 48
48 //public UserManager m_userManager; 49 //public UserManager m_userManager;
49 //public UserLoginService m_loginService; 50 //public UserLoginService m_loginService;
@@ -57,6 +58,8 @@ namespace OpenSim.Grid.MessagingServer
57 58
58 m_log.Info("Launching MessagingServer..."); 59 m_log.Info("Launching MessagingServer...");
59 60
61
62
60 OpenMessage_Main messageserver = new OpenMessage_Main(); 63 OpenMessage_Main messageserver = new OpenMessage_Main();
61 64
62 messageserver.Startup(); 65 messageserver.Startup();
@@ -85,23 +88,32 @@ namespace OpenSim.Grid.MessagingServer
85 88
86 m_log.Info("[REGION]: Starting HTTP process"); 89 m_log.Info("[REGION]: Starting HTTP process");
87 BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); 90 BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort);
91
92 msgsvc = new MessageService(Cfg);
88 93
89 //httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 94 if (msgsvc.registerWithUserServer())
95 {
96 httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn);
90 97
91 //httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); 98 //httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName);
92 //httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); 99 //httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID);
93 //httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar); 100 //httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar);
94 //httpServer.AddXmlRPCHandler("add_new_user_friend", m_userManager.XmlRpcResponseXmlRPCAddUserFriend); 101 //httpServer.AddXmlRPCHandler("add_new_user_friend", m_userManager.XmlRpcResponseXmlRPCAddUserFriend);
95 //httpServer.AddXmlRPCHandler("remove_user_friend", m_userManager.XmlRpcResponseXmlRPCRemoveUserFriend); 102 //httpServer.AddXmlRPCHandler("remove_user_friend", m_userManager.XmlRpcResponseXmlRPCRemoveUserFriend);
96 //httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); 103 //httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms);
97 //httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); 104 //httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList);
98
99 105
100 //httpServer.AddStreamHandler( 106
107 //httpServer.AddStreamHandler(
101 //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod)); 108 //new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod));
102 109
103 httpServer.Start(); 110 httpServer.Start();
104 m_log.Info("[SERVER]: Messageserver 0.5 - Startup complete"); 111 m_log.Info("[SERVER]: Messageserver 0.5 - Startup complete");
112 }
113 else
114 {
115 m_log.Error("[STARTUP]: Unable to connect to User Server");
116 }
105 } 117 }
106 118
107 public void do_create(string what) 119 public void do_create(string what)
@@ -144,6 +156,7 @@ namespace OpenSim.Grid.MessagingServer
144 break; 156 break;
145 157
146 case "shutdown": 158 case "shutdown":
159 msgsvc.deregisterWithUserServer();
147 m_console.Close(); 160 m_console.Close();
148 Environment.Exit(0); 161 Environment.Exit(0);
149 break; 162 break;
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs
index 059a6b0..42277e2 100644
--- a/OpenSim/Grid/MessagingServer/MessageService.cs
+++ b/OpenSim/Grid/MessagingServer/MessageService.cs
@@ -333,7 +333,7 @@ namespace OpenSim.Grid.MessagingServer
333 /// <returns></returns> 333 /// <returns></returns>
334 public XmlRpcResponse UserLoggedOn(XmlRpcRequest request) 334 public XmlRpcResponse UserLoggedOn(XmlRpcRequest request)
335 { 335 {
336 336 m_log.Info("[LOGON]: User logged on, building indexes for user");
337 Hashtable requestData = (Hashtable)request.Params[0]; 337 Hashtable requestData = (Hashtable)request.Params[0];
338 AgentCircuitData agentData = new AgentCircuitData(); 338 AgentCircuitData agentData = new AgentCircuitData();
339 agentData.SessionID = new LLUUID((string)requestData["session_id"]); 339 agentData.SessionID = new LLUUID((string)requestData["session_id"]);
@@ -472,6 +472,108 @@ namespace OpenSim.Grid.MessagingServer
472 472
473 return regionProfile; 473 return regionProfile;
474 } 474 }
475 public bool registerWithUserServer ()
476 {
477
478 Hashtable UserParams = new Hashtable();
479 // Login / Authentication
480
481 if (m_cfg.HttpSSL)
482 {
483 UserParams["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
484 }
485 else
486 {
487 UserParams["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
488 }
489
490 UserParams["recvkey"] = m_cfg.UserRecvKey;
491 UserParams["sendkey"] = m_cfg.UserRecvKey;
492
493
494
495
496 // Package into an XMLRPC Request
497 ArrayList SendParams = new ArrayList();
498 SendParams.Add(UserParams);
499
500 // Send Request
501 XmlRpcRequest UserReq;
502 XmlRpcResponse UserResp;
503 try
504 {
505 UserReq = new XmlRpcRequest("register_messageserver", SendParams);
506 UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
507 } catch (Exception ex)
508 {
509 m_log.Error("Unable to connect to grid. Grid server not running?");
510 throw(ex);
511 }
512 Hashtable GridRespData = (Hashtable)UserResp.Value;
513 Hashtable griddatahash = GridRespData;
514
515 // Process Response
516 if (GridRespData.ContainsKey("responsestring"))
517 {
518 return true;
519 }
520 else
521 {
522 return false;
523 }
524
525
526 }
527 public bool deregisterWithUserServer()
528 {
529
530 Hashtable UserParams = new Hashtable();
531 // Login / Authentication
532
533 if (m_cfg.HttpSSL)
534 {
535 UserParams["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
536 }
537 else
538 {
539 UserParams["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort;
540 }
541
542 UserParams["recvkey"] = m_cfg.UserRecvKey;
543 UserParams["sendkey"] = m_cfg.UserRecvKey;
544
545 // Package into an XMLRPC Request
546 ArrayList SendParams = new ArrayList();
547 SendParams.Add(UserParams);
548
549 // Send Request
550 XmlRpcRequest UserReq;
551 XmlRpcResponse UserResp;
552 try
553 {
554 UserReq = new XmlRpcRequest("deregister_messageserver", SendParams);
555 UserResp = UserReq.Send(m_cfg.UserServerURL, 16000);
556 }
557 catch (Exception ex)
558 {
559 m_log.Error("Unable to connect to grid. Grid server not running?");
560 throw (ex);
561 }
562 Hashtable UserRespData = (Hashtable)UserResp.Value;
563 Hashtable userdatahash = UserRespData;
564
565 // Process Response
566 if (UserRespData.ContainsKey("responsestring"))
567 {
568 return true;
569 }
570 else
571 {
572 return false;
573 }
574
575
576 }
475 #endregion 577 #endregion
476 } 578 }
477 579
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 3500665..3a3b8b6 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -227,6 +227,7 @@ namespace OpenSim.Grid.UserServer
227 227
228 public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position) 228 public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position)
229 { 229 {
230
230 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position); 231 m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, Position);
231 } 232 }
232 233
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs
index 251644b..6535247 100644
--- a/OpenSim/Grid/UserServer/MessageServersConnector.cs
+++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs
@@ -119,7 +119,7 @@ namespace OpenSim.Grid.UserServer
119 119
120 if (requestData.Contains("uri")) 120 if (requestData.Contains("uri"))
121 { 121 {
122 string URI = (string)requestData["URI"]; 122 string URI = (string)requestData["uri"];
123 123
124 DeRegisterMessageServer(URI); 124 DeRegisterMessageServer(URI);
125 responseData["responsestring"] = "TRUE"; 125 responseData["responsestring"] = "TRUE";
@@ -153,6 +153,14 @@ namespace OpenSim.Grid.UserServer
153 public void TellMessageServersAboutUser(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position) 153 public void TellMessageServersAboutUser(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position)
154 { 154 {
155 // Loop over registered Message Servers ( AND THERE WILL BE MORE THEN ONE :D ) 155 // Loop over registered Message Servers ( AND THERE WILL BE MORE THEN ONE :D )
156 if (MessageServers.Count > 0)
157 {
158 m_log.Info("[MSGCONNECTOR]: Sending login notice to registered message servers");
159 }
160 else
161 {
162 m_log.Info("[MSGCONNECTOR]: No Message Servers registered, ignoring");
163 }
156 foreach (MessageServerInfo serv in MessageServers.Values) 164 foreach (MessageServerInfo serv in MessageServers.Values)
157 { 165 {
158 NotifyMessageServerAboutUser(serv, agentID, sessionID, RegionID, regionhandle, Position); 166 NotifyMessageServerAboutUser(serv, agentID, sessionID, RegionID, regionhandle, Position);
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 80899e8..a82b978 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -144,7 +144,13 @@ namespace OpenSim.Grid.UserServer
144 m_log.ErrorFormat( 144 m_log.ErrorFormat(
145 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}", 145 "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}",
146 SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString); 146 SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString);
147 } 147 }
148 handler001 = OnUserLoggedInAtLocation;
149 if (handler001 != null)
150 {
151 m_log.Info("[LOGIN]: Letting other objects know about login");
152 handler001(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos);
153 }
148 } 154 }
149 catch (Exception) 155 catch (Exception)
150 { 156 {
@@ -219,6 +225,7 @@ namespace OpenSim.Grid.UserServer
219 handler001 = OnUserLoggedInAtLocation; 225 handler001 = OnUserLoggedInAtLocation;
220 if (handler001 != null) 226 if (handler001 != null)
221 { 227 {
228 m_log.Info("[LOGIN]: Letting other objects know about login");
222 handler001(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos); 229 handler001(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos);
223 } 230 }
224 } 231 }