aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-03-23 21:21:39 +0000
committerJustin Clarke Casey2008-03-23 21:21:39 +0000
commitda531fa9e124394228a7c7597bd50e548af81efb (patch)
treef522f4f115b8bf5db07b45ddcc1c60261dcde680 /OpenSim/Framework
parentImplements llGetParcelPrimOwners() (diff)
downloadopensim-SC-da531fa9e124394228a7c7597bd50e548af81efb.zip
opensim-SC-da531fa9e124394228a7c7597bd50e548af81efb.tar.gz
opensim-SC-da531fa9e124394228a7c7597bd50e548af81efb.tar.bz2
opensim-SC-da531fa9e124394228a7c7597bd50e548af81efb.tar.xz
* Start passing around a region server's http port in RegionInfo.
* This means that caps methods (editing scripts, poss map functions, etc) on non-home regions should now work with servers which are listening for http ports on a non default (9000) port. * If you are running a region server, this may only work properly once your grid server upgrades to this revision * PLEASE NOTE: This shouldn't cause inter-region problems if one end of the connection hasn't upgraded to this revision. However if it does, the instability will persist until the grid and region (and possibly all the region's neighbours) have upgraded to this revision. * This revision also adds extra login related messages, both for success and failure conditions
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs57
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs2
-rw-r--r--OpenSim/Framework/RegionInfo.cs17
-rw-r--r--OpenSim/Framework/SerializableRegionInfo.cs17
4 files changed, 69 insertions, 24 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index be47258..3e3216f 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Framework.UserManagement
73 } 73 }
74 74
75 /// <summary> 75 /// <summary>
76 /// Main user login function 76 /// Called when we receive the client's initial
77 /// </summary> 77 /// </summary>
78 /// <param name="request">The XMLRPC request</param> 78 /// <param name="request">The XMLRPC request</param>
79 /// <returns>The response to send</returns> 79 /// <returns>The response to send</returns>
@@ -94,25 +94,32 @@ namespace OpenSim.Framework.UserManagement
94 94
95 string startLocationRequest = "last"; 95 string startLocationRequest = "last";
96 96
97 if (requestData.Contains("start"))
98 {
99 startLocationRequest = (string)requestData["start"];
100 m_log.Info("[LOGIN]: Client Requested Start: " + (string)requestData["start"]);
101 }
102
103 UserProfileData userProfile; 97 UserProfileData userProfile;
104 LoginResponse logResponse = new LoginResponse(); 98 LoginResponse logResponse = new LoginResponse();
99
100 string firstname = String.Empty;
101 string lastname = String.Empty;
105 102
106 if (GoodXML) 103 if (GoodXML)
107 { 104 {
108 string firstname = (string) requestData["first"]; 105 firstname = (string) requestData["first"];
109 string lastname = (string) requestData["last"]; 106 lastname = (string) requestData["last"];
107
108 m_log.InfoFormat(
109 "[LOGIN]: Received login request message from user {0} {1}",
110 firstname, lastname);
110 111
111 if( requestData.Contains("version")) 112 if( requestData.Contains("version"))
112 { 113 {
113 string clientversion = (string)requestData["version"]; 114 string clientversion = (string)requestData["version"];
114 m_log.Info("[LOGIN]: Client Version " + clientversion + " for " + firstname + " " + lastname); 115 m_log.Info("[LOGIN]: Client version: " + clientversion);
115 } 116 }
117
118 if (requestData.Contains("start"))
119 {
120 startLocationRequest = (string)requestData["start"];
121 m_log.Info("[LOGIN]: Client requested start location: " + (string)requestData["start"]);
122 }
116 123
117 userProfile = GetTheUser(firstname, lastname); 124 userProfile = GetTheUser(firstname, lastname);
118 if (userProfile == null) 125 if (userProfile == null)
@@ -134,31 +141,35 @@ namespace OpenSim.Framework.UserManagement
134 { 141 {
135 webloginkey = new LLUUID((string)requestData["web_login_key"]); 142 webloginkey = new LLUUID((string)requestData["web_login_key"]);
136 } 143 }
137 catch (System.Exception) 144 catch (System.Exception e)
138 { 145 {
146 m_log.InfoFormat(
147 "[LOGIN]: Bad web_login_key: {0} for user {1} {2}, exception {3}",
148 requestData["web_login_key"], firstname, lastname, e);
149
139 return logResponse.CreateFailedResponse(); 150 return logResponse.CreateFailedResponse();
140 } 151 }
141 GoodLogin = AuthenticateUser(userProfile, webloginkey); 152 GoodLogin = AuthenticateUser(userProfile, webloginkey);
142 153
143 } 154 }
144 else
145 {
146 return logResponse.CreateFailedResponse();
147 }
148 } 155 }
149 else 156 else
150 { 157 {
158 m_log.Info(
159 "[LOGIN]: login_to_simulator login message did not contain all the required data");
160
151 return logResponse.CreateGridErrorResponse(); 161 return logResponse.CreateGridErrorResponse();
152 } 162 }
153 163
154 if (!GoodLogin) 164 if (!GoodLogin)
155 { 165 {
166 m_log.InfoFormat("[LOGIN]: User {0} {1} failed authentication", firstname, lastname);
167
156 return logResponse.CreateLoginFailedResponse(); 168 return logResponse.CreateLoginFailedResponse();
157 } 169 }
158 else 170 else
159 { 171 {
160 // If we already have a session... 172 // If we already have a session...
161
162 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) 173 if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline)
163 { 174 {
164 //TODO: The following statements can cause trouble: 175 //TODO: The following statements can cause trouble:
@@ -169,6 +180,11 @@ namespace OpenSim.Framework.UserManagement
169 m_userManager.CommitAgent(ref userProfile); 180 m_userManager.CommitAgent(ref userProfile);
170 181
171 // Reject the login 182 // Reject the login
183
184 m_log.InfoFormat(
185 "[LOGIN]: Notifying user {0} {1} that they are already logged in",
186 firstname, lastname);
187
172 return logResponse.CreateAlreadyLoggedInResponse(); 188 return logResponse.CreateAlreadyLoggedInResponse();
173 } 189 }
174 // Otherwise... 190 // Otherwise...
@@ -234,14 +250,19 @@ namespace OpenSim.Framework.UserManagement
234 if (StatsManager.UserStats != null) 250 if (StatsManager.UserStats != null)
235 StatsManager.UserStats.AddSuccessfulLogin(); 251 StatsManager.UserStats.AddSuccessfulLogin();
236 252
253 m_log.InfoFormat(
254 "[LOGIN]: Authentication of user {0} {1} successful. Sending response to client.",
255 firstname, lastname);
256
237 return logResponse.ToXmlRpcResponse(); 257 return logResponse.ToXmlRpcResponse();
238 } 258 }
239 catch (Exception e) 259 catch (Exception e)
240 { 260 {
241 m_log.Info("[LOGIN]: " + e.ToString()); 261 m_log.Info("[LOGIN]: Login failed, exception" + e.ToString());
242 } 262 }
243 //}
244 } 263 }
264
265 m_log.Info("[LOGIN]: Login failed. Sending back blank XMLRPC response");
245 return response; 266 return response;
246 } 267 }
247 finally 268 finally
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index 20cd768..df559fc 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Framework
45 45
46 public string InventoryURL = String.Empty; 46 public string InventoryURL = String.Empty;
47 47
48 public static uint DefaultHttpListenerPort = 9000; 48 public static readonly uint DefaultHttpListenerPort = 9000;
49 public uint HttpListenerPort = DefaultHttpListenerPort; 49 public uint HttpListenerPort = DefaultHttpListenerPort;
50 50
51 public static uint RemotingListenerPort = 8895; 51 public static uint RemotingListenerPort = 8895;
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index b5d6869..fc6da57 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -71,6 +71,7 @@ namespace OpenSim.Framework
71 m_internalEndPoint = ConvertFrom.InternalEndPoint; 71 m_internalEndPoint = ConvertFrom.InternalEndPoint;
72 m_externalHostName = ConvertFrom.ExternalHostName; 72 m_externalHostName = ConvertFrom.ExternalHostName;
73 m_remotingPort = ConvertFrom.RemotingPort; 73 m_remotingPort = ConvertFrom.RemotingPort;
74 m_httpPort = ConvertFrom.HttpPort;
74 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; 75 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
75 RemotingAddress = ConvertFrom.RemotingAddress; 76 RemotingAddress = ConvertFrom.RemotingAddress;
76 RegionID = LLUUID.Zero; 77 RegionID = LLUUID.Zero;
@@ -79,16 +80,27 @@ namespace OpenSim.Framework
79 80
80 public LLUUID RegionID = LLUUID.Zero; 81 public LLUUID RegionID = LLUUID.Zero;
81 82
82 public uint m_remotingPort; 83 protected uint m_remotingPort;
83 84
84 public uint RemotingPort 85 public uint RemotingPort
85 { 86 {
86 get { return m_remotingPort; } 87 get { return m_remotingPort; }
87 set { m_remotingPort = value; } 88 set { m_remotingPort = value; }
88 } 89 }
90
91 /// <value>
92 /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
93 /// </value>
94 protected uint m_httpPort;
95 public uint HttpPort
96 {
97 get { return m_httpPort; }
98 set { m_httpPort = value; }
99 }
100
89 public bool m_allow_alternate_ports; 101 public bool m_allow_alternate_ports;
90 102
91 public string m_serverURI; 103 protected string m_serverURI;
92 public string ServerURI 104 public string ServerURI
93 { 105 {
94 get 106 get
@@ -142,7 +154,6 @@ namespace OpenSim.Framework
142 } 154 }
143 155
144 protected string m_externalHostName; 156 protected string m_externalHostName;
145
146 public string ExternalHostName 157 public string ExternalHostName
147 { 158 {
148 get { return m_externalHostName; } 159 get { return m_externalHostName; }
diff --git a/OpenSim/Framework/SerializableRegionInfo.cs b/OpenSim/Framework/SerializableRegionInfo.cs
index 39a5993..2c73da8 100644
--- a/OpenSim/Framework/SerializableRegionInfo.cs
+++ b/OpenSim/Framework/SerializableRegionInfo.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Framework
49 m_internalEndPoint = ConvertFrom.InternalEndPoint; 49 m_internalEndPoint = ConvertFrom.InternalEndPoint;
50 m_externalHostName = ConvertFrom.ExternalHostName; 50 m_externalHostName = ConvertFrom.ExternalHostName;
51 m_remotingPort = ConvertFrom.RemotingPort; 51 m_remotingPort = ConvertFrom.RemotingPort;
52 m_httpPort = ConvertFrom.HttpPort;
52 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; 53 m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
53 RemotingAddress = ConvertFrom.RemotingAddress; 54 RemotingAddress = ConvertFrom.RemotingAddress;
54 m_proxyUrl = ConvertFrom.proxyUrl; 55 m_proxyUrl = ConvertFrom.proxyUrl;
@@ -79,17 +80,29 @@ namespace OpenSim.Framework
79 public Guid RegionID = LLUUID.Zero.UUID; 80 public Guid RegionID = LLUUID.Zero.UUID;
80 81
81 public uint m_remotingPort; 82 public uint m_remotingPort;
82
83 public uint RemotingPort 83 public uint RemotingPort
84 { 84 {
85 get { return m_remotingPort; } 85 get { return m_remotingPort; }
86 set { m_remotingPort = value; } 86 set { m_remotingPort = value; }
87 } 87 }
88
89 /// <value>
90 /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
91 ///
92 /// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region
93 /// servers are running) until the revision in which this change is made propogates around grids.
94 /// </value>
95 protected uint m_httpPort = 9000;
96 public uint HttpPort
97 {
98 get { return m_httpPort; }
99 set { m_httpPort = value; }
100 }
101
88 public bool m_allow_alternate_ports; 102 public bool m_allow_alternate_ports;
89 103
90 public string RemotingAddress; 104 public string RemotingAddress;
91 105
92
93 public IPEndPoint ExternalEndPoint 106 public IPEndPoint ExternalEndPoint
94 { 107 {
95 get 108 get