aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
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/Util.cs
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/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs50
1 files changed, 16 insertions, 34 deletions
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}