aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJeff Ames2008-03-18 14:51:42 +0000
committerJeff Ames2008-03-18 14:51:42 +0000
commitbf8b5844f24d294c459f54147bd511e7112288bf (patch)
tree1b6a1ba4e9888d43694a8a33c21beb6913ce2d3a /OpenSim/Framework
parent* Applied Grumly57 patch for #781; Thanks, Grumly! (diff)
downloadopensim-SC-bf8b5844f24d294c459f54147bd511e7112288bf.zip
opensim-SC-bf8b5844f24d294c459f54147bd511e7112288bf.tar.gz
opensim-SC-bf8b5844f24d294c459f54147bd511e7112288bf.tar.bz2
opensim-SC-bf8b5844f24d294c459f54147bd511e7112288bf.tar.xz
Formatting cleanup. Minor refactoring.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/LoginResponse.cs10
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs7
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oGridData.cs1
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs7
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLGridData.cs2
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteGridData.cs7
-rw-r--r--OpenSim/Framework/Data/RegionProfileData.cs9
-rw-r--r--OpenSim/Framework/Util.cs50
8 files changed, 36 insertions, 57 deletions
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs
index a815662..4a31986 100644
--- a/OpenSim/Framework/Communications/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/LoginResponse.cs
@@ -170,7 +170,6 @@ namespace OpenSim.Framework.UserManagement
170 AddClassifiedCategory((Int32) 8, "Service"); 170 AddClassifiedCategory((Int32) 8, "Service");
171 AddClassifiedCategory((Int32) 9, "Personal"); 171 AddClassifiedCategory((Int32) 9, "Personal");
172 172
173
174 SessionID = LLUUID.Random(); 173 SessionID = LLUUID.Random();
175 SecureSessionID = LLUUID.Random(); 174 SecureSessionID = LLUUID.Random();
176 AgentID = LLUUID.Random(); 175 AgentID = LLUUID.Random();
@@ -244,7 +243,10 @@ namespace OpenSim.Framework.UserManagement
244 { 243 {
245 return 244 return
246 (GenerateFailureResponse("presence", 245 (GenerateFailureResponse("presence",
247 "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner. Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.", 246 "You appear to be already logged in. " +
247 "If this is not the case please wait for your session to timeout. " +
248 "If this takes longer than a few minutes please contact the grid owner. " +
249 "Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.",
248 "false")); 250 "false"));
249 } 251 }
250 252
@@ -252,7 +254,9 @@ namespace OpenSim.Framework.UserManagement
252 { 254 {
253 return GenerateFailureResponseLLSD( 255 return GenerateFailureResponseLLSD(
254 "presence", 256 "presence",
255 "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", 257 "You appear to be already logged in. " +
258 "If this is not the case please wait for your session to timeout. " +
259 "If this takes longer than a few minutes please contact the grid owner",
256 "false"); 260 "false");
257 } 261 }
258 262
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 72b408b..be47258 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -121,6 +121,7 @@ namespace OpenSim.Framework.UserManagement
121 121
122 return logResponse.CreateLoginFailedResponse(); 122 return logResponse.CreateLoginFailedResponse();
123 } 123 }
124
124 if (requestData.Contains("passwd")) 125 if (requestData.Contains("passwd"))
125 { 126 {
126 string passwd = (string)requestData["passwd"]; 127 string passwd = (string)requestData["passwd"];
@@ -494,8 +495,8 @@ namespace OpenSim.Framework.UserManagement
494 } 495 }
495 496
496 public string GetLoginForm(string firstname, string lastname, string location, string region, 497 public string GetLoginForm(string firstname, string lastname, string location, string region,
497 string grid, string channel, string version, string lang, 498 string grid, string channel, string version, string lang,
498 string password, string errormessages) 499 string password, string errormessages)
499 { 500 {
500 // inject our values in the form at the markers 501 // inject our values in the form at the markers
501 502
@@ -522,6 +523,7 @@ namespace OpenSim.Framework.UserManagement
522 loginform = loginform.Replace("[$lang]", lang); 523 loginform = loginform.Replace("[$lang]", lang);
523 loginform = loginform.Replace("[$password]", password); 524 loginform = loginform.Replace("[$password]", password);
524 loginform = loginform.Replace("[$errors]", errormessages); 525 loginform = loginform.Replace("[$errors]", errormessages);
526
525 return loginform; 527 return loginform;
526 } 528 }
527 529
@@ -588,6 +590,7 @@ namespace OpenSim.Framework.UserManagement
588 responseString += "</div>"; 590 responseString += "</div>";
589 responseString += "</body>"; 591 responseString += "</body>";
590 responseString += "</html>"; 592 responseString += "</html>";
593
591 return responseString; 594 return responseString;
592 } 595 }
593 596
diff --git a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
index 999d4f8..9320ef9 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oGridData.cs
@@ -103,6 +103,7 @@ namespace OpenSim.Framework.Data.DB4o
103 throw new Exception("GetProfileByString Not supported in DB4oGridData"); 103 throw new Exception("GetProfileByString Not supported in DB4oGridData");
104 //return null; 104 //return null;
105 } 105 }
106
106 /// <summary> 107 /// <summary>
107 /// Adds a new specified region to the database 108 /// Adds a new specified region to the database
108 /// </summary> 109 /// </summary>
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
index 38a1d08..5a0f3f5 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLGridData.cs
@@ -180,7 +180,6 @@ namespace OpenSim.Framework.Data.MSSQL
180 return row; 180 return row;
181 } 181 }
182 182
183
184 /// <summary> 183 /// <summary>
185 /// Returns a sim profile from it's Region name string 184 /// Returns a sim profile from it's Region name string
186 /// </summary> 185 /// </summary>
@@ -222,7 +221,6 @@ namespace OpenSim.Framework.Data.MSSQL
222 } 221 }
223 } 222 }
224 223
225
226 /// <summary> 224 /// <summary>
227 /// Adds a new specified region to the database 225 /// Adds a new specified region to the database
228 /// </summary> 226 /// </summary>
@@ -242,7 +240,7 @@ namespace OpenSim.Framework.Data.MSSQL
242 System.Console.WriteLine("No regions found. Create new one."); 240 System.Console.WriteLine("No regions found. Create new one.");
243 } 241 }
244 242
245 if ( insertRegionRow(profile)) 243 if (insertRegionRow(profile))
246 { 244 {
247 return DataResponse.RESPONSE_OK; 245 return DataResponse.RESPONSE_OK;
248 } 246 }
@@ -252,7 +250,6 @@ namespace OpenSim.Framework.Data.MSSQL
252 } 250 }
253 } 251 }
254 252
255
256 /// <summary> 253 /// <summary>
257 /// Creates a new region in the database 254 /// Creates a new region in the database
258 /// </summary> 255 /// </summary>
@@ -324,7 +321,7 @@ namespace OpenSim.Framework.Data.MSSQL
324 } 321 }
325 322
326 /// <summary> 323 /// <summary>
327 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. 324 /// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
328 /// </summary> 325 /// </summary>
329 /// <param name="uuid">The UUID of the challenger</param> 326 /// <param name="uuid">The UUID of the challenger</param>
330 /// <param name="handle">The attempted regionHandle of the challenger</param> 327 /// <param name="handle">The attempted regionHandle of the challenger</param>
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
index 3855d99..0cba9f0 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
@@ -331,7 +331,7 @@ namespace OpenSim.Framework.Data.MySQL
331 } 331 }
332 332
333 /// <summary> 333 /// <summary>
334 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. 334 /// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
335 /// </summary> 335 /// </summary>
336 /// <param name="uuid">The UUID of the challenger</param> 336 /// <param name="uuid">The UUID of the challenger</param>
337 /// <param name="handle">The attempted regionHandle of the challenger</param> 337 /// <param name="handle">The attempted regionHandle of the challenger</param>
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
index 4d42f19..397ef82 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
@@ -114,13 +114,12 @@ namespace OpenSim.Framework.Data.SQLite
114 /// <summary> 114 /// <summary>
115 /// Returns a sim profile from it's Region name string 115 /// Returns a sim profile from it's Region name string
116 /// </summary> 116 /// </summary>
117 /// <param name="uuid">The region name search query</param> 117 /// <param name="regionName">The region name search query</param>
118 /// <returns>The sim profile</returns> 118 /// <returns>The sim profile</returns>
119 public RegionProfileData GetProfileByString(string regionName) 119 public RegionProfileData GetProfileByString(string regionName)
120 { 120 {
121 if (regionName.Length > 2) 121 if (regionName.Length > 2)
122 { 122 {
123
124 Dictionary<string, string> param = new Dictionary<string, string>(); 123 Dictionary<string, string> param = new Dictionary<string, string>();
125 // Add % because this is a like query. 124 // Add % because this is a like query.
126 param["?regionName"] = regionName + "%"; 125 param["?regionName"] = regionName + "%";
@@ -133,7 +132,6 @@ namespace OpenSim.Framework.Data.SQLite
133 result.Dispose(); 132 result.Dispose();
134 133
135 return row; 134 return row;
136
137 } 135 }
138 else 136 else
139 { 137 {
@@ -142,7 +140,6 @@ namespace OpenSim.Framework.Data.SQLite
142 } 140 }
143 } 141 }
144 142
145
146 /// <summary> 143 /// <summary>
147 /// Returns a sim profile from it's UUID 144 /// Returns a sim profile from it's UUID
148 /// </summary> 145 /// </summary>
@@ -191,7 +188,7 @@ namespace OpenSim.Framework.Data.SQLite
191 } 188 }
192 189
193 /// <summary> 190 /// <summary>
194 /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. 191 /// DEPRECATED. Attempts to authenticate a region by comparing a shared secret.
195 /// </summary> 192 /// </summary>
196 /// <param name="uuid">The UUID of the challenger</param> 193 /// <param name="uuid">The UUID of the challenger</param>
197 /// <param name="handle">The attempted regionHandle of the challenger</param> 194 /// <param name="handle">The attempted regionHandle of the challenger</param>
diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs
index f736571..84713b4 100644
--- a/OpenSim/Framework/Data/RegionProfileData.cs
+++ b/OpenSim/Framework/Data/RegionProfileData.cs
@@ -56,7 +56,6 @@ namespace OpenSim.Framework.Data
56 /// Coordinates of the region 56 /// Coordinates of the region
57 /// </summary> 57 /// </summary>
58 public uint regionLocX; 58 public uint regionLocX;
59
60 public uint regionLocY; 59 public uint regionLocY;
61 public uint regionLocZ; // Reserved (round-robin, layers, etc) 60 public uint regionLocZ; // Reserved (round-robin, layers, etc)
62 61
@@ -65,7 +64,6 @@ namespace OpenSim.Framework.Data
65 /// </summary> 64 /// </summary>
66 /// <remarks>Not very secure, needs improvement.</remarks> 65 /// <remarks>Not very secure, needs improvement.</remarks>
67 public string regionSendKey = String.Empty; 66 public string regionSendKey = String.Empty;
68
69 public string regionRecvKey = String.Empty; 67 public string regionRecvKey = String.Empty;
70 public string regionSecret = String.Empty; 68 public string regionSecret = String.Empty;
71 69
@@ -78,7 +76,6 @@ namespace OpenSim.Framework.Data
78 /// Information about the server that the region is currently hosted on 76 /// Information about the server that the region is currently hosted on
79 /// </summary> 77 /// </summary>
80 public string serverIP = String.Empty; 78 public string serverIP = String.Empty;
81
82 public uint serverPort; 79 public uint serverPort;
83 public string serverURI = String.Empty; 80 public string serverURI = String.Empty;
84 81
@@ -90,7 +87,6 @@ namespace OpenSim.Framework.Data
90 /// Set of optional overrides. Can be used to create non-eulicidean spaces. 87 /// Set of optional overrides. Can be used to create non-eulicidean spaces.
91 /// </summary> 88 /// </summary>
92 public ulong regionNorthOverrideHandle; 89 public ulong regionNorthOverrideHandle;
93
94 public ulong regionSouthOverrideHandle; 90 public ulong regionSouthOverrideHandle;
95 public ulong regionEastOverrideHandle; 91 public ulong regionEastOverrideHandle;
96 public ulong regionWestOverrideHandle; 92 public ulong regionWestOverrideHandle;
@@ -133,7 +129,6 @@ namespace OpenSim.Framework.Data
133 /// </summary> 129 /// </summary>
134 public LLUUID originUUID; 130 public LLUUID originUUID;
135 131
136
137 /// <summary> 132 /// <summary>
138 /// Get Sim profile data from grid server when in grid mode 133 /// Get Sim profile data from grid server when in grid mode
139 /// </summary> 134 /// </summary>
@@ -184,7 +179,7 @@ namespace OpenSim.Framework.Data
184 /// <param name="gridserver_recvkey"></param> 179 /// <param name="gridserver_recvkey"></param>
185 /// <returns>The sim profile. Null if there was a request failure</returns> 180 /// <returns>The sim profile. Null if there was a request failure</returns>
186 public static RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, 181 public static RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url,
187 string gridserver_sendkey, string gridserver_recvkey) 182 string gridserver_sendkey, string gridserver_recvkey)
188 { 183 {
189 Hashtable requestData = new Hashtable(); 184 Hashtable requestData = new Hashtable();
190 requestData["region_handle"] = region_handle.ToString(); 185 requestData["region_handle"] = region_handle.ToString();
@@ -226,7 +221,7 @@ namespace OpenSim.Framework.Data
226 /// <param name="gridserver_recvkey"></param> 221 /// <param name="gridserver_recvkey"></param>
227 /// <returns>The sim profile. Null if there was a request failure</returns> 222 /// <returns>The sim profile. Null if there was a request failure</returns>
228 public static RegionProfileData RequestSimProfileData(string regionName, string gridserver_url, 223 public static RegionProfileData RequestSimProfileData(string regionName, string gridserver_url,
229 string gridserver_sendkey, string gridserver_recvkey) 224 string gridserver_sendkey, string gridserver_recvkey)
230 { 225 {
231 Hashtable requestData = new Hashtable(); 226 Hashtable requestData = new Hashtable();
232 requestData["region_name_search"] = regionName; 227 requestData["region_name_search"] = regionName;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 37ddb3e..e16d15e 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -52,7 +52,6 @@ namespace OpenSim.Framework
52 // Get a list of invalid file characters (OS dependent) 52 // Get a list of invalid file characters (OS dependent)
53 private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]"; 53 private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]";
54 54
55
56 #region Vector Equasions 55 #region Vector Equasions
57 /// <summary> 56 /// <summary>
58 /// Get the distance between two 3d vectors 57 /// Get the distance between two 3d vectors
@@ -106,6 +105,7 @@ namespace OpenSim.Framework
106 105
107 return false; 106 return false;
108 } 107 }
108
109 # endregion 109 # endregion
110 110
111 public static ulong UIntsToLong(uint X, uint Y) 111 public static ulong UIntsToLong(uint X, uint Y)
@@ -384,8 +384,6 @@ namespace OpenSim.Framework
384 return System.Text.RegularExpressions.Regex.Replace(filename, @regexInvalidFileChars, string.Empty); ; 384 return System.Text.RegularExpressions.Regex.Replace(filename, @regexInvalidFileChars, string.Empty); ;
385 } 385 }
386 386
387
388
389 // 387 //
390 // directory locations 388 // directory locations
391 // 389 //
@@ -411,23 +409,17 @@ namespace OpenSim.Framework
411 409
412 public static string configDir() 410 public static string configDir()
413 { 411 {
414 string temp; 412 return ".";
415 temp = ".";
416 return temp;
417 } 413 }
418 414
419 public static string dataDir() 415 public static string dataDir()
420 { 416 {
421 string temp; 417 return ".";
422 temp = ".";
423 return temp;
424 } 418 }
425 419
426 public static string logDir() 420 public static string logDir()
427 { 421 {
428 string temp; 422 return ".";
429 temp = ".";
430 return temp;
431 } 423 }
432 424
433 public static string GetCapsURL(LLUUID userID) 425 public static string GetCapsURL(LLUUID userID)
@@ -549,8 +541,8 @@ namespace OpenSim.Framework
549 try 541 try
550 { 542 {
551 stream = new FileStream( 543 stream = new FileStream(
552 filename, FileMode.Create, 544 filename, FileMode.Create,
553 FileAccess.Write, FileShare.None); 545 FileAccess.Write, FileShare.None);
554 546
555 formatter.Serialize(stream, obj); 547 formatter.Serialize(stream, obj);
556 } 548 }
@@ -577,8 +569,8 @@ namespace OpenSim.Framework
577 try 569 try
578 { 570 {
579 stream = new FileStream( 571 stream = new FileStream(
580 filename, FileMode.Open, 572 filename, FileMode.Open,
581 FileAccess.Read, FileShare.None); 573 FileAccess.Read, FileShare.None);
582 574
583 ret = formatter.Deserialize(stream); 575 ret = formatter.Deserialize(stream);
584 } 576 }
@@ -597,6 +589,7 @@ namespace OpenSim.Framework
597 589
598 return ret; 590 return ret;
599 } 591 }
592
600 public static string[] ParseStartLocationRequest(string startLocationRequest) 593 public static string[] ParseStartLocationRequest(string startLocationRequest)
601 { 594 {
602 string[] returnstring = new string[4]; 595 string[] returnstring = new string[4];
@@ -617,33 +610,22 @@ namespace OpenSim.Framework
617 610
618 if (splitstr.GetLength(0) == 2) 611 if (splitstr.GetLength(0) == 2)
619 { 612 {
620
621 string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries); 613 string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries);
622 614
623 //System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result"); 615 //System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result");
624 616
625 if (splitstr2.GetLength(0) >= 1) 617 int len = Math.Min(splitstr2.GetLength(0), 4);
626 { 618
627 returnstring[0] = splitstr2[0]; 619 for (int i = 0; i < 4; ++i)
628 }
629 if (splitstr2.GetLength(0) >= 2)
630 {
631 returnstring[1] = splitstr2[1];
632 }
633 if (splitstr2.GetLength(0) >= 3)
634 {
635 returnstring[2] = splitstr2[2];
636 }
637 if (splitstr2.GetLength(0) >= 4)
638 { 620 {
639 returnstring[3] = splitstr2[3]; 621 if (len > i)
622 {
623 returnstring[i] = splitstr2[i];
624 }
640 } 625 }
641 } 626 }
642
643 } 627 }
644 return returnstring; 628 return returnstring;
645
646
647 } 629 }
648 } 630 }
649} 631}