Browse Source

Fix ID check and fix game quit crash

tags/v0.0.1
NorbiPeti 4 years ago
parent
commit
4d2a4b20d0
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      GCDC/TextBlockUpdateEngine.cs

+ 6
- 2
GCDC/TextBlockUpdateEngine.cs View File

@@ -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…
Cancel
Save