From 42857fe4e9e898c8e350da2f9acb3b252b31694a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 18 Mar 2008 05:44:25 +0000 Subject: * 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. --- OpenSim/Framework/Util.cs | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'OpenSim/Framework/Util.cs') 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 return ret; } + public static string[] ParseStartLocationRequest(string startLocationRequest) + { + string[] returnstring = new string[4]; + // format uri:RegionName&X&Y&Z + returnstring[0] = "last"; + returnstring[1] = "127"; + returnstring[2] = "127"; + returnstring[3] = "0"; + // This is the crappy way of doing it. + + if (startLocationRequest.Contains(":") && startLocationRequest.Contains("&")) + { + //System.Console.WriteLine("StartLocationRequest Contains proper elements"); + + string[] splitstr = startLocationRequest.Split(':');//,2,StringSplitOptions.RemoveEmptyEntries); + + //System.Console.WriteLine("Found " + splitstr.GetLength(0) + " elements in 1st split result"); + + if (splitstr.GetLength(0) == 2) + { + + string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries); + + //System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result"); + + if (splitstr2.GetLength(0) >= 1) + { + returnstring[0] = splitstr2[0]; + } + if (splitstr2.GetLength(0) >= 2) + { + returnstring[1] = splitstr2[1]; + } + if (splitstr2.GetLength(0) >= 3) + { + returnstring[2] = splitstr2[2]; + } + if (splitstr2.GetLength(0) >= 4) + { + returnstring[3] = splitstr2[3]; + } + } + + } + return returnstring; + + + } } } -- cgit v1.1