Skip to content

Commit

Permalink
Merge pull request #61 from seionmoya/small-tweaks
Browse files Browse the repository at this point in the history
Small tweaks
  • Loading branch information
seionmoya authored Oct 2, 2024
2 parents d888318 + a51f162 commit 95d9fd0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Fuyu.Backend.Core/Services/AccountValidationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static partial class AccountValidationService
// NOTE: regex has no length constraint as the validation method
// contains it instead.
// -- seionmoya, 2024/09/08
[GeneratedRegex("^[a-zA-Z0-9]{0,}$")]
[GeneratedRegex("^[a-zA-Z0-9_-]{0,}$")]
private static partial Regex UsernameRegex();

// compile-time generated regex
Expand Down
4 changes: 4 additions & 0 deletions Fuyu.Backend/Fuyu.Backend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
<ProjectReference Include="../Fuyu.Backend.EFT/Fuyu.Backend.EFT.csproj" />
</ItemGroup>

<Target Name="PostClean" AfterTargets="Clean">
<RemoveDir Directories="$(BaseOutputPath)" />
</Target>

</Project>
8 changes: 4 additions & 4 deletions Fuyu.Launcher/Pages/Login.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<MudPaper Class="pa-4" Elevation="4">
<MudForm @ref="_form" @bind-IsValid="@_success" @bind-Errors="@_errors" Spacing="4">
<MudTextField @bind-Value="_username" Label="Username" Required="true" RequiredError="User name is required!" />
<MudTextField @bind-Value="_password" Label="Password" Required="true" RequiredError="Password is required!" InputType="InputType.Password" />
<MudTextField @bind-Value="_username" Label="Username" Required="true" RequiredError="Required" />
<MudTextField @bind-Value="_password" Label="Password" Required="true" RequiredError="Required" InputType="InputType.Password" />
<div class="d-flex align-center justify-center mt-6">
<MudButton Variant="Variant.Filled" Color="Color.Tertiary" Disabled="@(!_success)" OnClick="Login_Clicked">Login</MudButton>
</div>
Expand Down Expand Up @@ -64,11 +64,11 @@
break;

case ELoginStatus.AccountBanned:
Snackbar.Add("Account is banned!", Severity.Warning);
Snackbar.Add("Account is banned.", Severity.Warning);
break;

case ELoginStatus.AccountNotFound:
Snackbar.Add("Account not found!", Severity.Warning);
Snackbar.Add("Account not found.", Severity.Warning);
break;

case ELoginStatus.SessionAlreadyExists:
Expand Down
28 changes: 14 additions & 14 deletions Fuyu.Launcher/Pages/Register.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
<MudStack Style="width: 400px;">
<MudPaper Class="pa-4" Elevation="4">
<MudText Typo="Typo.body1">Register</MudText>
<MudText Typo="Typo.body2">Choose your username, password and game edition.</MudText>
<MudText Typo="Typo.body2">Choose your account credentials.</MudText>
</MudPaper>

<MudPaper Class="pa-4" Elevation="4">
<MudForm @ref="_form" @bind-IsValid="@_success" @bind-Errors="@_errors">
<MudTextField @bind-Value="_username" Label="Username" Required="true" RequiredError="User name is required!" />
<MudTextField @bind-Value="_password" Label="Password" Required="true" RequiredError="Password is required!"
<MudTextField @bind-Value="_username" Label="Username" Required="true" RequiredError="Required" />
<MudTextField @bind-Value="_password" Label="Password" Required="true" RequiredError="Required"
InputType="InputType.Password"
HelperText="Choose a strong password" />
<MudTextField T="string" Label="Repeat the Password" InputType="InputType.Password" Validation="@(new Func<string, string>(PasswordMatch))" />
<MudTextField T="string" Label="Repeat the Password" Required="true" InputType="InputType.Password" Validation="@(new Func<string, string>(PasswordMatch))" />
<div class="d-flex align-center justify-center mt-6">
<MudButton Variant="Variant.Filled" Color="Color.Tertiary" Disabled="@(!_success)" OnClick="Register_Clicked">Register</MudButton>
</div>
Expand Down Expand Up @@ -61,43 +61,43 @@
switch (status)
{
case ERegisterStatus.Success:
Snackbar.Add("Account registered successfully. You can now login!", Severity.Success);
Snackbar.Add("Account registered successfully. You can now login.", Severity.Success);
Navigation.NavigateTo("/login");
break;

case ERegisterStatus.AlreadyExists:
Snackbar.Add("Account already exists!", Severity.Warning);
Snackbar.Add("Account already exists.", Severity.Warning);
break;

case ERegisterStatus.PasswordInvalid:
Snackbar.Add("Password doesn't meet the requirements!", Severity.Warning);
Snackbar.Add("Password doesn't meet the requirements.", Severity.Warning);
break;

case ERegisterStatus.PasswordTooLong:
Snackbar.Add("Password too long!", Severity.Warning);
Snackbar.Add("Password too long.", Severity.Warning);
break;
case ERegisterStatus.PasswordTooShort:
Snackbar.Add("Password too short!", Severity.Warning);
Snackbar.Add("Password too short.", Severity.Warning);
break;

case ERegisterStatus.PasswordEmpty:
Snackbar.Add("Didn't receive a password!", Severity.Warning);
Snackbar.Add("Didn't receive a password.", Severity.Warning);
break;

case ERegisterStatus.UsernameInvalid:
Snackbar.Add("Username contains invalid characters!", Severity.Warning);
Snackbar.Add("Username contains invalid characters.", Severity.Warning);
break;

case ERegisterStatus.UsernameTooLong:
Snackbar.Add("Username too long!", Severity.Warning);
Snackbar.Add("Username too long.", Severity.Warning);
break;

case ERegisterStatus.UsernameTooShort:
Snackbar.Add("Username too short!", Severity.Warning);
Snackbar.Add("Username too short.", Severity.Warning);
break;

case ERegisterStatus.UsernameEmpty:
Snackbar.Add("Didn't receive a username!", Severity.Warning);
Snackbar.Add("Didn't receive a username.", Severity.Warning);
break;

}
Expand Down
3 changes: 2 additions & 1 deletion Fuyu.Launcher/Store/GamesUseCase/Effects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ namespace Fuyu.Launcher.Store.GamesUseCase
public class Effects
{
[EffectMethod]
public async Task HandleGetGamesAction(GetGamesAction action, IDispatcher dispatcher)
public Task HandleGetGamesAction(GetGamesAction action, IDispatcher dispatcher)
{
var games = RequestService.GetGames();
dispatcher.Dispatch(new GetGamesResultAction(games));
return Task.CompletedTask;
}
}
}
Binary file modified Fuyu.Launcher/wwwroot/img/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ SPTarkov.
**Author** | **Reason**
---------- | ----------------------------------
seionmoya | Project creator, main author
thesparta | Most of the launcher code
nexus | Debugging issues inside EFT client

0 comments on commit 95d9fd0

Please sign in to comment.