2024-08-04 17:53:19 -05:00
|
|
|
|
using LANCommander.Launcher.Data.Models;
|
2024-09-11 00:24:34 -05:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2024-05-29 19:25:41 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
2024-08-04 17:53:19 -05:00
|
|
|
|
namespace LANCommander.Launcher.Services
|
2024-05-29 19:25:41 -05:00
|
|
|
|
{
|
2024-09-11 00:24:34 -05:00
|
|
|
|
public class SaveService : BaseService
|
2024-05-29 19:25:41 -05:00
|
|
|
|
{
|
2024-09-11 00:24:34 -05:00
|
|
|
|
public SaveService(SDK.Client client, ILogger<SaveService> saveService) : base(client, saveService) { }
|
2024-05-29 19:25:41 -05:00
|
|
|
|
|
2024-07-15 19:13:40 -05:00
|
|
|
|
public async Task DownloadLatestAsync(string installDirectory, Guid gameId)
|
|
|
|
|
|
{
|
2024-08-07 01:14:13 -05:00
|
|
|
|
await Task.Run(() => Client.Saves.DownloadAsync(installDirectory, gameId));
|
2024-07-15 19:13:40 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task DownloadLatest(string installDirectory, Guid gameId)
|
2024-05-29 19:25:41 -05:00
|
|
|
|
{
|
|
|
|
|
|
|
2024-08-07 01:14:13 -05:00
|
|
|
|
await Task.Run(() => Client.Saves.DownloadAsync(installDirectory, gameId));
|
2024-07-15 19:13:40 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task UploadAsync(string installDirectory, Guid gameId)
|
|
|
|
|
|
{
|
2024-08-05 18:02:01 -05:00
|
|
|
|
await Task.Run(() => Client.Saves.UploadAsync(installDirectory, gameId));
|
2024-05-29 19:25:41 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|