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 (!int.TryParse(tokenOrChannel, out _))
|
||||
if (!long.TryParse(tokenOrChannel, out _))
|
||||
{
|
||||
Log.Error("Bad format for channel ID.");
|
||||
return;
|
||||
|
@ -67,11 +67,11 @@ namespace GCDC
|
|||
}
|
||||
else
|
||||
{
|
||||
_token = tokenOrChannel;
|
||||
try
|
||||
{
|
||||
if (JObject.Parse(WebUtils.Request("users/get?token=" + tokenOrChannel))["response"].Value<string>() == "OK")
|
||||
{
|
||||
_token = tokenOrChannel;
|
||||
var jo = new JObject {["token"] = tokenOrChannel};
|
||||
File.WriteAllText("gcdc.json", jo.ToString());
|
||||
Start();
|
||||
|
@ -136,6 +136,10 @@ namespace GCDC
|
|||
{
|
||||
// ignored
|
||||
}
|
||||
catch (ThreadInterruptedException)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}) {Name = "DC Receiver Thread"};
|
||||
_rect.Start();
|
||||
|
|
Loading…
Reference in a new issue