Synchronize saves

This commit is contained in:
Aurélie Delhaie
2022-05-22 19:04:29 +02:00
parent b013815a96
commit 03ceaf3bda
33 changed files with 5751 additions and 81 deletions

View File

@@ -13,15 +13,23 @@ namespace OpenSaveCloudClient.Models
private readonly int max;
private int progress;
private AsyncTaskStatus status;
private readonly string uuid;
private bool undefined;
public string Label { get { return label; } }
public int Max { get { return max; } }
public int Progress { get { return progress; } set { progress = value; } }
public AsyncTaskStatus Status { get { return status; } set { status = value; } }
public AsyncTaskInformation(string label, int max)
public bool Undefined { get { return undefined; } set { undefined = value; } }
public string Uuid { get { return uuid; } }
public AsyncTaskInformation(string uuid, string label, bool undefined, int max)
{
this.uuid = uuid;
this.label = label;
this.undefined = undefined;
this.max = max;
this.progress = 0;
status = AsyncTaskStatus.Running;

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models
{
public enum LogSeverity
{
Error,
Warning,
Information
}
public class Log
{
public string Message { get; set; }
public LogSeverity Severity { get; set; }
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models.Remote
{
public class Game
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("revision")]
public int Revision { get; set; }
[JsonPropertyName("hash")]
public string Hash { get; set; }
[JsonPropertyName("last_update")]
public string LastUpdate { get; set; }
[JsonPropertyName("available")]
public bool Available { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models.Remote
{
public class GameUploadToken
{
[JsonPropertyName("upload_token")]
public string UploadToken { get; set; }
[JsonPropertyName("expire")]
public string Expire { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models.Remote
{
public class LockError
{
[JsonPropertyName("message")]
public string Message { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models.Remote
{
public class NewGameInfo
{
[JsonPropertyName("name")]
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OpenSaveCloudClient.Models.Remote
{
public class UploadGameInfo
{
[JsonPropertyName("game_id")]
public int GameId { get; set; }
}
}