mirror of
https://github.com/JuniorDark/RustyHearts-Launcher.git
synced 2026-05-07 05:21:44 -04:00
Changes for RustyHearts-API 1.3.0
This commit is contained in:
parent
558761943e
commit
1692923e18
14 changed files with 500 additions and 226 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using RHLauncher.RHLauncher.Helper;
|
using Newtonsoft.Json;
|
||||||
|
using RHLauncher.RHLauncher.Helper;
|
||||||
using RHLauncher.RHLauncher.i8n;
|
using RHLauncher.RHLauncher.i8n;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
|
@ -8,10 +9,10 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
private RegistryHandler registryHandler = new();
|
private RegistryHandler registryHandler = new();
|
||||||
|
|
||||||
public string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl;
|
private readonly string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl;
|
||||||
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
private readonly string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
||||||
public string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl;
|
private readonly string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl;
|
||||||
public string Lang = Configuration.Default.Lang;
|
private readonly string Lang = Configuration.Default.Lang;
|
||||||
private List<Button>? buttons;
|
private List<Button>? buttons;
|
||||||
private List<ImageList>? imageLists;
|
private List<ImageList>? imageLists;
|
||||||
private Dictionary<string, List<ImageList>>? languageImageLists;
|
private Dictionary<string, List<ImageList>>? languageImageLists;
|
||||||
|
|
@ -54,16 +55,16 @@ namespace RHLauncher
|
||||||
private void LoadLocalizedStrings()
|
private void LoadLocalizedStrings()
|
||||||
{
|
{
|
||||||
// Initialize buttons and image lists
|
// Initialize buttons and image lists
|
||||||
buttons = new List<Button> { ContinueButtonS1, SendEmailButton, OkButtonS2 };
|
buttons = [ContinueButtonS1, SendEmailButton, OkButtonS2];
|
||||||
imageLists = new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn };
|
imageLists = [imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn];
|
||||||
|
|
||||||
// Initialize language-specific image lists
|
// Initialize language-specific image lists
|
||||||
languageImageLists = new Dictionary<string, List<ImageList>>
|
languageImageLists = new Dictionary<string, List<ImageList>>
|
||||||
{
|
{
|
||||||
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn } }, // English image lists
|
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn } }, // English image lists
|
||||||
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListOKBtn_ko } }, // Korean image lists
|
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListOKBtn_ko } }, // Korean image lists
|
||||||
// Add other languages and their respective image lists here
|
// Add other languages and their respective image lists here
|
||||||
};
|
};
|
||||||
|
|
||||||
// Load the appropriate resource file based on the selected language
|
// Load the appropriate resource file based on the selected language
|
||||||
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
|
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
|
||||||
|
|
@ -91,12 +92,12 @@ namespace RHLauncher
|
||||||
private async Task<string> SendEmailRequestAsync()
|
private async Task<string> SendEmailRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(SendPasswordCodeUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(SendPasswordCodeUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
|
|
||||||
}));
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,45 +105,59 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
Invoke((MethodInvoker)(() =>
|
Invoke((MethodInvoker)(() =>
|
||||||
{
|
{
|
||||||
switch (response)
|
try
|
||||||
{
|
{
|
||||||
case "EmailSent":
|
HttpResponse? httpResponse = JsonConvert.DeserializeObject<HttpResponse>(response);
|
||||||
SendEmailButton.Enabled = false;
|
|
||||||
resendTimer.Start();
|
if (httpResponse == null)
|
||||||
break;
|
{
|
||||||
case "ValidVerificationCode":
|
MsgBoxForm.Show(LocalizedStrings.Error + $": {LocalizedStrings.HttpResponseNull}", LocalizedStrings.Error);
|
||||||
// Hide the firs panel and show the second panel
|
|
||||||
Stage1Panel.Visible = false;
|
|
||||||
Stage2Panel.Visible = true;
|
|
||||||
EmailLabelS2.Text = EmailTextBox.Text;
|
|
||||||
CodeDescLabel.Text = "";
|
|
||||||
CodePictureBox.Image = imageListTips.Images[1];
|
|
||||||
break;
|
|
||||||
case "PasswordChanged":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.PasswordChanged, LocalizedStrings.Success);
|
|
||||||
OnPasswordChanged();
|
|
||||||
break;
|
|
||||||
case "SamePassword":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.SamePassword, LocalizedStrings.Failed);
|
|
||||||
break;
|
|
||||||
case "AccountNotFound":
|
|
||||||
EmailDescLabel.Text = LocalizedStrings.AccountNotFound;
|
|
||||||
EmailDescLabel.ForeColor = Color.Red;
|
|
||||||
EmailPictureBox.Image = imageListTips.Images[0];
|
|
||||||
return;
|
return;
|
||||||
case "InvalidVerificationCode":
|
}
|
||||||
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
|
|
||||||
CodeDescLabel.ForeColor = Color.Red;
|
switch (httpResponse.Result)
|
||||||
CodePictureBox.Image = imageListTips.Images[0];
|
{
|
||||||
return;
|
case "EmailSent":
|
||||||
case "ExpiredVerificationCode":
|
SendEmailButton.Enabled = false;
|
||||||
CodeDescLabel.Text = LocalizedStrings.ExpiredVerificationCode;
|
resendTimer.Start();
|
||||||
CodeDescLabel.ForeColor = Color.Red;
|
break;
|
||||||
CodePictureBox.Image = imageListTips.Images[0];
|
case "ValidVerificationCode":
|
||||||
return;
|
Stage1Panel.Visible = false;
|
||||||
default:
|
Stage2Panel.Visible = true;
|
||||||
MsgBoxForm.Show("Error:" + response, LocalizedStrings.Error);
|
EmailLabelS2.Text = EmailTextBox.Text;
|
||||||
break;
|
CodeDescLabel.Text = "";
|
||||||
|
CodePictureBox.Image = imageListTips.Images[1];
|
||||||
|
break;
|
||||||
|
case "PasswordChanged":
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.PasswordChanged, LocalizedStrings.Success);
|
||||||
|
OnPasswordChanged();
|
||||||
|
break;
|
||||||
|
case "SamePassword":
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.SamePassword, LocalizedStrings.Failed);
|
||||||
|
break;
|
||||||
|
case "AccountNotFound":
|
||||||
|
EmailDescLabel.Text = LocalizedStrings.AccountNotFound;
|
||||||
|
EmailDescLabel.ForeColor = Color.Red;
|
||||||
|
EmailPictureBox.Image = imageListTips.Images[0];
|
||||||
|
break;
|
||||||
|
case "InvalidVerificationCode":
|
||||||
|
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
|
||||||
|
CodeDescLabel.ForeColor = Color.Red;
|
||||||
|
CodePictureBox.Image = imageListTips.Images[0];
|
||||||
|
break;
|
||||||
|
case "ExpiredVerificationCode":
|
||||||
|
CodeDescLabel.Text = LocalizedStrings.ExpiredVerificationCode;
|
||||||
|
CodeDescLabel.ForeColor = Color.Red;
|
||||||
|
CodePictureBox.Image = imageListTips.Images[0];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
MsgBoxForm.Show($"{LocalizedStrings.Error}: " + httpResponse.Message, LocalizedStrings.Error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (JsonException)
|
||||||
|
{
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.Error + $": {LocalizedStrings.HttpResponseParseError}", LocalizedStrings.Error);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
@ -167,28 +182,28 @@ namespace RHLauncher
|
||||||
private async Task<string> VerifyCodeSendRequestAsync()
|
private async Task<string> VerifyCodeSendRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
new KeyValuePair<string, string>("verificationCode", CodeTextBox.Text),
|
||||||
new KeyValuePair<string, string>("verification_code_type", "Password"),
|
new KeyValuePair<string, string>("verificationCodeType", "Password"),
|
||||||
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> ChangePasswordSendRequestAsync()
|
private async Task<string> ChangePasswordSendRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(ChangePasswordUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(ChangePasswordUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text),
|
new KeyValuePair<string, string>("password", PasswordTextBox.Text),
|
||||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
new KeyValuePair<string, string>("verificationCode", CodeTextBox.Text),
|
||||||
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -325,7 +340,7 @@ namespace RHLauncher
|
||||||
string password = PasswordTextBox.Text;
|
string password = PasswordTextBox.Text;
|
||||||
|
|
||||||
// Check for minimum length and maximum length
|
// Check for minimum length and maximum length
|
||||||
if (password.Length < 6 || password.Length > 16)
|
if (password.Length < 8 || password.Length > 16)
|
||||||
{
|
{
|
||||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
||||||
PwdDescLabel.ForeColor = Color.Red;
|
PwdDescLabel.ForeColor = Color.Red;
|
||||||
|
|
|
||||||
40
RHLauncher.Forms/ConfigForm.Designer.cs
generated
40
RHLauncher.Forms/ConfigForm.Designer.cs
generated
|
|
@ -40,6 +40,8 @@
|
||||||
OkButton = new Button();
|
OkButton = new Button();
|
||||||
VersionLabel = new Label();
|
VersionLabel = new Label();
|
||||||
toolTip = new ToolTip(components);
|
toolTip = new ToolTip(components);
|
||||||
|
ServiceLabel = new Label();
|
||||||
|
cbLauncherService = new ComboBox();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// CloseButton
|
// CloseButton
|
||||||
|
|
@ -88,7 +90,7 @@
|
||||||
TitleLabel.AutoEllipsis = true;
|
TitleLabel.AutoEllipsis = true;
|
||||||
TitleLabel.AutoSize = true;
|
TitleLabel.AutoSize = true;
|
||||||
TitleLabel.BackColor = Color.Transparent;
|
TitleLabel.BackColor = Color.Transparent;
|
||||||
TitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
TitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
|
||||||
TitleLabel.ForeColor = Color.White;
|
TitleLabel.ForeColor = Color.White;
|
||||||
TitleLabel.ImageAlign = ContentAlignment.TopRight;
|
TitleLabel.ImageAlign = ContentAlignment.TopRight;
|
||||||
TitleLabel.ImeMode = ImeMode.NoControl;
|
TitleLabel.ImeMode = ImeMode.NoControl;
|
||||||
|
|
@ -125,7 +127,7 @@
|
||||||
LanguageLabel.AutoEllipsis = true;
|
LanguageLabel.AutoEllipsis = true;
|
||||||
LanguageLabel.AutoSize = true;
|
LanguageLabel.AutoSize = true;
|
||||||
LanguageLabel.BackColor = Color.Transparent;
|
LanguageLabel.BackColor = Color.Transparent;
|
||||||
LanguageLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
LanguageLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
|
||||||
LanguageLabel.ForeColor = Color.White;
|
LanguageLabel.ForeColor = Color.White;
|
||||||
LanguageLabel.ImageAlign = ContentAlignment.TopRight;
|
LanguageLabel.ImageAlign = ContentAlignment.TopRight;
|
||||||
LanguageLabel.ImeMode = ImeMode.NoControl;
|
LanguageLabel.ImeMode = ImeMode.NoControl;
|
||||||
|
|
@ -161,7 +163,7 @@
|
||||||
VersionLabel.AutoSize = true;
|
VersionLabel.AutoSize = true;
|
||||||
VersionLabel.BackColor = Color.Transparent;
|
VersionLabel.BackColor = Color.Transparent;
|
||||||
VersionLabel.Cursor = Cursors.Hand;
|
VersionLabel.Cursor = Cursors.Hand;
|
||||||
VersionLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
VersionLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold);
|
||||||
VersionLabel.ForeColor = Color.White;
|
VersionLabel.ForeColor = Color.White;
|
||||||
VersionLabel.Location = new Point(5, 248);
|
VersionLabel.Location = new Point(5, 248);
|
||||||
VersionLabel.Name = "VersionLabel";
|
VersionLabel.Name = "VersionLabel";
|
||||||
|
|
@ -171,6 +173,34 @@
|
||||||
toolTip.SetToolTip(VersionLabel, "Click to open github repository");
|
toolTip.SetToolTip(VersionLabel, "Click to open github repository");
|
||||||
VersionLabel.Click += VersionLabel_Click;
|
VersionLabel.Click += VersionLabel_Click;
|
||||||
//
|
//
|
||||||
|
// ServiceLabel
|
||||||
|
//
|
||||||
|
ServiceLabel.Anchor = AnchorStyles.None;
|
||||||
|
ServiceLabel.AutoEllipsis = true;
|
||||||
|
ServiceLabel.AutoSize = true;
|
||||||
|
ServiceLabel.BackColor = Color.Transparent;
|
||||||
|
ServiceLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold);
|
||||||
|
ServiceLabel.ForeColor = Color.White;
|
||||||
|
ServiceLabel.ImageAlign = ContentAlignment.TopRight;
|
||||||
|
ServiceLabel.ImeMode = ImeMode.NoControl;
|
||||||
|
ServiceLabel.Location = new Point(294, 119);
|
||||||
|
ServiceLabel.Name = "ServiceLabel";
|
||||||
|
ServiceLabel.Size = new Size(59, 20);
|
||||||
|
ServiceLabel.TabIndex = 18;
|
||||||
|
ServiceLabel.Text = "Service";
|
||||||
|
ServiceLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
//
|
||||||
|
// cbLauncherService
|
||||||
|
//
|
||||||
|
cbLauncherService.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
cbLauncherService.FormattingEnabled = true;
|
||||||
|
cbLauncherService.Items.AddRange(new object[] { "JPN", "USA", "CHN", "JPN_BETA", "USA_BETA", "CHN_BETA" });
|
||||||
|
cbLauncherService.Location = new Point(254, 142);
|
||||||
|
cbLauncherService.Name = "cbLauncherService";
|
||||||
|
cbLauncherService.Size = new Size(145, 23);
|
||||||
|
cbLauncherService.TabIndex = 17;
|
||||||
|
cbLauncherService.SelectedIndexChanged += CbLauncherService_SelectedIndexChanged;
|
||||||
|
//
|
||||||
// ConfigForm
|
// ConfigForm
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
|
@ -178,6 +208,8 @@
|
||||||
BackColor = Color.Magenta;
|
BackColor = Color.Magenta;
|
||||||
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
|
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
|
||||||
ClientSize = new Size(646, 272);
|
ClientSize = new Size(646, 272);
|
||||||
|
Controls.Add(ServiceLabel);
|
||||||
|
Controls.Add(cbLauncherService);
|
||||||
Controls.Add(VersionLabel);
|
Controls.Add(VersionLabel);
|
||||||
Controls.Add(OkButton);
|
Controls.Add(OkButton);
|
||||||
Controls.Add(LanguageLabel);
|
Controls.Add(LanguageLabel);
|
||||||
|
|
@ -210,5 +242,7 @@
|
||||||
private Button OkButton;
|
private Button OkButton;
|
||||||
private Label VersionLabel;
|
private Label VersionLabel;
|
||||||
private ToolTip toolTip;
|
private ToolTip toolTip;
|
||||||
|
private Label ServiceLabel;
|
||||||
|
private ComboBox cbLauncherService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,27 +1,36 @@
|
||||||
using RHLauncher.RHLauncher.i8n;
|
using RHLauncher.RHLauncher.i8n;
|
||||||
using RHLauncher.RHLauncher.Helper;
|
using RHLauncher.RHLauncher.Helper;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace RHLauncher
|
namespace RHLauncher
|
||||||
{
|
{
|
||||||
public partial class ConfigForm : Form
|
public partial class ConfigForm : Form
|
||||||
{
|
{
|
||||||
public string Url = "https://github.com/JuniorDark/RustyHearts-Launcher";
|
private readonly RegistryHandler registryHandler = new();
|
||||||
|
private readonly string? installDirectory;
|
||||||
|
|
||||||
|
private readonly string Url = "https://github.com/JuniorDark/RustyHearts-Launcher";
|
||||||
|
|
||||||
private bool languageChanged = false;
|
private bool languageChanged = false;
|
||||||
readonly string currentLanguageCode = Configuration.Default.Lang;
|
readonly string currentLanguageCode = Configuration.Default.Lang;
|
||||||
|
|
||||||
|
private bool serviceChanged = false;
|
||||||
|
readonly string currentService = Configuration.Default.Service;
|
||||||
|
|
||||||
public ConfigForm()
|
public ConfigForm()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
installDirectory = registryHandler.GetInstallDirectory();
|
||||||
string currentVersion = GetLauncherVersion.GetVersion();
|
string currentVersion = GetLauncherVersion.GetVersion();
|
||||||
cbLauncherLanguage.SelectedItem = GetLanguageName(currentLanguageCode);
|
cbLauncherLanguage.SelectedItem = GetLanguageName(currentLanguageCode);
|
||||||
|
cbLauncherService.SelectedItem = GetServiceName(currentService);
|
||||||
|
|
||||||
VersionLabel.Text = $"{LocalizedStrings.Version}: {currentVersion}";
|
VersionLabel.Text = $"{LocalizedStrings.Version}: {currentVersion}";
|
||||||
Text = LocalizedStrings.ConfigFormTitle;
|
Text = LocalizedStrings.ConfigFormTitle;
|
||||||
TitleLabel.Text = LocalizedStrings.Settings;
|
TitleLabel.Text = LocalizedStrings.Settings;
|
||||||
LanguageLabel.Text = LocalizedStrings.LauncherLanguage;
|
LanguageLabel.Text = LocalizedStrings.LauncherLanguage;
|
||||||
|
ServiceLabel.Text = LocalizedStrings.Service;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,7 +70,7 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
"English" => "en",
|
"English" => "en",
|
||||||
"한국어" => "ko",
|
"한국어" => "ko",
|
||||||
_ => "en", // default to English if not found
|
_ => "en",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,40 +80,140 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
"en" => "English",
|
"en" => "English",
|
||||||
"ko" => "한국어",
|
"ko" => "한국어",
|
||||||
_ => "English", // default to English if not found
|
_ => "English",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Service Methods
|
||||||
|
|
||||||
|
private void CbLauncherService_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (cbLauncherService.SelectedItem is string selectedItem)
|
||||||
|
{
|
||||||
|
string selectedServiceCode = GetServiceCode(selectedItem);
|
||||||
|
if (selectedServiceCode != currentService)
|
||||||
|
{
|
||||||
|
serviceChanged = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
serviceChanged = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetServiceCode(string? service)
|
||||||
|
{
|
||||||
|
return service switch
|
||||||
|
{
|
||||||
|
"USA" => "usa",
|
||||||
|
"JPN" => "jpn",
|
||||||
|
"CHN" => "chn",
|
||||||
|
"USA_BETA" => "usa_beta",
|
||||||
|
"JPN_BETA" => "jpn_beta",
|
||||||
|
"CHN_BETA" => "chn_beta",
|
||||||
|
_ => "jpn",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetServiceName(string service)
|
||||||
|
{
|
||||||
|
return service switch
|
||||||
|
{
|
||||||
|
"usa" => "USA",
|
||||||
|
"jpn" => "JPN",
|
||||||
|
"chn" => "CHN",
|
||||||
|
"usa_beta" => "USA_BETA",
|
||||||
|
"jpn_beta" => "JPN_BETA",
|
||||||
|
"chn_beta" => "CHN_BETA",
|
||||||
|
_ => "JPN",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateServiceDatFile(string serviceCode)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(installDirectory))
|
||||||
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Compute MD5 hash
|
||||||
|
byte[] inputBytes = Encoding.UTF8.GetBytes(serviceCode);
|
||||||
|
byte[] hashBytes = System.Security.Cryptography.MD5.HashData(inputBytes);
|
||||||
|
|
||||||
|
StringBuilder sb = new();
|
||||||
|
foreach (byte b in hashBytes)
|
||||||
|
{
|
||||||
|
sb.Append(b.ToString("x2")); // Lowercase hex
|
||||||
|
}
|
||||||
|
string hashString = sb.ToString();
|
||||||
|
|
||||||
|
string fileContent = $"{hashString}\r\n\r\nSTAIRWAY GAMES";
|
||||||
|
|
||||||
|
// Write to Service.dat
|
||||||
|
string filePath = Path.Combine(installDirectory, "Service.dat");
|
||||||
|
File.WriteAllText(filePath, fileContent);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Failed to update Service.dat: {ex.Message}", LocalizedStrings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Button Click Events
|
#region Button Click Events
|
||||||
private void OkButton_Click(object sender, EventArgs e)
|
private void OkButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (languageChanged)
|
try
|
||||||
{
|
{
|
||||||
string? selectedLanguage = cbLauncherLanguage.SelectedItem?.ToString();
|
if (languageChanged || serviceChanged)
|
||||||
string languageCode = GetLanguageCode(selectedLanguage);
|
|
||||||
|
|
||||||
if (languageCode != null)
|
|
||||||
{
|
{
|
||||||
// Update the language in the INI file
|
string? selectedService = cbLauncherService.SelectedItem?.ToString();
|
||||||
Configuration.Default.Lang = languageCode;
|
string serviceCode = GetServiceCode(selectedService);
|
||||||
Configuration.Default.iniFile.WriteValue("Launcher", "Lang", languageCode);
|
if (serviceCode != null)
|
||||||
|
|
||||||
DialogResult result = MsgBoxForm.ShowYN(LocalizedStrings.ChangeLanguageMessage, LocalizedStrings.Confirmation);
|
|
||||||
|
|
||||||
if (result == DialogResult.Yes)
|
|
||||||
{
|
{
|
||||||
Invoke((MethodInvoker)(() => Close()));
|
// Update the service in the INI file
|
||||||
Task.Delay(1000).ContinueWith(_ =>
|
Configuration.Default.Service = serviceCode;
|
||||||
{
|
Configuration.Default.iniFile.WriteValue("Info", "Service", serviceCode);
|
||||||
Application.Restart();
|
|
||||||
});
|
UpdateServiceDatFile(serviceCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string? selectedLanguage = cbLauncherLanguage.SelectedItem?.ToString();
|
||||||
|
string languageCode = GetLanguageCode(selectedLanguage);
|
||||||
|
|
||||||
|
if (languageCode != null)
|
||||||
|
{
|
||||||
|
// Update the language in the INI file
|
||||||
|
Configuration.Default.Lang = languageCode;
|
||||||
|
Configuration.Default.iniFile.WriteValue("Launcher", "Lang", languageCode);
|
||||||
|
|
||||||
|
DialogResult result = MsgBoxForm.ShowYN(LocalizedStrings.ChangeLanguageMessage, LocalizedStrings.Confirmation);
|
||||||
|
|
||||||
|
if (result == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
Invoke((MethodInvoker)(() => Close()));
|
||||||
|
Task.Delay(1000).ContinueWith(_ =>
|
||||||
|
{
|
||||||
|
Application.Restart();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Close();
|
MessageBox.Show($"{LocalizedStrings.Error}: {ex.Message}", LocalizedStrings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
||||||
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
||||||
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAA+jYAAAJNU0Z0AUkBTAIBAQMB
|
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAA+jYAAAJNU0Z0AUkBTAIBAQMB
|
||||||
AAHQAQEB0AEBARkBAAEZAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABZAMAARkDAAEBAQABIAUAARAB
|
AAHwAQEB8AEBARkBAAEZAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABZAMAARkDAAEBAQABIAUAARAB
|
||||||
JxIAARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
JxIAARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
||||||
AAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
AAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
||||||
AAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
AAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUCAAH/ARUC
|
||||||
|
|
@ -370,7 +370,7 @@
|
||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
||||||
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
||||||
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAkGEBAAJNU0Z0AUkBTAIBAQMB
|
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAkGEBAAJNU0Z0AUkBTAIBAQMB
|
||||||
AAHAAQIBwAECAWcBAAElAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABnAEBAgABJQMAAQEBAAEgBQAB
|
AAHgAQIB4AECAWcBAAElAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABnAEBAgABJQMAAQEBAAEgBQAB
|
||||||
MAHuEgABJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
MAHuEgABJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
||||||
/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScB
|
/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScB
|
||||||
BwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
BwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
||||||
|
|
@ -1889,7 +1889,7 @@
|
||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
|
||||||
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
|
||||||
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAZGYBAAJNU0Z0AUkBTAIBAQMB
|
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAZGYBAAJNU0Z0AUkBTAIBAQMB
|
||||||
AAHIAQIByAECAWcBAAElAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABnAEBAgABJQMAAQEBAAEgBQAB
|
AAHoAQIB6AECAWcBAAElAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABnAEBAgABJQMAAQEBAAEgBQAB
|
||||||
MAHuEgABJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
MAHuEgABJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
||||||
/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScB
|
/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScB
|
||||||
BwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
BwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB/wEnAQcBAAH/AScBBwEAAf8BJwEHAQAB
|
||||||
|
|
@ -3427,7 +3427,7 @@
|
||||||
<data name="$this.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAoYAAAEQCAIAAACiPyLtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
iVBORw0KGgoAAAANSUhEUgAAAoYAAAEQCAIAAACiPyLtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
|
||||||
EgAACxIB0t1+/AAAJ5dJREFUeF7t3d2zXOV5pnFVZTCCJJXAluJ4QmypW1Bjhw8JBoT4sqfmOJkgnNRk
|
DgAACw4BQL7hQQAAJ5dJREFUeF7t3d2zXOV5pnFVZTCCJJXAluJ4QmypW1Bjhw8JBoT4sqfmOJkgnNRk
|
||||||
bDAIpypnwY4NqTmfkyR/9KzevbV399a1Xt0XYffqg7vqKpX2T0sLzp5aq99Hfe1nH//77Tc++9Frn916
|
bDAIpypnwY4NqTmfkyR/9KzevbV399a1Xt0XYffqg7vqKpX2T0sLzp5aq99Hfe1nH//77Tc++9Frn916
|
||||||
7dOXfvKLv/zJP7w09eN/mH7zl3/1f3746qbpNxv/8b5P+NjP8NTPcHCTCQ95k0v/28Ob7P0Xv91NJjzk
|
7dOXfvKLv/zJP7w09eN/mH7zl3/1f3746qbpNxv/8b5P+NjP8NTPcHCTCQ95k0v/28Ob7P0Xv91NJjzk
|
||||||
TSakm5zht73J3sW7N7n0v33VN5nwP3eTMwxvMuEhb3Lpf3t4k73/4re7yYSHvMmEdJMz/LY32bt49yaX
|
TSakm5zht73J3sW7N7n0v33VN5nwP3eTMwxvMuEhb3Lpf3t4k73/4re7yYSHvMmEdJMz/LY32bt49yaX
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ namespace RHLauncher
|
||||||
public partial class LauncherForm : Form
|
public partial class LauncherForm : Form
|
||||||
{
|
{
|
||||||
private RegistryHandler registryHandler = new();
|
private RegistryHandler registryHandler = new();
|
||||||
public string? installDirectory;
|
private string? installDirectory;
|
||||||
public string? tempInstallDirectory;
|
private string? tempInstallDirectory;
|
||||||
private static readonly string DefaultIniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.ini");
|
private static readonly string DefaultIniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.ini");
|
||||||
private readonly IniFile _iniFile = new(DefaultIniFilePath);
|
private readonly IniFile _iniFile = new(DefaultIniFilePath);
|
||||||
private readonly string _windyCode;
|
private readonly string _windyCode;
|
||||||
|
|
@ -487,10 +487,6 @@ namespace RHLauncher
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ServerStatusResponse
|
|
||||||
{
|
|
||||||
public string? Status { get; set; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Button Click Events
|
#region Button Click Events
|
||||||
|
|
@ -666,10 +662,6 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
Process.Start("explorer.exe", installDirectory);
|
Process.Start("explorer.exe", installDirectory);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -861,9 +853,15 @@ namespace RHLauncher
|
||||||
switch (service.ToLower())
|
switch (service.ToLower())
|
||||||
{
|
{
|
||||||
case "usa":
|
case "usa":
|
||||||
|
case "usa_beta":
|
||||||
arguments = "server=" + Configuration.Default.GateXMLUrl;
|
arguments = "server=" + Configuration.Default.GateXMLUrl;
|
||||||
break;
|
break;
|
||||||
|
case "jpn":
|
||||||
|
case "jpn_beta":
|
||||||
|
arguments = $"-serverurl{Configuration.Default.GateInfoUrl}";
|
||||||
|
break;
|
||||||
case "chn":
|
case "chn":
|
||||||
|
case "chn_beta":
|
||||||
arguments = $"-serverurl{Configuration.Default.GateInfoUrl} id={_windyCode} password={_password}";
|
arguments = $"-serverurl{Configuration.Default.GateInfoUrl} id={_windyCode} password={_password}";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -931,7 +929,7 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
foreach (FileInfo file in directoryInfo.GetFiles())
|
foreach (FileInfo file in directoryInfo.GetFiles())
|
||||||
{
|
{
|
||||||
if (file.Name.ToLower() != "launcher.exe" && file.Name.ToLower() != "config.ini")
|
if (!file.Name.Equals("launcher.exe", StringComparison.CurrentCultureIgnoreCase) && !file.Name.Equals("config.ini", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
file.Delete();
|
file.Delete();
|
||||||
}
|
}
|
||||||
|
|
@ -1056,8 +1054,8 @@ namespace RHLauncher
|
||||||
|
|
||||||
private static Image[] LoadImages()
|
private static Image[] LoadImages()
|
||||||
{
|
{
|
||||||
return new Image[]
|
return
|
||||||
{
|
[
|
||||||
Properties.Resources.character_select_cut_angela,
|
Properties.Resources.character_select_cut_angela,
|
||||||
Properties.Resources.character_select_cut_edgar,
|
Properties.Resources.character_select_cut_edgar,
|
||||||
Properties.Resources.character_select_cut_frantz,
|
Properties.Resources.character_select_cut_frantz,
|
||||||
|
|
@ -1067,7 +1065,7 @@ namespace RHLauncher
|
||||||
Properties.Resources.character_select_cut_natasha,
|
Properties.Resources.character_select_cut_natasha,
|
||||||
Properties.Resources.character_select_cut_roselle,
|
Properties.Resources.character_select_cut_roselle,
|
||||||
Properties.Resources.character_select_cut_tude
|
Properties.Resources.character_select_cut_tude
|
||||||
};
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HidePanel(Panel panel)
|
private static void HidePanel(Panel panel)
|
||||||
|
|
@ -1093,6 +1091,7 @@ namespace RHLauncher
|
||||||
Exception newLogEx = new(errorLog, ex);
|
Exception newLogEx = new(errorLog, ex);
|
||||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
private RegistryHandler registryHandler = new();
|
private RegistryHandler registryHandler = new();
|
||||||
|
|
||||||
public string windyCode = string.Empty;
|
private string windyCode = string.Empty;
|
||||||
public string password = string.Empty;
|
private string password = string.Empty;
|
||||||
public string LoginUrl = Configuration.Default.LoginUrl;
|
private readonly string LoginUrl = Configuration.Default.LoginUrl;
|
||||||
public string Lang = Configuration.Default.Lang;
|
private readonly string Lang = Configuration.Default.Lang;
|
||||||
private List<Button>? buttons;
|
private List<Button>? buttons;
|
||||||
private List<ImageList>? imageLists;
|
private List<ImageList>? imageLists;
|
||||||
private Dictionary<string, List<ImageList>>? languageImageLists;
|
private Dictionary<string, List<ImageList>>? languageImageLists;
|
||||||
|
|
@ -42,8 +42,8 @@ namespace RHLauncher
|
||||||
private void LoadLocalizedStrings()
|
private void LoadLocalizedStrings()
|
||||||
{
|
{
|
||||||
// Initialize buttons and image lists
|
// Initialize buttons and image lists
|
||||||
buttons = new List<Button> { LoginButton, RegisterButton };
|
buttons = [LoginButton, RegisterButton];
|
||||||
imageLists = new List<ImageList> { imageListLogin, imageListRegister };
|
imageLists = [imageListLogin, imageListRegister];
|
||||||
|
|
||||||
// Initialize language-specific image lists
|
// Initialize language-specific image lists
|
||||||
languageImageLists = new Dictionary<string, List<ImageList>>
|
languageImageLists = new Dictionary<string, List<ImageList>>
|
||||||
|
|
@ -171,12 +171,12 @@ namespace RHLauncher
|
||||||
private async Task<string> SendLoginRequestAsync()
|
private async Task<string> SendLoginRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(LoginUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(LoginUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("account", UsernameTextBox.Text),
|
new KeyValuePair<string, string>("account", UsernameTextBox.Text),
|
||||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
|
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
|
||||||
}));
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,52 +184,63 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Dictionary<string, string>? loginResponse = JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
|
var loginResponse = JsonConvert.DeserializeObject<LoginResponse>(response);
|
||||||
|
|
||||||
if (loginResponse != null)
|
if (loginResponse == null)
|
||||||
{
|
{
|
||||||
if (loginResponse.TryGetValue("Result", out var result))
|
MsgBoxForm.Show(LocalizedStrings.Error + $": {LocalizedStrings.HttpResponseNull}", LocalizedStrings.Error);
|
||||||
{
|
return;
|
||||||
switch (result)
|
}
|
||||||
|
|
||||||
|
switch (loginResponse.Result)
|
||||||
|
{
|
||||||
|
case "LoginSuccess":
|
||||||
|
if (!string.IsNullOrEmpty(loginResponse.WindyCode) && !string.IsNullOrEmpty(loginResponse.Token))
|
||||||
{
|
{
|
||||||
case "LoginSuccess":
|
windyCode = loginResponse.WindyCode;
|
||||||
windyCode = loginResponse["WindyCode"];
|
password = loginResponse.Token;
|
||||||
password = loginResponse["Token"];
|
progressBarLogin.Visible = false;
|
||||||
progressBarLogin.Visible = false;
|
Hide();
|
||||||
Hide();
|
notifyIcon.Visible = false;
|
||||||
notifyIcon.Visible = false;
|
LauncherForm launcherForm = new(windyCode, password);
|
||||||
LauncherForm launcherForm = new(windyCode, password);
|
launcherForm.ShowDialog();
|
||||||
launcherForm.ShowDialog();
|
|
||||||
break;
|
|
||||||
case "InvalidCredentials":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.LoginInvalidCredentials, LocalizedStrings.LoginInfoTitle);
|
|
||||||
break;
|
|
||||||
case "InvalidUsernameFormat":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.LoginInvalidUsernameFormat, LocalizedStrings.LoginInfoTitle);
|
|
||||||
break;
|
|
||||||
case "AccountNotFound":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.LoginInvalidCredentials, LocalizedStrings.LoginInfoTitle);
|
|
||||||
break;
|
|
||||||
case "Locked":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.LoginLocked, LocalizedStrings.LoginInfoTitle);
|
|
||||||
break;
|
|
||||||
case "TooManyAttempts":
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.LoginTooManyAttempts, LocalizedStrings.LoginInfoTitle);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
MsgBoxForm.Show(LocalizedStrings.Error + result, LocalizedStrings.Error);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
MsgBoxForm.Show(LocalizedStrings.Error + " Missing token or windyCode.", LocalizedStrings.Error);
|
||||||
MsgBoxForm.Show(LocalizedStrings.Error + "Response does not contain a Result field.", LocalizedStrings.Error);
|
}
|
||||||
}
|
break;
|
||||||
}
|
|
||||||
else
|
case "InvalidCredentials":
|
||||||
{
|
case "AccountNotFound":
|
||||||
MsgBoxForm.Show(LocalizedStrings.Error + "Failed to deserialize the response.", LocalizedStrings.Error);
|
MsgBoxForm.Show(LocalizedStrings.LoginInvalidCredentials, LocalizedStrings.LoginInfoTitle);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Locked":
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.LoginLocked, LocalizedStrings.LoginInfoTitle);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "TooManyAttempts":
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.LoginTooManyAttempts, LocalizedStrings.LoginInfoTitle);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "InvalidRequest":
|
||||||
|
case "ServerError":
|
||||||
|
if (!string.IsNullOrEmpty(loginResponse.Message))
|
||||||
|
{
|
||||||
|
MsgBoxForm.Show(loginResponse.Message, LocalizedStrings.Error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.Error + ": " + loginResponse.Result, LocalizedStrings.Error);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.Error + ": " + loginResponse.Result, LocalizedStrings.Error);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using RHLauncher.RHLauncher.Helper;
|
using Newtonsoft.Json;
|
||||||
|
using RHLauncher.RHLauncher.Helper;
|
||||||
using RHLauncher.RHLauncher.i8n;
|
using RHLauncher.RHLauncher.i8n;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
@ -7,11 +8,11 @@ namespace RHLauncher
|
||||||
{
|
{
|
||||||
public partial class RegisterForm : Form
|
public partial class RegisterForm : Form
|
||||||
{
|
{
|
||||||
public string SendCodeUrl = Configuration.Default.SendCodeUrl;
|
private readonly string SendCodeUrl = Configuration.Default.SendCodeUrl;
|
||||||
public string AgreementUrl = Configuration.Default.AgreementUrl;
|
private readonly string AgreementUrl = Configuration.Default.AgreementUrl;
|
||||||
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
private readonly string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
||||||
public string RegisterUrl = Configuration.Default.RegisterUrl;
|
private readonly string RegisterUrl = Configuration.Default.RegisterUrl;
|
||||||
public string Lang = Configuration.Default.Lang;
|
private readonly string Lang = Configuration.Default.Lang;
|
||||||
private List<Button>? buttons;
|
private List<Button>? buttons;
|
||||||
private List<ImageList>? imageLists;
|
private List<ImageList>? imageLists;
|
||||||
private Dictionary<string, List<ImageList>>? languageImageLists;
|
private Dictionary<string, List<ImageList>>? languageImageLists;
|
||||||
|
|
@ -55,16 +56,16 @@ namespace RHLauncher
|
||||||
private void LoadLocalizedStrings()
|
private void LoadLocalizedStrings()
|
||||||
{
|
{
|
||||||
// Initialize buttons and image lists
|
// Initialize buttons and image lists
|
||||||
buttons = new List<Button> { ContinueButtonS1, SendEmailButton, ContinueButtonS2 };
|
buttons = [ContinueButtonS1, SendEmailButton, ContinueButtonS2];
|
||||||
imageLists = new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn };
|
imageLists = [imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn];
|
||||||
|
|
||||||
// Initialize language-specific image lists
|
// Initialize language-specific image lists
|
||||||
languageImageLists = new Dictionary<string, List<ImageList>>
|
languageImageLists = new Dictionary<string, List<ImageList>>
|
||||||
{
|
{
|
||||||
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn } }, // English image lists
|
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn } }, // English image lists
|
||||||
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListContinueBtn_ko } }, // Korean image lists
|
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListContinueBtn_ko } }, // Korean image lists
|
||||||
// Add other languages and their respective image lists here
|
// Add other languages and their respective image lists here
|
||||||
};
|
};
|
||||||
|
|
||||||
// Load the appropriate resource file based on the selected language
|
// Load the appropriate resource file based on the selected language
|
||||||
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
|
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
|
||||||
|
|
@ -88,18 +89,26 @@ namespace RHLauncher
|
||||||
private async Task<string> SendEmailRequestAsync()
|
private async Task<string> SendEmailRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(SendCodeUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(SendCodeUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
|
|
||||||
}));
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleSendEmailResponse(string response)
|
private void HandleSendEmailResponse(string response)
|
||||||
{
|
{
|
||||||
switch (response)
|
HttpResponse? httpResponse = JsonConvert.DeserializeObject<HttpResponse>(response);
|
||||||
|
|
||||||
|
if (httpResponse == null)
|
||||||
|
{
|
||||||
|
MsgBoxForm.Show(LocalizedStrings.Error + $": {LocalizedStrings.HttpResponseNull}", LocalizedStrings.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (httpResponse.Result)
|
||||||
{
|
{
|
||||||
case "EmailSent":
|
case "EmailSent":
|
||||||
SendEmailButton.Enabled = false;
|
SendEmailButton.Enabled = false;
|
||||||
|
|
@ -107,6 +116,7 @@ namespace RHLauncher
|
||||||
break;
|
break;
|
||||||
case "AccountExists":
|
case "AccountExists":
|
||||||
MsgBoxForm.Show(LocalizedStrings.AccountEmailExists, LocalizedStrings.Info);
|
MsgBoxForm.Show(LocalizedStrings.AccountEmailExists, LocalizedStrings.Info);
|
||||||
|
ResetSendEmailButton();
|
||||||
break;
|
break;
|
||||||
case "ValidVerificationCode":
|
case "ValidVerificationCode":
|
||||||
// Hide the first panel and show the second panel
|
// Hide the first panel and show the second panel
|
||||||
|
|
@ -141,51 +151,65 @@ namespace RHLauncher
|
||||||
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
|
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
|
||||||
if (secondsLeft == 0)
|
if (secondsLeft == 0)
|
||||||
{
|
{
|
||||||
resendTimer.Stop();
|
ResetSendEmailButton();
|
||||||
SendEmailButton.Enabled = true;
|
|
||||||
TimerLabel.Text = "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ResetSendEmailButton()
|
||||||
|
{
|
||||||
|
resendTimer.Stop();
|
||||||
|
SendEmailButton.Enabled = true;
|
||||||
|
TimerLabel.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<string> VerifyCodeSendRequestAsync()
|
private async Task<string> VerifyCodeSendRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
new KeyValuePair<string, string>("verificationCode", CodeTextBox.Text),
|
||||||
new KeyValuePair<string, string>("verification_code_type", "Account"),
|
new KeyValuePair<string, string>("verificationCodeType", "Account"),
|
||||||
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> SendRequestAsync()
|
private async Task<string> SendRequestAsync()
|
||||||
{
|
{
|
||||||
using HttpClient client = new();
|
using HttpClient client = new();
|
||||||
using HttpResponseMessage response = await client.PostAsync(RegisterUrl, new FormUrlEncodedContent(new[]
|
using HttpResponseMessage response = await client.PostAsync(RegisterUrl, new FormUrlEncodedContent(
|
||||||
{
|
[
|
||||||
new KeyValuePair<string, string>("windyCode", UsernameTextBox.Text),
|
new KeyValuePair<string, string>("username", UsernameTextBox.Text),
|
||||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
|
new KeyValuePair<string, string>("password", PasswordTextBox.Text),
|
||||||
}));
|
new KeyValuePair<string, string>("verificationCode", CodeTextBox.Text)
|
||||||
|
]));
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStringAsync();
|
return await response.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleResponse(string response)
|
private void HandleResponse(string response)
|
||||||
{
|
{
|
||||||
switch (response)
|
HttpResponse? accounResponse = JsonConvert.DeserializeObject<HttpResponse>(response);
|
||||||
|
|
||||||
|
if (accounResponse == null)
|
||||||
{
|
{
|
||||||
case "Success":
|
MsgBoxForm.Show(LocalizedStrings.Error + $": {LocalizedStrings.HttpResponseNull}", LocalizedStrings.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (accounResponse.Result)
|
||||||
|
{
|
||||||
|
case "AccountCreated":
|
||||||
MsgBoxForm.Show(LocalizedStrings.AccountCreateSuccess, LocalizedStrings.RegisterWindow);
|
MsgBoxForm.Show(LocalizedStrings.AccountCreateSuccess, LocalizedStrings.RegisterWindow);
|
||||||
Close();
|
Close();
|
||||||
break;
|
break;
|
||||||
case "AccountExists":
|
case "EmailExists":
|
||||||
MsgBoxForm.Show(LocalizedStrings.AccountExists, LocalizedStrings.Info);
|
MsgBoxForm.Show(LocalizedStrings.AccountEmailExists, LocalizedStrings.Info);
|
||||||
break;
|
break;
|
||||||
case "WindyCodeExists":
|
case "UsernameExists":
|
||||||
MsgBoxForm.Show(LocalizedStrings.WindyCodeExists, LocalizedStrings.Error);
|
MsgBoxForm.Show(LocalizedStrings.WindyCodeExists, LocalizedStrings.Error);
|
||||||
break;
|
break;
|
||||||
case "InvalidUserNameFormat":
|
case "InvalidUserNameFormat":
|
||||||
|
|
@ -195,7 +219,7 @@ namespace RHLauncher
|
||||||
MsgBoxForm.Show(LocalizedStrings.InvalidEmailFormat, LocalizedStrings.Error);
|
MsgBoxForm.Show(LocalizedStrings.InvalidEmailFormat, LocalizedStrings.Error);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MsgBoxForm.Show($"{LocalizedStrings.Error}: {response}", LocalizedStrings.Error);
|
MsgBoxForm.Show($"{LocalizedStrings.Error}: " + accounResponse.Message, LocalizedStrings.Error);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -375,7 +399,7 @@ namespace RHLauncher
|
||||||
string password = PasswordTextBox.Text;
|
string password = PasswordTextBox.Text;
|
||||||
|
|
||||||
// Check for minimum length and maximum length
|
// Check for minimum length and maximum length
|
||||||
if (password.Length < 6 || password.Length > 16)
|
if (password.Length < 8 || password.Length > 16)
|
||||||
{
|
{
|
||||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
||||||
PwdDescLabel.ForeColor = Color.Red;
|
PwdDescLabel.ForeColor = Color.Red;
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,20 @@ public class Configuration
|
||||||
|
|
||||||
public Configuration()
|
public Configuration()
|
||||||
{
|
{
|
||||||
string apiUrl = iniFile.ReadValue("Info", "LoginURL");
|
string apiUrl = iniFile.ReadValue("Info", "ServerURL");
|
||||||
|
|
||||||
//Client endpoints
|
//Client endpoints
|
||||||
GateXMLUrl = $"{apiUrl}/serverApi/gateway";
|
GateXMLUrl = $"{apiUrl}/launcher/GetGatewayAction";
|
||||||
GateInfoUrl = $"{apiUrl}/serverApi/gateway/info";
|
GateInfoUrl = $"{apiUrl}/launcher/GetGatewayAction/info";
|
||||||
GateStatusUrl = $"{apiUrl}/serverApi/gateway/status";
|
GateStatusUrl = $"{apiUrl}/launcher/GetGatewayAction/status";
|
||||||
|
|
||||||
//Launcher endpoints
|
//Launcher endpoints
|
||||||
LoginUrl = $"{apiUrl}/accountApi/login";
|
LoginUrl = $"{apiUrl}/launcher/LoginAction";
|
||||||
RegisterUrl = $"{apiUrl}/accountApi/register";
|
RegisterUrl = $"{apiUrl}/launcher/SignupAction";
|
||||||
SendCodeUrl = $"{apiUrl}/accountApi/sendVerificationEmail";
|
SendCodeUrl = $"{apiUrl}/launcher/SendVerificationEmailAction";
|
||||||
VerifyCodeUrl = $"{apiUrl}/accountApi/codeVerification";
|
VerifyCodeUrl = $"{apiUrl}/launcher/VerifyCodeAction";
|
||||||
SendPasswordCodeUrl = $"{apiUrl}/accountApi/sendPasswordResetEmail";
|
SendPasswordCodeUrl = $"{apiUrl}/launcher/SendPasswordResetEmailAction";
|
||||||
ChangePasswordUrl = $"{apiUrl}/accountApi/changePassword";
|
ChangePasswordUrl = $"{apiUrl}/launcher/ResetPasswordAction";
|
||||||
LauncherNewsUrl = $"{apiUrl}/launcher/news";
|
LauncherNewsUrl = $"{apiUrl}/launcher/news";
|
||||||
AgreementUrl = $"{apiUrl}/launcher/agreement";
|
AgreementUrl = $"{apiUrl}/launcher/agreement";
|
||||||
|
|
||||||
|
|
@ -36,12 +36,12 @@ public class Configuration
|
||||||
DownloadUpdateFileUrl = $"{apiUrl}/launcher/patch";
|
DownloadUpdateFileUrl = $"{apiUrl}/launcher/patch";
|
||||||
|
|
||||||
//Launcher update endpoints
|
//Launcher update endpoints
|
||||||
GetLauncherVersion = $"{apiUrl}/launcherApi/launcherUpdater/getLauncherVersion";
|
GetLauncherVersion = $"{apiUrl}/launcherAction/getLauncherVersion";
|
||||||
UpdateLauncherVersion = $"{apiUrl}/launcherApi/launcherUpdater/updateLauncherVersion";
|
UpdateLauncherVersion = $"{apiUrl}/launcherAction/updateLauncherVersion";
|
||||||
|
|
||||||
//Launcher settings
|
//Launcher settings
|
||||||
string lang = iniFile.ReadValue("Launcher", "Lang");
|
Lang = iniFile.ReadValue("Launcher", "Lang");
|
||||||
Lang = lang;
|
Service = iniFile.ReadValue("Info", "Service");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GateXMLUrl { get; set; }
|
public string GateXMLUrl { get; set; }
|
||||||
|
|
@ -62,5 +62,6 @@ public class Configuration
|
||||||
public string ClientPartsListUrl { get; set; }
|
public string ClientPartsListUrl { get; set; }
|
||||||
public string DownloadClientPartUrl { get; set; }
|
public string DownloadClientPartUrl { get; set; }
|
||||||
public string Lang { get; set; }
|
public string Lang { get; set; }
|
||||||
|
public string Service { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
36
RHLauncher.Helper/HttpResponse.cs
Normal file
36
RHLauncher.Helper/HttpResponse.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace RHLauncher.RHLauncher.Helper;
|
||||||
|
|
||||||
|
public class HttpResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("success")]
|
||||||
|
public string? Success { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("result")]
|
||||||
|
public string? Result { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoginResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("result")]
|
||||||
|
public string? Result { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("token")]
|
||||||
|
public string? Token { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("windyCode")]
|
||||||
|
public string? WindyCode { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("message")]
|
||||||
|
public string? Message { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ServerStatusResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("status")]
|
||||||
|
public string? Status { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -21,9 +21,9 @@ namespace RHLauncher.RHLauncher.Helper
|
||||||
if (!File.Exists(_iniFilePath))
|
if (!File.Exists(_iniFilePath))
|
||||||
{
|
{
|
||||||
//Default api url
|
//Default api url
|
||||||
WritePrivateProfileString("Info", "LoginURL", "http://localhost:3000", _iniFilePath);
|
WritePrivateProfileString("Info", "ServerURL", "http://127.0.0.1", _iniFilePath);
|
||||||
//Default client service
|
//Default client service
|
||||||
WritePrivateProfileString("Info", "Service", "usa", _iniFilePath);
|
WritePrivateProfileString("Info", "Service", "jpn", _iniFilePath);
|
||||||
//Default launcher language
|
//Default launcher language
|
||||||
WritePrivateProfileString("Launcher", "Lang", "en", _iniFilePath);
|
WritePrivateProfileString("Launcher", "Lang", "en", _iniFilePath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@
|
||||||
<AssemblyName>Launcher</AssemblyName>
|
<AssemblyName>Launcher</AssemblyName>
|
||||||
<Description>Rusty Hearts Launcher</Description>
|
<Description>Rusty Hearts Launcher</Description>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<AssemblyVersion>1.3.0</AssemblyVersion>
|
<AssemblyVersion>1.4.0</AssemblyVersion>
|
||||||
<FileVersion>1.3.0</FileVersion>
|
<FileVersion>1.4.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|
|
||||||
31
RHLauncher.i8n/LocalizedStrings.Designer.cs
generated
31
RHLauncher.i8n/LocalizedStrings.Designer.cs
generated
|
|
@ -438,6 +438,24 @@ namespace RHLauncher.RHLauncher.i8n {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Failed to process server response..
|
||||||
|
/// </summary>
|
||||||
|
public static string HttpResponseNull {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("HttpResponseNull", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Failed to parse server response..
|
||||||
|
/// </summary>
|
||||||
|
public static string HttpResponseParseError {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("HttpResponseParseError", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Info.
|
/// Looks up a localized string similar to Info.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -736,7 +754,7 @@ namespace RHLauncher.RHLauncher.i8n {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to 6-16 characters.
|
/// Looks up a localized string similar to 8-16 characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string NewPasswordDesc {
|
public static string NewPasswordDesc {
|
||||||
get {
|
get {
|
||||||
|
|
@ -826,7 +844,7 @@ namespace RHLauncher.RHLauncher.i8n {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Password must be between 6-16 characters!.
|
/// Looks up a localized string similar to Password must be between 8-16 characters!.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string PwdDescLabelSize {
|
public static string PwdDescLabelSize {
|
||||||
get {
|
get {
|
||||||
|
|
@ -978,6 +996,15 @@ namespace RHLauncher.RHLauncher.i8n {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Service.
|
||||||
|
/// </summary>
|
||||||
|
public static string Service {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Service", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Could not find Service.dat. Please check if the Install Directory is correct..
|
/// Looks up a localized string similar to Could not find Service.dat. Please check if the Install Directory is correct..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,12 @@
|
||||||
<data name="GameSettings" xml:space="preserve">
|
<data name="GameSettings" xml:space="preserve">
|
||||||
<value>게임 설정</value>
|
<value>게임 설정</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="HttpResponseNull" xml:space="preserve">
|
||||||
|
<value>서버 응답을 처리하지 못했습니다.</value>
|
||||||
|
</data>
|
||||||
|
<data name="HttpResponseParseError" xml:space="preserve">
|
||||||
|
<value>서버 응답을 구문 분석하는 데 실패했습니다.</value>
|
||||||
|
</data>
|
||||||
<data name="Info" xml:space="preserve">
|
<data name="Info" xml:space="preserve">
|
||||||
<value>정보</value>
|
<value>정보</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
@ -343,7 +349,7 @@
|
||||||
<value>새 비밀번호를 입력하세요</value>
|
<value>새 비밀번호를 입력하세요</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewPasswordDesc" xml:space="preserve">
|
<data name="NewPasswordDesc" xml:space="preserve">
|
||||||
<value>6~16자</value>
|
<value>8~16자</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="No" xml:space="preserve">
|
<data name="No" xml:space="preserve">
|
||||||
<value>아니요</value>
|
<value>아니요</value>
|
||||||
|
|
@ -373,7 +379,7 @@
|
||||||
<value>비밀번호는 비워둘 수 없습니다!</value>
|
<value>비밀번호는 비워둘 수 없습니다!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PwdDescLabelSize" xml:space="preserve">
|
<data name="PwdDescLabelSize" xml:space="preserve">
|
||||||
<value>비밀번호는 6~16자 사이여야 합니다!</value>
|
<value>비밀번호는 8~16자 사이여야 합니다!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PwdStrengthLabelMedium" xml:space="preserve">
|
<data name="PwdStrengthLabelMedium" xml:space="preserve">
|
||||||
<value>매질</value>
|
<value>매질</value>
|
||||||
|
|
@ -423,6 +429,9 @@
|
||||||
<data name="ServerOffline" xml:space="preserve">
|
<data name="ServerOffline" xml:space="preserve">
|
||||||
<value>게임 서버에 연결할 수 없습니다.</value>
|
<value>게임 서버에 연결할 수 없습니다.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Service" xml:space="preserve">
|
||||||
|
<value>서비스</value>
|
||||||
|
</data>
|
||||||
<data name="ServiceDatFileMissing" xml:space="preserve">
|
<data name="ServiceDatFileMissing" xml:space="preserve">
|
||||||
<value>Service.dat를 찾을 수 없습니다. 설치 디렉터리가 올바른지 확인하세요.</value>
|
<value>Service.dat를 찾을 수 없습니다. 설치 디렉터리가 올바른지 확인하세요.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,12 @@
|
||||||
<data name="GameSettings" xml:space="preserve">
|
<data name="GameSettings" xml:space="preserve">
|
||||||
<value>Game Settings</value>
|
<value>Game Settings</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="HttpResponseNull" xml:space="preserve">
|
||||||
|
<value>Failed to process server response.</value>
|
||||||
|
</data>
|
||||||
|
<data name="HttpResponseParseError" xml:space="preserve">
|
||||||
|
<value>Failed to parse server response.</value>
|
||||||
|
</data>
|
||||||
<data name="Info" xml:space="preserve">
|
<data name="Info" xml:space="preserve">
|
||||||
<value>Info</value>
|
<value>Info</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
@ -343,7 +349,7 @@
|
||||||
<value>Enter the new password</value>
|
<value>Enter the new password</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NewPasswordDesc" xml:space="preserve">
|
<data name="NewPasswordDesc" xml:space="preserve">
|
||||||
<value>6-16 characters</value>
|
<value>8-16 characters</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="No" xml:space="preserve">
|
<data name="No" xml:space="preserve">
|
||||||
<value>No</value>
|
<value>No</value>
|
||||||
|
|
@ -373,7 +379,7 @@
|
||||||
<value>Password cannot be empty!</value>
|
<value>Password cannot be empty!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PwdDescLabelSize" xml:space="preserve">
|
<data name="PwdDescLabelSize" xml:space="preserve">
|
||||||
<value>Password must be between 6-16 characters!</value>
|
<value>Password must be between 8-16 characters!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PwdStrengthLabelMedium" xml:space="preserve">
|
<data name="PwdStrengthLabelMedium" xml:space="preserve">
|
||||||
<value>Medium</value>
|
<value>Medium</value>
|
||||||
|
|
@ -423,6 +429,9 @@
|
||||||
<data name="ServerOffline" xml:space="preserve">
|
<data name="ServerOffline" xml:space="preserve">
|
||||||
<value>Cannot connect to the game server.</value>
|
<value>Cannot connect to the game server.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Service" xml:space="preserve">
|
||||||
|
<value>Service</value>
|
||||||
|
</data>
|
||||||
<data name="ServiceDatFileMissing" xml:space="preserve">
|
<data name="ServiceDatFileMissing" xml:space="preserve">
|
||||||
<value>Could not find Service.dat. Please check if the Install Directory is correct.</value>
|
<value>Could not find Service.dat. Please check if the Install Directory is correct.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue