diff options
author | Teravus Ovares | 2008-03-18 05:44:25 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-03-18 05:44:25 +0000 |
commit | 42857fe4e9e898c8e350da2f9acb3b252b31694a (patch) | |
tree | de55ab7f5d6d6e1bb127a39f6e97f67e4e442cf4 /OpenSim/Framework/Util.cs | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.zip opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.gz opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.bz2 opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.xz |
* Added the ability to type the partial name of a region in the start location box and go to that region if it's there. If no close match was found, it sends you home. This is tested on mySQL. There's untested code on grids that are based on sqlite and MSSQL. The SQL statements *should* be right, but your results may very.
* Ex, if you want to go to Wright Plaza, you simply need to type Wright Plaza in the start location in the client when you log-in.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0f1f0d9..37ddb3e 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -597,5 +597,53 @@ namespace OpenSim.Framework | |||
597 | 597 | ||
598 | return ret; | 598 | return ret; |
599 | } | 599 | } |
600 | public static string[] ParseStartLocationRequest(string startLocationRequest) | ||
601 | { | ||
602 | string[] returnstring = new string[4]; | ||
603 | // format uri:RegionName&X&Y&Z | ||
604 | returnstring[0] = "last"; | ||
605 | returnstring[1] = "127"; | ||
606 | returnstring[2] = "127"; | ||
607 | returnstring[3] = "0"; | ||
608 | // This is the crappy way of doing it. | ||
609 | |||
610 | if (startLocationRequest.Contains(":") && startLocationRequest.Contains("&")) | ||
611 | { | ||
612 | //System.Console.WriteLine("StartLocationRequest Contains proper elements"); | ||
613 | |||
614 | string[] splitstr = startLocationRequest.Split(':');//,2,StringSplitOptions.RemoveEmptyEntries); | ||
615 | |||
616 | //System.Console.WriteLine("Found " + splitstr.GetLength(0) + " elements in 1st split result"); | ||
617 | |||
618 | if (splitstr.GetLength(0) == 2) | ||
619 | { | ||
620 | |||
621 | string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries); | ||
622 | |||
623 | //System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result"); | ||
624 | |||
625 | if (splitstr2.GetLength(0) >= 1) | ||
626 | { | ||
627 | returnstring[0] = splitstr2[0]; | ||
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 | { | ||
639 | returnstring[3] = splitstr2[3]; | ||
640 | } | ||
641 | } | ||
642 | |||
643 | } | ||
644 | return returnstring; | ||
645 | |||
646 | |||
647 | } | ||
600 | } | 648 | } |
601 | } | 649 | } |