mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-26 04:15:49 +00:00
Updated Networking classes
This commit is contained in:
@@ -7,7 +7,7 @@ namespace PckStudio.Classes.Networking
|
||||
{
|
||||
class Network
|
||||
{
|
||||
public static string Version = "6.51";
|
||||
public static string Version = Application.ProductVersion;
|
||||
public static bool IsBeta = true;
|
||||
public static bool Portable = false;
|
||||
public static bool NeedsUpdate = false;
|
||||
@@ -21,6 +21,8 @@ namespace PckStudio.Classes.Networking
|
||||
using WebClient wc = new WebClient();
|
||||
try
|
||||
{
|
||||
Update.CheckForUpdate(null); // TODO
|
||||
|
||||
Uri versionUri = new Uri(MainURL, IsBeta ? BetaUpdatePath : UpdatePath);
|
||||
Console.WriteLine(versionUri);
|
||||
string serverVersion = wc.DownloadString(versionUri);
|
||||
|
||||
@@ -7,6 +7,18 @@ using System.Windows.Forms;
|
||||
|
||||
namespace PckStudio.Classes.Networking
|
||||
{
|
||||
public enum UpdateResult
|
||||
{
|
||||
// Base Failure value
|
||||
Failure = -1,
|
||||
// Base Success value
|
||||
Success,
|
||||
|
||||
UpdateAvailable,
|
||||
|
||||
UpdateFailure,
|
||||
}
|
||||
|
||||
class UpdateOptions
|
||||
{
|
||||
public bool IsBeta { get; set; }
|
||||
@@ -35,6 +47,12 @@ namespace PckStudio.Classes.Networking
|
||||
|
||||
static class Update
|
||||
{
|
||||
public static UpdateResult CheckForUpdate(UpdateOptions options)
|
||||
{
|
||||
// TODO: implement this
|
||||
return UpdateResult.Failure;
|
||||
}
|
||||
|
||||
public static void UpdateProgram(UpdateOptions options)
|
||||
{
|
||||
string updateURL = options.Domain;
|
||||
|
||||
Reference in New Issue
Block a user