DutyContent/Updater.cs
ksh 712d8f5848
Packet desc & remote update (#13)
* Packet desc & remote update

* config: data remote update
2021-06-15 01:16:06 +09:00

41 lines
999 B
C#

using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace DutyContent
{
internal class Updater
{
internal static void CheckNewVersion()
{
Task.Factory.StartNew(() =>
{
try
{
var json = WebApi.Request($"https://raw.githubusercontent.com/kshman/DutyContent/main/Data/DcDuty-{DcContent.Language}.json");
DcContent.Fill(json);
}
catch (Exception ex)
{
MesgLog.Ex(ex, 31);
}
});
}
public static string CheckNewPacket(string name)
{
try
{
var ret = WebApi.Request($"https://raw.githubusercontent.com/kshman/DutyContent/main/Data/DcPacket-{name}.config");
return ret;
}
catch (Exception ex)
{
MesgLog.Ex(ex, 32);
return null;
}
}
}
}