Fix ID check and fix game quit crash
This commit is contained in:
parent
7f0acaeabf
commit
4d2a4b20d0
1 changed files with 6 additions and 2 deletions
|
@ -53,7 +53,7 @@ namespace GCDC
|
||||||
{
|
{
|
||||||
if (!tokenOrChannel.Contains("-"))
|
if (!tokenOrChannel.Contains("-"))
|
||||||
{
|
{
|
||||||
if (!int.TryParse(tokenOrChannel, out _))
|
if (!long.TryParse(tokenOrChannel, out _))
|
||||||
{
|
{
|
||||||
Log.Error("Bad format for channel ID.");
|
Log.Error("Bad format for channel ID.");
|
||||||
return;
|
return;
|
||||||
|
@ -67,11 +67,11 @@ namespace GCDC
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_token = tokenOrChannel;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (JObject.Parse(WebUtils.Request("users/get?token=" + tokenOrChannel))["response"].Value<string>() == "OK")
|
if (JObject.Parse(WebUtils.Request("users/get?token=" + tokenOrChannel))["response"].Value<string>() == "OK")
|
||||||
{
|
{
|
||||||
|
_token = tokenOrChannel;
|
||||||
var jo = new JObject {["token"] = tokenOrChannel};
|
var jo = new JObject {["token"] = tokenOrChannel};
|
||||||
File.WriteAllText("gcdc.json", jo.ToString());
|
File.WriteAllText("gcdc.json", jo.ToString());
|
||||||
Start();
|
Start();
|
||||||
|
@ -136,6 +136,10 @@ namespace GCDC
|
||||||
{
|
{
|
||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
|
catch (ThreadInterruptedException)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}) {Name = "DC Receiver Thread"};
|
}) {Name = "DC Receiver Thread"};
|
||||||
_rect.Start();
|
_rect.Start();
|
||||||
|
|
Loading…
Reference in a new issue