1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

more api tweaks

removed WebfrontSettings
IW4MAdminSettings are only generated when the file does not exist, placeholder values stored in DefaultSettings.json
This commit is contained in:
RaidMax
2018-04-19 00:48:14 -05:00
parent 2f336c1291
commit 8e9d8e46c7
31 changed files with 310 additions and 77 deletions

View File

@ -10,15 +10,13 @@ namespace IW4MAdmin.Application.API.Master
{
public class Heartbeat
{
static IMasterApi api;
public static async Task Send(ApplicationManager mgr, bool firstHeartbeat = false)
{
var api = Endpoint.Get();
if (firstHeartbeat)
{
api = RestClient.For<IMasterApi>("http://127.0.0.1");
var token = await api.Authenticate(new AuthenticationId()
{
Id = mgr.GetApplicationSettings().Configuration().Id
@ -48,12 +46,12 @@ namespace IW4MAdmin.Application.API.Master
if (firstHeartbeat)
{
instance = await api.AddInstance(instance);
var message = await api.AddInstance(instance);
}
else
{
instance = await api.UpdateInstance(instance.Id, instance);
var message = await api.UpdateInstance(instance.Id, instance);
}
}
}