Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Starlight v2 #25

Draft
wants to merge 105 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
e9f8478
Upload v2 draft
Oct 28, 2022
941ab91
Push v2 draft (build 2)
Nov 3, 2022
c6a8761
Delete abandoned project
Nov 3, 2022
d23bc77
Remove legacy project
Nov 3, 2022
1889d46
Build 3
Nov 11, 2022
bdf4bda
Run code cleanup
Nov 12, 2022
cda0a06
Refactor Session.cs
Nov 12, 2022
bbe36f4
Refactor JoinRequest.cs and add method for Session.cs
Nov 12, 2022
c72799d
Refactor RbxUser.cs + modify Session.cs documentation
Nov 12, 2022
f16f88e
Refactor pages
Nov 12, 2022
2fa84d7
Refactor AuthType.cs
Nov 12, 2022
6524893
Refactor JoinResponse.cs
Nov 12, 2022
2eb6646
Refactor JoinScript.cs
Nov 12, 2022
73ddb9e
Refactor JoinStatus.cs
Nov 12, 2022
9dce6f8
Refactor JoinType.cs
Nov 12, 2022
2f4dfe3
Refactor UdmuxEndpoint.cs
Nov 12, 2022
1450ba3
Remove exceptions
Nov 12, 2022
bfb9d13
Refactor Bootstrapper.cs
Nov 13, 2022
7453ef7
Refactor Client.cs
Nov 13, 2022
b56f7b7
Refactor ClientScope.cs
Nov 13, 2022
152188f
Revert "Refactor ClientScope.cs"
Nov 13, 2022
e96846f
Refactor ClientScope.cs
Nov 13, 2022
20dd214
Refactor Downloadable.cs
Nov 13, 2022
77935da
Refactor InstallConfig.cs
Nov 13, 2022
517d832
Refactor Utility.cs
Nov 13, 2022
965d373
Refactor Launch.cs and merge PostLaunch and SchemeLaunch with Launch
Nov 13, 2022
6e77c26
Add documentation for Launcher.cs
Nov 13, 2022
86ea471
Add documentation for Launcher.cs
Nov 13, 2022
736602d
Add login method with AuthType support
Nov 13, 2022
6054cc6
Bug fix in cultures
Nov 13, 2022
c4d6858
Refactor LaunchParams.cs
Nov 13, 2022
3280018
Refactor ClientInstance.cs
Nov 13, 2022
4cc4a6b
Refactor ProgressTracker.cs
Nov 13, 2022
d5f1a39
Refactor AsyncHelpers.cs and Shared.cs
Nov 13, 2022
ec61ed5
Refactor Plugins
Nov 13, 2022
aa37536
Fix an error in documentation
Nov 13, 2022
537fde8
CancellationToken support for Session.cs
Nov 13, 2022
2c0895f
CancellationToken support for Page.cs
Nov 13, 2022
e7ee698
CancellationToken support for Utility.cs
Nov 13, 2022
dd06440
CancellationToken support for Bootstrapper.cs
Nov 13, 2022
c821a01
Remove .editorconfig
Nov 13, 2022
7b7b357
Add .gitattributes
Nov 13, 2022
a2ffc01
CancellationToken support for Client.cs
Nov 13, 2022
94eeeff
CancellationToken support for Downloadable.cs
Nov 13, 2022
279a399
CancellationToken support for Launcher.cs
Nov 13, 2022
9e81933
CancellationToken support for Launcher.cs
Nov 13, 2022
f85bb05
Documentation for ParseResultFlags.cs
Nov 13, 2022
a0487fa
Modify Scheme.cs
Nov 13, 2022
8a625ff
Review
Nov 13, 2022
1a0d252
Synch. wrappers for Session
Nov 13, 2022
9c23dc4
Remove extension addition to solution file
Nov 13, 2022
cd10fc5
Synch. wrappers for Page
Nov 14, 2022
3856b88
Synch. wrappers for Bootstrapper
Nov 14, 2022
761df7e
Synch. wrappers for Client
Nov 14, 2022
a0ded7f
Synch. wrappers for Downloadable
Nov 14, 2022
80b1d3a
Synch. wrappers for Launcher
Nov 14, 2022
4841eae
Redo exceptions
Nov 14, 2022
d0b9b39
💄 Automated code cleanup
Nov 14, 2022
a601f1f
Bugfixes
Nov 14, 2022
6348b49
Refactor ThumbFollow.cs
Nov 14, 2022
7b2fcf1
XSRF cache bugfix
Nov 14, 2022
27302c1
Fix bugs
Nov 14, 2022
4005815
Bugfix for task scheduler
Nov 14, 2022
ffeeda8
Review
Nov 14, 2022
a89fb65
Installation script (#23)
Nov 16, 2022
e56b4eb
Review
Nov 20, 2022
2a877c1
Migrate from ClientScope to direct path
Nov 20, 2022
9755fe3
Make plugins run async code
Nov 20, 2022
1d9d7c3
Installation script updates
Nov 20, 2022
ae76e39
Update app
Nov 20, 2022
650156b
Remove documentation
Nov 20, 2022
9513adb
Update projects
Nov 20, 2022
c14ee4e
Remove COM reference
Nov 20, 2022
16235ba
Fix signature problem
Nov 20, 2022
291e5ab
Move to .NET 6.0
Nov 20, 2022
cee1b8d
Compatibility
Nov 20, 2022
2160853
Build 4
Nov 20, 2022
e57f089
Review PluginSdk.cs
Nov 20, 2022
5bf5bbf
Migrate to AppVeyor
Nov 20, 2022
3903840
Comply with CodeFactor
Nov 20, 2022
68da90b
💄 Format code
Nov 20, 2022
b8ec802
Fix dependencies for Starlight.App
Nov 20, 2022
a0f9362
Fix debug-only build
Nov 20, 2022
8f8ca1b
Gitpod
reversed-coffee Dec 2, 2022
4af5d3a
Clean up temporary files
reversed-coffee Dec 2, 2022
8380e38
Fix Gitpod dockerfile/workspace
reversed-coffee Dec 2, 2022
d847e27
Fix appveyor configuration
reversed-coffee Dec 2, 2022
915f1ef
Use official Docker image
reversed-coffee Dec 2, 2022
4679da5
Linux build support
reversed-coffee Dec 2, 2022
d062e96
Update README.md
reversed-coffee Dec 2, 2022
353e2ec
Commit filtering and formatting
reversed-coffee Dec 2, 2022
83ed13f
Update bundle artifact name
Dec 2, 2022
163e9b5
Update artifact name
Dec 2, 2022
4d45a3a
Enforce new code style
Dec 2, 2022
b7a57b4
Whitespace issues
Dec 3, 2022
46d9f18
Update editorconfig and fix auto-refactoring bug
Dec 3, 2022
97ba6ef
Update README.md
Dec 4, 2022
47bdbed
Add exclusion rules
Dec 4, 2022
89f9752
Remove submodules
Dec 9, 2022
6aaa98a
Use newer HackerFramework
Dec 9, 2022
815741c
Use newer HackerFramework
Dec 9, 2022
2196820
Use Thread.Interrupt in favor.
reversed-coffee Jan 9, 2023
9b7cce5
Simplify instance code
reversed-coffee Jan 9, 2023
f453c03
Fix previous 2 commits
reversed-coffee Jan 9, 2023
5620ea2
Push partial
reversed-coffee Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Starlight/Bootstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ public static async Task InstallAsync(Client client, ProgressTracker tracker = n

// Get files
tracker?.Start(2, "Getting files");
var files = await client.GetFiles();
var files = await client.GetFilesAsync();

// Download files
var downloadTracker = tracker?.SubStep(files.Count);

void Download(Downloadable file)
{
downloadTracker?.Step($"Downloading {file.Name}");
file.Download(client.Location);
AsyncHelpers.RunSync(() => file.DownloadAsync(client.Location));
reversed-coffee marked this conversation as resolved.
Show resolved Hide resolved
}

await Utility.DisperseActionsAsync(files, Download, cfg.DownloadConcurrency);
Expand Down
65 changes: 39 additions & 26 deletions src/Starlight/Bootstrap/Downloadable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ namespace Starlight.Bootstrap;

public class Downloadable
{
public readonly string Checksum;

public readonly string Name;

public readonly long Size;

public readonly long TrueSize;
public readonly string VersionHash;

internal Downloadable(string versionHash, string name, string checksum, long size, long trueSize)
{
VersionHash = versionHash;
Expand All @@ -28,31 +19,53 @@ internal Downloadable(string versionHash, string name, string checksum, long siz
Size = size;
}

internal async Task<string> DownloadAsync(string dir)
/// <summary>
/// <para>The MD5 checksum of the file.</para>
/// For more information on MD5:<br/>
/// <see href="https://en.wikipedia.org/wiki/MD5"/>
/// </summary>
public readonly string Checksum;

/// <summary>
/// The name of the file.
/// </summary>
public readonly string Name;

/// <summary>
/// The compressed size of the file.
/// </summary>
public readonly long Size;

/// <summary>
/// The uncompressed size of the file.
/// </summary>
public readonly long TrueSize;

/// <summary>
/// The version hash the file is categorized under.
/// </summary>
public readonly string VersionHash;

/// <summary>
/// Download the file to the specified directory.
/// </summary>
/// <param name="dir">The directory to download the file under.</param>
public async Task DownloadAsync(string dir)
{
var filePath = Path.Combine(dir, Name);

using (var web = new HttpClient()) // Multithreading requires a separate client for each thread.
using (var web = new HttpClient())
{
await web.DownloadFileAsync($"http://setup.rbxcdn.com/version-{VersionHash}-{Name}", filePath);
}

if (Validate(filePath))
return filePath;

// yuck delete it
File.Delete(filePath);

var ex = new BadIntegrityException(this);
// TODO: Add logging
throw ex;
}

internal string Download(string dir)
{
return AsyncHelpers.RunSync(() => DownloadAsync(dir));
if (!Validate(filePath))
{
File.Delete(filePath);
throw new NotImplementedException();
}
}

internal bool Validate(string filePath)
{
if (!File.Exists(filePath) || new FileInfo(filePath).Length != Size)
Expand Down