Update HomeboundService.cs
This commit is contained in:
parent
12b86a0c08
commit
cb7e2a738a
1 changed files with 11 additions and 2 deletions
|
|
@ -332,20 +332,29 @@ namespace SecondBotEvents.Services
|
||||||
public int x = 0;
|
public int x = 0;
|
||||||
public int y = 0;
|
public int y = 0;
|
||||||
public int z = 0;
|
public int z = 0;
|
||||||
public SimSlURL(string url)
|
public SimSlURL(string? url)
|
||||||
{
|
{
|
||||||
|
if(url == null)
|
||||||
|
{
|
||||||
|
name = "null";
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
z = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
// http://maps.secondlife.com/secondlife/Viserion/66/166/23
|
// http://maps.secondlife.com/secondlife/Viserion/66/166/23
|
||||||
url = url.Replace("maps.secondlife.com/secondlife/", "");
|
url = url.Replace("maps.secondlife.com/secondlife/", "");
|
||||||
url = url.Replace("http://", "");
|
url = url.Replace("http://", "");
|
||||||
url = url.Replace("https://", "");
|
url = url.Replace("https://", "");
|
||||||
// Viserion/66/166/23
|
// Viserion/66/166/23
|
||||||
string[] bits = url.Split("/");
|
string[] bits = url.Split("/");
|
||||||
if(bits.Count() != 3)
|
if(bits.Count() != 4)
|
||||||
{
|
{
|
||||||
name = "null";
|
name = "null";
|
||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
z = 0;
|
z = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
name = System.Net.WebUtility.UrlDecode(bits[0]);
|
name = System.Net.WebUtility.UrlDecode(bits[0]);
|
||||||
x = int.Parse(bits[1]);
|
x = int.Parse(bits[1]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue