-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into pre-release
- Loading branch information
Showing
54 changed files
with
218 additions
and
3,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.IO; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Logging; | ||
using Wabbajack.CLI.Builder; | ||
using Wabbajack.Downloaders.ModDB; | ||
using Wabbajack.Networking.Http.Interfaces; | ||
|
||
namespace Wabbajack.CLI.Verbs; | ||
|
||
public class MegaLogin | ||
{ | ||
private readonly ILogger<MegaLogin> _logger; | ||
|
||
public MegaLogin(ILogger<MegaLogin> logger, ITokenProvider<MegaToken> tokenProvider) | ||
{ | ||
_logger = logger; | ||
_tokenProvider = tokenProvider; | ||
} | ||
|
||
public static VerbDefinition Definition = new VerbDefinition("mega-login", | ||
"Hashes a file with Wabbajack's hashing routines", new[] | ||
{ | ||
new OptionDefinition(typeof(string), "e", "email", "Email for the user account"), | ||
new OptionDefinition(typeof(string), "p", "password", "Password for the user account"), | ||
}); | ||
|
||
private readonly ITokenProvider<MegaToken> _tokenProvider; | ||
|
||
public async Task<int> Run(string email, string password) | ||
{ | ||
_logger.LogInformation("Logging into Mega"); | ||
await _tokenProvider.SetToken(new MegaToken | ||
{ | ||
Email = email, | ||
Password = password | ||
}); | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Wabbajack.Downloaders.ModDB; | ||
|
||
public class MegaToken | ||
{ | ||
[JsonPropertyName("email")] | ||
public string Email { get; set; } | ||
|
||
[JsonPropertyName("password")] | ||
public string Password { get; set; } | ||
} |
Oops, something went wrong.