aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer
diff options
context:
space:
mode:
authorMW2007-08-13 15:55:36 +0000
committerMW2007-08-13 15:55:36 +0000
commit04b1767886af28fa1793c46a1cbe4b3f49eefca6 (patch)
treef7c1fc2fc19a5dce8e4e78537ff6a87c75a7dda2 /OpenSim/Grid/UserServer
parentAdded the SetPartText access method to SceneObjectGroup to set the text of me... (diff)
downloadopensim-SC_OLD-04b1767886af28fa1793c46a1cbe4b3f49eefca6.zip
opensim-SC_OLD-04b1767886af28fa1793c46a1cbe4b3f49eefca6.tar.gz
opensim-SC_OLD-04b1767886af28fa1793c46a1cbe4b3f49eefca6.tar.bz2
opensim-SC_OLD-04b1767886af28fa1793c46a1cbe4b3f49eefca6.tar.xz
Separated Login Service from usermanager, which helps to clean up the code a bit and also should help to integrate the inventory server (when it is wrote/finished).
Diffstat (limited to 'OpenSim/Grid/UserServer')
-rw-r--r--OpenSim/Grid/UserServer/Main.cs5
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs57
2 files changed, 5 insertions, 57 deletions
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 04f45b0..82bbd57 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Grid.UserServer
47 private UserConfig Cfg; 47 private UserConfig Cfg;
48 48
49 public UserManager m_userManager; 49 public UserManager m_userManager;
50 public UserLoginService m_loginService;
50 51
51 public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>(); 52 public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>();
52 53
@@ -92,10 +93,12 @@ namespace OpenSim.Grid.UserServer
92 m_userManager._config = Cfg; 93 m_userManager._config = Cfg;
93 m_userManager.AddPlugin(Cfg.DatabaseProvider); 94 m_userManager.AddPlugin(Cfg.DatabaseProvider);
94 95
96 m_loginService = new UserLoginService(m_userManager, Cfg, Cfg.DefaultStartupMsg);
97
95 MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); 98 MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process");
96 BaseHttpServer httpServer = new BaseHttpServer(8002); 99 BaseHttpServer httpServer = new BaseHttpServer(8002);
97 100
98 httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); 101 httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
99 102
100 httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); 103 httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName);
101 httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); 104 httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID);
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index c459b93..4203ba6 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -41,61 +41,6 @@ namespace OpenSim.Grid.UserServer
41 { 41 {
42 } 42 }
43 43
44 /// <summary> 44
45 /// Customises the login response and fills in missing values.
46 /// </summary>
47 /// <param name="response">The existing response</param>
48 /// <param name="theUser">The user profile</param>
49 public override void CustomiseResponse( LoginResponse response, UserProfileData theUser)
50 {
51 // Load information from the gridserver
52 SimProfileData SimInfo = new SimProfileData();
53 SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
54
55 // Customise the response
56 // Home Location
57 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " +
58 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
59 "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
60
61 // Destination
62 Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY);
63 response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
64 response.SimPort = (Int32)SimInfo.serverPort;
65 response.RegionX = SimInfo.regionLocX;
66 response.RegionY = SimInfo.regionLocY;
67
68 //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI
69 string capsPath = Util.GetRandomCapsPath();
70 response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/";
71
72 // Notify the target of an incoming user
73 Console.WriteLine("Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI+ ")");
74
75 // Prepare notification
76 Hashtable SimParams = new Hashtable();
77 SimParams["session_id"] = theUser.currentAgent.sessionID.ToString();
78 SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString();
79 SimParams["firstname"] = theUser.username;
80 SimParams["lastname"] = theUser.surname;
81 SimParams["agent_id"] = theUser.UUID.ToString();
82 SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode);
83 SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString();
84 SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString();
85 SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString();
86 SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString();
87 SimParams["caps_path"] = capsPath;
88 ArrayList SendParams = new ArrayList();
89 SendParams.Add(SimParams);
90
91 // Update agent with target sim
92 theUser.currentAgent.currentRegion = SimInfo.UUID;
93 theUser.currentAgent.currentHandle = SimInfo.regionHandle;
94
95 System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI);
96 // Send
97 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
98 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 3000);
99 }
100 } 45 }
101} 46}