mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-13 16:51:29 -07:00
Reorganize models
This commit is contained in:
parent
c58a8ab739
commit
0b20720fdb
@ -3,7 +3,6 @@ global using System.Collections.Generic;
|
||||
global using System.Diagnostics;
|
||||
global using System.Globalization;
|
||||
global using System.IO;
|
||||
global using System.IO.Compression;
|
||||
global using System.Text;
|
||||
global using System.Text.Json;
|
||||
global using System.Text.Json.Serialization;
|
||||
@ -18,10 +17,16 @@ global using Bloxstrap.Enums;
|
||||
global using Bloxstrap.Exceptions;
|
||||
global using Bloxstrap.Extensions;
|
||||
global using Bloxstrap.Models;
|
||||
global using Bloxstrap.Models.APIs.Config;
|
||||
global using Bloxstrap.Models.APIs.GitHub;
|
||||
global using Bloxstrap.Models.APIs.Roblox;
|
||||
global using Bloxstrap.Models.Attributes;
|
||||
global using Bloxstrap.Models.BloxstrapRPC;
|
||||
global using Bloxstrap.Models.RobloxApi;
|
||||
global using Bloxstrap.Models.Entities;
|
||||
global using Bloxstrap.Models.Manifest;
|
||||
global using Bloxstrap.Models.Persistable;
|
||||
global using Bloxstrap.Models.SettingTasks;
|
||||
global using Bloxstrap.Models.SettingTasks.Base;
|
||||
global using Bloxstrap.Resources;
|
||||
global using Bloxstrap.UI;
|
||||
global using Bloxstrap.Utility;
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs.Config
|
||||
{
|
||||
public class Supporter
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs.Config
|
||||
{
|
||||
public class SupporterData
|
||||
{
|
8
Bloxstrap/Models/APIs/GitHub/GitHubReleaseAsset.cs
Normal file
8
Bloxstrap/Models/APIs/GitHub/GitHubReleaseAsset.cs
Normal file
@ -0,0 +1,8 @@
|
||||
public class GithubReleaseAsset
|
||||
{
|
||||
[JsonPropertyName("browser_download_url")]
|
||||
public string BrowserDownloadUrl { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = null!;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs.GitHub
|
||||
{
|
||||
public class GithubRelease
|
||||
{
|
||||
@ -17,13 +17,4 @@
|
||||
[JsonPropertyName("assets")]
|
||||
public List<GithubReleaseAsset>? Assets { get; set; }
|
||||
}
|
||||
|
||||
public class GithubReleaseAsset
|
||||
{
|
||||
[JsonPropertyName("browser_download_url")]
|
||||
public string BrowserDownloadUrl { get; set; } = null!;
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = null!;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs
|
||||
{
|
||||
public class IPInfoResponse
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models.RobloxApi
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
/// <summary>
|
||||
/// Roblox.Web.WebAPI.Models.ApiArrayResponse
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
public class ClientFlagSettings
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
public class ClientVersion
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models.RobloxApi
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
/// <summary>
|
||||
/// Roblox.Games.Api.Models.Response.GameCreator
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models.RobloxApi
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
|
||||
/// <summary>
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models.RobloxApi
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
/// <summary>
|
||||
/// Roblox.Web.Responses.Thumbnails.ThumbnailResponse
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models.RobloxApi
|
||||
namespace Bloxstrap.Models.APIs.Roblox
|
||||
{
|
||||
// lmao its just one property
|
||||
public class UniverseIdResponse
|
@ -1,10 +1,10 @@
|
||||
using System.Web;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
using Bloxstrap.Models.APIs;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Entities
|
||||
{
|
||||
public class ActivityData
|
||||
{
|
||||
@ -28,16 +28,16 @@ namespace Bloxstrap.Models
|
||||
|
||||
public long PlaceId { get; set; } = 0;
|
||||
|
||||
public string JobId { get; set; } = String.Empty;
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// This will be empty unless the server joined is a private server
|
||||
/// </summary>
|
||||
public string AccessCode { get; set; } = String.Empty;
|
||||
public string AccessCode { get; set; } = string.Empty;
|
||||
|
||||
public string MachineAddress { get; set; } = String.Empty;
|
||||
public string MachineAddress { get; set; } = string.Empty;
|
||||
|
||||
public bool MachineAddressValid => !String.IsNullOrEmpty(MachineAddress) && !MachineAddress.StartsWith("10.");
|
||||
public bool MachineAddressValid => !string.IsNullOrEmpty(MachineAddress) && !MachineAddress.StartsWith("10.");
|
||||
|
||||
public bool IsTeleport { get; set; } = false;
|
||||
|
||||
@ -52,7 +52,7 @@ namespace Bloxstrap.Models
|
||||
/// <summary>
|
||||
/// This is intended only for other people to use, i.e. context menu invite link, rich presence joining
|
||||
/// </summary>
|
||||
public string RPCLaunchData { get; set; } = String.Empty;
|
||||
public string RPCLaunchData { get; set; } = string.Empty;
|
||||
|
||||
public UniverseDetails? UniverseDetails { get; set; }
|
||||
|
||||
@ -60,7 +60,7 @@ namespace Bloxstrap.Models
|
||||
{
|
||||
get
|
||||
{
|
||||
string desc = String.Format("{0} • {1} - {2}", UniverseDetails?.Data.Creator.Name, TimeJoined.ToString("h:mm tt"), TimeLeft?.ToString("h:mm tt"));
|
||||
string desc = string.Format("{0} • {1} - {2}", UniverseDetails?.Data.Creator.Name, TimeJoined.ToString("h:mm tt"), TimeLeft?.ToString("h:mm tt"));
|
||||
|
||||
if (ServerType != ServerType.Public)
|
||||
desc += " • " + ServerType.ToTranslatedString();
|
||||
@ -82,7 +82,7 @@ namespace Bloxstrap.Models
|
||||
else
|
||||
deeplink += "&gameInstanceId=" + JobId;
|
||||
|
||||
if (launchData && !String.IsNullOrEmpty(RPCLaunchData))
|
||||
if (launchData && !string.IsNullOrEmpty(RPCLaunchData))
|
||||
deeplink += "&launchData=" + HttpUtility.UrlEncode(RPCLaunchData);
|
||||
|
||||
return deeplink;
|
||||
@ -107,7 +107,7 @@ namespace Bloxstrap.Models
|
||||
{
|
||||
var ipInfo = await Http.GetJson<IPInfoResponse>($"https://ipinfo.io/{MachineAddress}/json");
|
||||
|
||||
if (String.IsNullOrEmpty(ipInfo.City))
|
||||
if (string.IsNullOrEmpty(ipInfo.City))
|
||||
throw new InvalidHTTPResponseException("Reported city was blank");
|
||||
|
||||
if (ipInfo.City == ipInfo.Region)
|
||||
@ -127,7 +127,7 @@ namespace Bloxstrap.Models
|
||||
serverQuerySemaphore.Release();
|
||||
|
||||
Frontend.ShowConnectivityDialog(
|
||||
String.Format(Strings.Dialog_Connectivity_UnableToConnect, "ipinfo.io"),
|
||||
string.Format(Strings.Dialog_Connectivity_UnableToConnect, "ipinfo.io"),
|
||||
Strings.ActivityWatcher_LocationQueryFailed,
|
||||
MessageBoxImage.Warning,
|
||||
ex
|
@ -1,7 +1,7 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Entities
|
||||
{
|
||||
public class ModPresetFileData
|
||||
{
|
@ -1,4 +1,6 @@
|
||||
namespace Bloxstrap.Models
|
||||
using Bloxstrap.Models.APIs.Roblox;
|
||||
|
||||
namespace Bloxstrap.Models.Entities
|
||||
{
|
||||
public class UniverseDetails
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Persistable
|
||||
{
|
||||
public class AppState
|
||||
{
|
||||
public string VersionGuid { get; set; } = String.Empty;
|
||||
public string VersionGuid { get; set; } = string.Empty;
|
||||
|
||||
public Dictionary<string, string> PackageHashes { get; set; } = new();
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Persistable
|
||||
{
|
||||
public class Settings
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Persistable
|
||||
{
|
||||
public class State
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Bloxstrap.Models
|
||||
namespace Bloxstrap.Models.Persistable
|
||||
{
|
||||
public class WindowState
|
||||
{
|
@ -1,4 +1,5 @@
|
||||
using Bloxstrap.Models.SettingTasks.Base;
|
||||
using Bloxstrap.Models.Entities;
|
||||
using Bloxstrap.Models.SettingTasks.Base;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Bloxstrap.Models.SettingTasks.Base;
|
||||
using Bloxstrap.Models.Entities;
|
||||
using Bloxstrap.Models.SettingTasks.Base;
|
||||
|
||||
namespace Bloxstrap.Models.SettingTasks
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace Bloxstrap.UI.Elements.Settings
|
||||
/// </summary>
|
||||
public partial class MainWindow : INavigationWindow
|
||||
{
|
||||
private Models.WindowState _state => App.State.Prop.SettingsWindow;
|
||||
private Models.Persistable.WindowState _state => App.State.Prop.SettingsWindow;
|
||||
|
||||
public MainWindow(bool showAlreadyRunningWarning)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user