diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Grid/UserServer/UserLoginService.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 1523f81..bbef4b2 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -30,12 +30,10 @@ using System; | |||
30 | using System.Collections; | 30 | using System.Collections; |
31 | using System.Net; | 31 | using System.Net; |
32 | using Nwc.XmlRpc; | 32 | using Nwc.XmlRpc; |
33 | using OpenSim.Framework.Data; | ||
34 | using OpenSim.Framework.UserManagement; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using OpenSim.Framework.Data; | ||
36 | using OpenSim.Framework.UserManagement; | ||
39 | 37 | ||
40 | namespace OpenSim.Grid.UserServer | 38 | namespace OpenSim.Grid.UserServer |
41 | { | 39 | { |
@@ -58,18 +56,24 @@ namespace OpenSim.Grid.UserServer | |||
58 | { | 56 | { |
59 | // Load information from the gridserver | 57 | // Load information from the gridserver |
60 | RegionProfileData SimInfo = new RegionProfileData(); | 58 | RegionProfileData SimInfo = new RegionProfileData(); |
61 | SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); | 59 | SimInfo = |
60 | SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, | ||
61 | m_config.GridSendKey, m_config.GridRecvKey); | ||
62 | 62 | ||
63 | // Customise the response | 63 | // Customise the response |
64 | // Home Location | 64 | // Home Location |
65 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + | 65 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + |
66 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | 66 | (SimInfo.regionLocY*256).ToString() + "], " + |
67 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; | 67 | "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + |
68 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " + | ||
69 | "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + | ||
70 | theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; | ||
68 | 71 | ||
69 | // Destination | 72 | // Destination |
70 | MainLog.Instance.Verbose("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); | 73 | MainLog.Instance.Verbose("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + |
74 | SimInfo.regionLocY); | ||
71 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); | 75 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); |
72 | response.SimPort = (Int32)SimInfo.serverPort; | 76 | response.SimPort = (Int32) SimInfo.serverPort; |
73 | response.RegionX = SimInfo.regionLocX; | 77 | response.RegionX = SimInfo.regionLocX; |
74 | response.RegionY = SimInfo.regionLocY; | 78 | response.RegionY = SimInfo.regionLocY; |
75 | 79 | ||
@@ -87,7 +91,7 @@ namespace OpenSim.Grid.UserServer | |||
87 | SimParams["firstname"] = theUser.username; | 91 | SimParams["firstname"] = theUser.username; |
88 | SimParams["lastname"] = theUser.surname; | 92 | SimParams["lastname"] = theUser.surname; |
89 | SimParams["agent_id"] = theUser.UUID.ToString(); | 93 | SimParams["agent_id"] = theUser.UUID.ToString(); |
90 | SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode); | 94 | SimParams["circuit_code"] = (Int32) Convert.ToUInt32(response.CircuitCode); |
91 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); | 95 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); |
92 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); | 96 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); |
93 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); | 97 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); |
@@ -107,21 +111,20 @@ namespace OpenSim.Grid.UserServer | |||
107 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | 111 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); |
108 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); | 112 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); |
109 | } | 113 | } |
110 | catch( WebException e ) | 114 | catch (WebException e) |
111 | { | 115 | { |
112 | switch( e.Status ) | 116 | switch (e.Status) |
113 | { | 117 | { |
114 | case WebExceptionStatus.Timeout: | 118 | case WebExceptionStatus.Timeout: |
115 | //TODO: Send him to nearby or default region instead | 119 | //TODO: Send him to nearby or default region instead |
116 | MainLog.Instance.Verbose("Unable to connect to " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); | 120 | MainLog.Instance.Verbose("Unable to connect to " + SimInfo.regionName + " (" + SimInfo.serverURI + |
121 | ")"); | ||
117 | break; | 122 | break; |
118 | 123 | ||
119 | default: | 124 | default: |
120 | throw; | 125 | throw; |
121 | } | 126 | } |
122 | } | 127 | } |
123 | } | 128 | } |
124 | } | 129 | } |
125 | } | 130 | } \ No newline at end of file |
126 | |||
127 | |||