private bool AutoPilotActive = false;
private TransparentButton btnDialogNextControl;
private MediaConsole mediaConsole;
+ private SlUriParser uriParser;
#endregion
#region Constructor and disposal
public void InitializeControls()
{
InitializeTabsConsole();
+ uriParser = new SlUriParser();
if (instance.MediaManager.SoundSystemAvailable)
{
public bool ProcessSecondlifeURI(string link)
{
- // First try if we have a region name, assume it's a teleport link if we have
- Regex r = new Regex(@"^(secondlife://)(?<region>[^/$]+)(/(?<x>\d+))?(/(?<y>\d+))?(/(?<z>\d+))?",
- RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
- Match m = r.Match(link);
-
- if (m.Success)
- {
- string region = HttpUtility.UrlDecode(m.Groups["region"].Value);
- int x = string.IsNullOrEmpty(m.Groups["x"].Value) ? 128 : int.Parse(m.Groups["x"].Value);
- int y = string.IsNullOrEmpty(m.Groups["y"].Value) ? 128 : int.Parse(m.Groups["y"].Value);
- int z = string.IsNullOrEmpty(m.Groups["z"].Value) ? 0 : int.Parse(m.Groups["z"].Value);
- MapTab.Select();
- WorldMap.DisplayLocation(region, x, y, z);
- return true;
- }
-
- // Is it group profile link
- r = new Regex(@"^secondlife:///app/group/(?<id>[^/]+)/about",
- RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
- m = r.Match(link);
-
- if (m.Success)
- {
- UUID id;
- if (UUID.TryParse(m.Groups["id"].Value, out id))
- {
- ShowGroupProfile(id);
- return true;
- }
- return false;
- }
-
- // Is it user profile link
- r = new Regex(@"^secondlife:///app/agent/(?<id>[^/]+)/about",
- RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
- m = r.Match(link);
-
- if (m.Success)
- {
- UUID id;
- if (UUID.TryParse(m.Groups["id"].Value, out id))
- {
- ShowAgentProfile(instance.Names.Get(id), id);
- return true;
- }
- return false;
- }
-
- return false;
+ uriParser.ExecuteLink(link);
+ return true;
}
public void ProcessLink(string link)
link = link.Substring(pos + 1);
}
- if (link.StartsWith("secondlife://"))
+ if (link.StartsWith("secondlife://") || link.StartsWith("[secondlife://"))
{
return ProcessSecondlifeURI(link);
}