Add project files.
63
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
3
.github/FUNDING.yml
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [JuniorDark]
|
||||
13
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
|
||||
version: 2
|
||||
updates:
|
||||
- directory: /
|
||||
package-ecosystem: github-actions
|
||||
schedule:
|
||||
interval: weekly
|
||||
labels: []
|
||||
- directory: /
|
||||
package-ecosystem: nuget
|
||||
schedule:
|
||||
interval: weekly
|
||||
labels: []
|
||||
24
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
run: dotnet publish --configuration Release --self-contained false --runtime win-x86 /p:PublishSingleFile=true
|
||||
- name: Zip output file
|
||||
run: Compress-Archive -Path ./bin/Release/net7.0-windows7.0/win-x86/publish/Launcher.exe -DestinationPath Launcher.zip
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Launcher
|
||||
path: Launcher.zip
|
||||
44
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Get version from .csproj file
|
||||
id: version
|
||||
|
||||
run: |
|
||||
echo "::set-output name=version::$(grep -m1 -o '<FileVersion>[^<]*' RHLauncher.csproj | sed 's/<FileVersion>//')"
|
||||
- name: Build
|
||||
run: dotnet publish --configuration Release --self-contained false --runtime win-x86 /p:PublishSingleFile=true
|
||||
- name: Zip output file
|
||||
run: Compress-Archive -Path ./bin/Release/net7.0-windows7.0/win-x86/publish/Launcher.exe -DestinationPath Launcher.zip
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.version }}
|
||||
release_name: v${{ steps.version.outputs.version }}
|
||||
body: Automated release created by GitHub Actions.
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./Launcher.zip
|
||||
asset_name: Launcher.zip
|
||||
asset_content_type: application/zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
363
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
18
DynamicLib/NativeMethod.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public static class NativeMethod
|
||||
{
|
||||
[DllImport("kernel32.dll", EntryPoint = "LoadLibrary")]
|
||||
public static extern int LoadLibrary(
|
||||
[MarshalAs(UnmanagedType.LPStr)] string lpLibFileName);
|
||||
|
||||
[DllImport("kernel32.dll", EntryPoint = "GetProcAddress")]
|
||||
public static extern IntPtr GetProcAddress(int hModule,
|
||||
[MarshalAs(UnmanagedType.LPStr)] string lpProcName);
|
||||
|
||||
[DllImport("kernel32.dll", EntryPoint = "FreeLibrary")]
|
||||
public static extern bool FreeLibrary(int hModule);
|
||||
}
|
||||
73
DynamicLib/ResourceDll.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace RHLauncher.DynamicLib {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class ResourceDll {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal ResourceDll() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RHLauncher.DynamicLib.ResourceDll", typeof(ResourceDll).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] ZlibDll {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ZlibDll", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
DynamicLib/ResourceDll.resx
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ZlibDll" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>ZlibDll.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
41
DynamicLib/ZLibDll.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
using RHLauncher.DynamicLib;
|
||||
|
||||
public static class ZLibDll
|
||||
{
|
||||
|
||||
//[DllImport("ZlibDll.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
//public static extern int Decompress(byte[] compressed_buffer, int compressed_size, byte[] decompressed_buffer, ref int decompressed_size);
|
||||
|
||||
public delegate int DecompressDelegate(byte[] compressed_buffer, int compressed_size, byte[] decompressed_buffer, ref int decompressed_size);
|
||||
public static DecompressDelegate? Decompress = null;
|
||||
|
||||
//[DllImport("ZlibDll.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
//public static extern int Compress(byte[] decompressed_buffer, int decompressed_size, byte[] compressed_buffer, ref int compressed_size);
|
||||
public delegate int CompressDelegate(byte[] decompressed_buffer, int decompressed_size, byte[] compressed_buffer, ref int compressed_size);
|
||||
public static CompressDelegate? Compress = null;
|
||||
|
||||
static ZLibDll()
|
||||
{
|
||||
byte[] libBuffer = ResourceDll.ZlibDll;
|
||||
string dllPath = Path.Combine(Path.GetTempPath(), "ZlibDll.dll");
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(dllPath, libBuffer);
|
||||
}
|
||||
catch { }
|
||||
|
||||
int hModule = NativeMethod.LoadLibrary(dllPath);
|
||||
if (hModule == 0) return;
|
||||
|
||||
IntPtr intPtr = NativeMethod.GetProcAddress(hModule, "Decompress");
|
||||
Decompress = (DecompressDelegate)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(DecompressDelegate));
|
||||
|
||||
intPtr = NativeMethod.GetProcAddress(hModule, "Compress");
|
||||
Compress = (CompressDelegate)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(CompressDelegate));
|
||||
}
|
||||
}
|
||||
BIN
DynamicLib/ZlibDll.dll
Normal file
12
LICENSE
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
BSD Zero Clause License (0BSD)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
36
Program.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Rusty Hearts Launcher - Windows Forms Implementation in C#
|
||||
Author: JuniorDark
|
||||
GitHub Repository: https://github.com/JuniorDark/RustyHearts-Launcher
|
||||
This code serves as a starting point for creating your own launcher.
|
||||
However, it requires further development to improve functionality and
|
||||
ensure stability. Please check the GitHub repository for updates.
|
||||
*/
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private static readonly Mutex mutex = new(false, "Launcher");
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
private static void Main()
|
||||
{
|
||||
|
||||
if (mutex.WaitOne(TimeSpan.Zero, true))
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new LoginForm());
|
||||
mutex.ReleaseMutex();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Only one instance of the launcher can run at a time.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
573
Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,573 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace RHLauncher.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RHLauncher.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap bg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("bg", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_close_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_close_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_close_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_close_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_close_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_close_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_login_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_login_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_login_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_login_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_login_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_login_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_minimize_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_minimize_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_minimize_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_minimize_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_minimize_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_minimize_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_register_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_register_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_register_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_register_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap button_register_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("button_register_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap ChangePwwnd_button_email_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ChangePwwnd_button_email_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap ChangePwwnd_button_email_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ChangePwwnd_button_email_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap ChangePwwnd_button_email_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ChangePwwnd_button_email_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_angela {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_angela", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_edgar {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_edgar", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_frantz {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_frantz", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_ian {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_ian", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_leila {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_leila", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_meilinchen {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_meilinchen", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_natasha {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_natasha", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_roselle {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_roselle", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap character_select_cut_tude {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("character_select_cut_tude", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap help_panel_bkg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("help_panel_bkg", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchbutton_bkg_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchbutton_bkg_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchbutton_bkg_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchbutton_bkg_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchbutton_bkg_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchbutton_bkg_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launcher_bg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launcher_bg", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchoptionbutton_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchoptionbutton_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchoptionbutton_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchoptionbutton_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap launchoptionbutton_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("launchoptionbutton_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap list_button_hover {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("list_button_hover", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap list_button_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("list_button_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap login_bg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("login_bg", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap menubutton_bkg_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("menubutton_bkg_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap menubutton_bkg_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("menubutton_bkg_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap menubutton_bkg_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("menubutton_bkg_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap message_bkg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("message_bkg", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap messagewnd_button_ok_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("messagewnd_button_ok_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap messagewnd_button_ok_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("messagewnd_button_ok_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap messagewnd_button_ok_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("messagewnd_button_ok_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwnd_button_continue_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwnd_button_continue_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwnd_button_continue_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwnd_button_continue_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwnd_button_continue_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwnd_button_continue_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwndwnd_button_sendemail_active {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwndwnd_button_sendemail_active", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwndwnd_button_sendemail_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwndwnd_button_sendemail_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Registerwndwnd_button_sendemail_normal {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Registerwndwnd_button_sendemail_normal", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap tips_error {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("tips_error", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap tips_ok {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("tips_ok", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
274
Properties/Resources.resx
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="bg" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\bg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_close_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_close_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_close_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_close_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_close_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_close_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_login_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_login_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_login_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_login_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_login_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_login_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_minimize_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_minimize_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_minimize_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_minimize_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_minimize_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_minimize_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_register_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_register_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_register_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_register_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="button_register_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\button_register_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ChangePwwnd_button_email_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\ChangePwwnd.button.email.active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ChangePwwnd_button_email_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\ChangePwwnd.button.email.down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="ChangePwwnd_button_email_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\ChangePwwnd.button.email.normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_angela" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_angela.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_edgar" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_edgar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_frantz" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_frantz.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_ian" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_ian.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_leila" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_leila.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_meilinchen" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_meilinchen.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_natasha" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_natasha.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_roselle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_roselle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="character_select_cut_tude" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\character_select_cut_tude.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="help_panel_bkg" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\help_panel_bkg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchbutton_bkg_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchbutton_bkg_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchbutton_bkg_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchbutton_bkg_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchbutton_bkg_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchbutton_bkg_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launcher_bg" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\launcher_bg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchoptionbutton_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchoptionbutton_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchoptionbutton_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchoptionbutton_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="launchoptionbutton_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\launchoptionbutton_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="list_button_hover" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\list_button_hover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="list_button_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\list_button_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="login_bg" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\login_bg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="menubutton_bkg_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\menubutton_bkg_active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="menubutton_bkg_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\menubutton_bkg_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="menubutton_bkg_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\menubutton_bkg_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="messagewnd_button_ok_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\messagewnd.button.ok.active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="messagewnd_button_ok_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\messagewnd.button.ok.down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="messagewnd_button_ok_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\messagewnd.button.ok.normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="message_bkg" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bg\message_bkg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwndwnd_button_sendemail_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwndwnd.button.sendemail.active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwndwnd_button_sendemail_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwndwnd.button.sendemail.down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwndwnd_button_sendemail_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwndwnd.button.sendemail.normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwnd_button_continue_active" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwnd.button.continue.active.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwnd_button_continue_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwnd.button.continue.down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Registerwnd_button_continue_normal" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\buttons\Registerwnd.button.continue.normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="tips_error" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons\tips_error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="tips_ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\icons\tips_ok.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
26
Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace RHLauncher.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Properties/Settings.settings
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
</SettingsFile>
|
||||
102
README.md
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
<div align="center">
|
||||
|
||||

|
||||
|
||||
# Rusty Hearts Launcher
|
||||
[](LICENSE)
|
||||
[](https://github.com/JuniorDark/RustyHearts-Launcher/actions/workflows/build.yml)
|
||||
|
||||
## Introduction
|
||||
Rusty Hearts Launcher is a custom launcher for the Rusty Hearts game client. It provides several features, including self-updating, automatic game updates, account registration, and a news window.
|
||||
|
||||
## Table of Contents
|
||||
* [Features](#features)
|
||||
* [Setup](#setup)
|
||||
* [Prerequisites for Building Locally/Development](#prerequisites-for-building-locallydevelopment)
|
||||
* [System Requirements for Ready-to-use build](#system-requirements-for-ready-to-use-build)
|
||||
* [Preview](#preview)
|
||||
* [License](#license)
|
||||
* [Contributing](#contributing)
|
||||
* [FAQ](#faq)
|
||||
* [Credits](#credits)
|
||||
* [Support](#support)
|
||||
* [Roadmap](#roadmap)
|
||||
|
||||
## Features
|
||||
* Self-updating: The launcher can automatically update itself to the latest version.
|
||||
* Automatic game update: The launcher can automatically download and install updates.
|
||||
* Register account: Users can register a new account/change the password directly from the launcher.
|
||||
* News window: The launcher displays the latest news and updates about the game.
|
||||
|
||||
## Setup
|
||||
The launcher require the [Rusty Hearts API](https://github.com/JuniorDark/RustyHearts-API) to work. See the api documentation for instructions on setup.
|
||||
|
||||
### API URL
|
||||
|
||||
In order for the launcher to work it need to be conected to the api. To change the URL address of the launcher API open the config.ini (it will be created when opening the launcher for the first time).
|
||||
|
||||
The default URL for the api can be changed on IniFile.cs
|
||||
|
||||
### Client region
|
||||
The client region can be set on Service on config.ini
|
||||
|
||||
**usa** PWE - Full api support
|
||||
**chn** Xunlei - Only launcher support
|
||||
|
||||
### Launcher self-update
|
||||
|
||||
In order for the launcher to automatically update itself, you need to use the launcher_info.ini in the `launcher_update` directory of the api. This file specifies the version of the launcher. After each update of the launcher, you need to change the version in the ini, as well in the launcher executable file.
|
||||
|
||||
### Client patch
|
||||
|
||||
In order to create client patches, you need to use the `patch` directory of the api.
|
||||
|
||||
The tool for creating the patch files is available in the repository: https://github.com/JuniorDark/RustyHearts-MIPTool
|
||||
|
||||
### Launcher customization
|
||||
If you want to change the text on the launcher the strings can be found on LocalizedStrings.resx resource file.
|
||||
|
||||
If you want to change the text on the buttons/images used in the launcher you can use the Photoshop .psd files included in the Resources.rar
|
||||
|
||||
## Prerequisites for Building Locally/Development
|
||||
The launcher is built in .NET 7 and as such, the packages listed below are required to create a local and development build of the launcher. Furthermore, it uses many submodules and packages outside of this, which will automatically be loaded when the user sets up a local environment of the application.
|
||||
* Visual Studio 2022 (Any Edition - 17.4 or later)
|
||||
* Windows 10 SDK (10.0.19043.0) or Windows 11 SDK (10.0.22000.0) via Visual Studio Installer
|
||||
* .NET: [.NET Core 7 SDK (7.0.100 or later)](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
|
||||
|
||||
## System Requirements for Ready-to-use build
|
||||
* OS: Windows 10 1809 Update (build 17763) or later / Windows 11 (Any builds)
|
||||
* Architecture: x64/AMD64
|
||||
|
||||
## Preview
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## License
|
||||
This project is licensed under the terms found in [`LICENSE-0BSD`](LICENSE).
|
||||
|
||||
## Contributing
|
||||
Contributions from the community are welcome! If you encounter a bug or have a feature request, please submit an issue on GitHub. If you would like to contribute code, please fork the repository and submit a pull request.
|
||||
|
||||
## FAQ
|
||||
* Q: How do I report a bug?
|
||||
* A: Please submit an issue on GitHub with a detailed description of the bug and steps to reproduce it.
|
||||
* Q: How do I request a new feature?
|
||||
* A: Please submit an issue on GitHub with a detailed description of the feature and why it would be useful.
|
||||
* Q: How do I contribute code?
|
||||
* A: Please fork the repository, make your changes, and submit a pull request.
|
||||
|
||||
## Credits
|
||||
The following third-party libraries, tools, and resources are used in this project:
|
||||
* [Microsoft.Web.WebView2](https://www.nuget.org/packages/Microsoft.Web.WebView2)
|
||||
* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json)
|
||||
|
||||
## Support
|
||||
If you need help with the launcher, please submit an issue on GitHub.
|
||||
|
||||
## Roadmap
|
||||
* Add support for client download/repair
|
||||
* Improve performance and stability
|
||||
* Add support for additional languages
|
||||
668
RHLauncher.ChangePwd/ChangePwd.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,668 @@
|
|||
namespace RHLauncher
|
||||
{
|
||||
partial class ChangePwd
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangePwd));
|
||||
CloseButton = new Button();
|
||||
imageListCloseBtn = new ImageList(components);
|
||||
MinimizeButton = new Button();
|
||||
imageListMinBtn = new ImageList(components);
|
||||
CodeLabel = new Label();
|
||||
imageListOKBtn = new ImageList(components);
|
||||
ContinueButtonS1 = new Button();
|
||||
imageListContinueBtn = new ImageList(components);
|
||||
PasswordLabel = new Label();
|
||||
RepeatPasswordLabel = new Label();
|
||||
SendEmailButton = new Button();
|
||||
imageListSendEmailBtn = new ImageList(components);
|
||||
CodeTextBox = new TextBox();
|
||||
Stage1Panel = new Panel();
|
||||
EmailPictureBox = new PictureBox();
|
||||
TimerLabel = new Label();
|
||||
CodePictureBox = new PictureBox();
|
||||
CodeDescLabel = new Label();
|
||||
EmailDescLabel = new Label();
|
||||
EmailTextBox = new TextBox();
|
||||
DescLabelS1 = new Label();
|
||||
SubTitleLabelS1 = new Label();
|
||||
TitleLabelS1 = new Label();
|
||||
Stage2Panel = new Panel();
|
||||
PwdStrengthLabel = new Label();
|
||||
PwdConfirmPictureBox = new PictureBox();
|
||||
PwdPictureBox = new PictureBox();
|
||||
PwdConfirmDescLabel = new Label();
|
||||
PwdDescLabel = new Label();
|
||||
EmailLabelS2 = new Label();
|
||||
ReturnLabelS2 = new Label();
|
||||
OkButtonS2 = new Button();
|
||||
PasswordTextBox = new TextBox();
|
||||
RepeatPasswordTextBox = new TextBox();
|
||||
SubTitleLabelS2 = new Label();
|
||||
TitleLabelS2 = new Label();
|
||||
imageListTips = new ImageList(components);
|
||||
Stage1Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)EmailPictureBox).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)CodePictureBox).BeginInit();
|
||||
Stage2Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdPictureBox).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// CloseButton
|
||||
//
|
||||
CloseButton.BackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.BorderColor = Color.Black;
|
||||
CloseButton.FlatAppearance.BorderSize = 0;
|
||||
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CloseButton.FlatStyle = FlatStyle.Flat;
|
||||
CloseButton.ForeColor = Color.Transparent;
|
||||
CloseButton.ImageIndex = 0;
|
||||
CloseButton.ImageList = imageListCloseBtn;
|
||||
CloseButton.Location = new Point(756, 12);
|
||||
CloseButton.Name = "CloseButton";
|
||||
CloseButton.Size = new Size(32, 29);
|
||||
CloseButton.TabIndex = 9;
|
||||
CloseButton.UseVisualStyleBackColor = false;
|
||||
CloseButton.Click += CloseButton_Click;
|
||||
CloseButton.MouseDown += CloseButton_OnMouseDown;
|
||||
CloseButton.MouseLeave += CloseButton_MouseLeave;
|
||||
CloseButton.MouseHover += CloseButton_MouseHover;
|
||||
//
|
||||
// imageListCloseBtn
|
||||
//
|
||||
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
|
||||
imageListCloseBtn.TransparentColor = Color.Transparent;
|
||||
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
|
||||
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
|
||||
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
|
||||
//
|
||||
// MinimizeButton
|
||||
//
|
||||
MinimizeButton.BackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
|
||||
MinimizeButton.FlatAppearance.BorderSize = 0;
|
||||
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatStyle = FlatStyle.Flat;
|
||||
MinimizeButton.ForeColor = Color.Transparent;
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
MinimizeButton.ImageList = imageListMinBtn;
|
||||
MinimizeButton.Location = new Point(681, 7);
|
||||
MinimizeButton.Name = "MinimizeButton";
|
||||
MinimizeButton.Size = new Size(25, 26);
|
||||
MinimizeButton.TabIndex = 8;
|
||||
MinimizeButton.UseVisualStyleBackColor = false;
|
||||
MinimizeButton.Click += MinimizeButton_Click;
|
||||
MinimizeButton.MouseDown += MinimizeButton_OnMouseDown;
|
||||
MinimizeButton.MouseLeave += MinimizeButton_MouseLeave;
|
||||
MinimizeButton.MouseHover += MinimizeButton_MouseHover;
|
||||
//
|
||||
// imageListMinBtn
|
||||
//
|
||||
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
|
||||
imageListMinBtn.TransparentColor = Color.Transparent;
|
||||
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
|
||||
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
|
||||
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
|
||||
//
|
||||
// CodeLabel
|
||||
//
|
||||
CodeLabel.Anchor = AnchorStyles.Top;
|
||||
CodeLabel.AutoEllipsis = true;
|
||||
CodeLabel.AutoSize = true;
|
||||
CodeLabel.BackColor = Color.Transparent;
|
||||
CodeLabel.Font = new Font("Microsoft Sans Serif", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CodeLabel.ForeColor = Color.White;
|
||||
CodeLabel.ImeMode = ImeMode.NoControl;
|
||||
CodeLabel.Location = new Point(85, 172);
|
||||
CodeLabel.Name = "CodeLabel";
|
||||
CodeLabel.Size = new Size(132, 17);
|
||||
CodeLabel.TabIndex = 15;
|
||||
CodeLabel.Text = "Verification Code";
|
||||
CodeLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// imageListOKBtn
|
||||
//
|
||||
imageListOKBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListOKBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn.ImageStream");
|
||||
imageListOKBtn.TransparentColor = Color.Transparent;
|
||||
imageListOKBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
|
||||
imageListOKBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
|
||||
imageListOKBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
|
||||
//
|
||||
// ContinueButtonS1
|
||||
//
|
||||
ContinueButtonS1.BackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatAppearance.BorderSize = 0;
|
||||
ContinueButtonS1.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatStyle = FlatStyle.Flat;
|
||||
ContinueButtonS1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ContinueButtonS1.ImageIndex = 0;
|
||||
ContinueButtonS1.ImageList = imageListContinueBtn;
|
||||
ContinueButtonS1.ImeMode = ImeMode.NoControl;
|
||||
ContinueButtonS1.Location = new Point(85, 242);
|
||||
ContinueButtonS1.Name = "ContinueButtonS1";
|
||||
ContinueButtonS1.Size = new Size(110, 44);
|
||||
ContinueButtonS1.TabIndex = 16;
|
||||
ContinueButtonS1.UseVisualStyleBackColor = false;
|
||||
ContinueButtonS1.Click += ContinueButtonS1_Click;
|
||||
ContinueButtonS1.MouseDown += ContinueButtonS1_OnMouseDown;
|
||||
ContinueButtonS1.MouseLeave += ContinueButtonS1_MouseLeave;
|
||||
ContinueButtonS1.MouseHover += ContinueButtonS1_MouseHover;
|
||||
//
|
||||
// imageListContinueBtn
|
||||
//
|
||||
imageListContinueBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListContinueBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn.ImageStream");
|
||||
imageListContinueBtn.TransparentColor = Color.Transparent;
|
||||
imageListContinueBtn.Images.SetKeyName(0, "Registerwnd.button.continue.normal.png");
|
||||
imageListContinueBtn.Images.SetKeyName(1, "Registerwnd.button.continue.active.png");
|
||||
imageListContinueBtn.Images.SetKeyName(2, "Registerwnd.button.continue.down.png");
|
||||
//
|
||||
// PasswordLabel
|
||||
//
|
||||
PasswordLabel.Anchor = AnchorStyles.Top;
|
||||
PasswordLabel.AutoEllipsis = true;
|
||||
PasswordLabel.AutoSize = true;
|
||||
PasswordLabel.BackColor = Color.Transparent;
|
||||
PasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PasswordLabel.ForeColor = Color.White;
|
||||
PasswordLabel.ImeMode = ImeMode.NoControl;
|
||||
PasswordLabel.Location = new Point(98, 179);
|
||||
PasswordLabel.Name = "PasswordLabel";
|
||||
PasswordLabel.Size = new Size(167, 19);
|
||||
PasswordLabel.TabIndex = 19;
|
||||
PasswordLabel.Text = "Enter the new password";
|
||||
PasswordLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// RepeatPasswordLabel
|
||||
//
|
||||
RepeatPasswordLabel.Anchor = AnchorStyles.Top;
|
||||
RepeatPasswordLabel.AutoEllipsis = true;
|
||||
RepeatPasswordLabel.AutoSize = true;
|
||||
RepeatPasswordLabel.BackColor = Color.Transparent;
|
||||
RepeatPasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
RepeatPasswordLabel.ForeColor = Color.White;
|
||||
RepeatPasswordLabel.ImeMode = ImeMode.NoControl;
|
||||
RepeatPasswordLabel.Location = new Point(95, 255);
|
||||
RepeatPasswordLabel.Name = "RepeatPasswordLabel";
|
||||
RepeatPasswordLabel.Size = new Size(191, 19);
|
||||
RepeatPasswordLabel.TabIndex = 20;
|
||||
RepeatPasswordLabel.Text = "Re-enter the new password";
|
||||
RepeatPasswordLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// SendEmailButton
|
||||
//
|
||||
SendEmailButton.BackColor = Color.Transparent;
|
||||
SendEmailButton.FlatAppearance.BorderSize = 0;
|
||||
SendEmailButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
SendEmailButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
SendEmailButton.FlatStyle = FlatStyle.Flat;
|
||||
SendEmailButton.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SendEmailButton.ImageIndex = 0;
|
||||
SendEmailButton.ImageList = imageListSendEmailBtn;
|
||||
SendEmailButton.ImeMode = ImeMode.NoControl;
|
||||
SendEmailButton.Location = new Point(254, 242);
|
||||
SendEmailButton.Name = "SendEmailButton";
|
||||
SendEmailButton.Size = new Size(110, 44);
|
||||
SendEmailButton.TabIndex = 21;
|
||||
SendEmailButton.UseVisualStyleBackColor = false;
|
||||
SendEmailButton.Click += SendEmailButton_Click;
|
||||
SendEmailButton.MouseDown += SendEmailButton_OnMouseDown;
|
||||
SendEmailButton.MouseLeave += SendEmailButton_MouseLeave;
|
||||
SendEmailButton.MouseHover += SendEmailButton_MouseHover;
|
||||
//
|
||||
// imageListSendEmailBtn
|
||||
//
|
||||
imageListSendEmailBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListSendEmailBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn.ImageStream");
|
||||
imageListSendEmailBtn.TransparentColor = Color.Transparent;
|
||||
imageListSendEmailBtn.Images.SetKeyName(0, "ChangePwwnd.button.email.normal.png");
|
||||
imageListSendEmailBtn.Images.SetKeyName(1, "ChangePwwnd.button.email.active.png");
|
||||
imageListSendEmailBtn.Images.SetKeyName(2, "ChangePwwnd.button.email.down.png");
|
||||
//
|
||||
// CodeTextBox
|
||||
//
|
||||
CodeTextBox.AcceptsTab = true;
|
||||
CodeTextBox.Location = new Point(85, 191);
|
||||
CodeTextBox.Name = "CodeTextBox";
|
||||
CodeTextBox.Size = new Size(279, 23);
|
||||
CodeTextBox.TabIndex = 22;
|
||||
CodeTextBox.TextChanged += CodeTextBox_TextChanged;
|
||||
//
|
||||
// Stage1Panel
|
||||
//
|
||||
Stage1Panel.BackColor = Color.Transparent;
|
||||
Stage1Panel.Controls.Add(EmailPictureBox);
|
||||
Stage1Panel.Controls.Add(TimerLabel);
|
||||
Stage1Panel.Controls.Add(CodePictureBox);
|
||||
Stage1Panel.Controls.Add(CodeDescLabel);
|
||||
Stage1Panel.Controls.Add(EmailDescLabel);
|
||||
Stage1Panel.Controls.Add(EmailTextBox);
|
||||
Stage1Panel.Controls.Add(DescLabelS1);
|
||||
Stage1Panel.Controls.Add(SubTitleLabelS1);
|
||||
Stage1Panel.Controls.Add(TitleLabelS1);
|
||||
Stage1Panel.Controls.Add(SendEmailButton);
|
||||
Stage1Panel.Controls.Add(CodeTextBox);
|
||||
Stage1Panel.Controls.Add(ContinueButtonS1);
|
||||
Stage1Panel.Controls.Add(CodeLabel);
|
||||
Stage1Panel.Location = new Point(0, 79);
|
||||
Stage1Panel.Name = "Stage1Panel";
|
||||
Stage1Panel.Size = new Size(800, 450);
|
||||
Stage1Panel.TabIndex = 23;
|
||||
//
|
||||
// EmailPictureBox
|
||||
//
|
||||
EmailPictureBox.BackColor = Color.Transparent;
|
||||
EmailPictureBox.Location = new Point(377, 108);
|
||||
EmailPictureBox.Name = "EmailPictureBox";
|
||||
EmailPictureBox.Size = new Size(14, 14);
|
||||
EmailPictureBox.TabIndex = 39;
|
||||
EmailPictureBox.TabStop = false;
|
||||
//
|
||||
// TimerLabel
|
||||
//
|
||||
TimerLabel.Anchor = AnchorStyles.Top;
|
||||
TimerLabel.AutoSize = true;
|
||||
TimerLabel.BackColor = Color.Transparent;
|
||||
TimerLabel.Font = new Font("Segoe UI", 11.25F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TimerLabel.ForeColor = Color.White;
|
||||
TimerLabel.ImeMode = ImeMode.NoControl;
|
||||
TimerLabel.Location = new Point(366, 255);
|
||||
TimerLabel.Name = "TimerLabel";
|
||||
TimerLabel.Size = new Size(0, 20);
|
||||
TimerLabel.TabIndex = 42;
|
||||
TimerLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// CodePictureBox
|
||||
//
|
||||
CodePictureBox.BackColor = Color.Transparent;
|
||||
CodePictureBox.Location = new Point(375, 196);
|
||||
CodePictureBox.Name = "CodePictureBox";
|
||||
CodePictureBox.Size = new Size(14, 14);
|
||||
CodePictureBox.TabIndex = 41;
|
||||
CodePictureBox.TabStop = false;
|
||||
//
|
||||
// CodeDescLabel
|
||||
//
|
||||
CodeDescLabel.Anchor = AnchorStyles.Top;
|
||||
CodeDescLabel.AutoSize = true;
|
||||
CodeDescLabel.BackColor = Color.Transparent;
|
||||
CodeDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CodeDescLabel.ForeColor = Color.White;
|
||||
CodeDescLabel.ImeMode = ImeMode.NoControl;
|
||||
CodeDescLabel.Location = new Point(391, 196);
|
||||
CodeDescLabel.Name = "CodeDescLabel";
|
||||
CodeDescLabel.Size = new Size(0, 13);
|
||||
CodeDescLabel.TabIndex = 40;
|
||||
CodeDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// EmailDescLabel
|
||||
//
|
||||
EmailDescLabel.Anchor = AnchorStyles.Top;
|
||||
EmailDescLabel.AutoSize = true;
|
||||
EmailDescLabel.BackColor = Color.Transparent;
|
||||
EmailDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
EmailDescLabel.ForeColor = Color.White;
|
||||
EmailDescLabel.ImeMode = ImeMode.NoControl;
|
||||
EmailDescLabel.Location = new Point(393, 108);
|
||||
EmailDescLabel.Name = "EmailDescLabel";
|
||||
EmailDescLabel.Size = new Size(0, 13);
|
||||
EmailDescLabel.TabIndex = 38;
|
||||
EmailDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// EmailTextBox
|
||||
//
|
||||
EmailTextBox.AcceptsTab = true;
|
||||
EmailTextBox.Location = new Point(85, 103);
|
||||
EmailTextBox.Name = "EmailTextBox";
|
||||
EmailTextBox.Size = new Size(279, 23);
|
||||
EmailTextBox.TabIndex = 23;
|
||||
EmailTextBox.TextChanged += EmailTextBox_TextChanged;
|
||||
//
|
||||
// DescLabelS1
|
||||
//
|
||||
DescLabelS1.Anchor = AnchorStyles.Top;
|
||||
DescLabelS1.AutoEllipsis = true;
|
||||
DescLabelS1.AutoSize = true;
|
||||
DescLabelS1.BackColor = Color.Transparent;
|
||||
DescLabelS1.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
DescLabelS1.ForeColor = Color.White;
|
||||
DescLabelS1.ImeMode = ImeMode.NoControl;
|
||||
DescLabelS1.Location = new Point(88, 83);
|
||||
DescLabelS1.Name = "DescLabelS1";
|
||||
DescLabelS1.Size = new Size(161, 17);
|
||||
DescLabelS1.TabIndex = 22;
|
||||
DescLabelS1.Text = "Enter your Email address";
|
||||
DescLabelS1.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// SubTitleLabelS1
|
||||
//
|
||||
SubTitleLabelS1.Anchor = AnchorStyles.Top;
|
||||
SubTitleLabelS1.AutoEllipsis = true;
|
||||
SubTitleLabelS1.AutoSize = true;
|
||||
SubTitleLabelS1.BackColor = Color.Transparent;
|
||||
SubTitleLabelS1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SubTitleLabelS1.ForeColor = Color.White;
|
||||
SubTitleLabelS1.ImeMode = ImeMode.NoControl;
|
||||
SubTitleLabelS1.Location = new Point(101, 45);
|
||||
SubTitleLabelS1.Name = "SubTitleLabelS1";
|
||||
SubTitleLabelS1.Size = new Size(93, 19);
|
||||
SubTitleLabelS1.TabIndex = 24;
|
||||
SubTitleLabelS1.Text = "Rusty Hearts";
|
||||
SubTitleLabelS1.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TitleLabelS1
|
||||
//
|
||||
TitleLabelS1.Anchor = AnchorStyles.Top;
|
||||
TitleLabelS1.AutoEllipsis = true;
|
||||
TitleLabelS1.AutoSize = true;
|
||||
TitleLabelS1.BackColor = Color.Transparent;
|
||||
TitleLabelS1.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TitleLabelS1.ForeColor = Color.White;
|
||||
TitleLabelS1.ImeMode = ImeMode.NoControl;
|
||||
TitleLabelS1.Location = new Point(85, 3);
|
||||
TitleLabelS1.Name = "TitleLabelS1";
|
||||
TitleLabelS1.Size = new Size(242, 37);
|
||||
TitleLabelS1.TabIndex = 23;
|
||||
TitleLabelS1.Text = "Change Password";
|
||||
TitleLabelS1.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// Stage2Panel
|
||||
//
|
||||
Stage2Panel.BackColor = Color.Transparent;
|
||||
Stage2Panel.Controls.Add(PwdStrengthLabel);
|
||||
Stage2Panel.Controls.Add(PwdConfirmPictureBox);
|
||||
Stage2Panel.Controls.Add(PwdPictureBox);
|
||||
Stage2Panel.Controls.Add(PwdConfirmDescLabel);
|
||||
Stage2Panel.Controls.Add(PwdDescLabel);
|
||||
Stage2Panel.Controls.Add(EmailLabelS2);
|
||||
Stage2Panel.Controls.Add(ReturnLabelS2);
|
||||
Stage2Panel.Controls.Add(OkButtonS2);
|
||||
Stage2Panel.Controls.Add(PasswordTextBox);
|
||||
Stage2Panel.Controls.Add(RepeatPasswordTextBox);
|
||||
Stage2Panel.Controls.Add(SubTitleLabelS2);
|
||||
Stage2Panel.Controls.Add(TitleLabelS2);
|
||||
Stage2Panel.Controls.Add(PasswordLabel);
|
||||
Stage2Panel.Controls.Add(RepeatPasswordLabel);
|
||||
Stage2Panel.Location = new Point(0, 79);
|
||||
Stage2Panel.Name = "Stage2Panel";
|
||||
Stage2Panel.Size = new Size(800, 450);
|
||||
Stage2Panel.TabIndex = 25;
|
||||
//
|
||||
// PwdStrengthLabel
|
||||
//
|
||||
PwdStrengthLabel.Anchor = AnchorStyles.Top;
|
||||
PwdStrengthLabel.AutoSize = true;
|
||||
PwdStrengthLabel.BackColor = Color.Transparent;
|
||||
PwdStrengthLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdStrengthLabel.ForeColor = Color.White;
|
||||
PwdStrengthLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdStrengthLabel.Location = new Point(93, 226);
|
||||
PwdStrengthLabel.Name = "PwdStrengthLabel";
|
||||
PwdStrengthLabel.Size = new Size(0, 13);
|
||||
PwdStrengthLabel.TabIndex = 36;
|
||||
PwdStrengthLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// PwdConfirmPictureBox
|
||||
//
|
||||
PwdConfirmPictureBox.BackColor = Color.Transparent;
|
||||
PwdConfirmPictureBox.Location = new Point(379, 284);
|
||||
PwdConfirmPictureBox.Name = "PwdConfirmPictureBox";
|
||||
PwdConfirmPictureBox.Size = new Size(14, 14);
|
||||
PwdConfirmPictureBox.TabIndex = 35;
|
||||
PwdConfirmPictureBox.TabStop = false;
|
||||
//
|
||||
// PwdPictureBox
|
||||
//
|
||||
PwdPictureBox.BackColor = Color.Transparent;
|
||||
PwdPictureBox.Location = new Point(379, 205);
|
||||
PwdPictureBox.Name = "PwdPictureBox";
|
||||
PwdPictureBox.Size = new Size(14, 14);
|
||||
PwdPictureBox.TabIndex = 34;
|
||||
PwdPictureBox.TabStop = false;
|
||||
//
|
||||
// PwdConfirmDescLabel
|
||||
//
|
||||
PwdConfirmDescLabel.Anchor = AnchorStyles.Top;
|
||||
PwdConfirmDescLabel.AutoSize = true;
|
||||
PwdConfirmDescLabel.BackColor = Color.Transparent;
|
||||
PwdConfirmDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdConfirmDescLabel.ForeColor = Color.White;
|
||||
PwdConfirmDescLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdConfirmDescLabel.Location = new Point(395, 284);
|
||||
PwdConfirmDescLabel.MaximumSize = new Size(250, 0);
|
||||
PwdConfirmDescLabel.Name = "PwdConfirmDescLabel";
|
||||
PwdConfirmDescLabel.Size = new Size(116, 13);
|
||||
PwdConfirmDescLabel.TabIndex = 33;
|
||||
PwdConfirmDescLabel.Text = "Repeat the password";
|
||||
PwdConfirmDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// PwdDescLabel
|
||||
//
|
||||
PwdDescLabel.Anchor = AnchorStyles.Top;
|
||||
PwdDescLabel.AutoEllipsis = true;
|
||||
PwdDescLabel.AutoSize = true;
|
||||
PwdDescLabel.BackColor = Color.Transparent;
|
||||
PwdDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdDescLabel.ForeColor = Color.White;
|
||||
PwdDescLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdDescLabel.Location = new Point(395, 206);
|
||||
PwdDescLabel.MaximumSize = new Size(250, 0);
|
||||
PwdDescLabel.Name = "PwdDescLabel";
|
||||
PwdDescLabel.Size = new Size(84, 13);
|
||||
PwdDescLabel.TabIndex = 32;
|
||||
PwdDescLabel.Text = "6-16 characters";
|
||||
PwdDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// EmailLabelS2
|
||||
//
|
||||
EmailLabelS2.AutoSize = true;
|
||||
EmailLabelS2.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
EmailLabelS2.ForeColor = Color.DodgerBlue;
|
||||
EmailLabelS2.Location = new Point(101, 106);
|
||||
EmailLabelS2.Name = "EmailLabelS2";
|
||||
EmailLabelS2.Size = new Size(47, 20);
|
||||
EmailLabelS2.TabIndex = 28;
|
||||
EmailLabelS2.Text = "Email";
|
||||
//
|
||||
// ReturnLabelS2
|
||||
//
|
||||
ReturnLabelS2.Anchor = AnchorStyles.Top;
|
||||
ReturnLabelS2.AutoEllipsis = true;
|
||||
ReturnLabelS2.AutoSize = true;
|
||||
ReturnLabelS2.BackColor = Color.Transparent;
|
||||
ReturnLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ReturnLabelS2.ForeColor = Color.Gainsboro;
|
||||
ReturnLabelS2.ImeMode = ImeMode.NoControl;
|
||||
ReturnLabelS2.Location = new Point(98, 392);
|
||||
ReturnLabelS2.Name = "ReturnLabelS2";
|
||||
ReturnLabelS2.Size = new Size(67, 19);
|
||||
ReturnLabelS2.TabIndex = 27;
|
||||
ReturnLabelS2.Text = "< Return";
|
||||
ReturnLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
ReturnLabelS2.Click += ReturnLabel_Click;
|
||||
ReturnLabelS2.MouseLeave += ReturnLabelS2_MouseLeave;
|
||||
ReturnLabelS2.MouseHover += ReturnLabelS2_MouseHover;
|
||||
//
|
||||
// OkButtonS2
|
||||
//
|
||||
OkButtonS2.BackColor = Color.Transparent;
|
||||
OkButtonS2.FlatAppearance.BorderSize = 0;
|
||||
OkButtonS2.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
OkButtonS2.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
OkButtonS2.FlatStyle = FlatStyle.Flat;
|
||||
OkButtonS2.ImageIndex = 0;
|
||||
OkButtonS2.ImageList = imageListOKBtn;
|
||||
OkButtonS2.ImeMode = ImeMode.NoControl;
|
||||
OkButtonS2.Location = new Point(95, 323);
|
||||
OkButtonS2.Name = "OkButtonS2";
|
||||
OkButtonS2.Size = new Size(110, 44);
|
||||
OkButtonS2.TabIndex = 26;
|
||||
OkButtonS2.UseVisualStyleBackColor = false;
|
||||
OkButtonS2.Click += OkButtonS2_Click;
|
||||
OkButtonS2.MouseDown += OkButtonS2_OnMouseDown;
|
||||
OkButtonS2.MouseLeave += OkButtonS2_MouseLeave;
|
||||
OkButtonS2.MouseHover += OkButtonS2_MouseHover;
|
||||
//
|
||||
// PasswordTextBox
|
||||
//
|
||||
PasswordTextBox.Location = new Point(93, 200);
|
||||
PasswordTextBox.Name = "PasswordTextBox";
|
||||
PasswordTextBox.Size = new Size(279, 23);
|
||||
PasswordTextBox.TabIndex = 25;
|
||||
PasswordTextBox.UseSystemPasswordChar = true;
|
||||
PasswordTextBox.TextChanged += PasswordTextBox_TextChanged;
|
||||
//
|
||||
// RepeatPasswordTextBox
|
||||
//
|
||||
RepeatPasswordTextBox.Location = new Point(93, 281);
|
||||
RepeatPasswordTextBox.Name = "RepeatPasswordTextBox";
|
||||
RepeatPasswordTextBox.Size = new Size(279, 23);
|
||||
RepeatPasswordTextBox.TabIndex = 24;
|
||||
RepeatPasswordTextBox.UseSystemPasswordChar = true;
|
||||
RepeatPasswordTextBox.TextChanged += RepeatPasswordTextBox_TextChanged;
|
||||
//
|
||||
// SubTitleLabelS2
|
||||
//
|
||||
SubTitleLabelS2.Anchor = AnchorStyles.Top;
|
||||
SubTitleLabelS2.AutoEllipsis = true;
|
||||
SubTitleLabelS2.AutoSize = true;
|
||||
SubTitleLabelS2.BackColor = Color.Transparent;
|
||||
SubTitleLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SubTitleLabelS2.ForeColor = Color.White;
|
||||
SubTitleLabelS2.ImeMode = ImeMode.NoControl;
|
||||
SubTitleLabelS2.Location = new Point(101, 72);
|
||||
SubTitleLabelS2.Name = "SubTitleLabelS2";
|
||||
SubTitleLabelS2.Size = new Size(63, 19);
|
||||
SubTitleLabelS2.TabIndex = 22;
|
||||
SubTitleLabelS2.Text = "Account";
|
||||
SubTitleLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TitleLabelS2
|
||||
//
|
||||
TitleLabelS2.Anchor = AnchorStyles.Top;
|
||||
TitleLabelS2.AutoEllipsis = true;
|
||||
TitleLabelS2.AutoSize = true;
|
||||
TitleLabelS2.BackColor = Color.Transparent;
|
||||
TitleLabelS2.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TitleLabelS2.ForeColor = Color.White;
|
||||
TitleLabelS2.ImeMode = ImeMode.NoControl;
|
||||
TitleLabelS2.Location = new Point(85, 3);
|
||||
TitleLabelS2.Name = "TitleLabelS2";
|
||||
TitleLabelS2.Size = new Size(242, 37);
|
||||
TitleLabelS2.TabIndex = 21;
|
||||
TitleLabelS2.Text = "Change Password";
|
||||
TitleLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// imageListTips
|
||||
//
|
||||
imageListTips.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListTips.ImageStream = (ImageListStreamer)resources.GetObject("imageListTips.ImageStream");
|
||||
imageListTips.TransparentColor = Color.Transparent;
|
||||
imageListTips.Images.SetKeyName(0, "tips_error.png");
|
||||
imageListTips.Images.SetKeyName(1, "tips_ok.png");
|
||||
//
|
||||
// ChangePwd
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.Black;
|
||||
BackgroundImage = Properties.Resources.bg;
|
||||
BackgroundImageLayout = ImageLayout.Center;
|
||||
ClientSize = new Size(800, 571);
|
||||
Controls.Add(CloseButton);
|
||||
Controls.Add(MinimizeButton);
|
||||
Controls.Add(Stage1Panel);
|
||||
Controls.Add(Stage2Panel);
|
||||
DoubleBuffered = true;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "ChangePwd";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Change Password";
|
||||
FormClosing += ChangePwd_FormClosing;
|
||||
Load += ChangePwd_Load;
|
||||
Stage1Panel.ResumeLayout(false);
|
||||
Stage1Panel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)EmailPictureBox).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)CodePictureBox).EndInit();
|
||||
Stage2Panel.ResumeLayout(false);
|
||||
Stage2Panel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdPictureBox).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button CloseButton;
|
||||
private ImageList imageListCloseBtn;
|
||||
private Button MinimizeButton;
|
||||
private ImageList imageListMinBtn;
|
||||
private Label CodeLabel;
|
||||
private ImageList imageListOKBtn;
|
||||
private Button ContinueButtonS1;
|
||||
private Label PasswordLabel;
|
||||
private Label RepeatPasswordLabel;
|
||||
private Button SendEmailButton;
|
||||
private TextBox CodeTextBox;
|
||||
private Label SubTitleLabelS1;
|
||||
private Label TitleLabelS1;
|
||||
private Panel Stage1Panel;
|
||||
private TextBox EmailTextBox;
|
||||
private Label DescLabelS1;
|
||||
private Panel Stage2Panel;
|
||||
private Button OkButtonS2;
|
||||
private TextBox PasswordTextBox;
|
||||
private TextBox RepeatPasswordTextBox;
|
||||
private Label SubTitleLabelS2;
|
||||
private Label TitleLabelS2;
|
||||
private Label ReturnLabelS2;
|
||||
private Label EmailLabelS2;
|
||||
private ImageList imageListSendEmailBtn;
|
||||
private PictureBox PwdConfirmPictureBox;
|
||||
private PictureBox PwdPictureBox;
|
||||
private Label PwdConfirmDescLabel;
|
||||
private Label PwdDescLabel;
|
||||
private ImageList imageListTips;
|
||||
private PictureBox EmailPictureBox;
|
||||
private Label EmailDescLabel;
|
||||
private PictureBox CodePictureBox;
|
||||
private Label CodeDescLabel;
|
||||
private Label TimerLabel;
|
||||
private ImageList imageListContinueBtn;
|
||||
private Label PwdStrengthLabel;
|
||||
}
|
||||
}
|
||||
565
RHLauncher.ChangePwd/ChangePwd.cs
Normal file
|
|
@ -0,0 +1,565 @@
|
|||
using RHLauncher.Helper;
|
||||
using RHLauncher.RHLauncher;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class ChangePwd : Form
|
||||
{
|
||||
private RegistryHandler registryHandler = new();
|
||||
|
||||
public string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl;
|
||||
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
||||
public string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl;
|
||||
|
||||
private readonly System.Windows.Forms.Timer resendTimer = new();
|
||||
private int secondsLeft = 60;
|
||||
|
||||
private readonly bool _shouldRestart;
|
||||
|
||||
public ChangePwd(bool shouldRestart = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Stage1Panel.Visible = true;
|
||||
Stage2Panel.Visible = false;
|
||||
|
||||
resendTimer = new System.Windows.Forms.Timer
|
||||
{
|
||||
Interval = 1000
|
||||
};
|
||||
resendTimer.Tick += ResendTimer_Tick;
|
||||
_shouldRestart = shouldRestart;
|
||||
|
||||
|
||||
TitleLabelS1.Text = LocalizedStrings.ChangePassword;
|
||||
TitleLabelS2.Text = LocalizedStrings.ChangePassword;
|
||||
SubTitleLabelS1.Text = LocalizedStrings.RustyHearts;
|
||||
SubTitleLabelS2.Text = LocalizedStrings.Account;
|
||||
DescLabelS1.Text = LocalizedStrings.EnterEmail;
|
||||
ReturnLabelS2.Text = LocalizedStrings.Return;
|
||||
CodeLabel.Text = LocalizedStrings.VerificationCode;
|
||||
PasswordLabel.Text = LocalizedStrings.NewPassword;
|
||||
PwdDescLabel.Text = LocalizedStrings.NewPasswordDesc;
|
||||
RepeatPasswordLabel.Text = LocalizedStrings.RepeatPassword;
|
||||
PwdConfirmDescLabel.Text = LocalizedStrings.RepeatPasswordDesc;
|
||||
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
private async Task<string> SendEmailRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
using HttpResponseMessage response = await client.PostAsync(SendPasswordCodeUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private void HandleSendEmailResponse(string response)
|
||||
{
|
||||
switch (response)
|
||||
{
|
||||
case "EmailSent":
|
||||
SendEmailButton.Enabled = false;
|
||||
resendTimer.Start();
|
||||
break;
|
||||
case "ValidVerificationCode":
|
||||
// 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;
|
||||
case "InvalidVerificationCode":
|
||||
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
case "ExpiredVerificationCode":
|
||||
CodeDescLabel.Text = LocalizedStrings.ExpiredVerificationCode;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
default:
|
||||
MsgBoxForm.Show("Error:" + response, LocalizedStrings.Error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ResendTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
// Decrement the secondsLeft variable and update the button text
|
||||
secondsLeft--;
|
||||
TimerLabel.Text = $"({secondsLeft})";
|
||||
|
||||
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
|
||||
if (secondsLeft == 0)
|
||||
{
|
||||
resendTimer.Stop();
|
||||
SendEmailButton.Enabled = true;
|
||||
TimerLabel.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> VerifyCodeSendRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
||||
new KeyValuePair<string, string>("verification_code_type", "Password"),
|
||||
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private async Task<string> ChangePasswordSendRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
using HttpResponseMessage response = await client.PostAsync(ChangePasswordUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text),
|
||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
||||
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private void OnPasswordChanged()
|
||||
{
|
||||
if (_shouldRestart)
|
||||
{
|
||||
registryHandler = new RegistryHandler();
|
||||
registryHandler.ClearPassword();
|
||||
|
||||
Application.Restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleException(Exception ex)
|
||||
{
|
||||
string errorMessage = ex.Message;
|
||||
string errorLog = ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Click Events
|
||||
|
||||
private async void SendEmailButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(EmailTextBox.Text))
|
||||
{
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
|
||||
EmailDescLabel.ForeColor = Color.Red;
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable the ResendEmailButton and stop the timer
|
||||
SendEmailButton.Enabled = false;
|
||||
resendTimer.Stop();
|
||||
|
||||
try
|
||||
{
|
||||
string email = EmailTextBox.Text;
|
||||
string pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
|
||||
if (Regex.IsMatch(email, pattern))
|
||||
{
|
||||
// email is valid
|
||||
EmailPictureBox.Image = imageListTips.Images[1];
|
||||
EmailDescLabel.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// email is not valid
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the secondsLeft variable and start the timer again
|
||||
secondsLeft = 60;
|
||||
resendTimer.Start();
|
||||
SendEmailButton.Enabled = false;
|
||||
|
||||
string response = await SendEmailRequestAsync();
|
||||
|
||||
HandleSendEmailResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async void ContinueButtonS1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CodeTextBox.Text))
|
||||
{
|
||||
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string response = await VerifyCodeSendRequestAsync();
|
||||
|
||||
HandleSendEmailResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async void OkButtonS2_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string response = await ChangePasswordSendRequestAsync();
|
||||
|
||||
HandleSendEmailResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ReturnLabel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Show the previous panel and hide the current panel
|
||||
if (Stage2Panel.Visible)
|
||||
{
|
||||
Stage1Panel.Visible = true;
|
||||
Stage2Panel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool PasswordTextBoxValid = false;
|
||||
private void PasswordTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
string password = PasswordTextBox.Text;
|
||||
|
||||
// Check for minimum length and maximum length
|
||||
if (password.Length < 6 || password.Length > 16)
|
||||
{
|
||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
||||
PwdDescLabel.ForeColor = Color.Red;
|
||||
PwdPictureBox.Image = imageListTips.Images[0];
|
||||
PasswordTextBoxValid = false;
|
||||
RepeatPasswordTextBoxValid = false;
|
||||
CheckFormS2Validity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for at least one uppercase, one lowercase letter, and one number
|
||||
Regex regex = new(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$");
|
||||
if (!regex.IsMatch(password))
|
||||
{
|
||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelCriteria;
|
||||
PwdDescLabel.ForeColor = Color.Red;
|
||||
PwdPictureBox.Image = imageListTips.Images[0];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelWeak;
|
||||
PwdStrengthLabel.ForeColor = Color.Red;
|
||||
PasswordTextBoxValid = false;
|
||||
RepeatPasswordTextBoxValid = false;
|
||||
CheckFormS2Validity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for additional character types such as symbols
|
||||
regex = new Regex(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).+$");
|
||||
if (regex.IsMatch(password))
|
||||
{
|
||||
PwdDescLabel.Text = "";
|
||||
PwdPictureBox.Image = imageListTips.Images[1];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelStrong;
|
||||
PwdStrengthLabel.ForeColor = Color.Green;
|
||||
PasswordTextBoxValid = true;
|
||||
RepeatPasswordTextBox_TextChanged(sender, e);
|
||||
return;
|
||||
}
|
||||
|
||||
// Password is valid but could be stronger
|
||||
PwdDescLabel.Text = "";
|
||||
PwdPictureBox.Image = imageListTips.Images[1];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelMedium;
|
||||
PwdStrengthLabel.ForeColor = Color.Yellow;
|
||||
PasswordTextBoxValid = true;
|
||||
RepeatPasswordTextBox_TextChanged(sender, e);
|
||||
return;
|
||||
}
|
||||
|
||||
private bool RepeatPasswordTextBoxValid = false;
|
||||
private void RepeatPasswordTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(RepeatPasswordTextBox.Text))
|
||||
{
|
||||
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelEmpty;
|
||||
PwdConfirmDescLabel.ForeColor = Color.Red;
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[0];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
else if (!RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text))
|
||||
{
|
||||
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelMatch;
|
||||
PwdConfirmDescLabel.ForeColor = Color.Red;
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[0];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
PwdConfirmDescLabel.Text = "";
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[1];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
CheckFormS2Validity();
|
||||
}
|
||||
|
||||
|
||||
private bool EmailTextBoxValid = false;
|
||||
private void EmailTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(EmailTextBox.Text))
|
||||
{
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
|
||||
EmailDescLabel.ForeColor = Color.Red;
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailTextBoxValid = false;
|
||||
}
|
||||
try
|
||||
{
|
||||
string email = EmailTextBox.Text;
|
||||
string pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
|
||||
if (Regex.IsMatch(email, pattern))
|
||||
{
|
||||
// email is valid
|
||||
EmailPictureBox.Image = imageListTips.Images[1];
|
||||
EmailDescLabel.Text = "";
|
||||
EmailTextBoxValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// email is not valid
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
|
||||
EmailTextBoxValid = false;
|
||||
}
|
||||
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
}
|
||||
CheckFormS1Validity();
|
||||
}
|
||||
|
||||
private bool CodeTextBoxValid = false;
|
||||
private void CodeTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CodeTextBox.Text))
|
||||
{
|
||||
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
CodeTextBoxValid = false;
|
||||
}
|
||||
try
|
||||
{
|
||||
string input = CodeTextBox.Text;
|
||||
if (int.TryParse(input, out int number))
|
||||
{
|
||||
// input is numeric
|
||||
CodeDescLabel.Text = "";
|
||||
CodePictureBox.Image = imageListTips.Images[1];
|
||||
CodeTextBoxValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// input is not numeric
|
||||
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
CodeTextBoxValid = false;
|
||||
}
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
}
|
||||
CheckFormS1Validity();
|
||||
}
|
||||
|
||||
private void CheckFormS1Validity()
|
||||
{
|
||||
if (EmailTextBoxValid &&
|
||||
CodeTextBoxValid)
|
||||
{
|
||||
ContinueButtonS1.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ContinueButtonS1.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckFormS2Validity()
|
||||
{
|
||||
if (PasswordTextBoxValid &&
|
||||
RepeatPasswordTextBoxValid)
|
||||
{
|
||||
OkButtonS2.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
OkButtonS2.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MinimizeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Events
|
||||
|
||||
private void ContinueButtonS1_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void ContinueButtonS1_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 0;
|
||||
}
|
||||
private void ContinueButtonS1_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void OkButtonS2_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
OkButtonS2.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void OkButtonS2_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
OkButtonS2.ImageIndex = 0;
|
||||
}
|
||||
private void OkButtonS2_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
OkButtonS2.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void SendEmailButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void SendEmailButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 0;
|
||||
}
|
||||
private void SendEmailButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void ChangePwd_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
resendTimer.Dispose();
|
||||
if (sender is ChangePwd changePwd)
|
||||
{
|
||||
changePwd.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
}
|
||||
private void MinimizeButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 0;
|
||||
}
|
||||
private void CloseButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void ReturnLabelS2_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ReturnLabelS2.ForeColor = Color.White;
|
||||
}
|
||||
|
||||
private void ReturnLabelS2_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ReturnLabelS2.ForeColor = Color.Gainsboro;
|
||||
}
|
||||
|
||||
private void ChangePwd_Load(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.Enabled = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
5293
RHLauncher.ChangePwd/ChangePwd.resx
Normal file
55
RHLauncher.Helper/Configuration.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
namespace RHLauncher.RHLauncher.Helper;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
private static readonly string DefaultIniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini");
|
||||
|
||||
public static readonly Configuration Default = new();
|
||||
|
||||
private readonly IniFile iniFile = new(DefaultIniFilePath);
|
||||
|
||||
public Configuration()
|
||||
{
|
||||
string apiUrl = iniFile.ReadValue("Info", "LoginURL");
|
||||
|
||||
//Client endpoints
|
||||
GateXMLUrl = $"{apiUrl}/serverApi/gateway";
|
||||
GateInfoUrl = $"{apiUrl}/serverApi/gateway/info";
|
||||
GateStatusUrl = $"{apiUrl}/serverApi/gateway/status";
|
||||
|
||||
//Launcher endpoints
|
||||
LoginUrl = $"{apiUrl}/accountApi/login";
|
||||
RegisterUrl = $"{apiUrl}/accountApi/register";
|
||||
SendCodeUrl = $"{apiUrl}/accountApi/sendVerificationEmail";
|
||||
VerifyCodeUrl = $"{apiUrl}/accountApi/codeVerification";
|
||||
SendPasswordCodeUrl = $"{apiUrl}/accountApi/sendPasswordResetEmail";
|
||||
ChangePasswordUrl = $"{apiUrl}/accountApi/changePassword";
|
||||
LauncherNewsUrl = $"{apiUrl}/launcher/news";
|
||||
AgreementUrl = $"{apiUrl}/launcher/agreement";
|
||||
|
||||
//Client update endpoints
|
||||
FileListUrl = $"{apiUrl}/launcher/patch/filelist.txt";
|
||||
DownloadUpdateFileUrl = $"{apiUrl}/launcher/patch";
|
||||
|
||||
//Launcher update endpoints
|
||||
GetLauncherVersion = $"{apiUrl}/launcherApi/launcherUpdater/getLauncherVersion";
|
||||
UpdateLauncherVersion = $"{apiUrl}/launcherApi/launcherUpdater/updateLauncherVersion";
|
||||
}
|
||||
|
||||
public string GateXMLUrl { get; set; }
|
||||
public string GateInfoUrl { get; set; }
|
||||
public string GateStatusUrl { get; set; }
|
||||
public string LoginUrl { get; set; }
|
||||
public string RegisterUrl { get; set; }
|
||||
public string SendCodeUrl { get; set; }
|
||||
public string VerifyCodeUrl { get; set; }
|
||||
public string SendPasswordCodeUrl { get; set; }
|
||||
public string ChangePasswordUrl { get; set; }
|
||||
public string FileListUrl { get; set; }
|
||||
public string LauncherNewsUrl { get; set; }
|
||||
public string AgreementUrl { get; set; }
|
||||
public string GetLauncherVersion { get; set; }
|
||||
public string UpdateLauncherVersion { get; set; }
|
||||
public string DownloadUpdateFileUrl { get; set; }
|
||||
}
|
||||
|
||||
15
RHLauncher.Helper/ExceptionHandler.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using RHLauncher.Helper;
|
||||
|
||||
namespace RHLauncher.RHLauncher.Helper
|
||||
{
|
||||
public class ExceptionHandler
|
||||
{
|
||||
public static void HandleException(Exception ex, Exception exlog)
|
||||
{
|
||||
string errorMessage = $"Error: {ex.Message}";
|
||||
string errorLog = $"Error:{ex.Message} {Environment.NewLine} {exlog.Message}";
|
||||
Logger.WriteLog(errorLog);
|
||||
MsgBoxForm.Show(errorMessage, LocalizedStrings.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
RHLauncher.Helper/FormUtils.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace RHLauncher.Helper
|
||||
{
|
||||
public class FormUtils
|
||||
{
|
||||
public const int WM_NCLBUTTONDOWN = 0xA1;
|
||||
public const int HTCAPTION = 0x2;
|
||||
[DllImport("User32.dll")]
|
||||
private static extern bool ReleaseCapture();
|
||||
[DllImport("User32.dll")]
|
||||
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
|
||||
|
||||
public static void MoveForm(IntPtr handle)
|
||||
{
|
||||
ReleaseCapture();
|
||||
SendMessage(handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
RHLauncher.Helper/IniFile.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher.RHLauncher.Helper
|
||||
{
|
||||
public class IniFile
|
||||
{
|
||||
private readonly string _iniFilePath;
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
public IniFile(string iniFileName)
|
||||
{
|
||||
string appDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
_iniFilePath = Path.Combine(appDirectory, iniFileName);
|
||||
|
||||
if (!File.Exists(_iniFilePath))
|
||||
{
|
||||
//Default api url
|
||||
WritePrivateProfileString("Info", "LoginURL", "http://localhost:3000", _iniFilePath);
|
||||
//Default client service
|
||||
WritePrivateProfileString("Info", "Service", "usa", _iniFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public string ReadValue(string section, string key)
|
||||
{
|
||||
StringBuilder sb = new(255);
|
||||
GetPrivateProfileString(section, key, "", sb, 255, _iniFilePath);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public void WriteValue(string section, string key, string value)
|
||||
{
|
||||
WritePrivateProfileString(section, key, value, _iniFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
RHLauncher.Helper/Logger.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
namespace RHLauncher.Helper;
|
||||
|
||||
public class Logger
|
||||
{
|
||||
public static void WriteLog(string message)
|
||||
{
|
||||
string appDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
// Create log file directory if it doesn't exist
|
||||
string logFilePath = Path.Combine(appDirectory, "Logs");
|
||||
Directory.CreateDirectory(logFilePath);
|
||||
|
||||
// Create log file with today's date
|
||||
logFilePath = Path.Combine(logFilePath, "Log-" + DateTime.Today.ToString("MM-dd-yyyy") + ".txt");
|
||||
FileInfo logFileInfo = new(logFilePath);
|
||||
DirectoryInfo logDirInfo = new(logFileInfo.DirectoryName);
|
||||
if (!logDirInfo.Exists)
|
||||
{
|
||||
logDirInfo.Create();
|
||||
}
|
||||
|
||||
// Write log entry to file
|
||||
using FileStream fileStream = logFileInfo.Exists ? new FileStream(logFilePath, FileMode.Append) : logFileInfo.Create();
|
||||
using StreamWriter streamWriter = new(fileStream);
|
||||
streamWriter.WriteLine();
|
||||
streamWriter.WriteLine("Log Entry:");
|
||||
streamWriter.WriteLine("Date/Time: {0} {1}", DateTime.Now.ToLongDateString(), DateTime.Now.ToLongTimeString());
|
||||
streamWriter.WriteLine("Message: {0}", message);
|
||||
streamWriter.WriteLine("---------------------------");
|
||||
}
|
||||
}
|
||||
129
RHLauncher.Helper/RegistryHandler.cs
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
using Microsoft.Win32;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher.Helper
|
||||
{
|
||||
public class RegistryHandler
|
||||
{
|
||||
private const string KEY_NAME = "RustyHearts\\UserInfo";
|
||||
private const string INSTALL_DIR_KEY = "InstallDirectory";
|
||||
private readonly RegistryKey key;
|
||||
|
||||
public RegistryHandler()
|
||||
{
|
||||
key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\" + KEY_NAME, true) ?? Registry.CurrentUser.CreateSubKey("SOFTWARE\\" + KEY_NAME);
|
||||
if (!KeyExist())
|
||||
{
|
||||
CreateKey();
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateKey()
|
||||
{
|
||||
string username = key.GetValue("Username")?.ToString() ?? string.Empty;
|
||||
string password = key.GetValue("Password")?.ToString() ?? string.Empty;
|
||||
string remember = (key.GetValue("Remember") as int?)?.ToString() ?? "0";
|
||||
string autoLogin = (key.GetValue("AutoLogin") as int?)?.ToString() ?? "0";
|
||||
|
||||
key.SetValue("Username", username);
|
||||
key.SetValue("Password", password);
|
||||
key.SetValue("Remember", remember);
|
||||
key.SetValue("AutoLogin", autoLogin);
|
||||
}
|
||||
|
||||
public bool KeyExist()
|
||||
{
|
||||
return key.GetValueNames().Length > 0;
|
||||
}
|
||||
|
||||
public void SaveValues(string username, string password, bool remember, bool autologin)
|
||||
{
|
||||
key.SetValue("Username", username ?? string.Empty);
|
||||
key.SetValue("Password", password != null ? Encrypt(password) : string.Empty);
|
||||
key.SetValue("Remember", remember ? 1 : 0, RegistryValueKind.DWord);
|
||||
key.SetValue("AutoLogin", autologin ? 1 : 0, RegistryValueKind.DWord);
|
||||
}
|
||||
|
||||
public void SaveUser(string username, bool remember)
|
||||
{
|
||||
key.SetValue("Username", username ?? string.Empty);
|
||||
key.SetValue("Remember", remember ? 1 : 0, RegistryValueKind.DWord);
|
||||
}
|
||||
|
||||
public void SaveInstallDirectory(string directory)
|
||||
{
|
||||
key.SetValue(INSTALL_DIR_KEY, directory ?? string.Empty);
|
||||
}
|
||||
|
||||
public string GetInstallDirectory()
|
||||
{
|
||||
return key.GetValue(INSTALL_DIR_KEY)?.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
public void ClearInstallDirectory()
|
||||
{
|
||||
var value = key.GetValue(INSTALL_DIR_KEY)?.ToString();
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
key.DeleteValue(INSTALL_DIR_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteValues(string KEY_NAME)
|
||||
{
|
||||
var value = key.GetValue(KEY_NAME) as string ?? "";
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
{
|
||||
key.DeleteValue(KEY_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearPassword()
|
||||
{
|
||||
key.SetValue("Password", string.Empty);
|
||||
}
|
||||
|
||||
public string?[] ReadValues()
|
||||
{
|
||||
if (KeyExist())
|
||||
{
|
||||
string?[] values = new string?[4];
|
||||
values[0] = (string?)key.GetValue("Username");
|
||||
if (!string.IsNullOrEmpty(values[0]))
|
||||
{
|
||||
string? encryptedPassword = (string?)key.GetValue("Password");
|
||||
if (!string.IsNullOrEmpty(encryptedPassword))
|
||||
{
|
||||
values[1] = Decrypt(encryptedPassword);
|
||||
}
|
||||
else
|
||||
{
|
||||
values[1] = string.Empty;
|
||||
}
|
||||
int? rememberValue = (int?)key.GetValue("Remember");
|
||||
values[2] = rememberValue?.ToString() ?? "0";
|
||||
int? autoLoginValue = (int?)key.GetValue("AutoLogin");
|
||||
values[3] = autoLoginValue?.ToString() ?? "0";
|
||||
return values;
|
||||
}
|
||||
}
|
||||
return new string?[] { string.Empty, string.Empty, "0", "0" };
|
||||
}
|
||||
|
||||
private static string Encrypt(string plainText)
|
||||
{
|
||||
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
byte[] encryptedBytes = ProtectedData.Protect(plainTextBytes, null, DataProtectionScope.CurrentUser);
|
||||
return Convert.ToBase64String(encryptedBytes);
|
||||
}
|
||||
|
||||
private static string Decrypt(string encryptedText)
|
||||
{
|
||||
byte[] encryptedBytes = Convert.FromBase64String(encryptedText);
|
||||
byte[] plainTextBytes = ProtectedData.Unprotect(encryptedBytes, null, DataProtectionScope.CurrentUser);
|
||||
return Encoding.UTF8.GetString(plainTextBytes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
41
RHLauncher.Helper/ServiceFileHandler.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System.Security.Cryptography;
|
||||
|
||||
namespace RHLauncher.RHLauncher.Helper
|
||||
{
|
||||
public class ServiceFileHandler
|
||||
{
|
||||
private readonly string _iniFilePath;
|
||||
private readonly string _installDirectory;
|
||||
|
||||
public ServiceFileHandler(string iniFileName, string installDirectory)
|
||||
{
|
||||
_iniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, iniFileName);
|
||||
_installDirectory = installDirectory;
|
||||
}
|
||||
|
||||
public void UpdateService()
|
||||
{
|
||||
string service = new IniFile(_iniFilePath).ReadValue("Info", "Service");
|
||||
string md5 = CalculateMD5(service);
|
||||
|
||||
string serviceDatPath = Path.Combine(_installDirectory, "Service.dat");
|
||||
string[] lines = File.ReadAllLines(serviceDatPath);
|
||||
|
||||
string currentMd5 = lines[0];
|
||||
string currentService = string.Join(Environment.NewLine, lines, 1, lines.Length - 1);
|
||||
|
||||
if (currentMd5 != md5)
|
||||
{
|
||||
lines[0] = md5;
|
||||
File.WriteAllLines(serviceDatPath, lines);
|
||||
}
|
||||
}
|
||||
|
||||
private static string CalculateMD5(string input)
|
||||
{
|
||||
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
|
||||
byte[] hashBytes = MD5.HashData(inputBytes);
|
||||
return BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
|
||||
}
|
||||
}
|
||||
}
|
||||
753
RHLauncher.LauncherForm/LauncherForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,753 @@
|
|||
namespace RHLauncher
|
||||
{
|
||||
partial class LauncherForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LauncherForm));
|
||||
CloseButton = new Button();
|
||||
imageListCloseBtn = new ImageList(components);
|
||||
MinimizeButton = new Button();
|
||||
imageListMinBtn = new ImageList(components);
|
||||
LaunchButton = new Button();
|
||||
imageListLaunch = new ImageList(components);
|
||||
NameLabel = new Label();
|
||||
CharPictureBox = new PictureBox();
|
||||
getUpdatePanel = new Panel();
|
||||
StopButton = new Button();
|
||||
imageListStopBtn = new ImageList(components);
|
||||
FileCountLabel = new Label();
|
||||
FileSizeLabel = new Label();
|
||||
SpeedLabel = new Label();
|
||||
TimeLabel = new Label();
|
||||
PercentLabel = new Label();
|
||||
DownloadingLabel = new Label();
|
||||
FileNameLabel = new Label();
|
||||
progressBar1 = new ProgressBar();
|
||||
webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
|
||||
LabelNews = new Label();
|
||||
imageListButton = new ImageList(components);
|
||||
AccOptionsButton = new Button();
|
||||
AccPanel = new Panel();
|
||||
LogoutButton = new Button();
|
||||
imageListMenuButton = new ImageList(components);
|
||||
ChangePwdButton = new Button();
|
||||
LaunchOptionsButton = new Button();
|
||||
imageListLaunchOpt = new ImageList(components);
|
||||
LaunchPanel = new Panel();
|
||||
OpenSettingsButton = new Button();
|
||||
OpenInstallDirButton = new Button();
|
||||
ManageButton = new Button();
|
||||
CheckUpdateButton = new Button();
|
||||
InstallButton = new Button();
|
||||
InstallPanel = new Panel();
|
||||
UninstallButton = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)CharPictureBox).BeginInit();
|
||||
getUpdatePanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)webView21).BeginInit();
|
||||
AccPanel.SuspendLayout();
|
||||
LaunchPanel.SuspendLayout();
|
||||
InstallPanel.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// CloseButton
|
||||
//
|
||||
CloseButton.BackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.BorderColor = Color.Black;
|
||||
CloseButton.FlatAppearance.BorderSize = 0;
|
||||
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CloseButton.FlatStyle = FlatStyle.Flat;
|
||||
CloseButton.ForeColor = Color.Transparent;
|
||||
CloseButton.ImageIndex = 0;
|
||||
CloseButton.ImageList = imageListCloseBtn;
|
||||
CloseButton.ImeMode = ImeMode.NoControl;
|
||||
CloseButton.Location = new Point(1203, 8);
|
||||
CloseButton.Name = "CloseButton";
|
||||
CloseButton.Size = new Size(32, 29);
|
||||
CloseButton.TabIndex = 9;
|
||||
CloseButton.UseVisualStyleBackColor = false;
|
||||
CloseButton.Click += CloseButton_Click;
|
||||
CloseButton.MouseDown += CloseButton_OnMouseDown;
|
||||
CloseButton.MouseLeave += CloseButton_MouseLeave;
|
||||
CloseButton.MouseHover += CloseButton_MouseHover;
|
||||
//
|
||||
// imageListCloseBtn
|
||||
//
|
||||
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
|
||||
imageListCloseBtn.TransparentColor = Color.Transparent;
|
||||
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
|
||||
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
|
||||
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
|
||||
//
|
||||
// MinimizeButton
|
||||
//
|
||||
MinimizeButton.BackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
|
||||
MinimizeButton.FlatAppearance.BorderSize = 0;
|
||||
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatStyle = FlatStyle.Flat;
|
||||
MinimizeButton.ForeColor = Color.Transparent;
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
MinimizeButton.ImageList = imageListMinBtn;
|
||||
MinimizeButton.ImeMode = ImeMode.NoControl;
|
||||
MinimizeButton.Location = new Point(1176, 31);
|
||||
MinimizeButton.Name = "MinimizeButton";
|
||||
MinimizeButton.Size = new Size(25, 26);
|
||||
MinimizeButton.TabIndex = 8;
|
||||
MinimizeButton.UseVisualStyleBackColor = false;
|
||||
MinimizeButton.Click += MinimizeButton_Click;
|
||||
MinimizeButton.MouseDown += MinimizeButton_OnMouseDown;
|
||||
MinimizeButton.MouseLeave += MinimizeButton_MouseLeave;
|
||||
MinimizeButton.MouseHover += MinimizeButton_MouseHover;
|
||||
//
|
||||
// imageListMinBtn
|
||||
//
|
||||
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
|
||||
imageListMinBtn.TransparentColor = Color.Transparent;
|
||||
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
|
||||
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
|
||||
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
|
||||
//
|
||||
// LaunchButton
|
||||
//
|
||||
LaunchButton.BackColor = Color.Transparent;
|
||||
LaunchButton.FlatAppearance.BorderSize = 0;
|
||||
LaunchButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
LaunchButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
LaunchButton.FlatStyle = FlatStyle.Flat;
|
||||
LaunchButton.Font = new Font("Segoe UI", 15F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
LaunchButton.ForeColor = Color.White;
|
||||
LaunchButton.ImageIndex = 0;
|
||||
LaunchButton.ImageList = imageListLaunch;
|
||||
LaunchButton.ImeMode = ImeMode.NoControl;
|
||||
LaunchButton.Location = new Point(997, 590);
|
||||
LaunchButton.Name = "LaunchButton";
|
||||
LaunchButton.Size = new Size(158, 52);
|
||||
LaunchButton.TabIndex = 10;
|
||||
LaunchButton.Text = "Launch";
|
||||
LaunchButton.UseVisualStyleBackColor = false;
|
||||
LaunchButton.MouseDown += LaunchButton_OnMouseDown;
|
||||
LaunchButton.MouseLeave += LaunchButton_MouseLeave;
|
||||
LaunchButton.MouseHover += LaunchButton_MouseHover;
|
||||
//
|
||||
// imageListLaunch
|
||||
//
|
||||
imageListLaunch.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListLaunch.ImageStream = (ImageListStreamer)resources.GetObject("imageListLaunch.ImageStream");
|
||||
imageListLaunch.TransparentColor = Color.Transparent;
|
||||
imageListLaunch.Images.SetKeyName(0, "launchbutton_bkg_normal.png");
|
||||
imageListLaunch.Images.SetKeyName(1, "launchbutton_bkg_active.png");
|
||||
imageListLaunch.Images.SetKeyName(2, "launchbutton_bkg_down.png");
|
||||
//
|
||||
// NameLabel
|
||||
//
|
||||
NameLabel.BackColor = Color.Transparent;
|
||||
NameLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
NameLabel.ForeColor = Color.White;
|
||||
NameLabel.ImeMode = ImeMode.NoControl;
|
||||
NameLabel.Location = new Point(822, 32);
|
||||
NameLabel.Name = "NameLabel";
|
||||
NameLabel.Size = new Size(191, 15);
|
||||
NameLabel.TabIndex = 13;
|
||||
NameLabel.Text = "Welcome, {_windyCode}";
|
||||
NameLabel.TextAlign = ContentAlignment.MiddleRight;
|
||||
//
|
||||
// CharPictureBox
|
||||
//
|
||||
CharPictureBox.BackColor = Color.Transparent;
|
||||
CharPictureBox.Image = Properties.Resources.character_select_cut_roselle;
|
||||
CharPictureBox.Location = new Point(23, 165);
|
||||
CharPictureBox.Name = "CharPictureBox";
|
||||
CharPictureBox.Size = new Size(367, 497);
|
||||
CharPictureBox.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
CharPictureBox.TabIndex = 17;
|
||||
CharPictureBox.TabStop = false;
|
||||
CharPictureBox.Click += CharPictureBox_Click;
|
||||
//
|
||||
// getUpdatePanel
|
||||
//
|
||||
getUpdatePanel.BackColor = Color.Transparent;
|
||||
getUpdatePanel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
getUpdatePanel.BorderStyle = BorderStyle.FixedSingle;
|
||||
getUpdatePanel.Controls.Add(StopButton);
|
||||
getUpdatePanel.Controls.Add(FileCountLabel);
|
||||
getUpdatePanel.Controls.Add(FileSizeLabel);
|
||||
getUpdatePanel.Controls.Add(SpeedLabel);
|
||||
getUpdatePanel.Controls.Add(TimeLabel);
|
||||
getUpdatePanel.Controls.Add(PercentLabel);
|
||||
getUpdatePanel.Controls.Add(DownloadingLabel);
|
||||
getUpdatePanel.Controls.Add(FileNameLabel);
|
||||
getUpdatePanel.Controls.Add(progressBar1);
|
||||
getUpdatePanel.Location = new Point(397, 570);
|
||||
getUpdatePanel.Name = "getUpdatePanel";
|
||||
getUpdatePanel.Size = new Size(594, 93);
|
||||
getUpdatePanel.TabIndex = 18;
|
||||
//
|
||||
// StopButton
|
||||
//
|
||||
StopButton.BackColor = Color.Transparent;
|
||||
StopButton.FlatAppearance.BorderColor = Color.Black;
|
||||
StopButton.FlatAppearance.BorderSize = 0;
|
||||
StopButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
StopButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
StopButton.FlatStyle = FlatStyle.Flat;
|
||||
StopButton.ForeColor = Color.Transparent;
|
||||
StopButton.ImageIndex = 0;
|
||||
StopButton.ImageList = imageListStopBtn;
|
||||
StopButton.ImeMode = ImeMode.NoControl;
|
||||
StopButton.Location = new Point(562, 36);
|
||||
StopButton.Name = "StopButton";
|
||||
StopButton.Size = new Size(25, 25);
|
||||
StopButton.TabIndex = 28;
|
||||
StopButton.UseVisualStyleBackColor = false;
|
||||
StopButton.Click += StopButton_Click;
|
||||
StopButton.MouseDown += StopButton_OnMouseDown;
|
||||
StopButton.MouseLeave += StopButton_MouseLeave;
|
||||
StopButton.MouseHover += StopButton_MouseHover;
|
||||
//
|
||||
// imageListStopBtn
|
||||
//
|
||||
imageListStopBtn.ColorDepth = ColorDepth.Depth8Bit;
|
||||
imageListStopBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListStopBtn.ImageStream");
|
||||
imageListStopBtn.TransparentColor = Color.Transparent;
|
||||
imageListStopBtn.Images.SetKeyName(0, "button_stop_normal.png");
|
||||
imageListStopBtn.Images.SetKeyName(1, "button_stop_active.png");
|
||||
imageListStopBtn.Images.SetKeyName(2, "button_stop_down.png");
|
||||
//
|
||||
// FileCountLabel
|
||||
//
|
||||
FileCountLabel.Anchor = AnchorStyles.Top;
|
||||
FileCountLabel.AutoSize = true;
|
||||
FileCountLabel.BackColor = Color.Transparent;
|
||||
FileCountLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
FileCountLabel.ForeColor = Color.White;
|
||||
FileCountLabel.ImeMode = ImeMode.NoControl;
|
||||
FileCountLabel.Location = new Point(130, 15);
|
||||
FileCountLabel.Name = "FileCountLabel";
|
||||
FileCountLabel.Size = new Size(32, 13);
|
||||
FileCountLabel.TabIndex = 20;
|
||||
FileCountLabel.Text = "(0/0)";
|
||||
FileCountLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// FileSizeLabel
|
||||
//
|
||||
FileSizeLabel.Anchor = AnchorStyles.Top;
|
||||
FileSizeLabel.AutoSize = true;
|
||||
FileSizeLabel.BackColor = Color.Transparent;
|
||||
FileSizeLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
FileSizeLabel.ForeColor = Color.White;
|
||||
FileSizeLabel.ImeMode = ImeMode.NoControl;
|
||||
FileSizeLabel.Location = new Point(251, 15);
|
||||
FileSizeLabel.Name = "FileSizeLabel";
|
||||
FileSizeLabel.Size = new Size(31, 13);
|
||||
FileSizeLabel.TabIndex = 19;
|
||||
FileSizeLabel.Text = "0MB";
|
||||
FileSizeLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// SpeedLabel
|
||||
//
|
||||
SpeedLabel.Anchor = AnchorStyles.Top;
|
||||
SpeedLabel.AutoSize = true;
|
||||
SpeedLabel.BackColor = Color.Transparent;
|
||||
SpeedLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SpeedLabel.ForeColor = Color.White;
|
||||
SpeedLabel.ImeMode = ImeMode.NoControl;
|
||||
SpeedLabel.Location = new Point(381, 15);
|
||||
SpeedLabel.Name = "SpeedLabel";
|
||||
SpeedLabel.Size = new Size(41, 13);
|
||||
SpeedLabel.TabIndex = 17;
|
||||
SpeedLabel.Text = "0MB/s";
|
||||
SpeedLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TimeLabel
|
||||
//
|
||||
TimeLabel.Anchor = AnchorStyles.Top;
|
||||
TimeLabel.AutoSize = true;
|
||||
TimeLabel.BackColor = Color.Transparent;
|
||||
TimeLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TimeLabel.ForeColor = Color.White;
|
||||
TimeLabel.ImeMode = ImeMode.NoControl;
|
||||
TimeLabel.Location = new Point(455, 15);
|
||||
TimeLabel.Name = "TimeLabel";
|
||||
TimeLabel.Size = new Size(49, 13);
|
||||
TimeLabel.TabIndex = 16;
|
||||
TimeLabel.Text = "00:00:00";
|
||||
TimeLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// PercentLabel
|
||||
//
|
||||
PercentLabel.Anchor = AnchorStyles.Top;
|
||||
PercentLabel.AutoSize = true;
|
||||
PercentLabel.BackColor = Color.Transparent;
|
||||
PercentLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PercentLabel.ForeColor = Color.White;
|
||||
PercentLabel.ImeMode = ImeMode.NoControl;
|
||||
PercentLabel.Location = new Point(527, 44);
|
||||
PercentLabel.Name = "PercentLabel";
|
||||
PercentLabel.Size = new Size(23, 13);
|
||||
PercentLabel.TabIndex = 15;
|
||||
PercentLabel.Text = "0%";
|
||||
PercentLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// DownloadingLabel
|
||||
//
|
||||
DownloadingLabel.Anchor = AnchorStyles.Top;
|
||||
DownloadingLabel.AutoSize = true;
|
||||
DownloadingLabel.BackColor = Color.Transparent;
|
||||
DownloadingLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
DownloadingLabel.ForeColor = Color.White;
|
||||
DownloadingLabel.ImeMode = ImeMode.NoControl;
|
||||
DownloadingLabel.Location = new Point(12, 15);
|
||||
DownloadingLabel.Name = "DownloadingLabel";
|
||||
DownloadingLabel.Size = new Size(78, 13);
|
||||
DownloadingLabel.TabIndex = 14;
|
||||
DownloadingLabel.Text = "Downloading";
|
||||
DownloadingLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// FileNameLabel
|
||||
//
|
||||
FileNameLabel.AutoSize = true;
|
||||
FileNameLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
FileNameLabel.ForeColor = Color.White;
|
||||
FileNameLabel.Location = new Point(10, 70);
|
||||
FileNameLabel.Name = "FileNameLabel";
|
||||
FileNameLabel.Size = new Size(56, 15);
|
||||
FileNameLabel.TabIndex = 1;
|
||||
FileNameLabel.Text = "filename";
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
progressBar1.Location = new Point(11, 38);
|
||||
progressBar1.Name = "progressBar1";
|
||||
progressBar1.Size = new Size(502, 23);
|
||||
progressBar1.TabIndex = 0;
|
||||
//
|
||||
// webView21
|
||||
//
|
||||
webView21.AllowExternalDrop = true;
|
||||
webView21.BackColor = Color.RoyalBlue;
|
||||
webView21.CreationProperties = null;
|
||||
webView21.DefaultBackgroundColor = Color.White;
|
||||
webView21.Location = new Point(412, 101);
|
||||
webView21.Name = "webView21";
|
||||
webView21.Size = new Size(475, 405);
|
||||
webView21.TabIndex = 21;
|
||||
webView21.ZoomFactor = 1D;
|
||||
//
|
||||
// LabelNews
|
||||
//
|
||||
LabelNews.AutoSize = true;
|
||||
LabelNews.BackColor = Color.Transparent;
|
||||
LabelNews.FlatStyle = FlatStyle.Flat;
|
||||
LabelNews.Font = new Font("Segoe UI", 20.25F, FontStyle.Bold | FontStyle.Underline, GraphicsUnit.Point);
|
||||
LabelNews.ForeColor = Color.FromArgb(246, 239, 247);
|
||||
LabelNews.Location = new Point(599, 64);
|
||||
LabelNews.Name = "LabelNews";
|
||||
LabelNews.Size = new Size(95, 37);
|
||||
LabelNews.TabIndex = 22;
|
||||
LabelNews.Text = "NEWS";
|
||||
//
|
||||
// imageListButton
|
||||
//
|
||||
imageListButton.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListButton.ImageStream = (ImageListStreamer)resources.GetObject("imageListButton.ImageStream");
|
||||
imageListButton.TransparentColor = Color.Transparent;
|
||||
imageListButton.Images.SetKeyName(0, "list_button_normal.png");
|
||||
imageListButton.Images.SetKeyName(1, "list_button_hover.png");
|
||||
//
|
||||
// AccOptionsButton
|
||||
//
|
||||
AccOptionsButton.BackColor = Color.Transparent;
|
||||
AccOptionsButton.FlatAppearance.BorderColor = Color.Black;
|
||||
AccOptionsButton.FlatAppearance.BorderSize = 0;
|
||||
AccOptionsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
AccOptionsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
AccOptionsButton.FlatStyle = FlatStyle.Flat;
|
||||
AccOptionsButton.ForeColor = Color.Transparent;
|
||||
AccOptionsButton.ImageIndex = 0;
|
||||
AccOptionsButton.ImageList = imageListButton;
|
||||
AccOptionsButton.ImeMode = ImeMode.NoControl;
|
||||
AccOptionsButton.Location = new Point(1018, 26);
|
||||
AccOptionsButton.Name = "AccOptionsButton";
|
||||
AccOptionsButton.Size = new Size(25, 26);
|
||||
AccOptionsButton.TabIndex = 23;
|
||||
AccOptionsButton.UseVisualStyleBackColor = false;
|
||||
AccOptionsButton.Click += AccOptionsButton_Click;
|
||||
AccOptionsButton.MouseLeave += AccOptionsButton_MouseLeave;
|
||||
AccOptionsButton.MouseHover += AccOptionsButton_MouseHover;
|
||||
//
|
||||
// AccPanel
|
||||
//
|
||||
AccPanel.BackColor = Color.RoyalBlue;
|
||||
AccPanel.BackgroundImage = Properties.Resources.help_panel_bkg;
|
||||
AccPanel.Controls.Add(LogoutButton);
|
||||
AccPanel.Controls.Add(ChangePwdButton);
|
||||
AccPanel.Location = new Point(969, 52);
|
||||
AccPanel.Name = "AccPanel";
|
||||
AccPanel.Size = new Size(124, 62);
|
||||
AccPanel.TabIndex = 24;
|
||||
AccPanel.Visible = false;
|
||||
//
|
||||
// LogoutButton
|
||||
//
|
||||
LogoutButton.BackColor = Color.Transparent;
|
||||
LogoutButton.FlatAppearance.BorderSize = 0;
|
||||
LogoutButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
LogoutButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
LogoutButton.FlatStyle = FlatStyle.Flat;
|
||||
LogoutButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
LogoutButton.ForeColor = Color.White;
|
||||
LogoutButton.ImageIndex = 0;
|
||||
LogoutButton.ImageList = imageListMenuButton;
|
||||
LogoutButton.ImeMode = ImeMode.NoControl;
|
||||
LogoutButton.Location = new Point(3, 31);
|
||||
LogoutButton.Name = "LogoutButton";
|
||||
LogoutButton.Size = new Size(118, 28);
|
||||
LogoutButton.TabIndex = 29;
|
||||
LogoutButton.Text = "Logout";
|
||||
LogoutButton.UseVisualStyleBackColor = false;
|
||||
LogoutButton.Click += LogoutButton_Click;
|
||||
LogoutButton.MouseDown += MenuButton_MouseDown;
|
||||
LogoutButton.MouseLeave += MenuButton_MouseLeave;
|
||||
LogoutButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// imageListMenuButton
|
||||
//
|
||||
imageListMenuButton.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListMenuButton.ImageStream = (ImageListStreamer)resources.GetObject("imageListMenuButton.ImageStream");
|
||||
imageListMenuButton.TransparentColor = Color.Transparent;
|
||||
imageListMenuButton.Images.SetKeyName(0, "menubutton_bkg_normal.png");
|
||||
imageListMenuButton.Images.SetKeyName(1, "menubutton_bkg_active.png");
|
||||
imageListMenuButton.Images.SetKeyName(2, "menubutton_bkg_down.png");
|
||||
//
|
||||
// ChangePwdButton
|
||||
//
|
||||
ChangePwdButton.BackColor = Color.Transparent;
|
||||
ChangePwdButton.FlatAppearance.BorderSize = 0;
|
||||
ChangePwdButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
ChangePwdButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
ChangePwdButton.FlatStyle = FlatStyle.Flat;
|
||||
ChangePwdButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ChangePwdButton.ForeColor = Color.White;
|
||||
ChangePwdButton.ImageIndex = 0;
|
||||
ChangePwdButton.ImageList = imageListMenuButton;
|
||||
ChangePwdButton.ImeMode = ImeMode.NoControl;
|
||||
ChangePwdButton.Location = new Point(3, 3);
|
||||
ChangePwdButton.Name = "ChangePwdButton";
|
||||
ChangePwdButton.Size = new Size(118, 28);
|
||||
ChangePwdButton.TabIndex = 28;
|
||||
ChangePwdButton.Text = "Change Password";
|
||||
ChangePwdButton.UseVisualStyleBackColor = false;
|
||||
ChangePwdButton.Click += ChangePwdButton_Click;
|
||||
ChangePwdButton.MouseDown += MenuButton_MouseDown;
|
||||
ChangePwdButton.MouseLeave += MenuButton_MouseLeave;
|
||||
ChangePwdButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// LaunchOptionsButton
|
||||
//
|
||||
LaunchOptionsButton.BackColor = Color.Transparent;
|
||||
LaunchOptionsButton.FlatAppearance.BorderSize = 0;
|
||||
LaunchOptionsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
LaunchOptionsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
LaunchOptionsButton.FlatStyle = FlatStyle.Flat;
|
||||
LaunchOptionsButton.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
LaunchOptionsButton.ForeColor = Color.White;
|
||||
LaunchOptionsButton.ImageIndex = 0;
|
||||
LaunchOptionsButton.ImageList = imageListLaunchOpt;
|
||||
LaunchOptionsButton.ImeMode = ImeMode.NoControl;
|
||||
LaunchOptionsButton.Location = new Point(1155, 590);
|
||||
LaunchOptionsButton.Name = "LaunchOptionsButton";
|
||||
LaunchOptionsButton.Size = new Size(34, 52);
|
||||
LaunchOptionsButton.TabIndex = 25;
|
||||
LaunchOptionsButton.UseVisualStyleBackColor = false;
|
||||
LaunchOptionsButton.Click += LaunchOptionsButton_Click;
|
||||
LaunchOptionsButton.MouseDown += LaunchOptionsButton_OnMouseDown;
|
||||
LaunchOptionsButton.MouseLeave += LaunchOptionsButton_MouseLeave;
|
||||
LaunchOptionsButton.MouseHover += LaunchOptionsButton_MouseHover;
|
||||
//
|
||||
// imageListLaunchOpt
|
||||
//
|
||||
imageListLaunchOpt.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListLaunchOpt.ImageStream = (ImageListStreamer)resources.GetObject("imageListLaunchOpt.ImageStream");
|
||||
imageListLaunchOpt.TransparentColor = Color.Transparent;
|
||||
imageListLaunchOpt.Images.SetKeyName(0, "launchoptionbutton_normal.png");
|
||||
imageListLaunchOpt.Images.SetKeyName(1, "launchoptionbutton_active.png");
|
||||
imageListLaunchOpt.Images.SetKeyName(2, "launchoptionbutton_down.png");
|
||||
//
|
||||
// LaunchPanel
|
||||
//
|
||||
LaunchPanel.BackColor = Color.RoyalBlue;
|
||||
LaunchPanel.BackgroundImage = Properties.Resources.help_panel_bkg;
|
||||
LaunchPanel.Controls.Add(OpenSettingsButton);
|
||||
LaunchPanel.Controls.Add(OpenInstallDirButton);
|
||||
LaunchPanel.Controls.Add(ManageButton);
|
||||
LaunchPanel.Controls.Add(CheckUpdateButton);
|
||||
LaunchPanel.Location = new Point(1066, 469);
|
||||
LaunchPanel.Name = "LaunchPanel";
|
||||
LaunchPanel.Size = new Size(124, 120);
|
||||
LaunchPanel.TabIndex = 26;
|
||||
LaunchPanel.Visible = false;
|
||||
//
|
||||
// OpenSettingsButton
|
||||
//
|
||||
OpenSettingsButton.BackColor = Color.Transparent;
|
||||
OpenSettingsButton.FlatAppearance.BorderSize = 0;
|
||||
OpenSettingsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
OpenSettingsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
OpenSettingsButton.FlatStyle = FlatStyle.Flat;
|
||||
OpenSettingsButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
OpenSettingsButton.ForeColor = Color.White;
|
||||
OpenSettingsButton.ImageIndex = 0;
|
||||
OpenSettingsButton.ImageList = imageListMenuButton;
|
||||
OpenSettingsButton.ImeMode = ImeMode.NoControl;
|
||||
OpenSettingsButton.Location = new Point(3, 2);
|
||||
OpenSettingsButton.Name = "OpenSettingsButton";
|
||||
OpenSettingsButton.Size = new Size(118, 28);
|
||||
OpenSettingsButton.TabIndex = 31;
|
||||
OpenSettingsButton.Text = "Game Settings";
|
||||
OpenSettingsButton.UseVisualStyleBackColor = false;
|
||||
OpenSettingsButton.Click += OpenSettingsButton_Click;
|
||||
OpenSettingsButton.MouseDown += MenuButton_MouseDown;
|
||||
OpenSettingsButton.MouseLeave += MenuButton_MouseLeave;
|
||||
OpenSettingsButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// OpenInstallDirButton
|
||||
//
|
||||
OpenInstallDirButton.BackColor = Color.Transparent;
|
||||
OpenInstallDirButton.FlatAppearance.BorderSize = 0;
|
||||
OpenInstallDirButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
OpenInstallDirButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
OpenInstallDirButton.FlatStyle = FlatStyle.Flat;
|
||||
OpenInstallDirButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
OpenInstallDirButton.ForeColor = Color.White;
|
||||
OpenInstallDirButton.ImageIndex = 0;
|
||||
OpenInstallDirButton.ImageList = imageListMenuButton;
|
||||
OpenInstallDirButton.ImeMode = ImeMode.NoControl;
|
||||
OpenInstallDirButton.Location = new Point(3, 60);
|
||||
OpenInstallDirButton.Name = "OpenInstallDirButton";
|
||||
OpenInstallDirButton.Size = new Size(118, 28);
|
||||
OpenInstallDirButton.TabIndex = 28;
|
||||
OpenInstallDirButton.Text = "Open Install Dir";
|
||||
OpenInstallDirButton.UseVisualStyleBackColor = false;
|
||||
OpenInstallDirButton.Click += OpenInstallDirButton_Click;
|
||||
OpenInstallDirButton.MouseDown += MenuButton_MouseDown;
|
||||
OpenInstallDirButton.MouseLeave += MenuButton_MouseLeave;
|
||||
OpenInstallDirButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// ManageButton
|
||||
//
|
||||
ManageButton.BackColor = Color.Transparent;
|
||||
ManageButton.FlatAppearance.BorderSize = 0;
|
||||
ManageButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
ManageButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
ManageButton.FlatStyle = FlatStyle.Flat;
|
||||
ManageButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ManageButton.ForeColor = Color.White;
|
||||
ManageButton.ImageIndex = 0;
|
||||
ManageButton.ImageList = imageListMenuButton;
|
||||
ManageButton.ImeMode = ImeMode.NoControl;
|
||||
ManageButton.Location = new Point(3, 89);
|
||||
ManageButton.Name = "ManageButton";
|
||||
ManageButton.Size = new Size(118, 28);
|
||||
ManageButton.TabIndex = 30;
|
||||
ManageButton.Text = "< Manage";
|
||||
ManageButton.UseVisualStyleBackColor = false;
|
||||
ManageButton.Click += ManageButton_Click;
|
||||
ManageButton.MouseDown += MenuButton_MouseDown;
|
||||
ManageButton.MouseLeave += MenuButton_MouseLeave;
|
||||
ManageButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// CheckUpdateButton
|
||||
//
|
||||
CheckUpdateButton.BackColor = Color.Transparent;
|
||||
CheckUpdateButton.FlatAppearance.BorderSize = 0;
|
||||
CheckUpdateButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CheckUpdateButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CheckUpdateButton.FlatStyle = FlatStyle.Flat;
|
||||
CheckUpdateButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CheckUpdateButton.ForeColor = Color.White;
|
||||
CheckUpdateButton.ImageIndex = 0;
|
||||
CheckUpdateButton.ImageList = imageListMenuButton;
|
||||
CheckUpdateButton.ImeMode = ImeMode.NoControl;
|
||||
CheckUpdateButton.Location = new Point(3, 31);
|
||||
CheckUpdateButton.Name = "CheckUpdateButton";
|
||||
CheckUpdateButton.Size = new Size(118, 28);
|
||||
CheckUpdateButton.TabIndex = 27;
|
||||
CheckUpdateButton.Text = "Check Update";
|
||||
CheckUpdateButton.UseVisualStyleBackColor = false;
|
||||
CheckUpdateButton.Click += UpdateCheckButton_Click;
|
||||
CheckUpdateButton.MouseDown += MenuButton_MouseDown;
|
||||
CheckUpdateButton.MouseLeave += MenuButton_MouseLeave;
|
||||
CheckUpdateButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// InstallButton
|
||||
//
|
||||
InstallButton.BackColor = Color.Transparent;
|
||||
InstallButton.FlatAppearance.BorderSize = 0;
|
||||
InstallButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
InstallButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
InstallButton.FlatStyle = FlatStyle.Flat;
|
||||
InstallButton.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
InstallButton.ForeColor = Color.White;
|
||||
InstallButton.ImageIndex = 0;
|
||||
InstallButton.ImageList = imageListMenuButton;
|
||||
InstallButton.ImeMode = ImeMode.NoControl;
|
||||
InstallButton.Location = new Point(3, 2);
|
||||
InstallButton.Name = "InstallButton";
|
||||
InstallButton.Size = new Size(118, 28);
|
||||
InstallButton.TabIndex = 28;
|
||||
InstallButton.Text = "Install Location";
|
||||
InstallButton.UseVisualStyleBackColor = false;
|
||||
InstallButton.Click += InstallButton_Click;
|
||||
InstallButton.MouseDown += MenuButton_MouseDown;
|
||||
InstallButton.MouseLeave += MenuButton_MouseLeave;
|
||||
InstallButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// InstallPanel
|
||||
//
|
||||
InstallPanel.BackColor = Color.RoyalBlue;
|
||||
InstallPanel.BackgroundImage = Properties.Resources.help_panel_bkg;
|
||||
InstallPanel.Controls.Add(UninstallButton);
|
||||
InstallPanel.Controls.Add(InstallButton);
|
||||
InstallPanel.Location = new Point(941, 469);
|
||||
InstallPanel.Name = "InstallPanel";
|
||||
InstallPanel.Size = new Size(124, 62);
|
||||
InstallPanel.TabIndex = 27;
|
||||
InstallPanel.Visible = false;
|
||||
//
|
||||
// UninstallButton
|
||||
//
|
||||
UninstallButton.BackColor = Color.Transparent;
|
||||
UninstallButton.FlatAppearance.BorderSize = 0;
|
||||
UninstallButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
UninstallButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
UninstallButton.FlatStyle = FlatStyle.Flat;
|
||||
UninstallButton.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
UninstallButton.ForeColor = Color.Red;
|
||||
UninstallButton.ImageIndex = 0;
|
||||
UninstallButton.ImageList = imageListMenuButton;
|
||||
UninstallButton.ImeMode = ImeMode.NoControl;
|
||||
UninstallButton.Location = new Point(3, 31);
|
||||
UninstallButton.Name = "UninstallButton";
|
||||
UninstallButton.Size = new Size(118, 28);
|
||||
UninstallButton.TabIndex = 29;
|
||||
UninstallButton.Text = "Uninstall";
|
||||
UninstallButton.UseVisualStyleBackColor = false;
|
||||
UninstallButton.Click += UninstallButton_Click;
|
||||
UninstallButton.MouseDown += MenuButton_MouseDown;
|
||||
UninstallButton.MouseLeave += MenuButton_MouseLeave;
|
||||
UninstallButton.MouseHover += MenuButton_MouseHover;
|
||||
//
|
||||
// LauncherForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.Magenta;
|
||||
BackgroundImage = Properties.Resources.launcher_bg;
|
||||
BackgroundImageLayout = ImageLayout.None;
|
||||
ClientSize = new Size(1239, 700);
|
||||
Controls.Add(InstallPanel);
|
||||
Controls.Add(LaunchPanel);
|
||||
Controls.Add(LaunchOptionsButton);
|
||||
Controls.Add(AccPanel);
|
||||
Controls.Add(AccOptionsButton);
|
||||
Controls.Add(LabelNews);
|
||||
Controls.Add(webView21);
|
||||
Controls.Add(getUpdatePanel);
|
||||
Controls.Add(CharPictureBox);
|
||||
Controls.Add(NameLabel);
|
||||
Controls.Add(LaunchButton);
|
||||
Controls.Add(CloseButton);
|
||||
Controls.Add(MinimizeButton);
|
||||
DoubleBuffered = true;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "LauncherForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Rusty Hearts Launcher";
|
||||
TransparencyKey = Color.Magenta;
|
||||
FormClosing += LauncherForm_FormClosing;
|
||||
Load += LauncherForm_Load;
|
||||
MouseDown += OnMouseDown;
|
||||
((System.ComponentModel.ISupportInitialize)CharPictureBox).EndInit();
|
||||
getUpdatePanel.ResumeLayout(false);
|
||||
getUpdatePanel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)webView21).EndInit();
|
||||
AccPanel.ResumeLayout(false);
|
||||
LaunchPanel.ResumeLayout(false);
|
||||
InstallPanel.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button CloseButton;
|
||||
private ImageList imageListCloseBtn;
|
||||
private Button MinimizeButton;
|
||||
private ImageList imageListMinBtn;
|
||||
private ImageList imageListLaunch;
|
||||
private Label NameLabel;
|
||||
private PictureBox CharPictureBox;
|
||||
private Panel getUpdatePanel;
|
||||
private ProgressBar progressBar1;
|
||||
private Label FileSizeLabel;
|
||||
private Label SpeedLabel;
|
||||
private Label TimeLabel;
|
||||
private Label PercentLabel;
|
||||
private Label DownloadingLabel;
|
||||
private Label FileNameLabel;
|
||||
private Button LaunchButton;
|
||||
private Label FileCountLabel;
|
||||
private Microsoft.Web.WebView2.WinForms.WebView2 webView21;
|
||||
private Label LabelNews;
|
||||
private ImageList imageListButton;
|
||||
private Button AccOptionsButton;
|
||||
private Panel AccPanel;
|
||||
private Button LaunchOptionsButton;
|
||||
private ImageList imageListLaunchOpt;
|
||||
private Panel LaunchPanel;
|
||||
private Label CheckUpdateLabel;
|
||||
private Button CheckUpdateButton;
|
||||
private ImageList imageListMenuButton;
|
||||
private Button LogoutButton;
|
||||
private Button ChangePwdButton;
|
||||
private Button InstallButton;
|
||||
private Button ManageButton;
|
||||
private Panel InstallPanel;
|
||||
private Button UninstallButton;
|
||||
private Button OpenInstallDirButton;
|
||||
private Button OpenSettingsButton;
|
||||
private ImageList imageListStopBtn;
|
||||
private Button StopButton;
|
||||
}
|
||||
}
|
||||
697
RHLauncher.LauncherForm/LauncherForm.cs
Normal file
|
|
@ -0,0 +1,697 @@
|
|||
using Newtonsoft.Json;
|
||||
using RHLauncher.Helper;
|
||||
using RHLauncher.RHLauncher;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Diagnostics;
|
||||
using static RHLauncher.RHLauncher.UpdateDownloader;
|
||||
using static RHLauncher.RHLauncher.UpdateInstaller;
|
||||
using static RHLauncher.RHLauncher.UpdateUnpacker;
|
||||
|
||||
/*
|
||||
Rusty Hearts Launcher - Windows Forms Implementation in C#
|
||||
Author: JuniorDark
|
||||
GitHub Repository: https://github.com/JuniorDark/RustyHearts-Launcher
|
||||
This code serves as a starting point for creating your own launcher.
|
||||
However, it requires further development to improve functionality and
|
||||
ensure stability. Please check the GitHub repository for updates.
|
||||
*/
|
||||
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class LauncherForm : Form
|
||||
{
|
||||
private RegistryHandler registryHandler = new();
|
||||
private readonly CancellationTokenSource? cancellationTokenSource;
|
||||
public string? installDirectory;
|
||||
private static readonly string DefaultIniFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "config.ini");
|
||||
private readonly IniFile _iniFile = new(DefaultIniFilePath);
|
||||
private readonly string _windyCode;
|
||||
private readonly string _password;
|
||||
private readonly Image[] images = {
|
||||
Properties.Resources.character_select_cut_angela,
|
||||
Properties.Resources.character_select_cut_edgar,
|
||||
Properties.Resources.character_select_cut_frantz,
|
||||
Properties.Resources.character_select_cut_ian,
|
||||
Properties.Resources.character_select_cut_leila,
|
||||
Properties.Resources.character_select_cut_meilinchen,
|
||||
Properties.Resources.character_select_cut_natasha,
|
||||
Properties.Resources.character_select_cut_roselle,
|
||||
Properties.Resources.character_select_cut_tude
|
||||
};
|
||||
|
||||
public LauncherForm(string windyCode, string password)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
LabelNews.Text = LocalizedStrings.LabelNews;
|
||||
|
||||
_windyCode = windyCode;
|
||||
_password = password;
|
||||
installDirectory = registryHandler.GetInstallDirectory();
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
private async void LauncherForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
NameLabel.Text = LocalizedStrings.Welcome + ", " + _windyCode;
|
||||
ChangeCharPictureBox();
|
||||
getUpdatePanel.Hide();
|
||||
|
||||
if (string.IsNullOrEmpty(installDirectory))
|
||||
{
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
LaunchButton.Text = LocalizedStrings.Install;
|
||||
LaunchButton.Click += (s, e) =>
|
||||
{
|
||||
Install();
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
var updater = new ServiceFileHandler("config.ini", installDirectory);
|
||||
updater.UpdateService();
|
||||
|
||||
await CheckForUpdates();
|
||||
}
|
||||
|
||||
await WebView2Async();
|
||||
}
|
||||
|
||||
private async Task WebView2Async()
|
||||
{
|
||||
await webView21.EnsureCoreWebView2Async();
|
||||
webView21.Source = new Uri(Configuration.Default.LauncherNewsUrl);
|
||||
webView21.CoreWebView2.NavigationStarting += (sender, args) =>
|
||||
{
|
||||
// Check if the URL being navigated to is an external link
|
||||
if (!args.Uri.ToString().StartsWith(Configuration.Default.LauncherNewsUrl))
|
||||
{
|
||||
// Cancel the navigation
|
||||
args.Cancel = true;
|
||||
|
||||
// Launch the URL in the user's default browser
|
||||
Process.Start(new ProcessStartInfo(args.Uri) { UseShellExecute = true });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async void Install()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(installDirectory))
|
||||
{
|
||||
OpenFileDialog openFileDialog1 = new()
|
||||
{
|
||||
InitialDirectory = AppDomain.CurrentDomain.BaseDirectory,
|
||||
Filter = "RustyHearts.exe|RustyHearts.exe",
|
||||
Title = "Select RustyHearts.exe"
|
||||
};
|
||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
installDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
|
||||
registryHandler.SaveInstallDirectory(installDirectory);
|
||||
await CheckForUpdates();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CheckForUpdates()
|
||||
{
|
||||
try
|
||||
{
|
||||
LaunchButton.Enabled = false;
|
||||
LaunchButton.Text = LocalizedStrings.Checking;
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
|
||||
switch (await CheckForUpdatesAsync())
|
||||
{
|
||||
case UpdateState.UpdateAvailable:
|
||||
LaunchButton.Text = LocalizedStrings.Update;
|
||||
LaunchButton.Enabled = true;
|
||||
LaunchButton.Click -= LaunchGameButton_Click;
|
||||
LaunchButton.Click += InstallUpdateButton_Click;
|
||||
|
||||
break;
|
||||
case UpdateState.NoUpdateAvailable:
|
||||
LaunchButton.Text = LocalizedStrings.Launch;
|
||||
LaunchButton.Click -= LaunchGameButton_Click;
|
||||
LaunchButton.Click += LaunchGameButton_Click;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
LaunchButton.Enabled = true;
|
||||
LaunchOptionsButton.Enabled = true;
|
||||
AccOptionsButton.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly SemaphoreSlim _semaphore = new(1);
|
||||
|
||||
public async Task InstallUpdate()
|
||||
{
|
||||
await _semaphore.WaitAsync();
|
||||
_cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
try
|
||||
{
|
||||
Progress<ProgressReport> progress = new(ReportProgress);
|
||||
ProgressThrottler progressThrottler = new(progress, 200);
|
||||
|
||||
Progress<ProgressReport> packProgress = new(ReportInstallProgress);
|
||||
ProgressThrottler packProgressThrottler = new(packProgress, 200);
|
||||
|
||||
await DownloadUpdatesAsync(installDirectory, progressThrottler, _cancellationTokenSource.Token);
|
||||
await UnpackDownloadedFilesAsync(installDirectory, packProgressThrottler, _cancellationTokenSource.Token);
|
||||
await PackDownloadedFilesAsync(installDirectory, packProgressThrottler, _cancellationTokenSource.Token);
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
Logger.WriteLog($"Update installation canceled: {ex.Message}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_semaphore.Release();
|
||||
LaunchButton.Enabled = true;
|
||||
LaunchOptionsButton.Enabled = true;
|
||||
LaunchButton.Text = LocalizedStrings.Launch;
|
||||
LaunchButton.Click -= InstallUpdateButton_Click;
|
||||
LaunchButton.Click += LaunchGameButton_Click;
|
||||
|
||||
if (_cancellationTokenSource.IsCancellationRequested)
|
||||
{
|
||||
await CheckForUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void HandleException(Exception ex)
|
||||
{
|
||||
string errorMessage = ex.Message;
|
||||
string errorLog = ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
|
||||
private void ReportProgress(ProgressReport progressReport)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new Action<ProgressReport>(ReportProgress), progressReport);
|
||||
return;
|
||||
}
|
||||
FileNameLabel.Visible = progressReport.ShowFileNameLabel;
|
||||
SpeedLabel.Visible = progressReport.ShowSpeedLabel;
|
||||
TimeLabel.Visible = progressReport.ShowTimeLabel;
|
||||
FileSizeLabel.Visible = progressReport.ShowFileSizeLabel;
|
||||
FileCountLabel.Visible = progressReport.ShowFileCountLabel;
|
||||
DownloadingLabel.Text = progressReport.Label;
|
||||
PercentLabel.Text = $"{progressReport.PercentComplete}%";
|
||||
progressBar1.Maximum = (int)progressReport.TotalBytesToDownload;
|
||||
progressBar1.Value = (int)Math.Min(progressReport.BytesDownloaded, progressReport.TotalBytesToDownload);
|
||||
FileNameLabel.Text = progressReport.FileName;
|
||||
SpeedLabel.Text = FormatDownloadSpeed(progressReport.TotalSpeed);
|
||||
TimeSpan t = TimeSpan.FromSeconds(progressReport.TimeLeft);
|
||||
TimeLabel.Text = $"{t.Hours:00}:{t.Minutes:00}:{t.Seconds:00}";
|
||||
FileSizeLabel.Text = $"({FormatFileSize(progressReport.BytesDownloaded)} / {FormatFileSize(progressReport.TotalBytesToDownload)})";
|
||||
FileCountLabel.Text = $"({progressReport.NumFilesDownloaded}/{progressReport.TotalNumFiles})";
|
||||
|
||||
if (!string.IsNullOrEmpty(progressReport.FileName))
|
||||
{
|
||||
FileNameLabel.Refresh();
|
||||
}
|
||||
|
||||
getUpdatePanel.Visible = progressReport.Panel;
|
||||
}
|
||||
|
||||
private void ReportInstallProgress(ProgressReport progressReport)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new Action<ProgressReport>(ReportInstallProgress), progressReport);
|
||||
return;
|
||||
}
|
||||
FileNameLabel.Visible = progressReport.ShowFileNameLabel;
|
||||
SpeedLabel.Visible = progressReport.ShowSpeedLabel;
|
||||
TimeLabel.Visible = progressReport.ShowTimeLabel;
|
||||
FileSizeLabel.Visible = progressReport.ShowFileSizeLabel;
|
||||
FileCountLabel.Visible = progressReport.ShowFileCountLabel;
|
||||
DownloadingLabel.Text = progressReport.Label;
|
||||
PercentLabel.Text = $"{progressReport.PercentComplete}%";
|
||||
progressBar1.Maximum = progressReport.TotalNumFiles;
|
||||
progressBar1.Value = progressReport.NumFilesPacked;
|
||||
FileNameLabel.Text = progressReport.FileName;
|
||||
FileCountLabel.Text = $"({progressReport.NumFilesPacked}/{progressReport.TotalNumFiles})";
|
||||
|
||||
if (!string.IsNullOrEmpty(progressReport.FileName))
|
||||
{
|
||||
FileNameLabel.Refresh();
|
||||
}
|
||||
|
||||
getUpdatePanel.Visible = progressReport.Panel;
|
||||
}
|
||||
|
||||
public void ChangeCharPictureBox()
|
||||
{
|
||||
Random rnd = new();
|
||||
int index = rnd.Next(images.Length);
|
||||
CharPictureBox.Image = images[index];
|
||||
}
|
||||
|
||||
private static async Task<bool> CheckServerStatusAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
using HttpClient client = new();
|
||||
HttpResponseMessage response = await client.GetAsync(Configuration.Default.GateStatusUrl);
|
||||
response.EnsureSuccessStatusCode();
|
||||
string json = await response.Content.ReadAsStringAsync();
|
||||
dynamic result = JsonConvert.DeserializeObject(json);
|
||||
string status = result.status;
|
||||
return (status == "online");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CharPictureBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
ChangeCharPictureBox();
|
||||
}
|
||||
|
||||
private static void HidePanel(Panel panel)
|
||||
{
|
||||
if (panel.Visible)
|
||||
{
|
||||
panel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void HidePanels()
|
||||
{
|
||||
HidePanel(AccPanel);
|
||||
HidePanel(LaunchPanel);
|
||||
HidePanel(InstallPanel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Click Events
|
||||
|
||||
private CancellationTokenSource? _cancellationTokenSource;
|
||||
private void StopButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
_cancellationTokenSource?.Cancel();
|
||||
getUpdatePanel.Visible = false;
|
||||
LaunchButton.Text = LocalizedStrings.Cancelling;
|
||||
LaunchButton.Click -= InstallUpdateButton_Click;
|
||||
}
|
||||
|
||||
private async void InstallUpdateButton_Click(object? sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
LaunchButton.Text = LocalizedStrings.Updating;
|
||||
LaunchButton.Enabled = false;
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
await InstallUpdate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async void LaunchGameButton_Click(object? sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
HidePanels();
|
||||
LaunchButton.Text = LocalizedStrings.Launching;
|
||||
LaunchButton.Enabled = false;
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
AccOptionsButton.Enabled = false;
|
||||
|
||||
// Check if RustyHearts.exe is already running
|
||||
if (Process.GetProcessesByName("RustyHearts").Length > 0)
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.AlreadyExecute, LocalizedStrings.Error);
|
||||
await CheckForUpdates();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if server is online
|
||||
bool serverOnline = await CheckServerStatusAsync();
|
||||
if (!serverOnline)
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.ServerOffline, LocalizedStrings.Error);
|
||||
await CheckForUpdates();
|
||||
return;
|
||||
}
|
||||
|
||||
LaunchButton.Text = LocalizedStrings.Running;
|
||||
LaunchButton.Enabled = false;
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
AccOptionsButton.Enabled = false;
|
||||
|
||||
string service = _iniFile.ReadValue("Info", "Service");
|
||||
string arguments = string.Empty;
|
||||
|
||||
switch (service.ToLower())
|
||||
{
|
||||
case "usa":
|
||||
arguments = "server=" + Configuration.Default.GateXMLUrl;
|
||||
break;
|
||||
case "chn":
|
||||
arguments = $"-serverurl{Configuration.Default.GateInfoUrl} id={_windyCode} password={_password}";
|
||||
break;
|
||||
default:
|
||||
// handle unsupported service
|
||||
MsgBoxForm.Show(LocalizedStrings.UnsupportedService, LocalizedStrings.Error);
|
||||
await CheckForUpdates();
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessStartInfo startInfo = new()
|
||||
{
|
||||
FileName = Path.Combine(installDirectory, "RustyHearts.exe"),
|
||||
Arguments = arguments,
|
||||
WorkingDirectory = installDirectory
|
||||
};
|
||||
Process? process = Process.Start(startInfo);
|
||||
WindowState = FormWindowState.Minimized;
|
||||
await process.WaitForExitAsync();
|
||||
WindowState = FormWindowState.Maximized;
|
||||
await CheckForUpdates();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
FormUtils.MoveForm(Handle);
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MinimizeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
private void LauncherForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
private void LogoutButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
DialogResult result = MsgBoxForm.ShowYN(LocalizedStrings.LogoutText, LocalizedStrings.Confirmation);
|
||||
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
registryHandler = new RegistryHandler();
|
||||
registryHandler.SaveValues(_windyCode, "", false, false);
|
||||
Logout();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Logout()
|
||||
{
|
||||
LoginForm? loginForm = Application.OpenForms.OfType<LoginForm>().FirstOrDefault();
|
||||
if (loginForm != null)
|
||||
{
|
||||
Application.Restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
LoginForm newLoginForm = new();
|
||||
newLoginForm.Show();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private async void UpdateCheckButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
await CheckForUpdates();
|
||||
}
|
||||
|
||||
private async void InstallButton_Click(object? sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
OpenFileDialog openFileDialog1 = new()
|
||||
{
|
||||
InitialDirectory = AppDomain.CurrentDomain.BaseDirectory,
|
||||
Filter = "RustyHearts.exe|RustyHearts.exe",
|
||||
Title = "Select RustyHearts.exe"
|
||||
};
|
||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
installDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
|
||||
registryHandler.SaveInstallDirectory(installDirectory);
|
||||
await CheckForUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
private void ManageButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
InstallPanel.Visible = !InstallPanel.Visible;
|
||||
}
|
||||
|
||||
private void OpenInstallDirButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
if (!string.IsNullOrEmpty(installDirectory))
|
||||
{
|
||||
Process.Start("explorer.exe", installDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenSettingsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
if (!string.IsNullOrEmpty(installDirectory))
|
||||
{
|
||||
string rustyHeartsConfigPath = Path.Combine(installDirectory, "rustyheartsconfig.exe");
|
||||
if (File.Exists(rustyHeartsConfigPath))
|
||||
{
|
||||
ProcessStartInfo startInfo = new()
|
||||
{
|
||||
FileName = rustyHeartsConfigPath,
|
||||
WorkingDirectory = installDirectory
|
||||
|
||||
};
|
||||
Process.Start(startInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.rustyheartsconfig, LocalizedStrings.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UninstallButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
if (!string.IsNullOrEmpty(installDirectory))
|
||||
{
|
||||
DialogResult result = MsgBoxForm.ShowYN(LocalizedStrings.ConfirmUninstallText, LocalizedStrings.ConfirmUninstall);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
try
|
||||
{
|
||||
LaunchButton.Enabled = false;
|
||||
LaunchOptionsButton.Enabled = false;
|
||||
LaunchButton.Text = LocalizedStrings.Uninstalling;
|
||||
Directory.Delete(installDirectory, true);
|
||||
MsgBoxForm.Show(LocalizedStrings.UninstallText, LocalizedStrings.Uninstall);
|
||||
registryHandler.ClearInstallDirectory();
|
||||
LaunchButton.Enabled = true;
|
||||
LaunchButton.Text = LocalizedStrings.Install;
|
||||
LaunchButton.Click -= LaunchGameButton_Click;
|
||||
LaunchButton.Click += InstallButton_Click;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
else if (result == DialogResult.No)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangePwdButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
HidePanels();
|
||||
ChangePwd changePwd = new(true);
|
||||
changePwd.FormClosing += ChangePwd_FormClosing;
|
||||
changePwd.ShowDialog();
|
||||
}
|
||||
|
||||
private async void ChangePwd_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (sender is ChangePwd changePwd)
|
||||
{
|
||||
changePwd.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void LaunchOptionsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
LaunchPanel.Visible = !LaunchPanel.Visible;
|
||||
if (InstallPanel.Visible)
|
||||
{
|
||||
InstallPanel.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Events
|
||||
|
||||
private void MenuButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
Button button = (Button)sender;
|
||||
button.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void MenuButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
Button button = (Button)sender;
|
||||
button.ImageIndex = 0;
|
||||
}
|
||||
|
||||
private void MenuButton_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
Button button = (Button)sender;
|
||||
button.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void AccOptionsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
AccPanel.Visible = !AccPanel.Visible;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
}
|
||||
|
||||
private void MinimizeButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 0;
|
||||
}
|
||||
private void CloseButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void LaunchButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
LaunchButton.ImageIndex = 1;
|
||||
}
|
||||
private void LaunchButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
LaunchButton.ImageIndex = 0;
|
||||
}
|
||||
private void LaunchButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
LaunchButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void AccOptionsButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
AccOptionsButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void AccOptionsButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
AccOptionsButton.ImageIndex = 0;
|
||||
}
|
||||
|
||||
private void LaunchOptionsButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
LaunchOptionsButton.ImageIndex = 1;
|
||||
}
|
||||
private void LaunchOptionsButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
LaunchOptionsButton.ImageIndex = 0;
|
||||
}
|
||||
private void LaunchOptionsButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
LaunchOptionsButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void StopButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
StopButton.ImageIndex = 1;
|
||||
}
|
||||
private void StopButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
StopButton.ImageIndex = 0;
|
||||
}
|
||||
private void StopButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
StopButton.ImageIndex = 2;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
6240
RHLauncher.LauncherForm/LauncherForm.resx
Normal file
339
RHLauncher.LoginForm/LoginForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
namespace RHLauncher
|
||||
{
|
||||
partial class LoginForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm));
|
||||
UsernameLabel = new Label();
|
||||
PasswordLabel = new Label();
|
||||
UsernameTextBox = new TextBox();
|
||||
PasswordTextBox = new TextBox();
|
||||
MinimizeButton = new Button();
|
||||
imageListMinBtn = new ImageList(components);
|
||||
imageListCloseBtn = new ImageList(components);
|
||||
CloseButton = new Button();
|
||||
imageListLogin = new ImageList(components);
|
||||
LoginButton = new Button();
|
||||
RegisterButton = new Button();
|
||||
imageListRegister = new ImageList(components);
|
||||
CheckBoxAutoLogin = new CheckBox();
|
||||
CheckBoxSaveUser = new CheckBox();
|
||||
timer1 = new System.Windows.Forms.Timer(components);
|
||||
progressBarLogin = new ProgressBar();
|
||||
ForgotPwdLabel = new Label();
|
||||
VersionLabel = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// UsernameLabel
|
||||
//
|
||||
UsernameLabel.AutoSize = true;
|
||||
UsernameLabel.BackColor = Color.Transparent;
|
||||
UsernameLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
UsernameLabel.ForeColor = Color.White;
|
||||
UsernameLabel.Location = new Point(612, 199);
|
||||
UsernameLabel.Name = "UsernameLabel";
|
||||
UsernameLabel.Size = new Size(76, 25);
|
||||
UsernameLabel.TabIndex = 0;
|
||||
UsernameLabel.Text = "Username";
|
||||
UsernameLabel.UseCompatibleTextRendering = true;
|
||||
//
|
||||
// PasswordLabel
|
||||
//
|
||||
PasswordLabel.AutoSize = true;
|
||||
PasswordLabel.BackColor = Color.Transparent;
|
||||
PasswordLabel.Font = new Font("Segoe UI Black", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PasswordLabel.ForeColor = Color.White;
|
||||
PasswordLabel.Location = new Point(612, 248);
|
||||
PasswordLabel.Name = "PasswordLabel";
|
||||
PasswordLabel.Size = new Size(81, 20);
|
||||
PasswordLabel.TabIndex = 1;
|
||||
PasswordLabel.Text = "Password";
|
||||
//
|
||||
// UsernameTextBox
|
||||
//
|
||||
UsernameTextBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
UsernameTextBox.Location = new Point(612, 222);
|
||||
UsernameTextBox.Name = "UsernameTextBox";
|
||||
UsernameTextBox.Size = new Size(210, 21);
|
||||
UsernameTextBox.TabIndex = 2;
|
||||
//
|
||||
// PasswordTextBox
|
||||
//
|
||||
PasswordTextBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
PasswordTextBox.Location = new Point(613, 271);
|
||||
PasswordTextBox.Name = "PasswordTextBox";
|
||||
PasswordTextBox.PasswordChar = '*';
|
||||
PasswordTextBox.Size = new Size(210, 21);
|
||||
PasswordTextBox.TabIndex = 3;
|
||||
//
|
||||
// MinimizeButton
|
||||
//
|
||||
MinimizeButton.BackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
|
||||
MinimizeButton.FlatAppearance.BorderSize = 0;
|
||||
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatStyle = FlatStyle.Flat;
|
||||
MinimizeButton.ForeColor = Color.Transparent;
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
MinimizeButton.ImageList = imageListMinBtn;
|
||||
MinimizeButton.Location = new Point(752, 7);
|
||||
MinimizeButton.Name = "MinimizeButton";
|
||||
MinimizeButton.Size = new Size(25, 26);
|
||||
MinimizeButton.TabIndex = 5;
|
||||
MinimizeButton.UseVisualStyleBackColor = false;
|
||||
MinimizeButton.Click += MinimizeButton_Click;
|
||||
MinimizeButton.MouseDown += MinimizeButton_OnMouseDown;
|
||||
MinimizeButton.MouseLeave += MinimizeButton_MouseLeave;
|
||||
MinimizeButton.MouseHover += MinimizeButton_MouseHover;
|
||||
//
|
||||
// imageListMinBtn
|
||||
//
|
||||
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
|
||||
imageListMinBtn.TransparentColor = Color.Transparent;
|
||||
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
|
||||
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
|
||||
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
|
||||
//
|
||||
// imageListCloseBtn
|
||||
//
|
||||
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
|
||||
imageListCloseBtn.TransparentColor = Color.Transparent;
|
||||
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
|
||||
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
|
||||
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
|
||||
//
|
||||
// CloseButton
|
||||
//
|
||||
CloseButton.BackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.BorderColor = Color.Black;
|
||||
CloseButton.FlatAppearance.BorderSize = 0;
|
||||
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CloseButton.FlatStyle = FlatStyle.Flat;
|
||||
CloseButton.ForeColor = Color.Transparent;
|
||||
CloseButton.ImageIndex = 0;
|
||||
CloseButton.ImageList = imageListCloseBtn;
|
||||
CloseButton.Location = new Point(827, 12);
|
||||
CloseButton.Name = "CloseButton";
|
||||
CloseButton.Size = new Size(32, 29);
|
||||
CloseButton.TabIndex = 7;
|
||||
CloseButton.UseVisualStyleBackColor = false;
|
||||
CloseButton.Click += CloseButton_Click;
|
||||
CloseButton.MouseDown += CloseButton_OnMouseDown;
|
||||
CloseButton.MouseLeave += CloseButton_MouseLeave;
|
||||
CloseButton.MouseHover += CloseButton_MouseHover;
|
||||
//
|
||||
// imageListLogin
|
||||
//
|
||||
imageListLogin.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListLogin.ImageStream = (ImageListStreamer)resources.GetObject("imageListLogin.ImageStream");
|
||||
imageListLogin.TransparentColor = Color.Transparent;
|
||||
imageListLogin.Images.SetKeyName(0, "button_login_normal.png");
|
||||
imageListLogin.Images.SetKeyName(1, "button_login_active.png");
|
||||
imageListLogin.Images.SetKeyName(2, "button_login_down.png");
|
||||
//
|
||||
// LoginButton
|
||||
//
|
||||
LoginButton.BackColor = Color.Transparent;
|
||||
LoginButton.FlatAppearance.BorderSize = 0;
|
||||
LoginButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
LoginButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
LoginButton.FlatStyle = FlatStyle.Flat;
|
||||
LoginButton.ImageIndex = 0;
|
||||
LoginButton.ImageList = imageListLogin;
|
||||
LoginButton.Location = new Point(612, 349);
|
||||
LoginButton.Name = "LoginButton";
|
||||
LoginButton.Size = new Size(210, 60);
|
||||
LoginButton.TabIndex = 8;
|
||||
LoginButton.UseVisualStyleBackColor = false;
|
||||
LoginButton.Click += LoginButton_Click;
|
||||
LoginButton.MouseDown += LoginButton_OnMouseDown;
|
||||
LoginButton.MouseLeave += LoginButton_MouseLeave;
|
||||
LoginButton.MouseHover += LoginButton_MouseHover;
|
||||
//
|
||||
// RegisterButton
|
||||
//
|
||||
RegisterButton.BackColor = Color.Transparent;
|
||||
RegisterButton.FlatAppearance.BorderSize = 0;
|
||||
RegisterButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
RegisterButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
RegisterButton.FlatStyle = FlatStyle.Flat;
|
||||
RegisterButton.ImageIndex = 0;
|
||||
RegisterButton.ImageList = imageListRegister;
|
||||
RegisterButton.Location = new Point(666, 433);
|
||||
RegisterButton.Name = "RegisterButton";
|
||||
RegisterButton.Size = new Size(101, 26);
|
||||
RegisterButton.TabIndex = 9;
|
||||
RegisterButton.UseVisualStyleBackColor = false;
|
||||
RegisterButton.Click += RegisterButton_Click;
|
||||
RegisterButton.MouseDown += RegisterButton_OnMouseDown;
|
||||
RegisterButton.MouseLeave += RegisterButton_MouseLeave;
|
||||
RegisterButton.MouseHover += RegisterButton_MouseHover;
|
||||
//
|
||||
// imageListRegister
|
||||
//
|
||||
imageListRegister.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListRegister.ImageStream = (ImageListStreamer)resources.GetObject("imageListRegister.ImageStream");
|
||||
imageListRegister.TransparentColor = Color.Transparent;
|
||||
imageListRegister.Images.SetKeyName(0, "button_register_normal.png");
|
||||
imageListRegister.Images.SetKeyName(1, "button_register_active.png");
|
||||
imageListRegister.Images.SetKeyName(2, "button_register_down.png");
|
||||
//
|
||||
// CheckBoxAutoLogin
|
||||
//
|
||||
CheckBoxAutoLogin.AutoSize = true;
|
||||
CheckBoxAutoLogin.BackColor = Color.Transparent;
|
||||
CheckBoxAutoLogin.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CheckBoxAutoLogin.ForeColor = Color.White;
|
||||
CheckBoxAutoLogin.Location = new Point(612, 325);
|
||||
CheckBoxAutoLogin.Name = "CheckBoxAutoLogin";
|
||||
CheckBoxAutoLogin.Size = new Size(106, 24);
|
||||
CheckBoxAutoLogin.TabIndex = 11;
|
||||
CheckBoxAutoLogin.Text = "Auto Login";
|
||||
CheckBoxAutoLogin.UseVisualStyleBackColor = false;
|
||||
CheckBoxAutoLogin.CheckedChanged += CheckBoxAutoLogin_CheckedChanged;
|
||||
//
|
||||
// CheckBoxSaveUser
|
||||
//
|
||||
CheckBoxSaveUser.AutoSize = true;
|
||||
CheckBoxSaveUser.BackColor = Color.Transparent;
|
||||
CheckBoxSaveUser.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CheckBoxSaveUser.ForeColor = Color.White;
|
||||
CheckBoxSaveUser.ImeMode = ImeMode.NoControl;
|
||||
CheckBoxSaveUser.Location = new Point(612, 302);
|
||||
CheckBoxSaveUser.Name = "CheckBoxSaveUser";
|
||||
CheckBoxSaveUser.Size = new Size(173, 23);
|
||||
CheckBoxSaveUser.TabIndex = 12;
|
||||
CheckBoxSaveUser.Text = "Remember Username";
|
||||
CheckBoxSaveUser.UseVisualStyleBackColor = false;
|
||||
CheckBoxSaveUser.CheckedChanged += CheckBoxSaveUser_CheckedChanged;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
timer1.Enabled = true;
|
||||
//
|
||||
// progressBarLogin
|
||||
//
|
||||
progressBarLogin.BackColor = SystemColors.ControlDark;
|
||||
progressBarLogin.ForeColor = Color.Transparent;
|
||||
progressBarLogin.Location = new Point(788, 369);
|
||||
progressBarLogin.Name = "progressBarLogin";
|
||||
progressBarLogin.Size = new Size(24, 23);
|
||||
progressBarLogin.Style = ProgressBarStyle.Continuous;
|
||||
progressBarLogin.TabIndex = 13;
|
||||
progressBarLogin.Visible = false;
|
||||
//
|
||||
// ForgotPwdLabel
|
||||
//
|
||||
ForgotPwdLabel.AutoSize = true;
|
||||
ForgotPwdLabel.BackColor = Color.Transparent;
|
||||
ForgotPwdLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ForgotPwdLabel.ForeColor = Color.White;
|
||||
ForgotPwdLabel.Location = new Point(652, 410);
|
||||
ForgotPwdLabel.Name = "ForgotPwdLabel";
|
||||
ForgotPwdLabel.Size = new Size(134, 20);
|
||||
ForgotPwdLabel.TabIndex = 14;
|
||||
ForgotPwdLabel.Text = "Forgot Password?";
|
||||
ForgotPwdLabel.Click += ForgotPwdLabel_Click;
|
||||
ForgotPwdLabel.MouseLeave += ForgotPwdLabel_MouseLeave;
|
||||
ForgotPwdLabel.MouseHover += ForgotPwdLabel_MouseHover;
|
||||
//
|
||||
// VersionLabel
|
||||
//
|
||||
VersionLabel.AutoSize = true;
|
||||
VersionLabel.BackColor = Color.Transparent;
|
||||
VersionLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
VersionLabel.ForeColor = Color.White;
|
||||
VersionLabel.Location = new Point(8, 471);
|
||||
VersionLabel.Name = "VersionLabel";
|
||||
VersionLabel.Size = new Size(62, 19);
|
||||
VersionLabel.TabIndex = 15;
|
||||
VersionLabel.Text = "Version:";
|
||||
//
|
||||
// LoginForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
BackColor = Color.Magenta;
|
||||
BackgroundImage = Properties.Resources.login_bg;
|
||||
BackgroundImageLayout = ImageLayout.Stretch;
|
||||
ClientSize = new Size(874, 497);
|
||||
Controls.Add(VersionLabel);
|
||||
Controls.Add(ForgotPwdLabel);
|
||||
Controls.Add(progressBarLogin);
|
||||
Controls.Add(CheckBoxSaveUser);
|
||||
Controls.Add(CheckBoxAutoLogin);
|
||||
Controls.Add(RegisterButton);
|
||||
Controls.Add(LoginButton);
|
||||
Controls.Add(CloseButton);
|
||||
Controls.Add(MinimizeButton);
|
||||
Controls.Add(PasswordTextBox);
|
||||
Controls.Add(UsernameTextBox);
|
||||
Controls.Add(PasswordLabel);
|
||||
Controls.Add(UsernameLabel);
|
||||
DoubleBuffered = true;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "LoginForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Rusty Hearts Launcher";
|
||||
TransparencyKey = Color.Magenta;
|
||||
FormClosing += LoginForm_FormClosing;
|
||||
Load += LoginForm_Load;
|
||||
MouseDown += OnMouseDown;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label UsernameLabel;
|
||||
private Label PasswordLabel;
|
||||
public TextBox UsernameTextBox;
|
||||
private TextBox PasswordTextBox;
|
||||
private Button MinimizeButton;
|
||||
private ImageList imageListMinBtn;
|
||||
private ImageList imageListCloseBtn;
|
||||
private Button CloseButton;
|
||||
private ImageList imageListLogin;
|
||||
private Button LoginButton;
|
||||
private Button RegisterButton;
|
||||
private ImageList imageListRegister;
|
||||
private CheckBox CheckBoxAutoLogin;
|
||||
private CheckBox CheckBoxSaveUser;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private ProgressBar progressBarLogin;
|
||||
private Label ForgotPwdLabel;
|
||||
private Label VersionLabel;
|
||||
}
|
||||
}
|
||||
352
RHLauncher.LoginForm/LoginForm.cs
Normal file
|
|
@ -0,0 +1,352 @@
|
|||
using Newtonsoft.Json;
|
||||
using RHLauncher.Helper;
|
||||
using RHLauncher.RHLauncher;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class LoginForm : Form
|
||||
{
|
||||
private RegistryHandler registryHandler = new();
|
||||
|
||||
public string windyCode = string.Empty;
|
||||
public string password = string.Empty;
|
||||
public string LoginUrl = Configuration.Default.LoginUrl;
|
||||
|
||||
public LoginForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UsernameLabel.Text = LocalizedStrings.UsernameLabel;
|
||||
PasswordLabel.Text = LocalizedStrings.PasswordLabel;
|
||||
CheckBoxSaveUser.Text = LocalizedStrings.CheckBoxSaveUser;
|
||||
CheckBoxAutoLogin.Text = LocalizedStrings.CheckBoxAutoLogin;
|
||||
ForgotPwdLabel.Text = LocalizedStrings.ForgotPwdLabel;
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
private async void LoginForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
string currentVersion = GetLauncherVersion();
|
||||
VersionLabel.Text = $"{LocalizedStrings.Version}: {currentVersion}";
|
||||
|
||||
registryHandler = new RegistryHandler();
|
||||
if (!registryHandler.KeyExist())
|
||||
{
|
||||
registryHandler.CreateKey();
|
||||
}
|
||||
else
|
||||
{
|
||||
string?[] values = registryHandler.ReadValues();
|
||||
UsernameTextBox.Text = values[0];
|
||||
PasswordTextBox.Text = values[1];
|
||||
CheckBoxSaveUser.Checked = values[2] == "1";
|
||||
CheckBoxAutoLogin.Checked = values[3] == "1";
|
||||
|
||||
await CheckForLauncherUpdate();
|
||||
|
||||
AutoLogin();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static async Task CheckForLauncherUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
LauncherUpdater launcherUpdater = new();
|
||||
await launcherUpdater.CheckForLauncherUpdateAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetLauncherVersion()
|
||||
{
|
||||
// Get the version information of the application
|
||||
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
|
||||
|
||||
// Extract the version number
|
||||
string version = $"{versionInfo.FileMajorPart}.{versionInfo.FileMinorPart}.{versionInfo.FileBuildPart}";
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
private async Task Login()
|
||||
{
|
||||
if (string.IsNullOrEmpty(UsernameTextBox.Text))
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.LoginInsertUsername, LocalizedStrings.LoginWindowTitle);
|
||||
return;
|
||||
}
|
||||
if (!Regex.IsMatch(UsernameTextBox.Text, @"^[A-Za-z0-9]{6,50}$|^[\w\d._%+-]+@[\w\d.-]+\.[\w]{2,}$"))
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.LoginInvalidUsernameFormat, LocalizedStrings.LoginWindowTitle);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(PasswordTextBox.Text))
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.LoginInsertPassword, LocalizedStrings.LoginWindowTitle);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
progressBarLogin.Visible = true;
|
||||
progressBarLogin.Style = ProgressBarStyle.Marquee;
|
||||
progressBarLogin.MarqueeAnimationSpeed = 30;
|
||||
LoginButton.Enabled = false;
|
||||
|
||||
string response = await SendLoginRequestAsync();
|
||||
|
||||
HandleLoginResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
progressBarLogin.Visible = false;
|
||||
LoginButton.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async void AutoLogin()
|
||||
{
|
||||
if (CheckBoxAutoLogin.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(UsernameTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Text))
|
||||
{
|
||||
await Login();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> SendLoginRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
using HttpResponseMessage response = await client.PostAsync(LoginUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("account", UsernameTextBox.Text),
|
||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private void HandleLoginResponse(string response)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dictionary<string, string>? loginResponse = JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
|
||||
|
||||
switch (loginResponse["Result"])
|
||||
{
|
||||
case "LoginSuccess":
|
||||
windyCode = loginResponse["WindyCode"];
|
||||
password = loginResponse["Token"];
|
||||
Hide();
|
||||
LauncherForm launcherForm = new(windyCode, password);
|
||||
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 + loginResponse["Result"], LocalizedStrings.Error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleException(Exception ex)
|
||||
{
|
||||
string errorMessage = ex.Message;
|
||||
string errorLog = ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
|
||||
private void CheckBoxAutoLogin_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (CheckBoxAutoLogin.Checked)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(UsernameTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Text))
|
||||
{
|
||||
registryHandler.SaveValues(UsernameTextBox.Text, PasswordTextBox.Text, true, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
registryHandler.SaveValues(UsernameTextBox.Text, "", true, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBoxSaveUser_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (CheckBoxSaveUser.Checked)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(UsernameTextBox.Text))
|
||||
{
|
||||
registryHandler.SaveUser(UsernameTextBox.Text, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
registryHandler.SaveUser("", false);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Click Events
|
||||
|
||||
private async void LoginButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
await Login();
|
||||
}
|
||||
|
||||
private void OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
FormUtils.MoveForm(Handle);
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
using RegForm RegisterForm = new();
|
||||
RegisterForm.ShowDialog();
|
||||
}
|
||||
|
||||
private void ForgotPwdLabel_Click(object sender, EventArgs e)
|
||||
{
|
||||
using ChangePwd ChangePwd = new();
|
||||
ChangePwd.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
private void CloseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MinimizeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Events
|
||||
|
||||
private void MinimizeButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
}
|
||||
private void MinimizeButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 0;
|
||||
}
|
||||
private void CloseButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void LoginButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
LoginButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void LoginButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
LoginButton.ImageIndex = 0;
|
||||
}
|
||||
|
||||
private void LoginButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
LoginButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void RegisterButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
RegisterButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void RegisterButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
RegisterButton.ImageIndex = 0;
|
||||
}
|
||||
private void RegisterButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
RegisterButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void ForgotPwdLabel_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ForgotPwdLabel.ForeColor = Color.White;
|
||||
}
|
||||
|
||||
private void ForgotPwdLabel_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ForgotPwdLabel.ForeColor = Color.Gainsboro;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
6127
RHLauncher.LoginForm/LoginForm.resx
Normal file
244
RHLauncher.MsgBoxForm/MsgBoxForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
namespace RHLauncher
|
||||
{
|
||||
partial class MsgBoxForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgBoxForm));
|
||||
CloseButton = new Button();
|
||||
imageListCloseBtn = new ImageList(components);
|
||||
OkButton = new Button();
|
||||
imageListOKBtn = new ImageList(components);
|
||||
TitleLabel = new Label();
|
||||
TextLabel = new Label();
|
||||
textBox1 = new TextBox();
|
||||
YesButton = new Button();
|
||||
imageListBtn = new ImageList(components);
|
||||
NoButton = new Button();
|
||||
SuspendLayout();
|
||||
//
|
||||
// CloseButton
|
||||
//
|
||||
CloseButton.BackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.BorderColor = Color.Black;
|
||||
CloseButton.FlatAppearance.BorderSize = 0;
|
||||
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CloseButton.FlatStyle = FlatStyle.Flat;
|
||||
CloseButton.ForeColor = Color.Transparent;
|
||||
CloseButton.ImageIndex = 0;
|
||||
CloseButton.ImageList = imageListCloseBtn;
|
||||
CloseButton.ImeMode = ImeMode.NoControl;
|
||||
CloseButton.Location = new Point(613, 16);
|
||||
CloseButton.Name = "CloseButton";
|
||||
CloseButton.Size = new Size(32, 29);
|
||||
CloseButton.TabIndex = 8;
|
||||
CloseButton.UseVisualStyleBackColor = false;
|
||||
CloseButton.Click += CloseButton_Click;
|
||||
CloseButton.MouseDown += CloseButton_OnMouseDown;
|
||||
CloseButton.MouseLeave += CloseButton_MouseLeave;
|
||||
CloseButton.MouseHover += CloseButton_MouseHover;
|
||||
//
|
||||
// imageListCloseBtn
|
||||
//
|
||||
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
|
||||
imageListCloseBtn.TransparentColor = Color.Transparent;
|
||||
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
|
||||
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
|
||||
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
|
||||
//
|
||||
// OkButton
|
||||
//
|
||||
OkButton.BackColor = Color.Transparent;
|
||||
OkButton.FlatAppearance.BorderSize = 0;
|
||||
OkButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
OkButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
OkButton.FlatStyle = FlatStyle.Flat;
|
||||
OkButton.ImageIndex = 0;
|
||||
OkButton.ImageList = imageListOKBtn;
|
||||
OkButton.ImeMode = ImeMode.NoControl;
|
||||
OkButton.Location = new Point(268, 234);
|
||||
OkButton.Name = "OkButton";
|
||||
OkButton.Size = new Size(110, 44);
|
||||
OkButton.TabIndex = 9;
|
||||
OkButton.UseVisualStyleBackColor = false;
|
||||
OkButton.Click += OkButton_Click;
|
||||
OkButton.MouseDown += OkButton_OnMouseDown;
|
||||
OkButton.MouseLeave += OkButton_MouseLeave;
|
||||
OkButton.MouseHover += OkButton_MouseHover;
|
||||
//
|
||||
// imageListOKBtn
|
||||
//
|
||||
imageListOKBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListOKBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn.ImageStream");
|
||||
imageListOKBtn.TransparentColor = Color.Transparent;
|
||||
imageListOKBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
|
||||
imageListOKBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
|
||||
imageListOKBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
|
||||
//
|
||||
// TitleLabel
|
||||
//
|
||||
TitleLabel.Anchor = AnchorStyles.None;
|
||||
TitleLabel.AutoEllipsis = true;
|
||||
TitleLabel.AutoSize = true;
|
||||
TitleLabel.BackColor = Color.Transparent;
|
||||
TitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TitleLabel.ForeColor = Color.White;
|
||||
TitleLabel.ImageAlign = ContentAlignment.TopRight;
|
||||
TitleLabel.ImeMode = ImeMode.NoControl;
|
||||
TitleLabel.Location = new Point(295, 30);
|
||||
TitleLabel.Name = "TitleLabel";
|
||||
TitleLabel.Size = new Size(40, 20);
|
||||
TitleLabel.TabIndex = 10;
|
||||
TitleLabel.Text = "Title";
|
||||
TitleLabel.TextAlign = ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// TextLabel
|
||||
//
|
||||
TextLabel.Anchor = AnchorStyles.Left;
|
||||
TextLabel.AutoEllipsis = true;
|
||||
TextLabel.AutoSize = true;
|
||||
TextLabel.BackColor = Color.Transparent;
|
||||
TextLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TextLabel.ForeColor = Color.White;
|
||||
TextLabel.ImeMode = ImeMode.NoControl;
|
||||
TextLabel.Location = new Point(39, 72);
|
||||
TextLabel.MaximumSize = new Size(550, 0);
|
||||
TextLabel.MinimumSize = new Size(50, 0);
|
||||
TextLabel.Name = "TextLabel";
|
||||
TextLabel.Size = new Size(50, 15);
|
||||
TextLabel.TabIndex = 11;
|
||||
TextLabel.Text = "Text";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
textBox1.Location = new Point(106, 99);
|
||||
textBox1.Multiline = true;
|
||||
textBox1.Name = "textBox1";
|
||||
textBox1.ReadOnly = true;
|
||||
textBox1.ScrollBars = ScrollBars.Vertical;
|
||||
textBox1.Size = new Size(441, 129);
|
||||
textBox1.TabIndex = 12;
|
||||
textBox1.WordWrap = false;
|
||||
//
|
||||
// YesButton
|
||||
//
|
||||
YesButton.BackColor = Color.Transparent;
|
||||
YesButton.FlatAppearance.BorderSize = 0;
|
||||
YesButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
YesButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
YesButton.FlatStyle = FlatStyle.Flat;
|
||||
YesButton.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
YesButton.ForeColor = Color.White;
|
||||
YesButton.ImageIndex = 0;
|
||||
YesButton.ImageList = imageListBtn;
|
||||
YesButton.ImeMode = ImeMode.NoControl;
|
||||
YesButton.Location = new Point(164, 234);
|
||||
YesButton.Name = "YesButton";
|
||||
YesButton.Size = new Size(110, 44);
|
||||
YesButton.TabIndex = 13;
|
||||
YesButton.Text = "Yes";
|
||||
YesButton.UseVisualStyleBackColor = false;
|
||||
YesButton.MouseDown += YesButton_OnMouseDown;
|
||||
YesButton.MouseLeave += YesButton_MouseLeave;
|
||||
YesButton.MouseHover += YesButton_MouseHover;
|
||||
//
|
||||
// imageListBtn
|
||||
//
|
||||
imageListBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListBtn.ImageStream");
|
||||
imageListBtn.TransparentColor = Color.Transparent;
|
||||
imageListBtn.Images.SetKeyName(0, "button_normal.png");
|
||||
imageListBtn.Images.SetKeyName(1, "button_active.png");
|
||||
imageListBtn.Images.SetKeyName(2, "button_down.png");
|
||||
//
|
||||
// NoButton
|
||||
//
|
||||
NoButton.BackColor = Color.Transparent;
|
||||
NoButton.FlatAppearance.BorderSize = 0;
|
||||
NoButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
NoButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
NoButton.FlatStyle = FlatStyle.Flat;
|
||||
NoButton.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
NoButton.ForeColor = Color.White;
|
||||
NoButton.ImageIndex = 0;
|
||||
NoButton.ImageList = imageListBtn;
|
||||
NoButton.ImeMode = ImeMode.NoControl;
|
||||
NoButton.Location = new Point(373, 234);
|
||||
NoButton.Name = "NoButton";
|
||||
NoButton.Size = new Size(110, 44);
|
||||
NoButton.TabIndex = 14;
|
||||
NoButton.Text = "No";
|
||||
NoButton.UseVisualStyleBackColor = false;
|
||||
NoButton.MouseDown += NoButton_OnMouseDown;
|
||||
NoButton.MouseLeave += NoButton_MouseLeave;
|
||||
NoButton.MouseHover += NoButton_MouseHover;
|
||||
//
|
||||
// MsgBoxForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.Black;
|
||||
BackgroundImage = Properties.Resources.message_bkg;
|
||||
BackgroundImageLayout = ImageLayout.Center;
|
||||
ClientSize = new Size(666, 292);
|
||||
Controls.Add(NoButton);
|
||||
Controls.Add(YesButton);
|
||||
Controls.Add(textBox1);
|
||||
Controls.Add(TextLabel);
|
||||
Controls.Add(TitleLabel);
|
||||
Controls.Add(OkButton);
|
||||
Controls.Add(CloseButton);
|
||||
DoubleBuffered = true;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "MsgBoxForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Message";
|
||||
TransparencyKey = Color.Black;
|
||||
FormClosing += MsgBoxForm_FormClosing;
|
||||
Load += MsgBoxForm_Load;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button CloseButton;
|
||||
private ImageList imageListCloseBtn;
|
||||
private Button OkButton;
|
||||
private ImageList imageListOKBtn;
|
||||
private Label TitleLabel;
|
||||
private Label TextLabel;
|
||||
private TextBox textBox1;
|
||||
private Button YesButton;
|
||||
private ImageList imageListBtn;
|
||||
private Button NoButton;
|
||||
}
|
||||
}
|
||||
145
RHLauncher.MsgBoxForm/MsgBoxForm.cs
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
using RHLauncher.RHLauncher.Helper;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class MsgBoxForm : Form
|
||||
{
|
||||
public new DialogResult DialogResult { get; private set; }
|
||||
|
||||
public MsgBoxForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
YesButton.Click += YesButton_Click;
|
||||
NoButton.Click += NoButton_Click;
|
||||
}
|
||||
|
||||
private void YesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Yes;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void NoButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.No;
|
||||
Close();
|
||||
}
|
||||
|
||||
public static void Show(string message, string title)
|
||||
{
|
||||
MsgBoxForm msgBox = new();
|
||||
msgBox.textBox1.Visible = false;
|
||||
msgBox.YesButton.Visible = false;
|
||||
msgBox.NoButton.Visible = false;
|
||||
msgBox.TextLabel.Text = message;
|
||||
msgBox.TitleLabel.Text = title;
|
||||
msgBox.ShowDialog();
|
||||
}
|
||||
|
||||
public static void ShowST(string message, string title, string stacktrace)
|
||||
{
|
||||
MsgBoxForm msgBox = new();
|
||||
msgBox.textBox1.Visible = true;
|
||||
msgBox.YesButton.Visible = false;
|
||||
msgBox.NoButton.Visible = false;
|
||||
msgBox.TextLabel.Text = message;
|
||||
msgBox.textBox1.Text = stacktrace;
|
||||
msgBox.TitleLabel.Text = title;
|
||||
msgBox.ShowDialog();
|
||||
}
|
||||
|
||||
public static DialogResult ShowYN(string message, string title)
|
||||
{
|
||||
MsgBoxForm msgBox = new();
|
||||
msgBox.textBox1.Visible = false;
|
||||
msgBox.OkButton.Visible = false;
|
||||
msgBox.YesButton.Visible = true;
|
||||
msgBox.NoButton.Visible = true;
|
||||
msgBox.TextLabel.Text = message;
|
||||
msgBox.TitleLabel.Text = title;
|
||||
msgBox.ShowDialog();
|
||||
|
||||
return msgBox.DialogResult;
|
||||
}
|
||||
|
||||
private void CloseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CloseButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 0;
|
||||
}
|
||||
private void CloseButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void OkButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
OkButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void OkButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
OkButton.ImageIndex = 0;
|
||||
}
|
||||
|
||||
private void OkButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
OkButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void YesButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
YesButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void YesButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
YesButton.ImageIndex = 0;
|
||||
}
|
||||
private void YesButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
YesButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void NoButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
NoButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void NoButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
NoButton.ImageIndex = 0;
|
||||
}
|
||||
private void NoButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
NoButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void MsgBoxForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
TitleLabel.Left = (ClientSize.Width - TitleLabel.Width) / 2;
|
||||
OkButton.Left = (ClientSize.Width - OkButton.Width) / 2;
|
||||
}
|
||||
|
||||
private void MsgBoxForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
3669
RHLauncher.MsgBoxForm/MsgBoxForm.resx
Normal file
70
RHLauncher.PCK/MIPDecoder.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
using System.IO.Compression;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
internal class MIPDecoder
|
||||
{
|
||||
private static readonly byte[] codeMip = new byte[] {
|
||||
0x30, 0x22, 0x41, 0xa8, 0x5b, 0xa6, 0x6a, 0x49, 0xbf, 0x53, 0x35, 0xe5, 0x9e, 14, 0xec, 0xb8,
|
||||
0x5e, 0x15, 0x1f, 0xc1, 0x4f, 0xec, 0x77, 0xe8, 0xb7, 0x4e, 0x87, 230, 0xf5, 60, 0xb3, 0x43,
|
||||
0xcc, 0x53, 0x36, 0xac, 90, 0x77, 0xb8, 0xdd, 0x30, 0x74, 140, 0x4a, 0x9a, 0x9b, 0xbc, 10,
|
||||
0xa4, 0xad, 0xbb, 0x13, 0x4b, 140, 0xd4, 0x80, 0xce, 0x65, 0x1d, 8, 90, 0x6a, 0x6f, 0x25,
|
||||
0xf9, 0x3f, 0xef, 0x1b, 0xa4, 0x72, 20, 0xed, 0x97, 0x22, 0x4a, 0x2e, 0xb8, 150, 0x4b, 0x8e,
|
||||
150, 0x93, 0xf1, 40, 0xb2, 11, 60, 0xf8, 0x5d, 170, 0xa9, 130, 0x13, 110, 0xc1, 0xa9,
|
||||
0x20, 0x57, 0xb2, 0x5b, 0x16, 0xcf, 0x9e, 0x5f, 0xd4, 0xcc, 0x2e, 0xf5, 0xc9, 0x4c, 0x1c, 0xee,
|
||||
0xe3, 0x3f, 0x29, 0xb3, 6, 0x70, 0x43, 0x3d, 0xf5, 0x90, 0xa2, 0x42, 2, 0x98, 80, 0xfd,
|
||||
0x5d, 0x4e, 0x92, 0xad, 0xad, 0x7f, 0xab, 0x60, 0x2c, 0xb8, 0x43, 0x76, 0x8f, 0x5f, 230, 0xa7,
|
||||
0x19, 0xe0, 0xb9, 0xb5, 0x62, 0x6b, 0xd4, 0x47, 0x69, 0x34, 14, 0x6d, 0xa4, 0x52, 0xe3, 100,
|
||||
0x4a, 0x65, 0x47, 0xf5, 0x3f, 0x53, 0x5e, 0x8b, 0x1b, 0xfd, 0x21, 0xf7, 0xba, 0x68, 0xf9, 0xdf,
|
||||
0x68, 0xa8, 150, 15, 0x8b, 1, 0x97, 0x58, 140, 30, 0xef, 0xb3, 0x41, 0x44, 0x21, 0xda,
|
||||
0xe0, 0xf4, 0xe0, 0x2d, 0xcd, 11, 240, 0x5c, 0x59, 0xd6, 0x99, 0xe7, 1, 0x15, 0x67, 50,
|
||||
0xe0, 0x12, 0x2f, 0xcd, 0xa2, 0xde, 0x52, 0xce, 0xec, 0xef, 0x77, 14, 0xbc, 0x38, 100, 0x8d,
|
||||
180, 0xdb, 0x67, 0xff, 200, 0x66, 12, 0x8a, 0x60, 0xe1, 0x2e, 0, 0x43, 0xa9, 0x37, 0x9c,
|
||||
0x11, 170, 0xb9, 0x98, 0xed, 0x21, 0x35, 0xd4, 0xc3, 0xde, 0x65, 0x54, 0x9d, 0x1c, 0xb0, 0xa9
|
||||
};
|
||||
|
||||
private static void BytesWithCodeMip(byte[] toBytes)
|
||||
{
|
||||
for (int i = 0; i < toBytes.Length; i++)
|
||||
{
|
||||
toBytes[i] = (byte)(toBytes[i] ^ codeMip[i & 0xff]);
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task DecompressFileAsync(string filePath, string outputPath, CancellationToken cancellationToken)
|
||||
{
|
||||
byte[] buffer;
|
||||
using (FileStream fileStream = new(filePath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
buffer = new byte[fileStream.Length];
|
||||
await fileStream.ReadAsync(buffer, 0, (int)fileStream.Length, cancellationToken);
|
||||
}
|
||||
BytesWithCodeMip(buffer);
|
||||
buffer = DecompressBytes(buffer);
|
||||
using FileStream outputFileStream = new(outputPath, FileMode.Create, FileAccess.Write);
|
||||
await outputFileStream.WriteAsync(buffer, 0, buffer.Length, cancellationToken);
|
||||
}
|
||||
|
||||
private static byte[] DecompressBytes(byte[] toBytes)
|
||||
{
|
||||
using MemoryStream inputStream = new(toBytes);
|
||||
using DeflateStream deflateStream = new(inputStream, CompressionMode.Decompress);
|
||||
using MemoryStream outputStream = new();
|
||||
deflateStream.CopyTo(outputStream);
|
||||
return outputStream.ToArray();
|
||||
}
|
||||
|
||||
//Zlib have issues with some files
|
||||
private static byte[] DecompressBytes1(byte[] toBytes)
|
||||
{
|
||||
int num = (toBytes.Length << 4) - toBytes.Length;
|
||||
byte[] buffer = new byte[num];
|
||||
int err = ZLibDll.Decompress(toBytes, toBytes.Length, buffer, ref num);
|
||||
if (err != 0) throw new Exception(string.Format("Decompress returned error code {0}.", err));
|
||||
|
||||
toBytes = new byte[num];
|
||||
Buffer.BlockCopy(buffer, 0, toBytes, 0, num);
|
||||
return toBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
RHLauncher.PCK/PCKFile.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
namespace RHLauncher.PCK
|
||||
{
|
||||
public class PCKFile
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
|
||||
public byte Archive { get; private set; }
|
||||
|
||||
public int FileSize { get; private set; }
|
||||
|
||||
public uint Hash { get; private set; }
|
||||
|
||||
public long Offset { get; private set; }
|
||||
|
||||
public bool IsChecked { get; set; }
|
||||
|
||||
public string[] PathElements { get { return Name.Split(new char[] { '\\' }); } }
|
||||
|
||||
public PCKFile(string name, byte archive, int size, uint hash, long offset)
|
||||
{
|
||||
Name = name;
|
||||
Archive = archive;
|
||||
FileSize = size;
|
||||
Hash = hash;
|
||||
Offset = offset;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
27
RHLauncher.PCK/PCKFileNode.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
namespace RHLauncher.PCK
|
||||
{
|
||||
public class PCKFileNode
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public PCKFile PCKFile { get; set; }
|
||||
public bool IsDir { get { return PCKFile == null; } }
|
||||
public SortedDictionary<string, PCKFileNode> Nodes { get; set; }
|
||||
|
||||
private bool isChecked;
|
||||
public bool IsChecked
|
||||
{
|
||||
get { return isChecked; }
|
||||
set
|
||||
{
|
||||
isChecked = value;
|
||||
if (PCKFile != null) PCKFile.IsChecked = isChecked;
|
||||
}
|
||||
}
|
||||
|
||||
public PCKFileNode(string name, PCKFile file)
|
||||
{
|
||||
Name = name;
|
||||
PCKFile = file;
|
||||
}
|
||||
}
|
||||
}
|
||||
84
RHLauncher.PCK/PCKReader.cs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
using RHLauncher.Helper;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher.PCK
|
||||
{
|
||||
public static class PCKReader
|
||||
{
|
||||
|
||||
public static readonly byte[] BufferTable = new byte[]
|
||||
{
|
||||
0x30, 0x22, 0x41, 0xA8, 0x5B, 0xA6, 0x6A, 0x49, 0xBF, 0x53, 0x35, 0xE5, 0x9E, 0x0E, 0xEC, 0xB8, 0x5E, 0x15, 0x1F, 0xC1, 0x4F, 0xEC, 0x77, 0xE8, 0xB7, 0x4E, 0x87, 0xE6, 0xF5, 0x3C, 0xB3, 0x43
|
||||
, 0xCC, 0x53, 0x36, 0xAC, 0x5A, 0x77, 0xB8, 0xDD, 0x30, 0x74, 0x8C, 0x4A, 0x9A, 0x9B, 0xBC, 0x0A, 0xA4, 0xAD, 0xBB, 0x13, 0x4B, 0x8C, 0xD4, 0x80, 0xCE, 0x65, 0x1D, 0x08, 0x5A, 0x6A, 0x6F, 0x25
|
||||
, 0xF9, 0x3F, 0xEF, 0x1B, 0xA4, 0x72, 0x14, 0xED, 0x97, 0x22, 0x4A, 0x2E, 0xB8, 0x96, 0x4B, 0x8E, 0x96, 0x93, 0xF1, 0x28, 0xB2, 0x0B, 0x3C, 0xF8, 0x5D, 0xAA, 0xA9, 0x82, 0x13, 0x6E, 0xC1, 0xA9
|
||||
, 0x20, 0x57, 0xB2, 0x5B, 0x16, 0xCF, 0x9E, 0x5F, 0xD4, 0xCC, 0x2E, 0xF5, 0xC9, 0x4C, 0x1C, 0xEE, 0xE3, 0x3F, 0x29, 0xB3, 0x06, 0x70, 0x43, 0x3D, 0xF5, 0x90, 0xA2, 0x42, 0x02, 0x98, 0x50, 0xFD
|
||||
, 0x5D, 0x4E, 0x92, 0xAD, 0xAD, 0x7F, 0xAB, 0x60, 0x2C, 0xB8, 0x43, 0x76, 0x8F, 0x5F, 0xE6, 0xA7, 0x19, 0xE0, 0xB9, 0xB5, 0x62, 0x6B, 0xD4, 0x47, 0x69, 0x34, 0x0E, 0x6D, 0xA4, 0x52, 0xE3, 0x64
|
||||
, 0x4A, 0x65, 0x47, 0xF5, 0x3F, 0x53, 0x5E, 0x8B, 0x1B, 0xFD, 0x21, 0xF7, 0xBA, 0x68, 0xF9, 0xDF, 0x68, 0xA8, 0x96, 0x0F, 0x8B, 0x01, 0x97, 0x58, 0x8C, 0x1E, 0xEF, 0xB3, 0x41, 0x44, 0x21, 0xDA
|
||||
, 0xE0, 0xF4, 0xE0, 0x2D, 0xCD, 0x0B, 0xF0, 0x5C, 0x59, 0xD6, 0x99, 0xE7, 0x01, 0x15, 0x67, 0x32, 0xE0, 0x12, 0x2F, 0xCD, 0xA2, 0xDE, 0x52, 0xCE, 0xEC, 0xEF, 0x77, 0x0E, 0xBC, 0x38, 0x64, 0x8D
|
||||
, 0xB4, 0xDB, 0x67, 0xFF, 0xC8, 0x66, 0x0C, 0x8A, 0x60, 0xE1, 0x2E, 0x00, 0x43, 0xA9, 0x37, 0x9C, 0x11, 0xAA, 0xB9, 0x98, 0xED, 0x21, 0x35, 0xD4, 0xC3, 0xDE, 0x65, 0x54, 0x9D, 0x1C, 0xB0, 0xA9
|
||||
};
|
||||
|
||||
public static List<PCKFile> GetPCKFileList()
|
||||
{
|
||||
string installDirectory = new RegistryHandler().GetInstallDirectory();
|
||||
string fileF00XDAT = Path.Combine(installDirectory, "f00X.dat");
|
||||
|
||||
byte[] compressedBytes = File.ReadAllBytes(fileF00XDAT);
|
||||
|
||||
if (compressedBytes.Length == 0) return new List<PCKFile>();
|
||||
|
||||
compressedBytes = compressedBytes.Select((b, i) => (byte)(b ^ BufferTable[i & 0xFF])).ToArray();
|
||||
|
||||
int decompressedSize = (compressedBytes.Length << 4) - compressedBytes.Length;
|
||||
byte[] decompressedBytes = new byte[decompressedSize];
|
||||
|
||||
int result = ZLibDll.Decompress(compressedBytes, compressedBytes.Length, decompressedBytes, ref decompressedSize);
|
||||
if (result != 0) throw new Exception("Error decoding f00x.dat");
|
||||
|
||||
List<PCKFile> pckFileList = new(100000);
|
||||
using (MemoryStream memoryStream = new(decompressedBytes, 0, decompressedSize, false))
|
||||
{
|
||||
using BinaryReader binaryReader = new(memoryStream);
|
||||
while (binaryReader.BaseStream.Position < binaryReader.BaseStream.Length)
|
||||
{
|
||||
string fileName = string.Empty;
|
||||
try
|
||||
{
|
||||
ushort nameLength = binaryReader.ReadUInt16();
|
||||
byte[] byteName = binaryReader.ReadBytes(nameLength * 2);
|
||||
|
||||
fileName = Encoding.Unicode.GetString(byteName);
|
||||
byte archive = binaryReader.ReadByte(); // Which archive is it in
|
||||
int size = binaryReader.ReadInt32(); // Size of the file
|
||||
uint hash = binaryReader.ReadUInt32(); // Guessing the hash of the data
|
||||
long offset = binaryReader.ReadInt64(); // Offset in the file
|
||||
|
||||
if (fileName.Length > 0 && !new[] { '/', ':', '*', '?', '<', '>' }.Any(fileName.Contains))
|
||||
{
|
||||
PCKFile file = new(fileName, archive, size, hash, offset);
|
||||
pckFileList.Add(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.WriteLog($"Invalid file name: {fileName}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMessage = $"Error parsing PCK file data {fileName}: {ex.Message}";
|
||||
string errorLog = $"Error parsing PCK file data {fileName}: {ex.Message}|{ex.StackTrace}";
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pckFileList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
262
RHLauncher.PCK/PCKWriter.cs
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
using Newtonsoft.Json;
|
||||
using RHLauncher.Helper;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher.PCK
|
||||
{
|
||||
public static class PCKWriter
|
||||
{
|
||||
private static readonly byte[] BufferTable = new byte[] {
|
||||
0x30, 0x22, 0x41, 0xa8, 0x5b, 0xa6, 0x6a, 0x49, 0xbf, 0x53, 0x35, 0xe5, 0x9e, 14, 0xec, 0xb8,
|
||||
0x5e, 0x15, 0x1f, 0xc1, 0x4f, 0xec, 0x77, 0xe8, 0xb7, 0x4e, 0x87, 230, 0xf5, 60, 0xb3, 0x43,
|
||||
0xcc, 0x53, 0x36, 0xac, 90, 0x77, 0xb8, 0xdd, 0x30, 0x74, 140, 0x4a, 0x9a, 0x9b, 0xbc, 10,
|
||||
0xa4, 0xad, 0xbb, 0x13, 0x4b, 140, 0xd4, 0x80, 0xce, 0x65, 0x1d, 8, 90, 0x6a, 0x6f, 0x25,
|
||||
0xf9, 0x3f, 0xef, 0x1b, 0xa4, 0x72, 20, 0xed, 0x97, 0x22, 0x4a, 0x2e, 0xb8, 150, 0x4b, 0x8e,
|
||||
150, 0x93, 0xf1, 40, 0xb2, 11, 60, 0xf8, 0x5d, 170, 0xa9, 130, 0x13, 110, 0xc1, 0xa9,
|
||||
0x20, 0x57, 0xb2, 0x5b, 0x16, 0xcf, 0x9e, 0x5f, 0xd4, 0xcc, 0x2e, 0xf5, 0xc9, 0x4c, 0x1c, 0xee,
|
||||
0xe3, 0x3f, 0x29, 0xb3, 6, 0x70, 0x43, 0x3d, 0xf5, 0x90, 0xa2, 0x42, 2, 0x98, 80, 0xfd,
|
||||
0x5d, 0x4e, 0x92, 0xad, 0xad, 0x7f, 0xab, 0x60, 0x2c, 0xb8, 0x43, 0x76, 0x8f, 0x5f, 230, 0xa7,
|
||||
0x19, 0xe0, 0xb9, 0xb5, 0x62, 0x6b, 0xd4, 0x47, 0x69, 0x34, 14, 0x6d, 0xa4, 0x52, 0xe3, 100,
|
||||
0x4a, 0x65, 0x47, 0xf5, 0x3f, 0x53, 0x5e, 0x8b, 0x1b, 0xfd, 0x21, 0xf7, 0xba, 0x68, 0xf9, 0xdf,
|
||||
0x68, 0xa8, 150, 15, 0x8b, 1, 0x97, 0x58, 140, 30, 0xef, 0xb3, 0x41, 0x44, 0x21, 0xda,
|
||||
0xe0, 0xf4, 0xe0, 0x2d, 0xcd, 11, 240, 0x5c, 0x59, 0xd6, 0x99, 0xe7, 1, 0x15, 0x67, 50,
|
||||
0xe0, 0x12, 0x2f, 0xcd, 0xa2, 0xde, 0x52, 0xce, 0xec, 0xef, 0x77, 14, 0xbc, 0x38, 100, 0x8d,
|
||||
180, 0xdb, 0x67, 0xff, 200, 0x66, 12, 0x8a, 0x60, 0xe1, 0x2e, 0, 0x43, 0xa9, 0x37, 0x9c,
|
||||
0x11, 170, 0xb9, 0x98, 0xed, 0x21, 0x35, 0xd4, 0xc3, 0xde, 0x65, 0x54, 0x9d, 0x1c, 0xb0, 0xa9
|
||||
};
|
||||
private static readonly uint[] CodeHash = new uint[]
|
||||
{
|
||||
0, 0x77073096, 0xee0e612c, 0x990951ba, 0x76dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0xedb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x9b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
|
||||
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
|
||||
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
|
||||
0x76dc4190, 0x1db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x6b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0xf00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x86d3d2d, 0x91646c97, 0xe6635c01,
|
||||
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
|
||||
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
|
||||
0xedb88320, 0x9abfb3b6, 0x3b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x4db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0xd6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0xa00ae27, 0x7d079eb1,
|
||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
||||
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
|
||||
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x26d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x5005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0xcb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0xbdbdf21,
|
||||
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
|
||||
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
public static uint BytesWithCodeHash(byte[] toBytes)
|
||||
{
|
||||
int num = -1;
|
||||
for (int i = 0; i < toBytes.Length; i++)
|
||||
{
|
||||
num = (int)CodeHash[num & 0xff ^ toBytes[i]] ^ num >> 8 & 0xffffff;
|
||||
}
|
||||
return (uint)num;
|
||||
}
|
||||
|
||||
public delegate void GetFilesDelegate(string path, bool isComplete);
|
||||
public static List<string> GetFiles(string dir, GetFilesDelegate gfDelegate)
|
||||
{
|
||||
List<string> listFile = new();
|
||||
|
||||
foreach (string file in Directory.EnumerateFiles(dir, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
if (File.GetAttributes(file).HasFlag(FileAttributes.Directory))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
listFile.Add(file);
|
||||
gfDelegate(file, false);
|
||||
}
|
||||
|
||||
return listFile;
|
||||
}
|
||||
|
||||
public delegate void PackingDelegate(string fileName, int pos, int count);
|
||||
public static async Task Packing(string rootDir, List<string> listFile, List<PCKFile> listPckFile, bool replace, PackingDelegate pDelegate, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
RegistryHandler registryHandler = new();
|
||||
string installDirectory = registryHandler.GetInstallDirectory();
|
||||
|
||||
SortedDictionary<string, PCKFile> dicPckFile = new();
|
||||
foreach (PCKFile file in listPckFile)
|
||||
{
|
||||
dicPckFile.Add(file.Name, file);
|
||||
}
|
||||
|
||||
SortedDictionary<string, string> dicInputFile = new();
|
||||
string s = rootDir.Substring(rootDir.Length - 1, 1);
|
||||
if (s != "\\") rootDir += "\\";
|
||||
foreach (string file in listFile)
|
||||
{
|
||||
dicInputFile.Add(file.Replace(rootDir, ""), file);
|
||||
}
|
||||
|
||||
Dictionary<int, FileStream> archives = new(10);
|
||||
Dictionary<int, BinaryWriter> writers = new(10);
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
string pathPCK = Path.Combine(installDirectory, string.Format("{0:000}.pck", i));
|
||||
FileMode mode = File.Exists(pathPCK) ? FileMode.Open : FileMode.Create;
|
||||
FileStream ofs = new(pathPCK, mode, FileAccess.Write);
|
||||
ofs.Position = ofs.Length;
|
||||
BinaryWriter obr = new(ofs);
|
||||
archives.Add(i, ofs);
|
||||
writers.Add(i, obr);
|
||||
}
|
||||
|
||||
// Read the f00x.dat file to get the archive numbers
|
||||
Dictionary<string, int> dicArchive = new();
|
||||
string pathF00X = Path.Combine(installDirectory, "f00x.dat");
|
||||
if (File.Exists(pathF00X))
|
||||
{
|
||||
byte[] buffer = await File.ReadAllBytesAsync(pathF00X);
|
||||
int numDecompressed = buffer.Length << 4;
|
||||
byte[] decompressed = new byte[numDecompressed];
|
||||
int result = ZLibDll.Decompress(buffer, buffer.Length, decompressed, ref numDecompressed);
|
||||
if (result == 0)
|
||||
{
|
||||
string json = Encoding.UTF8.GetString(decompressed);
|
||||
dicArchive = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
||||
}
|
||||
}
|
||||
|
||||
int pos = 0;
|
||||
int count = dicInputFile.Count;
|
||||
foreach (KeyValuePair<string, string> file in dicInputFile)
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
WriteF00XDAT(dicPckFile);
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
|
||||
pos++;
|
||||
pDelegate(file.Key, pos, count);
|
||||
PCKFile? pckFile = null;
|
||||
if (dicPckFile.ContainsKey(file.Key))
|
||||
{
|
||||
if (!replace) continue;
|
||||
pckFile = dicPckFile[file.Key];
|
||||
}
|
||||
|
||||
if (!File.Exists(file.Value)) continue;
|
||||
|
||||
byte[] fileBytes;
|
||||
using (FileStream fileStream = File.OpenRead(file.Value))
|
||||
{
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
fileBytes = new byte[fileStream.Length];
|
||||
await fileStream.ReadAsync(fileBytes, 0, fileBytes.Length);
|
||||
}
|
||||
|
||||
uint fileHash = BytesWithCodeHash(fileBytes);
|
||||
int arc = 0;
|
||||
if (pckFile != null)
|
||||
{
|
||||
if (pckFile.Hash == fileHash) continue;
|
||||
arc = pckFile.Archive;
|
||||
dicPckFile.Remove(file.Key);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dicArchive.ContainsKey(file.Key)) arc = dicArchive[file.Key];
|
||||
else
|
||||
{
|
||||
long pckLen = archives[0].Length;
|
||||
|
||||
for (byte i = 1; i < 10; i++)
|
||||
{
|
||||
long x = archives[i].Length;
|
||||
if (x < pckLen)
|
||||
{
|
||||
pckLen = x;
|
||||
arc = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pckFile = new PCKFile(file.Key, (byte)arc, fileBytes.Length, fileHash, archives[arc].Length);
|
||||
dicPckFile.Add(file.Key, pckFile);
|
||||
BinaryWriter bw = writers[pckFile.Archive];
|
||||
bw.Write(fileBytes);
|
||||
bw.Flush();
|
||||
}
|
||||
WriteF00XDAT(dicPckFile);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (KeyValuePair<int, FileStream> kvp in archives)
|
||||
{
|
||||
kvp.Value.Close();
|
||||
kvp.Value.Dispose();
|
||||
}
|
||||
|
||||
listFile.Clear();
|
||||
listPckFile.Clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void WriteF00XDAT(SortedDictionary<string, PCKFile> dicPckFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
RegistryHandler registryHandler = new();
|
||||
string installDirectory = registryHandler.GetInstallDirectory();
|
||||
byte[]? bufferF00XDAT = null;
|
||||
using (MemoryStream streamF00X = new())
|
||||
{
|
||||
using BinaryWriter writerF00X = new(streamF00X);
|
||||
foreach (KeyValuePair<string, PCKFile> kvFile in dicPckFile)
|
||||
{
|
||||
PCKFile pckFile = kvFile.Value;
|
||||
|
||||
byte[] bytes = Encoding.Unicode.GetBytes(pckFile.Name);
|
||||
int numNameLen = Convert.ToInt32(bytes.Length / 2);
|
||||
writerF00X.Write((ushort)numNameLen);
|
||||
writerF00X.Write(bytes);
|
||||
writerF00X.Write(pckFile.Archive);
|
||||
writerF00X.Write((uint)pckFile.FileSize);
|
||||
writerF00X.Write(pckFile.Hash);
|
||||
writerF00X.Write((ulong)pckFile.Offset);
|
||||
}
|
||||
writerF00X.Flush();
|
||||
bufferF00XDAT = streamF00X.ToArray();
|
||||
}
|
||||
|
||||
int numCompress = (bufferF00XDAT.Length >> 4) + bufferF00XDAT.Length;
|
||||
byte[] bufferCompress = new byte[numCompress];
|
||||
if (ZLibDll.Compress(bufferF00XDAT, bufferF00XDAT.Length, bufferCompress, ref numCompress) == 0)
|
||||
{
|
||||
for (int i = 0; i < numCompress; i++)
|
||||
{
|
||||
bufferCompress[i] = (byte)(bufferCompress[i] ^ BufferTable[i & 0xff]);
|
||||
}
|
||||
|
||||
string pathF00XDAT = Path.Combine(installDirectory, "f00X.dat");
|
||||
File.Delete(pathF00XDAT + ".old");
|
||||
File.Move(pathF00XDAT, pathF00XDAT + ".old");
|
||||
|
||||
using FileStream streamF00XDAT = new(pathF00XDAT, FileMode.Create, FileAccess.Write);
|
||||
using BinaryWriter writerF00XDAT = new(streamF00XDAT);
|
||||
writerF00XDAT.Write(bufferCompress, 0, numCompress);
|
||||
writerF00XDAT.Flush();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
764
RHLauncher.RegForm/RegForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,764 @@
|
|||
namespace RHLauncher
|
||||
{
|
||||
partial class RegForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegForm));
|
||||
CloseButton = new Button();
|
||||
imageListCloseBtn = new ImageList(components);
|
||||
MinimizeButton = new Button();
|
||||
imageListMinBtn = new ImageList(components);
|
||||
CodeLabel = new Label();
|
||||
imageListContinueBtn = new ImageList(components);
|
||||
ContinueButtonS1 = new Button();
|
||||
PasswordLabel = new Label();
|
||||
RepeatPasswordLabel = new Label();
|
||||
SendEmailButton = new Button();
|
||||
imageListSendEmailBtn = new ImageList(components);
|
||||
CodeTextBox = new TextBox();
|
||||
Stage1Panel = new Panel();
|
||||
EmailPictureBox = new PictureBox();
|
||||
EmailDescLabel = new Label();
|
||||
EmailTextBox = new TextBox();
|
||||
EmailLabel = new Label();
|
||||
TimerLabel = new Label();
|
||||
CodePictureBox = new PictureBox();
|
||||
CodeDescLabel = new Label();
|
||||
SubTitleLabelS1 = new Label();
|
||||
TitleLabelS1 = new Label();
|
||||
Stage2Panel = new Panel();
|
||||
PwdStrengthLabel = new Label();
|
||||
AgreementLabel = new Label();
|
||||
AgreeCheckBox = new CheckBox();
|
||||
NamePictureBox = new PictureBox();
|
||||
NameTextBox = new TextBox();
|
||||
NameDescLabel = new Label();
|
||||
NameLabel = new Label();
|
||||
PwdConfirmPictureBox = new PictureBox();
|
||||
PwdPictureBox = new PictureBox();
|
||||
PwdConfirmDescLabel = new Label();
|
||||
PwdDescLabel = new Label();
|
||||
EmailLabelS2 = new Label();
|
||||
ReturnLabelS2 = new Label();
|
||||
ContinueButtonS2 = new Button();
|
||||
PasswordTextBox = new TextBox();
|
||||
RepeatPasswordTextBox = new TextBox();
|
||||
SubTitleLabelS2 = new Label();
|
||||
TitleLabelS2 = new Label();
|
||||
imageListTips = new ImageList(components);
|
||||
imageListOkBtn = new ImageList(components);
|
||||
Stage1Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)EmailPictureBox).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)CodePictureBox).BeginInit();
|
||||
Stage2Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)NamePictureBox).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdPictureBox).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// CloseButton
|
||||
//
|
||||
CloseButton.BackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.BorderColor = Color.Black;
|
||||
CloseButton.FlatAppearance.BorderSize = 0;
|
||||
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
CloseButton.FlatStyle = FlatStyle.Flat;
|
||||
CloseButton.ForeColor = Color.Transparent;
|
||||
CloseButton.ImageIndex = 0;
|
||||
CloseButton.ImageList = imageListCloseBtn;
|
||||
CloseButton.Location = new Point(756, 12);
|
||||
CloseButton.Name = "CloseButton";
|
||||
CloseButton.Size = new Size(32, 29);
|
||||
CloseButton.TabIndex = 9;
|
||||
CloseButton.UseVisualStyleBackColor = false;
|
||||
CloseButton.Click += CloseButton_Click;
|
||||
CloseButton.MouseDown += CloseButton_OnMouseDown;
|
||||
CloseButton.MouseLeave += CloseButton_MouseLeave;
|
||||
CloseButton.MouseHover += CloseButton_MouseHover;
|
||||
//
|
||||
// imageListCloseBtn
|
||||
//
|
||||
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
|
||||
imageListCloseBtn.TransparentColor = Color.Transparent;
|
||||
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
|
||||
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
|
||||
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
|
||||
//
|
||||
// MinimizeButton
|
||||
//
|
||||
MinimizeButton.BackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
|
||||
MinimizeButton.FlatAppearance.BorderSize = 0;
|
||||
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
MinimizeButton.FlatStyle = FlatStyle.Flat;
|
||||
MinimizeButton.ForeColor = Color.Transparent;
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
MinimizeButton.ImageList = imageListMinBtn;
|
||||
MinimizeButton.Location = new Point(681, 7);
|
||||
MinimizeButton.Name = "MinimizeButton";
|
||||
MinimizeButton.Size = new Size(25, 26);
|
||||
MinimizeButton.TabIndex = 8;
|
||||
MinimizeButton.UseVisualStyleBackColor = false;
|
||||
MinimizeButton.Click += MinimizeButton_Click;
|
||||
MinimizeButton.MouseDown += MinimizeButton_OnMouseDown;
|
||||
MinimizeButton.MouseLeave += MinimizeButton_MouseLeave;
|
||||
MinimizeButton.MouseHover += MinimizeButton_MouseHover;
|
||||
//
|
||||
// imageListMinBtn
|
||||
//
|
||||
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
|
||||
imageListMinBtn.TransparentColor = Color.Transparent;
|
||||
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
|
||||
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
|
||||
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
|
||||
//
|
||||
// CodeLabel
|
||||
//
|
||||
CodeLabel.Anchor = AnchorStyles.Top;
|
||||
CodeLabel.AutoEllipsis = true;
|
||||
CodeLabel.AutoSize = true;
|
||||
CodeLabel.BackColor = Color.Transparent;
|
||||
CodeLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CodeLabel.ForeColor = Color.White;
|
||||
CodeLabel.ImeMode = ImeMode.NoControl;
|
||||
CodeLabel.Location = new Point(85, 171);
|
||||
CodeLabel.Name = "CodeLabel";
|
||||
CodeLabel.Size = new Size(124, 19);
|
||||
CodeLabel.TabIndex = 15;
|
||||
CodeLabel.Text = "Verification Code";
|
||||
CodeLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// imageListContinueBtn
|
||||
//
|
||||
imageListContinueBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListContinueBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn.ImageStream");
|
||||
imageListContinueBtn.TransparentColor = Color.Transparent;
|
||||
imageListContinueBtn.Images.SetKeyName(0, "Registerwnd.button.continue.normal.png");
|
||||
imageListContinueBtn.Images.SetKeyName(1, "Registerwnd.button.continue.active.png");
|
||||
imageListContinueBtn.Images.SetKeyName(2, "Registerwnd.button.continue.down.png");
|
||||
//
|
||||
// ContinueButtonS1
|
||||
//
|
||||
ContinueButtonS1.BackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatAppearance.BorderSize = 0;
|
||||
ContinueButtonS1.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
ContinueButtonS1.FlatStyle = FlatStyle.Flat;
|
||||
ContinueButtonS1.ImageIndex = 0;
|
||||
ContinueButtonS1.ImageList = imageListContinueBtn;
|
||||
ContinueButtonS1.ImeMode = ImeMode.NoControl;
|
||||
ContinueButtonS1.Location = new Point(85, 242);
|
||||
ContinueButtonS1.Name = "ContinueButtonS1";
|
||||
ContinueButtonS1.Size = new Size(110, 44);
|
||||
ContinueButtonS1.TabIndex = 16;
|
||||
ContinueButtonS1.UseVisualStyleBackColor = false;
|
||||
ContinueButtonS1.Click += ContinueButtonS1_Click;
|
||||
ContinueButtonS1.MouseDown += ContinueButtonS1_OnMouseDown;
|
||||
ContinueButtonS1.MouseLeave += ContinueButtonS1_MouseLeave;
|
||||
ContinueButtonS1.MouseHover += ContinueButtonS1_MouseHover;
|
||||
//
|
||||
// PasswordLabel
|
||||
//
|
||||
PasswordLabel.Anchor = AnchorStyles.Top;
|
||||
PasswordLabel.AutoEllipsis = true;
|
||||
PasswordLabel.AutoSize = true;
|
||||
PasswordLabel.BackColor = Color.Transparent;
|
||||
PasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PasswordLabel.ForeColor = Color.White;
|
||||
PasswordLabel.ImeMode = ImeMode.NoControl;
|
||||
PasswordLabel.Location = new Point(98, 195);
|
||||
PasswordLabel.Name = "PasswordLabel";
|
||||
PasswordLabel.Size = new Size(136, 19);
|
||||
PasswordLabel.TabIndex = 19;
|
||||
PasswordLabel.Text = "Enter the password";
|
||||
PasswordLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// RepeatPasswordLabel
|
||||
//
|
||||
RepeatPasswordLabel.Anchor = AnchorStyles.Top;
|
||||
RepeatPasswordLabel.AutoEllipsis = true;
|
||||
RepeatPasswordLabel.AutoSize = true;
|
||||
RepeatPasswordLabel.BackColor = Color.Transparent;
|
||||
RepeatPasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
RepeatPasswordLabel.ForeColor = Color.White;
|
||||
RepeatPasswordLabel.ImeMode = ImeMode.NoControl;
|
||||
RepeatPasswordLabel.Location = new Point(95, 262);
|
||||
RepeatPasswordLabel.Name = "RepeatPasswordLabel";
|
||||
RepeatPasswordLabel.Size = new Size(160, 19);
|
||||
RepeatPasswordLabel.TabIndex = 20;
|
||||
RepeatPasswordLabel.Text = "Re-enter the password";
|
||||
RepeatPasswordLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// SendEmailButton
|
||||
//
|
||||
SendEmailButton.BackColor = Color.Transparent;
|
||||
SendEmailButton.FlatAppearance.BorderSize = 0;
|
||||
SendEmailButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
SendEmailButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
SendEmailButton.FlatStyle = FlatStyle.Flat;
|
||||
SendEmailButton.ImageIndex = 0;
|
||||
SendEmailButton.ImageList = imageListSendEmailBtn;
|
||||
SendEmailButton.ImeMode = ImeMode.NoControl;
|
||||
SendEmailButton.Location = new Point(254, 242);
|
||||
SendEmailButton.Name = "SendEmailButton";
|
||||
SendEmailButton.Size = new Size(110, 44);
|
||||
SendEmailButton.TabIndex = 21;
|
||||
SendEmailButton.UseVisualStyleBackColor = false;
|
||||
SendEmailButton.Click += SendEmailButton_Click;
|
||||
SendEmailButton.MouseDown += SendEmailButton_OnMouseDown;
|
||||
SendEmailButton.MouseLeave += SendEmailButton_MouseLeave;
|
||||
SendEmailButton.MouseHover += SendEmailButton_MouseHover;
|
||||
//
|
||||
// imageListSendEmailBtn
|
||||
//
|
||||
imageListSendEmailBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListSendEmailBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn.ImageStream");
|
||||
imageListSendEmailBtn.TransparentColor = Color.Transparent;
|
||||
imageListSendEmailBtn.Images.SetKeyName(0, "ChangePwwnd.button.email.normal.png");
|
||||
imageListSendEmailBtn.Images.SetKeyName(1, "ChangePwwnd.button.email.active.png");
|
||||
imageListSendEmailBtn.Images.SetKeyName(2, "ChangePwwnd.button.email.down.png");
|
||||
//
|
||||
// CodeTextBox
|
||||
//
|
||||
CodeTextBox.Location = new Point(85, 191);
|
||||
CodeTextBox.Name = "CodeTextBox";
|
||||
CodeTextBox.Size = new Size(279, 23);
|
||||
CodeTextBox.TabIndex = 22;
|
||||
CodeTextBox.TextChanged += CodeTextBox_TextChanged;
|
||||
//
|
||||
// Stage1Panel
|
||||
//
|
||||
Stage1Panel.BackColor = Color.Transparent;
|
||||
Stage1Panel.Controls.Add(EmailPictureBox);
|
||||
Stage1Panel.Controls.Add(EmailDescLabel);
|
||||
Stage1Panel.Controls.Add(EmailTextBox);
|
||||
Stage1Panel.Controls.Add(EmailLabel);
|
||||
Stage1Panel.Controls.Add(TimerLabel);
|
||||
Stage1Panel.Controls.Add(CodePictureBox);
|
||||
Stage1Panel.Controls.Add(CodeDescLabel);
|
||||
Stage1Panel.Controls.Add(SubTitleLabelS1);
|
||||
Stage1Panel.Controls.Add(TitleLabelS1);
|
||||
Stage1Panel.Controls.Add(SendEmailButton);
|
||||
Stage1Panel.Controls.Add(CodeTextBox);
|
||||
Stage1Panel.Controls.Add(ContinueButtonS1);
|
||||
Stage1Panel.Controls.Add(CodeLabel);
|
||||
Stage1Panel.Location = new Point(0, 79);
|
||||
Stage1Panel.Name = "Stage1Panel";
|
||||
Stage1Panel.Size = new Size(800, 450);
|
||||
Stage1Panel.TabIndex = 23;
|
||||
//
|
||||
// EmailPictureBox
|
||||
//
|
||||
EmailPictureBox.BackColor = Color.Transparent;
|
||||
EmailPictureBox.Location = new Point(377, 108);
|
||||
EmailPictureBox.Name = "EmailPictureBox";
|
||||
EmailPictureBox.Size = new Size(14, 14);
|
||||
EmailPictureBox.TabIndex = 46;
|
||||
EmailPictureBox.TabStop = false;
|
||||
//
|
||||
// EmailDescLabel
|
||||
//
|
||||
EmailDescLabel.Anchor = AnchorStyles.Top;
|
||||
EmailDescLabel.AutoSize = true;
|
||||
EmailDescLabel.BackColor = Color.Transparent;
|
||||
EmailDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
EmailDescLabel.ForeColor = Color.White;
|
||||
EmailDescLabel.ImeMode = ImeMode.NoControl;
|
||||
EmailDescLabel.Location = new Point(393, 108);
|
||||
EmailDescLabel.Name = "EmailDescLabel";
|
||||
EmailDescLabel.Size = new Size(0, 13);
|
||||
EmailDescLabel.TabIndex = 45;
|
||||
EmailDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// EmailTextBox
|
||||
//
|
||||
EmailTextBox.Location = new Point(85, 103);
|
||||
EmailTextBox.Name = "EmailTextBox";
|
||||
EmailTextBox.Size = new Size(279, 23);
|
||||
EmailTextBox.TabIndex = 44;
|
||||
EmailTextBox.TextChanged += EmailTextBox_TextChanged;
|
||||
//
|
||||
// EmailLabel
|
||||
//
|
||||
EmailLabel.Anchor = AnchorStyles.Top;
|
||||
EmailLabel.AutoEllipsis = true;
|
||||
EmailLabel.AutoSize = true;
|
||||
EmailLabel.BackColor = Color.Transparent;
|
||||
EmailLabel.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
EmailLabel.ForeColor = Color.White;
|
||||
EmailLabel.ImeMode = ImeMode.NoControl;
|
||||
EmailLabel.Location = new Point(88, 82);
|
||||
EmailLabel.Name = "EmailLabel";
|
||||
EmailLabel.Size = new Size(96, 17);
|
||||
EmailLabel.TabIndex = 43;
|
||||
EmailLabel.Text = "Account Email";
|
||||
EmailLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TimerLabel
|
||||
//
|
||||
TimerLabel.Anchor = AnchorStyles.Top;
|
||||
TimerLabel.AutoSize = true;
|
||||
TimerLabel.BackColor = Color.Transparent;
|
||||
TimerLabel.Font = new Font("Segoe UI", 11.25F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TimerLabel.ForeColor = Color.White;
|
||||
TimerLabel.ImeMode = ImeMode.NoControl;
|
||||
TimerLabel.Location = new Point(366, 255);
|
||||
TimerLabel.Name = "TimerLabel";
|
||||
TimerLabel.Size = new Size(0, 20);
|
||||
TimerLabel.TabIndex = 42;
|
||||
TimerLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// CodePictureBox
|
||||
//
|
||||
CodePictureBox.BackColor = Color.Transparent;
|
||||
CodePictureBox.Location = new Point(375, 196);
|
||||
CodePictureBox.Name = "CodePictureBox";
|
||||
CodePictureBox.Size = new Size(14, 14);
|
||||
CodePictureBox.TabIndex = 41;
|
||||
CodePictureBox.TabStop = false;
|
||||
//
|
||||
// CodeDescLabel
|
||||
//
|
||||
CodeDescLabel.Anchor = AnchorStyles.Top;
|
||||
CodeDescLabel.AutoSize = true;
|
||||
CodeDescLabel.BackColor = Color.Transparent;
|
||||
CodeDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
CodeDescLabel.ForeColor = Color.White;
|
||||
CodeDescLabel.ImeMode = ImeMode.NoControl;
|
||||
CodeDescLabel.Location = new Point(391, 196);
|
||||
CodeDescLabel.Name = "CodeDescLabel";
|
||||
CodeDescLabel.Size = new Size(0, 13);
|
||||
CodeDescLabel.TabIndex = 40;
|
||||
CodeDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// SubTitleLabelS1
|
||||
//
|
||||
SubTitleLabelS1.Anchor = AnchorStyles.Top;
|
||||
SubTitleLabelS1.AutoEllipsis = true;
|
||||
SubTitleLabelS1.AutoSize = true;
|
||||
SubTitleLabelS1.BackColor = Color.Transparent;
|
||||
SubTitleLabelS1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SubTitleLabelS1.ForeColor = Color.White;
|
||||
SubTitleLabelS1.ImeMode = ImeMode.NoControl;
|
||||
SubTitleLabelS1.Location = new Point(101, 44);
|
||||
SubTitleLabelS1.Name = "SubTitleLabelS1";
|
||||
SubTitleLabelS1.Size = new Size(93, 19);
|
||||
SubTitleLabelS1.TabIndex = 24;
|
||||
SubTitleLabelS1.Text = "Rusty Hearts";
|
||||
SubTitleLabelS1.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TitleLabelS1
|
||||
//
|
||||
TitleLabelS1.Anchor = AnchorStyles.Top;
|
||||
TitleLabelS1.AutoEllipsis = true;
|
||||
TitleLabelS1.AutoSize = true;
|
||||
TitleLabelS1.BackColor = Color.Transparent;
|
||||
TitleLabelS1.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TitleLabelS1.ForeColor = Color.White;
|
||||
TitleLabelS1.ImeMode = ImeMode.NoControl;
|
||||
TitleLabelS1.Location = new Point(85, 2);
|
||||
TitleLabelS1.Name = "TitleLabelS1";
|
||||
TitleLabelS1.Size = new Size(235, 37);
|
||||
TitleLabelS1.TabIndex = 23;
|
||||
TitleLabelS1.Text = "Register Account";
|
||||
TitleLabelS1.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// Stage2Panel
|
||||
//
|
||||
Stage2Panel.BackColor = Color.Transparent;
|
||||
Stage2Panel.Controls.Add(PwdStrengthLabel);
|
||||
Stage2Panel.Controls.Add(AgreementLabel);
|
||||
Stage2Panel.Controls.Add(AgreeCheckBox);
|
||||
Stage2Panel.Controls.Add(NamePictureBox);
|
||||
Stage2Panel.Controls.Add(NameTextBox);
|
||||
Stage2Panel.Controls.Add(NameDescLabel);
|
||||
Stage2Panel.Controls.Add(NameLabel);
|
||||
Stage2Panel.Controls.Add(PwdConfirmPictureBox);
|
||||
Stage2Panel.Controls.Add(PwdPictureBox);
|
||||
Stage2Panel.Controls.Add(PwdConfirmDescLabel);
|
||||
Stage2Panel.Controls.Add(PwdDescLabel);
|
||||
Stage2Panel.Controls.Add(EmailLabelS2);
|
||||
Stage2Panel.Controls.Add(ReturnLabelS2);
|
||||
Stage2Panel.Controls.Add(ContinueButtonS2);
|
||||
Stage2Panel.Controls.Add(PasswordTextBox);
|
||||
Stage2Panel.Controls.Add(RepeatPasswordTextBox);
|
||||
Stage2Panel.Controls.Add(SubTitleLabelS2);
|
||||
Stage2Panel.Controls.Add(TitleLabelS2);
|
||||
Stage2Panel.Controls.Add(PasswordLabel);
|
||||
Stage2Panel.Controls.Add(RepeatPasswordLabel);
|
||||
Stage2Panel.Location = new Point(0, 79);
|
||||
Stage2Panel.Name = "Stage2Panel";
|
||||
Stage2Panel.Size = new Size(800, 450);
|
||||
Stage2Panel.TabIndex = 25;
|
||||
//
|
||||
// PwdStrengthLabel
|
||||
//
|
||||
PwdStrengthLabel.Anchor = AnchorStyles.Top;
|
||||
PwdStrengthLabel.AutoSize = true;
|
||||
PwdStrengthLabel.BackColor = Color.Transparent;
|
||||
PwdStrengthLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdStrengthLabel.ForeColor = Color.White;
|
||||
PwdStrengthLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdStrengthLabel.Location = new Point(93, 242);
|
||||
PwdStrengthLabel.Name = "PwdStrengthLabel";
|
||||
PwdStrengthLabel.Size = new Size(0, 13);
|
||||
PwdStrengthLabel.TabIndex = 42;
|
||||
PwdStrengthLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// AgreementLabel
|
||||
//
|
||||
AgreementLabel.Anchor = AnchorStyles.Top;
|
||||
AgreementLabel.AutoEllipsis = true;
|
||||
AgreementLabel.AutoSize = true;
|
||||
AgreementLabel.BackColor = Color.Transparent;
|
||||
AgreementLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
AgreementLabel.ForeColor = Color.Gainsboro;
|
||||
AgreementLabel.ImeMode = ImeMode.NoControl;
|
||||
AgreementLabel.Location = new Point(259, 321);
|
||||
AgreementLabel.Name = "AgreementLabel";
|
||||
AgreementLabel.Size = new Size(132, 19);
|
||||
AgreementLabel.TabIndex = 41;
|
||||
AgreementLabel.Text = "\"User Agreement\"";
|
||||
AgreementLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
AgreementLabel.Click += AgreementLabel_Click;
|
||||
AgreementLabel.MouseLeave += AgreementLabel_MouseLeave;
|
||||
AgreementLabel.MouseHover += AgreementLabel_MouseHover;
|
||||
//
|
||||
// AgreeCheckBox
|
||||
//
|
||||
AgreeCheckBox.AutoSize = true;
|
||||
AgreeCheckBox.BackColor = Color.Transparent;
|
||||
AgreeCheckBox.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
AgreeCheckBox.ForeColor = Color.White;
|
||||
AgreeCheckBox.Location = new Point(95, 320);
|
||||
AgreeCheckBox.Name = "AgreeCheckBox";
|
||||
AgreeCheckBox.Size = new Size(171, 23);
|
||||
AgreeCheckBox.TabIndex = 40;
|
||||
AgreeCheckBox.Text = "Agree and accept the";
|
||||
AgreeCheckBox.UseVisualStyleBackColor = false;
|
||||
AgreeCheckBox.CheckedChanged += AgreeCheckBox_CheckedChanged;
|
||||
//
|
||||
// NamePictureBox
|
||||
//
|
||||
NamePictureBox.BackColor = Color.Transparent;
|
||||
NamePictureBox.Location = new Point(383, 151);
|
||||
NamePictureBox.Name = "NamePictureBox";
|
||||
NamePictureBox.Size = new Size(14, 14);
|
||||
NamePictureBox.TabIndex = 39;
|
||||
NamePictureBox.TabStop = false;
|
||||
//
|
||||
// NameTextBox
|
||||
//
|
||||
NameTextBox.Location = new Point(93, 147);
|
||||
NameTextBox.Name = "NameTextBox";
|
||||
NameTextBox.Size = new Size(279, 23);
|
||||
NameTextBox.TabIndex = 38;
|
||||
NameTextBox.TextChanged += NameTextBox_TextChanged;
|
||||
//
|
||||
// NameDescLabel
|
||||
//
|
||||
NameDescLabel.Anchor = AnchorStyles.Top;
|
||||
NameDescLabel.AutoEllipsis = true;
|
||||
NameDescLabel.AutoSize = true;
|
||||
NameDescLabel.BackColor = Color.Transparent;
|
||||
NameDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
NameDescLabel.ForeColor = Color.White;
|
||||
NameDescLabel.ImeMode = ImeMode.NoControl;
|
||||
NameDescLabel.Location = new Point(399, 152);
|
||||
NameDescLabel.MaximumSize = new Size(250, 0);
|
||||
NameDescLabel.Name = "NameDescLabel";
|
||||
NameDescLabel.Size = new Size(158, 13);
|
||||
NameDescLabel.TabIndex = 37;
|
||||
NameDescLabel.Text = "6-16 alphanumeric characters";
|
||||
NameDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// NameLabel
|
||||
//
|
||||
NameLabel.Anchor = AnchorStyles.Top;
|
||||
NameLabel.AutoSize = true;
|
||||
NameLabel.BackColor = Color.Transparent;
|
||||
NameLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
NameLabel.ForeColor = Color.White;
|
||||
NameLabel.ImeMode = ImeMode.NoControl;
|
||||
NameLabel.Location = new Point(104, 126);
|
||||
NameLabel.Name = "NameLabel";
|
||||
NameLabel.Size = new Size(107, 19);
|
||||
NameLabel.TabIndex = 36;
|
||||
NameLabel.Text = "Account Name";
|
||||
NameLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// PwdConfirmPictureBox
|
||||
//
|
||||
PwdConfirmPictureBox.BackColor = Color.Transparent;
|
||||
PwdConfirmPictureBox.Location = new Point(379, 284);
|
||||
PwdConfirmPictureBox.Name = "PwdConfirmPictureBox";
|
||||
PwdConfirmPictureBox.Size = new Size(14, 14);
|
||||
PwdConfirmPictureBox.TabIndex = 35;
|
||||
PwdConfirmPictureBox.TabStop = false;
|
||||
//
|
||||
// PwdPictureBox
|
||||
//
|
||||
PwdPictureBox.BackColor = Color.Transparent;
|
||||
PwdPictureBox.Location = new Point(379, 220);
|
||||
PwdPictureBox.Name = "PwdPictureBox";
|
||||
PwdPictureBox.Size = new Size(14, 14);
|
||||
PwdPictureBox.TabIndex = 34;
|
||||
PwdPictureBox.TabStop = false;
|
||||
//
|
||||
// PwdConfirmDescLabel
|
||||
//
|
||||
PwdConfirmDescLabel.Anchor = AnchorStyles.Top;
|
||||
PwdConfirmDescLabel.AutoSize = true;
|
||||
PwdConfirmDescLabel.BackColor = Color.Transparent;
|
||||
PwdConfirmDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdConfirmDescLabel.ForeColor = Color.White;
|
||||
PwdConfirmDescLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdConfirmDescLabel.Location = new Point(395, 284);
|
||||
PwdConfirmDescLabel.MaximumSize = new Size(250, 0);
|
||||
PwdConfirmDescLabel.Name = "PwdConfirmDescLabel";
|
||||
PwdConfirmDescLabel.Size = new Size(116, 13);
|
||||
PwdConfirmDescLabel.TabIndex = 33;
|
||||
PwdConfirmDescLabel.Text = "Repeat the password";
|
||||
PwdConfirmDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// PwdDescLabel
|
||||
//
|
||||
PwdDescLabel.Anchor = AnchorStyles.Top;
|
||||
PwdDescLabel.AutoSize = true;
|
||||
PwdDescLabel.BackColor = Color.Transparent;
|
||||
PwdDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
PwdDescLabel.ForeColor = Color.White;
|
||||
PwdDescLabel.ImeMode = ImeMode.NoControl;
|
||||
PwdDescLabel.Location = new Point(395, 221);
|
||||
PwdDescLabel.MaximumSize = new Size(250, 0);
|
||||
PwdDescLabel.Name = "PwdDescLabel";
|
||||
PwdDescLabel.Size = new Size(84, 13);
|
||||
PwdDescLabel.TabIndex = 32;
|
||||
PwdDescLabel.Text = "6-16 characters";
|
||||
PwdDescLabel.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// EmailLabelS2
|
||||
//
|
||||
EmailLabelS2.AutoSize = true;
|
||||
EmailLabelS2.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
EmailLabelS2.ForeColor = Color.DodgerBlue;
|
||||
EmailLabelS2.Location = new Point(101, 74);
|
||||
EmailLabelS2.Name = "EmailLabelS2";
|
||||
EmailLabelS2.Size = new Size(47, 20);
|
||||
EmailLabelS2.TabIndex = 28;
|
||||
EmailLabelS2.Text = "Email";
|
||||
//
|
||||
// ReturnLabelS2
|
||||
//
|
||||
ReturnLabelS2.Anchor = AnchorStyles.Top;
|
||||
ReturnLabelS2.AutoEllipsis = true;
|
||||
ReturnLabelS2.AutoSize = true;
|
||||
ReturnLabelS2.BackColor = Color.Transparent;
|
||||
ReturnLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
ReturnLabelS2.ForeColor = Color.Gainsboro;
|
||||
ReturnLabelS2.ImeMode = ImeMode.NoControl;
|
||||
ReturnLabelS2.Location = new Point(98, 420);
|
||||
ReturnLabelS2.Name = "ReturnLabelS2";
|
||||
ReturnLabelS2.Size = new Size(67, 19);
|
||||
ReturnLabelS2.TabIndex = 27;
|
||||
ReturnLabelS2.Text = "< Return";
|
||||
ReturnLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
ReturnLabelS2.Click += ReturnLabel_Click;
|
||||
ReturnLabelS2.MouseLeave += ReturnLabelS2_MouseLeave;
|
||||
ReturnLabelS2.MouseHover += ReturnLabelS2_MouseHover;
|
||||
//
|
||||
// ContinueButtonS2
|
||||
//
|
||||
ContinueButtonS2.BackColor = Color.Transparent;
|
||||
ContinueButtonS2.FlatAppearance.BorderSize = 0;
|
||||
ContinueButtonS2.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
ContinueButtonS2.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
ContinueButtonS2.FlatStyle = FlatStyle.Flat;
|
||||
ContinueButtonS2.ImageIndex = 0;
|
||||
ContinueButtonS2.ImageList = imageListContinueBtn;
|
||||
ContinueButtonS2.ImeMode = ImeMode.NoControl;
|
||||
ContinueButtonS2.Location = new Point(95, 351);
|
||||
ContinueButtonS2.Name = "ContinueButtonS2";
|
||||
ContinueButtonS2.Size = new Size(110, 44);
|
||||
ContinueButtonS2.TabIndex = 26;
|
||||
ContinueButtonS2.UseVisualStyleBackColor = false;
|
||||
ContinueButtonS2.Click += ContinueButtonS2_Click;
|
||||
ContinueButtonS2.MouseLeave += ContinueButtonS2_MouseLeave;
|
||||
ContinueButtonS2.MouseHover += ContinueButtonS2_MouseHover;
|
||||
//
|
||||
// PasswordTextBox
|
||||
//
|
||||
PasswordTextBox.Location = new Point(93, 215);
|
||||
PasswordTextBox.Name = "PasswordTextBox";
|
||||
PasswordTextBox.Size = new Size(279, 23);
|
||||
PasswordTextBox.TabIndex = 25;
|
||||
PasswordTextBox.UseSystemPasswordChar = true;
|
||||
PasswordTextBox.TextChanged += PasswordTextBox_TextChanged;
|
||||
//
|
||||
// RepeatPasswordTextBox
|
||||
//
|
||||
RepeatPasswordTextBox.Location = new Point(93, 281);
|
||||
RepeatPasswordTextBox.Name = "RepeatPasswordTextBox";
|
||||
RepeatPasswordTextBox.Size = new Size(279, 23);
|
||||
RepeatPasswordTextBox.TabIndex = 24;
|
||||
RepeatPasswordTextBox.UseSystemPasswordChar = true;
|
||||
RepeatPasswordTextBox.TextChanged += RepeatPasswordTextBox_TextChanged;
|
||||
//
|
||||
// SubTitleLabelS2
|
||||
//
|
||||
SubTitleLabelS2.Anchor = AnchorStyles.Top;
|
||||
SubTitleLabelS2.AutoEllipsis = true;
|
||||
SubTitleLabelS2.AutoSize = true;
|
||||
SubTitleLabelS2.BackColor = Color.Transparent;
|
||||
SubTitleLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
SubTitleLabelS2.ForeColor = Color.White;
|
||||
SubTitleLabelS2.ImeMode = ImeMode.NoControl;
|
||||
SubTitleLabelS2.Location = new Point(101, 42);
|
||||
SubTitleLabelS2.Name = "SubTitleLabelS2";
|
||||
SubTitleLabelS2.Size = new Size(63, 19);
|
||||
SubTitleLabelS2.TabIndex = 22;
|
||||
SubTitleLabelS2.Text = "Account";
|
||||
SubTitleLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// TitleLabelS2
|
||||
//
|
||||
TitleLabelS2.Anchor = AnchorStyles.Top;
|
||||
TitleLabelS2.AutoEllipsis = true;
|
||||
TitleLabelS2.AutoSize = true;
|
||||
TitleLabelS2.BackColor = Color.Transparent;
|
||||
TitleLabelS2.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
|
||||
TitleLabelS2.ForeColor = Color.White;
|
||||
TitleLabelS2.ImeMode = ImeMode.NoControl;
|
||||
TitleLabelS2.Location = new Point(85, 3);
|
||||
TitleLabelS2.Name = "TitleLabelS2";
|
||||
TitleLabelS2.Size = new Size(218, 37);
|
||||
TitleLabelS2.TabIndex = 21;
|
||||
TitleLabelS2.Text = "Account Details";
|
||||
TitleLabelS2.TextAlign = ContentAlignment.TopCenter;
|
||||
//
|
||||
// imageListTips
|
||||
//
|
||||
imageListTips.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListTips.ImageStream = (ImageListStreamer)resources.GetObject("imageListTips.ImageStream");
|
||||
imageListTips.TransparentColor = Color.Transparent;
|
||||
imageListTips.Images.SetKeyName(0, "tips_error.png");
|
||||
imageListTips.Images.SetKeyName(1, "tips_ok.png");
|
||||
//
|
||||
// imageListOkBtn
|
||||
//
|
||||
imageListOkBtn.ColorDepth = ColorDepth.Depth32Bit;
|
||||
imageListOkBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOkBtn.ImageStream");
|
||||
imageListOkBtn.TransparentColor = Color.Transparent;
|
||||
imageListOkBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
|
||||
imageListOkBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
|
||||
imageListOkBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
|
||||
//
|
||||
// RegForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.Black;
|
||||
BackgroundImage = Properties.Resources.bg;
|
||||
BackgroundImageLayout = ImageLayout.Center;
|
||||
ClientSize = new Size(800, 571);
|
||||
Controls.Add(CloseButton);
|
||||
Controls.Add(MinimizeButton);
|
||||
Controls.Add(Stage2Panel);
|
||||
Controls.Add(Stage1Panel);
|
||||
DoubleBuffered = true;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
Name = "RegForm";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Change Password";
|
||||
FormClosing += RegForm_FormClosing;
|
||||
Load += RegForm_Load;
|
||||
Stage1Panel.ResumeLayout(false);
|
||||
Stage1Panel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)EmailPictureBox).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)CodePictureBox).EndInit();
|
||||
Stage2Panel.ResumeLayout(false);
|
||||
Stage2Panel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)NamePictureBox).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)PwdPictureBox).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button CloseButton;
|
||||
private ImageList imageListCloseBtn;
|
||||
private Button MinimizeButton;
|
||||
private ImageList imageListMinBtn;
|
||||
private Label CodeLabel;
|
||||
private ImageList imageListContinueBtn;
|
||||
private Button ContinueButtonS1;
|
||||
private Label PasswordLabel;
|
||||
private Label RepeatPasswordLabel;
|
||||
private Button SendEmailButton;
|
||||
private TextBox CodeTextBox;
|
||||
private Label SubTitleLabelS1;
|
||||
private Label TitleLabelS1;
|
||||
private Panel Stage1Panel;
|
||||
private Panel Stage2Panel;
|
||||
private Button ContinueButtonS2;
|
||||
private TextBox PasswordTextBox;
|
||||
private TextBox RepeatPasswordTextBox;
|
||||
private Label SubTitleLabelS2;
|
||||
private Label TitleLabelS2;
|
||||
private Label ReturnLabelS2;
|
||||
private Label EmailLabelS2;
|
||||
private ImageList imageListSendEmailBtn;
|
||||
private PictureBox PwdConfirmPictureBox;
|
||||
private PictureBox PwdPictureBox;
|
||||
private Label PwdConfirmDescLabel;
|
||||
private Label PwdDescLabel;
|
||||
private ImageList imageListTips;
|
||||
private PictureBox CodePictureBox;
|
||||
private Label CodeDescLabel;
|
||||
private Label TimerLabel;
|
||||
private PictureBox EmailPictureBox;
|
||||
private Label EmailDescLabel;
|
||||
private TextBox EmailTextBox;
|
||||
private Label EmailLabel;
|
||||
private ImageList imageListOkBtn;
|
||||
private PictureBox NamePictureBox;
|
||||
private TextBox NameTextBox;
|
||||
private Label NameDescLabel;
|
||||
private Label NameLabel;
|
||||
private CheckBox AgreeCheckBox;
|
||||
private Label AgreementLabel;
|
||||
private Label PwdStrengthLabel;
|
||||
}
|
||||
}
|
||||
611
RHLauncher.RegForm/RegForm.cs
Normal file
|
|
@ -0,0 +1,611 @@
|
|||
using RHLauncher.RHLauncher;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class RegForm : Form
|
||||
{
|
||||
public string SendCodeUrl = Configuration.Default.SendCodeUrl;
|
||||
public string AgreementUrl = Configuration.Default.AgreementUrl;
|
||||
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
|
||||
public string RegisterUrl = Configuration.Default.RegisterUrl;
|
||||
|
||||
private readonly System.Windows.Forms.Timer resendTimer = new();
|
||||
private int secondsLeft = 60;
|
||||
|
||||
[GeneratedRegex("^(?=.*[a-zA-Z])[a-zA-Z0-9]+$")]
|
||||
private static partial Regex MyRegex();
|
||||
|
||||
public RegForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Stage1Panel.Visible = true;
|
||||
Stage2Panel.Visible = false;
|
||||
|
||||
resendTimer = new System.Windows.Forms.Timer
|
||||
{
|
||||
Interval = 1000
|
||||
};
|
||||
resendTimer.Tick += ResendTimer_Tick;
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
private async Task<string> SendEmailRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
HttpResponseMessage response = await client.PostAsync(SendCodeUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private void HandleSendEmailResponse(string response)
|
||||
{
|
||||
switch (response)
|
||||
{
|
||||
case "EmailSent":
|
||||
SendEmailButton.Enabled = false;
|
||||
resendTimer.Start();
|
||||
break;
|
||||
case "AccountExists":
|
||||
MsgBoxForm.Show("A account with this email already exists.", "Info");
|
||||
break;
|
||||
case "ValidVerificationCode":
|
||||
// Hide the first 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 "InvalidVerificationCode":
|
||||
CodeDescLabel.Text = "Invalid Verification Code";
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
case "ExpiredVerificationCode":
|
||||
CodeDescLabel.Text = "This verification code has expired, please request a new one.";
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
default:
|
||||
MsgBoxForm.Show("An error occurred:" + response, "Error");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ResendTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
// Decrement the secondsLeft variable and update the button text
|
||||
secondsLeft--;
|
||||
TimerLabel.Text = $"({secondsLeft})";
|
||||
|
||||
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
|
||||
if (secondsLeft == 0)
|
||||
{
|
||||
resendTimer.Stop();
|
||||
SendEmailButton.Enabled = true;
|
||||
TimerLabel.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<string> VerifyCodeSendRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
|
||||
new KeyValuePair<string, string>("verification_code_type", "Account"),
|
||||
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private async Task<string> SendRequestAsync()
|
||||
{
|
||||
using HttpClient client = new();
|
||||
HttpResponseMessage response = await client.PostAsync(RegisterUrl, new FormUrlEncodedContent(new[]
|
||||
{
|
||||
new KeyValuePair<string, string>("windyCode", NameTextBox.Text),
|
||||
new KeyValuePair<string, string>("email", EmailTextBox.Text),
|
||||
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
|
||||
}));
|
||||
|
||||
return await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
private void HandleResponse(string response)
|
||||
{
|
||||
switch (response)
|
||||
{
|
||||
case "Success":
|
||||
MsgBoxForm.Show("Account created successfully.", "Register Window");
|
||||
Close();
|
||||
break;
|
||||
case "AccountExists":
|
||||
MsgBoxForm.Show("A account with this username already exists.", "Info");
|
||||
break;
|
||||
case "WindyCodeExists":
|
||||
MsgBoxForm.Show("A game account with this username already exists.", "Error");
|
||||
break;
|
||||
case "InvalidUserNameFormat":
|
||||
MsgBoxForm.Show("Invalid username format", "Error");
|
||||
break;
|
||||
case "InvalidEmailFormat":
|
||||
MsgBoxForm.Show("Invalid email format", "Error");
|
||||
break;
|
||||
default:
|
||||
MsgBoxForm.Show("An error occurred:" + response, "Error");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void HandleException(Exception ex)
|
||||
{
|
||||
string errorMessage = ex.Message;
|
||||
string errorLog = ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Click Events
|
||||
|
||||
private void AgreementLabel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo { FileName = AgreementUrl, UseShellExecute = true });
|
||||
}
|
||||
|
||||
private async void SendEmailButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(EmailTextBox.Text))
|
||||
{
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
|
||||
EmailDescLabel.ForeColor = Color.Red;
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable the ResendEmailButton and stop the timer
|
||||
SendEmailButton.Enabled = false;
|
||||
resendTimer.Stop();
|
||||
|
||||
try
|
||||
{
|
||||
string email = EmailTextBox.Text;
|
||||
string pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
|
||||
if (Regex.IsMatch(email, pattern))
|
||||
{
|
||||
// email is valid
|
||||
EmailPictureBox.Image = imageListTips.Images[1];
|
||||
EmailDescLabel.Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// email is not valid
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset the secondsLeft variable and start the timer again
|
||||
secondsLeft = 60;
|
||||
resendTimer.Start();
|
||||
SendEmailButton.Enabled = false;
|
||||
|
||||
string response = await SendEmailRequestAsync();
|
||||
|
||||
HandleSendEmailResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async void ContinueButtonS1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CodeTextBox.Text))
|
||||
{
|
||||
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string response = await VerifyCodeSendRequestAsync();
|
||||
|
||||
HandleSendEmailResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async void ContinueButtonS2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS2.Enabled = false;
|
||||
try
|
||||
{
|
||||
string response = await SendRequestAsync();
|
||||
|
||||
HandleResponse(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReturnLabel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Show the previous panel and hide the current panel
|
||||
if (Stage2Panel.Visible)
|
||||
{
|
||||
Stage1Panel.Visible = true;
|
||||
Stage2Panel.Visible = false;
|
||||
}
|
||||
else if (Stage1Panel.Visible)
|
||||
{
|
||||
Stage1Panel.Visible = false;
|
||||
Stage2Panel.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
private bool NameTextBoxValid = false;
|
||||
private void NameTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(NameTextBox.Text) || NameTextBox.Text.Length < 6 || NameTextBox.Text.Length > 16 || !MyRegex().IsMatch(NameTextBox.Text))
|
||||
{
|
||||
if (string.IsNullOrEmpty(NameTextBox.Text))
|
||||
{
|
||||
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelEmpty;
|
||||
NameDescLabel.ForeColor = Color.Red;
|
||||
NamePictureBox.Image = imageListTips.Images[0];
|
||||
NameTextBoxValid = false;
|
||||
}
|
||||
else if (NameTextBox.Text.Length < 6 || NameTextBox.Text.Length > 16)
|
||||
{
|
||||
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelSize;
|
||||
NameDescLabel.ForeColor = Color.Red;
|
||||
NamePictureBox.Image = imageListTips.Images[0];
|
||||
NameTextBoxValid = false;
|
||||
}
|
||||
else if (!MyRegex().IsMatch(NameTextBox.Text))
|
||||
{
|
||||
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelInvalid;
|
||||
NameDescLabel.ForeColor = Color.Red;
|
||||
NamePictureBox.Image = imageListTips.Images[0];
|
||||
NameTextBoxValid = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NameDescLabel.Text = "";
|
||||
NamePictureBox.Image = imageListTips.Images[1];
|
||||
NameTextBoxValid = true;
|
||||
}
|
||||
CheckFormS2Validity();
|
||||
}
|
||||
|
||||
private bool PasswordTextBoxValid = false;
|
||||
private void PasswordTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
string password = PasswordTextBox.Text;
|
||||
|
||||
// Check for minimum length and maximum length
|
||||
if (password.Length < 6 || password.Length > 16)
|
||||
{
|
||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
|
||||
PwdDescLabel.ForeColor = Color.Red;
|
||||
PwdPictureBox.Image = imageListTips.Images[0];
|
||||
PasswordTextBoxValid = false;
|
||||
RepeatPasswordTextBoxValid = false;
|
||||
CheckFormS2Validity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for at least one uppercase, one lowercase letter, and one number
|
||||
Regex regex = new(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$");
|
||||
if (!regex.IsMatch(password))
|
||||
{
|
||||
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelCriteria;
|
||||
PwdDescLabel.ForeColor = Color.Red;
|
||||
PwdPictureBox.Image = imageListTips.Images[0];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelWeak;
|
||||
PwdStrengthLabel.ForeColor = Color.Red;
|
||||
PasswordTextBoxValid = false;
|
||||
RepeatPasswordTextBoxValid = false;
|
||||
CheckFormS2Validity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for additional character types such as symbols
|
||||
regex = new Regex(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).+$");
|
||||
if (regex.IsMatch(password))
|
||||
{
|
||||
PwdDescLabel.Text = "";
|
||||
PwdPictureBox.Image = imageListTips.Images[1];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelStrong;
|
||||
PwdStrengthLabel.ForeColor = Color.Green;
|
||||
PasswordTextBoxValid = true;
|
||||
RepeatPasswordTextBox_TextChanged(sender, e);
|
||||
return;
|
||||
}
|
||||
|
||||
// Password is valid but could be stronger
|
||||
PwdDescLabel.Text = "";
|
||||
PwdPictureBox.Image = imageListTips.Images[1];
|
||||
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelMedium;
|
||||
PwdStrengthLabel.ForeColor = Color.Yellow;
|
||||
PasswordTextBoxValid = true;
|
||||
RepeatPasswordTextBox_TextChanged(sender, e);
|
||||
return;
|
||||
}
|
||||
|
||||
private bool RepeatPasswordTextBoxValid = false;
|
||||
private void RepeatPasswordTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(RepeatPasswordTextBox.Text))
|
||||
{
|
||||
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelEmpty;
|
||||
PwdConfirmDescLabel.ForeColor = Color.Red;
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[0];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
else if (!RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text))
|
||||
{
|
||||
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelMatch;
|
||||
PwdConfirmDescLabel.ForeColor = Color.Red;
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[0];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
PwdConfirmDescLabel.Text = "";
|
||||
PwdConfirmPictureBox.Image = imageListTips.Images[1];
|
||||
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
|
||||
}
|
||||
CheckFormS2Validity();
|
||||
}
|
||||
|
||||
private bool EmailTextBoxValid = false;
|
||||
private void EmailTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(EmailTextBox.Text))
|
||||
{
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
|
||||
EmailDescLabel.ForeColor = Color.Red;
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailTextBoxValid = false;
|
||||
}
|
||||
try
|
||||
{
|
||||
string email = EmailTextBox.Text;
|
||||
string pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
|
||||
if (Regex.IsMatch(email, pattern))
|
||||
{
|
||||
// email is valid
|
||||
EmailPictureBox.Image = imageListTips.Images[1];
|
||||
EmailDescLabel.Text = "";
|
||||
EmailTextBoxValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// email is not valid
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
|
||||
EmailTextBoxValid = false;
|
||||
}
|
||||
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
EmailPictureBox.Image = imageListTips.Images[0];
|
||||
}
|
||||
CheckFormS1Validity();
|
||||
}
|
||||
|
||||
private bool CodeTextBoxValid = false;
|
||||
private void CodeTextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CodeTextBox.Text))
|
||||
{
|
||||
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
CodeTextBoxValid = false;
|
||||
}
|
||||
try
|
||||
{
|
||||
string input = CodeTextBox.Text;
|
||||
if (int.TryParse(input, out int number))
|
||||
{
|
||||
// input is numeric
|
||||
CodeDescLabel.Text = "";
|
||||
CodePictureBox.Image = imageListTips.Images[1];
|
||||
CodeTextBoxValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// input is not numeric
|
||||
CodeDescLabel.Text = LocalizedStrings.CodeDescLabelInvalid;
|
||||
CodeDescLabel.ForeColor = Color.Red;
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
CodeTextBoxValid = false;
|
||||
}
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
CodePictureBox.Image = imageListTips.Images[0];
|
||||
}
|
||||
CheckFormS1Validity();
|
||||
}
|
||||
|
||||
private void AgreeCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CheckFormS2Validity();
|
||||
}
|
||||
|
||||
private void CheckFormS1Validity()
|
||||
{
|
||||
if (EmailTextBoxValid &&
|
||||
CodeTextBoxValid)
|
||||
{
|
||||
ContinueButtonS1.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ContinueButtonS1.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckFormS2Validity()
|
||||
{
|
||||
if (NameTextBoxValid &&
|
||||
PasswordTextBoxValid &&
|
||||
RepeatPasswordTextBoxValid &&
|
||||
AgreeCheckBox.Checked)
|
||||
{
|
||||
ContinueButtonS2.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ContinueButtonS2.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Events
|
||||
|
||||
private void CloseButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void MinimizeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
|
||||
private void RegForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
resendTimer.Dispose();
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void ContinueButtonS1_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void ContinueButtonS1_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 0;
|
||||
}
|
||||
private void ContinueButtonS1_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
ContinueButtonS1.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void ContinueButtonS2_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS2.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void ContinueButtonS2_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS2.ImageIndex = 0;
|
||||
}
|
||||
private void ContinueButtonS2_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
ContinueButtonS2.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void SendEmailButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void SendEmailButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 0;
|
||||
}
|
||||
private void SendEmailButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
SendEmailButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void RegForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
ContinueButtonS1.Enabled = false;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void MinimizeButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 0;
|
||||
}
|
||||
private void MinimizeButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
MinimizeButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 1;
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 0;
|
||||
}
|
||||
private void CloseButton_OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
CloseButton.ImageIndex = 2;
|
||||
}
|
||||
|
||||
private void ReturnLabelS2_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
ReturnLabelS2.ForeColor = Color.White;
|
||||
}
|
||||
|
||||
private void ReturnLabelS2_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
ReturnLabelS2.ForeColor = Color.Gainsboro;
|
||||
}
|
||||
|
||||
private void AgreementLabel_MouseHover(object sender, EventArgs e)
|
||||
{
|
||||
AgreementLabel.ForeColor = Color.White;
|
||||
}
|
||||
|
||||
private void AgreementLabel_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
AgreementLabel.ForeColor = Color.Gainsboro;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
5288
RHLauncher.RegForm/RegForm.resx
Normal file
94
RHLauncher.csproj
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup Label="Globals">
|
||||
<WebView2LoaderPreference>Static</WebView2LoaderPreference>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0-windows7.0</TargetFramework>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<StartupObject></StartupObject>
|
||||
<ApplicationIcon>Resources\rhicon.ico</ApplicationIcon>
|
||||
<Company>JuniorDark</Company>
|
||||
<Product>Rusty Hearts Launcher</Product>
|
||||
<AssemblyName>Launcher</AssemblyName>
|
||||
<Description>Rusty Hearts Launcher</Description>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<AssemblyVersion>1.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="RHLauncher.LauncherForm\LauncherForm.resx~RF3c0dbfb.TMP" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\rhicon.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1774.30" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="RegForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="RHLauncher\LocalizedStrings.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>LocalizedStrings.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="RHLauncher\LocalizedStrings.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>LocalizedStrings.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||
<Authors>Rusty Hearts Launcher</Authors>
|
||||
<PackageId>Rusty Hearts Launcher</PackageId>
|
||||
<Title>Rusty Hearts Launcher</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
25
RHLauncher.sln
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33213.308
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RHLauncher", "RHLauncher.csproj", "{B6A96372-24D9-4667-9995-537D65AF2EEB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B6A96372-24D9-4667-9995-537D65AF2EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B6A96372-24D9-4667-9995-537D65AF2EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B6A96372-24D9-4667-9995-537D65AF2EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B6A96372-24D9-4667-9995-537D65AF2EEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {BB3F3BCB-8255-4BF7-ADBE-2480A82FB80A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
104
RHLauncher/LauncherUpdater.cs
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
using Newtonsoft.Json;
|
||||
using RHLauncher.RHLauncher;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public class LauncherUpdater
|
||||
{
|
||||
private readonly string LauncherVersionUrl = Configuration.Default.GetLauncherVersion;
|
||||
private readonly string LauncherUpdateUrl = Configuration.Default.UpdateLauncherVersion;
|
||||
|
||||
public async Task CheckForLauncherUpdateAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
using HttpClient client = new();
|
||||
HttpResponseMessage response = await client.GetAsync(LauncherVersionUrl);
|
||||
response.EnsureSuccessStatusCode();
|
||||
string json = await response.Content.ReadAsStringAsync();
|
||||
dynamic result = JsonConvert.DeserializeObject(json);
|
||||
string version = result.version;
|
||||
if (!string.IsNullOrEmpty(version))
|
||||
{
|
||||
string currentVersion = GetLauncherVersion();
|
||||
if (!string.IsNullOrEmpty(currentVersion) && !currentVersion.Equals(version, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MsgBoxForm.Show(LocalizedStrings.LauncherUpdateText, LocalizedStrings.Info);
|
||||
await DownloadLauncherUpdateAsync(json);
|
||||
}
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMessage = LocalizedStrings.LauncherUpdateCheckFailed + ex.Message;
|
||||
string errorLog = LocalizedStrings.LauncherUpdateCheckFailed + ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DownloadLauncherUpdateAsync(string version)
|
||||
{
|
||||
try
|
||||
{
|
||||
using HttpClient client = new();
|
||||
using StringContent content = new(version, Encoding.UTF8, "application/json");
|
||||
|
||||
dynamic result = JsonConvert.DeserializeObject(version);
|
||||
string v = result.version;
|
||||
|
||||
using HttpResponseMessage response = await client.PostAsync(LauncherUpdateUrl, content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
byte[] updateBytes = await response.Content.ReadAsByteArrayAsync();
|
||||
string tempFilePath = Path.Combine(Path.GetTempPath(), $"launcher_update.zip");
|
||||
File.WriteAllBytes(tempFilePath, updateBytes);
|
||||
|
||||
string executablePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string backupFilePath = Path.Combine(executablePath, $"Launcher_old.exe");
|
||||
string launcherExePath = Path.Combine(executablePath, "Launcher.exe");
|
||||
|
||||
if (File.Exists(backupFilePath))
|
||||
{
|
||||
File.Delete(backupFilePath);
|
||||
}
|
||||
|
||||
// Move existing launcher.exe to temporary location
|
||||
File.Move(launcherExePath, backupFilePath);
|
||||
|
||||
// Extract new update files
|
||||
ZipFile.ExtractToDirectory(tempFilePath, executablePath, true);
|
||||
|
||||
// Delete temporary zip file
|
||||
File.Delete(tempFilePath);
|
||||
|
||||
MsgBoxForm.Show(LocalizedStrings.LauncherUpdateSuccess + v, LocalizedStrings.Info);
|
||||
Application.Restart();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMessage = LocalizedStrings.LauncherUpdateFailed + ex.Message;
|
||||
string errorLog = LocalizedStrings.LauncherUpdateFailed + ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetLauncherVersion()
|
||||
{
|
||||
// Get the version information of the application
|
||||
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
|
||||
|
||||
// Extract the version number
|
||||
string version = $"{versionInfo.FileMajorPart}.{versionInfo.FileMinorPart}.{versionInfo.FileBuildPart}";
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
783
RHLauncher/LocalizedStrings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,783 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace RHLauncher.RHLauncher {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class LocalizedStrings {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal LocalizedStrings() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RHLauncher.RHLauncher.LocalizedStrings", typeof(LocalizedStrings).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Account.
|
||||
/// </summary>
|
||||
public static string Account {
|
||||
get {
|
||||
return ResourceManager.GetString("Account", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A account with this email was not found.
|
||||
/// </summary>
|
||||
public static string AccountNotFound {
|
||||
get {
|
||||
return ResourceManager.GetString("AccountNotFound", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to rustyhearts.exe is already running..
|
||||
/// </summary>
|
||||
public static string AlreadyExecute {
|
||||
get {
|
||||
return ResourceManager.GetString("AlreadyExecute", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancelling.
|
||||
/// </summary>
|
||||
public static string Cancelling {
|
||||
get {
|
||||
return ResourceManager.GetString("Cancelling", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Change Password.
|
||||
/// </summary>
|
||||
public static string ChangePassword {
|
||||
get {
|
||||
return ResourceManager.GetString("ChangePassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Auto Login.
|
||||
/// </summary>
|
||||
public static string CheckBoxAutoLogin {
|
||||
get {
|
||||
return ResourceManager.GetString("CheckBoxAutoLogin", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Remember Username.
|
||||
/// </summary>
|
||||
public static string CheckBoxSaveUser {
|
||||
get {
|
||||
return ResourceManager.GetString("CheckBoxSaveUser", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Checking.
|
||||
/// </summary>
|
||||
public static string Checking {
|
||||
get {
|
||||
return ResourceManager.GetString("Checking", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Insert the verification code.
|
||||
/// </summary>
|
||||
public static string CodeDescLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("CodeDescLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid Verification Code format.
|
||||
/// </summary>
|
||||
public static string CodeDescLabelInvalid {
|
||||
get {
|
||||
return ResourceManager.GetString("CodeDescLabelInvalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Confirmation.
|
||||
/// </summary>
|
||||
public static string Confirmation {
|
||||
get {
|
||||
return ResourceManager.GetString("Confirmation", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Confirm Uninstall.
|
||||
/// </summary>
|
||||
public static string ConfirmUninstall {
|
||||
get {
|
||||
return ResourceManager.GetString("ConfirmUninstall", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure you want to uninstall and delete the install directory?.
|
||||
/// </summary>
|
||||
public static string ConfirmUninstallText {
|
||||
get {
|
||||
return ResourceManager.GetString("ConfirmUninstallText", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The verification email has been sent to.
|
||||
/// </summary>
|
||||
public static string DescLabelS2Email {
|
||||
get {
|
||||
return ResourceManager.GetString("DescLabelS2Email", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Downloading.
|
||||
/// </summary>
|
||||
public static string Downloading {
|
||||
get {
|
||||
return ResourceManager.GetString("Downloading", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Email cannot be empty.
|
||||
/// </summary>
|
||||
public static string EmailDescLabelEmpty {
|
||||
get {
|
||||
return ResourceManager.GetString("EmailDescLabelEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid email address.
|
||||
/// </summary>
|
||||
public static string EmailDescLabelInvalid {
|
||||
get {
|
||||
return ResourceManager.GetString("EmailDescLabelInvalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enter your Email address.
|
||||
/// </summary>
|
||||
public static string EnterEmail {
|
||||
get {
|
||||
return ResourceManager.GetString("EnterEmail", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error.
|
||||
/// </summary>
|
||||
public static string Error {
|
||||
get {
|
||||
return ResourceManager.GetString("Error", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to This verification code has expired, please request a new one..
|
||||
/// </summary>
|
||||
public static string ExpiredVerificationCode {
|
||||
get {
|
||||
return ResourceManager.GetString("ExpiredVerificationCode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed.
|
||||
/// </summary>
|
||||
public static string Failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Forgot Password?.
|
||||
/// </summary>
|
||||
public static string ForgotPwdLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("ForgotPwdLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Info.
|
||||
/// </summary>
|
||||
public static string Info {
|
||||
get {
|
||||
return ResourceManager.GetString("Info", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Install.
|
||||
/// </summary>
|
||||
public static string Install {
|
||||
get {
|
||||
return ResourceManager.GetString("Install", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid Verification Code.
|
||||
/// </summary>
|
||||
public static string InvalidVerificationCode {
|
||||
get {
|
||||
return ResourceManager.GetString("InvalidVerificationCode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to News.
|
||||
/// </summary>
|
||||
public static string LabelNews {
|
||||
get {
|
||||
return ResourceManager.GetString("LabelNews", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Launch.
|
||||
/// </summary>
|
||||
public static string Launch {
|
||||
get {
|
||||
return ResourceManager.GetString("Launch", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error checking for launcher update: .
|
||||
/// </summary>
|
||||
public static string LauncherUpdateCheckFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("LauncherUpdateCheckFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error downloading launcher update: .
|
||||
/// </summary>
|
||||
public static string LauncherUpdateFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("LauncherUpdateFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Launcher updated successfully to version .
|
||||
/// </summary>
|
||||
public static string LauncherUpdateSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("LauncherUpdateSuccess", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to A new version of the launcher is available. It will be downloaded and installed automatically..
|
||||
/// </summary>
|
||||
public static string LauncherUpdateText {
|
||||
get {
|
||||
return ResourceManager.GetString("LauncherUpdateText", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Launching.
|
||||
/// </summary>
|
||||
public static string Launching {
|
||||
get {
|
||||
return ResourceManager.GetString("Launching", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Login Info.
|
||||
/// </summary>
|
||||
public static string LoginInfoTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginInfoTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please insert the password..
|
||||
/// </summary>
|
||||
public static string LoginInsertPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginInsertPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please insert the username..
|
||||
/// </summary>
|
||||
public static string LoginInsertUsername {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginInsertUsername", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid username or password..
|
||||
/// </summary>
|
||||
public static string LoginInvalidCredentials {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginInvalidCredentials", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid username format..
|
||||
/// </summary>
|
||||
public static string LoginInvalidUsernameFormat {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginInvalidUsernameFormat", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Your account is locked. Please contact customer support..
|
||||
/// </summary>
|
||||
public static string LoginLocked {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginLocked", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Too many login attempts. Please try again later..
|
||||
/// </summary>
|
||||
public static string LoginTooManyAttempts {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginTooManyAttempts", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Login Window.
|
||||
/// </summary>
|
||||
public static string LoginWindowTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("LoginWindowTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure you want to logout?.
|
||||
/// </summary>
|
||||
public static string LogoutText {
|
||||
get {
|
||||
return ResourceManager.GetString("LogoutText", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enter the new password.
|
||||
/// </summary>
|
||||
public static string NewPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("NewPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 6-16 characters.
|
||||
/// </summary>
|
||||
public static string NewPasswordDesc {
|
||||
get {
|
||||
return ResourceManager.GetString("NewPasswordDesc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Packing.
|
||||
/// </summary>
|
||||
public static string Packing {
|
||||
get {
|
||||
return ResourceManager.GetString("Packing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password changed successfully! Please log in again..
|
||||
/// </summary>
|
||||
public static string PasswordChanged {
|
||||
get {
|
||||
return ResourceManager.GetString("PasswordChanged", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password.
|
||||
/// </summary>
|
||||
public static string PasswordLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("PasswordLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Confirm Password cannot be empty!.
|
||||
/// </summary>
|
||||
public static string PwdConfirmDescLabelEmpty {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdConfirmDescLabelEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Passwords do not match!.
|
||||
/// </summary>
|
||||
public static string PwdConfirmDescLabelMatch {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdConfirmDescLabelMatch", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password must have at least one uppercase, one lowercase letter, and one number.
|
||||
/// </summary>
|
||||
public static string PwdDescLabelCriteria {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdDescLabelCriteria", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password cannot be empty!.
|
||||
/// </summary>
|
||||
public static string PwdDescLabelEmpty {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdDescLabelEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Password must be between 6-16 characters!.
|
||||
/// </summary>
|
||||
public static string PwdDescLabelSize {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdDescLabelSize", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Medium.
|
||||
/// </summary>
|
||||
public static string PwdStrengthLabelMedium {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdStrengthLabelMedium", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Strong.
|
||||
/// </summary>
|
||||
public static string PwdStrengthLabelStrong {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdStrengthLabelStrong", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Weak.
|
||||
/// </summary>
|
||||
public static string PwdStrengthLabelWeak {
|
||||
get {
|
||||
return ResourceManager.GetString("PwdStrengthLabelWeak", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Re-enter the new password.
|
||||
/// </summary>
|
||||
public static string RepeatPassword {
|
||||
get {
|
||||
return ResourceManager.GetString("RepeatPassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Repeat the password.
|
||||
/// </summary>
|
||||
public static string RepeatPasswordDesc {
|
||||
get {
|
||||
return ResourceManager.GetString("RepeatPasswordDesc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to < Return.
|
||||
/// </summary>
|
||||
public static string Return {
|
||||
get {
|
||||
return ResourceManager.GetString("Return", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Running.
|
||||
/// </summary>
|
||||
public static string Running {
|
||||
get {
|
||||
return ResourceManager.GetString("Running", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Rusty Hearts.
|
||||
/// </summary>
|
||||
public static string RustyHearts {
|
||||
get {
|
||||
return ResourceManager.GetString("RustyHearts", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Could not find rustyheartsconfig.exe.
|
||||
/// </summary>
|
||||
public static string rustyheartsconfig {
|
||||
get {
|
||||
return ResourceManager.GetString("rustyheartsconfig", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Same password. Please use another password..
|
||||
/// </summary>
|
||||
public static string SamePassword {
|
||||
get {
|
||||
return ResourceManager.GetString("SamePassword", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cannot connect to the game server..
|
||||
/// </summary>
|
||||
public static string ServerOffline {
|
||||
get {
|
||||
return ResourceManager.GetString("ServerOffline", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Success.
|
||||
/// </summary>
|
||||
public static string Success {
|
||||
get {
|
||||
return ResourceManager.GetString("Success", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Uninstall.
|
||||
/// </summary>
|
||||
public static string Uninstall {
|
||||
get {
|
||||
return ResourceManager.GetString("Uninstall", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Uninstalling.
|
||||
/// </summary>
|
||||
public static string Uninstalling {
|
||||
get {
|
||||
return ResourceManager.GetString("Uninstalling", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Uninstall complete..
|
||||
/// </summary>
|
||||
public static string UninstallText {
|
||||
get {
|
||||
return ResourceManager.GetString("UninstallText", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unpacking.
|
||||
/// </summary>
|
||||
public static string Unpacking {
|
||||
get {
|
||||
return ResourceManager.GetString("Unpacking", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unsupported client region..
|
||||
/// </summary>
|
||||
public static string UnsupportedService {
|
||||
get {
|
||||
return ResourceManager.GetString("UnsupportedService", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update.
|
||||
/// </summary>
|
||||
public static string Update {
|
||||
get {
|
||||
return ResourceManager.GetString("Update", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An error occurred while checking for updates..
|
||||
/// </summary>
|
||||
public static string UpdateCheckError {
|
||||
get {
|
||||
return ResourceManager.GetString("UpdateCheckError", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to An error occurred while downloading updates..
|
||||
/// </summary>
|
||||
public static string UpdateDownloadError {
|
||||
get {
|
||||
return ResourceManager.GetString("UpdateDownloadError", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Updating.
|
||||
/// </summary>
|
||||
public static string Updating {
|
||||
get {
|
||||
return ResourceManager.GetString("Updating", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Name cannot be empty.
|
||||
/// </summary>
|
||||
public static string UsernameDescLabelEmpty {
|
||||
get {
|
||||
return ResourceManager.GetString("UsernameDescLabelEmpty", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Name must be alphanumeric with at least one letter.
|
||||
/// </summary>
|
||||
public static string UsernameDescLabelInvalid {
|
||||
get {
|
||||
return ResourceManager.GetString("UsernameDescLabelInvalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Username must be between 6-16 characters.
|
||||
/// </summary>
|
||||
public static string UsernameDescLabelSize {
|
||||
get {
|
||||
return ResourceManager.GetString("UsernameDescLabelSize", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Username/Email.
|
||||
/// </summary>
|
||||
public static string UsernameLabel {
|
||||
get {
|
||||
return ResourceManager.GetString("UsernameLabel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Verification Code.
|
||||
/// </summary>
|
||||
public static string VerificationCode {
|
||||
get {
|
||||
return ResourceManager.GetString("VerificationCode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The verificaton email has been sent to.
|
||||
/// </summary>
|
||||
public static string VerificationEmailSent {
|
||||
get {
|
||||
return ResourceManager.GetString("VerificationEmailSent", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Version.
|
||||
/// </summary>
|
||||
public static string Version {
|
||||
get {
|
||||
return ResourceManager.GetString("Version", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Welcome.
|
||||
/// </summary>
|
||||
public static string Welcome {
|
||||
get {
|
||||
return ResourceManager.GetString("Welcome", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
360
RHLauncher/LocalizedStrings.resx
Normal file
|
|
@ -0,0 +1,360 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Account" xml:space="preserve">
|
||||
<value>Account</value>
|
||||
</data>
|
||||
<data name="AccountNotFound" xml:space="preserve">
|
||||
<value>A account with this email was not found</value>
|
||||
</data>
|
||||
<data name="AlreadyExecute" xml:space="preserve">
|
||||
<value>rustyhearts.exe is already running.</value>
|
||||
</data>
|
||||
<data name="Cancelling" xml:space="preserve">
|
||||
<value>Cancelling</value>
|
||||
</data>
|
||||
<data name="ChangePassword" xml:space="preserve">
|
||||
<value>Change Password</value>
|
||||
</data>
|
||||
<data name="CheckBoxAutoLogin" xml:space="preserve">
|
||||
<value>Auto Login</value>
|
||||
</data>
|
||||
<data name="CheckBoxSaveUser" xml:space="preserve">
|
||||
<value>Remember Username</value>
|
||||
</data>
|
||||
<data name="Checking" xml:space="preserve">
|
||||
<value>Checking</value>
|
||||
</data>
|
||||
<data name="CodeDescLabel" xml:space="preserve">
|
||||
<value>Insert the verification code</value>
|
||||
</data>
|
||||
<data name="CodeDescLabelInvalid" xml:space="preserve">
|
||||
<value>Invalid Verification Code format</value>
|
||||
</data>
|
||||
<data name="Confirmation" xml:space="preserve">
|
||||
<value>Confirmation</value>
|
||||
</data>
|
||||
<data name="ConfirmUninstall" xml:space="preserve">
|
||||
<value>Confirm Uninstall</value>
|
||||
</data>
|
||||
<data name="ConfirmUninstallText" xml:space="preserve">
|
||||
<value>Are you sure you want to uninstall and delete the install directory?</value>
|
||||
</data>
|
||||
<data name="DescLabelS2Email" xml:space="preserve">
|
||||
<value>The verification email has been sent to</value>
|
||||
</data>
|
||||
<data name="Downloading" xml:space="preserve">
|
||||
<value>Downloading</value>
|
||||
</data>
|
||||
<data name="EmailDescLabelEmpty" xml:space="preserve">
|
||||
<value>Email cannot be empty</value>
|
||||
</data>
|
||||
<data name="EmailDescLabelInvalid" xml:space="preserve">
|
||||
<value>Invalid email address</value>
|
||||
</data>
|
||||
<data name="EnterEmail" xml:space="preserve">
|
||||
<value>Enter your Email address</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Error</value>
|
||||
</data>
|
||||
<data name="ExpiredVerificationCode" xml:space="preserve">
|
||||
<value>This verification code has expired, please request a new one.</value>
|
||||
</data>
|
||||
<data name="Failed" xml:space="preserve">
|
||||
<value>Failed</value>
|
||||
</data>
|
||||
<data name="ForgotPwdLabel" xml:space="preserve">
|
||||
<value>Forgot Password?</value>
|
||||
</data>
|
||||
<data name="Info" xml:space="preserve">
|
||||
<value>Info</value>
|
||||
</data>
|
||||
<data name="Install" xml:space="preserve">
|
||||
<value>Install</value>
|
||||
</data>
|
||||
<data name="InvalidVerificationCode" xml:space="preserve">
|
||||
<value>Invalid Verification Code</value>
|
||||
</data>
|
||||
<data name="LabelNews" xml:space="preserve">
|
||||
<value>News</value>
|
||||
</data>
|
||||
<data name="Launch" xml:space="preserve">
|
||||
<value>Launch</value>
|
||||
</data>
|
||||
<data name="LauncherUpdateCheckFailed" xml:space="preserve">
|
||||
<value>Error checking for launcher update: </value>
|
||||
</data>
|
||||
<data name="LauncherUpdateFailed" xml:space="preserve">
|
||||
<value>Error downloading launcher update: </value>
|
||||
</data>
|
||||
<data name="LauncherUpdateSuccess" xml:space="preserve">
|
||||
<value>Launcher updated successfully to version </value>
|
||||
</data>
|
||||
<data name="LauncherUpdateText" xml:space="preserve">
|
||||
<value>A new version of the launcher is available. It will be downloaded and installed automatically.</value>
|
||||
</data>
|
||||
<data name="Launching" xml:space="preserve">
|
||||
<value>Launching</value>
|
||||
</data>
|
||||
<data name="LoginInfoTitle" xml:space="preserve">
|
||||
<value>Login Info</value>
|
||||
</data>
|
||||
<data name="LoginInsertPassword" xml:space="preserve">
|
||||
<value>Please insert the password.</value>
|
||||
</data>
|
||||
<data name="LoginInsertUsername" xml:space="preserve">
|
||||
<value>Please insert the username.</value>
|
||||
</data>
|
||||
<data name="LoginInvalidCredentials" xml:space="preserve">
|
||||
<value>Invalid username or password.</value>
|
||||
</data>
|
||||
<data name="LoginInvalidUsernameFormat" xml:space="preserve">
|
||||
<value>Invalid username format.</value>
|
||||
</data>
|
||||
<data name="LoginLocked" xml:space="preserve">
|
||||
<value>Your account is locked. Please contact customer support.</value>
|
||||
</data>
|
||||
<data name="LoginTooManyAttempts" xml:space="preserve">
|
||||
<value>Too many login attempts. Please try again later.</value>
|
||||
</data>
|
||||
<data name="LoginWindowTitle" xml:space="preserve">
|
||||
<value>Login Window</value>
|
||||
</data>
|
||||
<data name="LogoutText" xml:space="preserve">
|
||||
<value>Are you sure you want to logout?</value>
|
||||
</data>
|
||||
<data name="NewPassword" xml:space="preserve">
|
||||
<value>Enter the new password</value>
|
||||
</data>
|
||||
<data name="NewPasswordDesc" xml:space="preserve">
|
||||
<value>6-16 characters</value>
|
||||
</data>
|
||||
<data name="Packing" xml:space="preserve">
|
||||
<value>Packing</value>
|
||||
</data>
|
||||
<data name="PasswordChanged" xml:space="preserve">
|
||||
<value>Password changed successfully! Please log in again.</value>
|
||||
</data>
|
||||
<data name="PasswordLabel" xml:space="preserve">
|
||||
<value>Password</value>
|
||||
</data>
|
||||
<data name="PwdConfirmDescLabelEmpty" xml:space="preserve">
|
||||
<value>Confirm Password cannot be empty!</value>
|
||||
</data>
|
||||
<data name="PwdConfirmDescLabelMatch" xml:space="preserve">
|
||||
<value>Passwords do not match!</value>
|
||||
</data>
|
||||
<data name="PwdDescLabelCriteria" xml:space="preserve">
|
||||
<value>Password must have at least one uppercase, one lowercase letter, and one number</value>
|
||||
</data>
|
||||
<data name="PwdDescLabelEmpty" xml:space="preserve">
|
||||
<value>Password cannot be empty!</value>
|
||||
</data>
|
||||
<data name="PwdDescLabelSize" xml:space="preserve">
|
||||
<value>Password must be between 6-16 characters!</value>
|
||||
</data>
|
||||
<data name="PwdStrengthLabelMedium" xml:space="preserve">
|
||||
<value>Medium</value>
|
||||
</data>
|
||||
<data name="PwdStrengthLabelStrong" xml:space="preserve">
|
||||
<value>Strong</value>
|
||||
</data>
|
||||
<data name="PwdStrengthLabelWeak" xml:space="preserve">
|
||||
<value>Weak</value>
|
||||
</data>
|
||||
<data name="RepeatPassword" xml:space="preserve">
|
||||
<value>Re-enter the new password</value>
|
||||
</data>
|
||||
<data name="RepeatPasswordDesc" xml:space="preserve">
|
||||
<value>Repeat the password</value>
|
||||
</data>
|
||||
<data name="Return" xml:space="preserve">
|
||||
<value>< Return</value>
|
||||
</data>
|
||||
<data name="Running" xml:space="preserve">
|
||||
<value>Running</value>
|
||||
</data>
|
||||
<data name="RustyHearts" xml:space="preserve">
|
||||
<value>Rusty Hearts</value>
|
||||
</data>
|
||||
<data name="rustyheartsconfig" xml:space="preserve">
|
||||
<value>Could not find rustyheartsconfig.exe</value>
|
||||
</data>
|
||||
<data name="SamePassword" xml:space="preserve">
|
||||
<value>Same password. Please use another password.</value>
|
||||
</data>
|
||||
<data name="ServerOffline" xml:space="preserve">
|
||||
<value>Cannot connect to the game server.</value>
|
||||
</data>
|
||||
<data name="Success" xml:space="preserve">
|
||||
<value>Success</value>
|
||||
</data>
|
||||
<data name="Uninstall" xml:space="preserve">
|
||||
<value>Uninstall</value>
|
||||
</data>
|
||||
<data name="Uninstalling" xml:space="preserve">
|
||||
<value>Uninstalling</value>
|
||||
</data>
|
||||
<data name="UninstallText" xml:space="preserve">
|
||||
<value>Uninstall complete.</value>
|
||||
</data>
|
||||
<data name="Unpacking" xml:space="preserve">
|
||||
<value>Unpacking</value>
|
||||
</data>
|
||||
<data name="UnsupportedService" xml:space="preserve">
|
||||
<value>Unsupported client region.</value>
|
||||
</data>
|
||||
<data name="Update" xml:space="preserve">
|
||||
<value>Update</value>
|
||||
</data>
|
||||
<data name="UpdateCheckError" xml:space="preserve">
|
||||
<value>An error occurred while checking for updates.</value>
|
||||
</data>
|
||||
<data name="UpdateDownloadError" xml:space="preserve">
|
||||
<value>An error occurred while downloading updates.</value>
|
||||
</data>
|
||||
<data name="Updating" xml:space="preserve">
|
||||
<value>Updating</value>
|
||||
</data>
|
||||
<data name="UsernameDescLabelEmpty" xml:space="preserve">
|
||||
<value>Name cannot be empty</value>
|
||||
</data>
|
||||
<data name="UsernameDescLabelInvalid" xml:space="preserve">
|
||||
<value>Name must be alphanumeric with at least one letter</value>
|
||||
</data>
|
||||
<data name="UsernameDescLabelSize" xml:space="preserve">
|
||||
<value>Username must be between 6-16 characters</value>
|
||||
</data>
|
||||
<data name="UsernameLabel" xml:space="preserve">
|
||||
<value>Username/Email</value>
|
||||
</data>
|
||||
<data name="VerificationCode" xml:space="preserve">
|
||||
<value>Verification Code</value>
|
||||
</data>
|
||||
<data name="VerificationEmailSent" xml:space="preserve">
|
||||
<value>The verificaton email has been sent to</value>
|
||||
</data>
|
||||
<data name="Version" xml:space="preserve">
|
||||
<value>Version</value>
|
||||
</data>
|
||||
<data name="Welcome" xml:space="preserve">
|
||||
<value>Welcome</value>
|
||||
</data>
|
||||
</root>
|
||||
25
RHLauncher/ProgressReport.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
public class ProgressReport
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
public int PercentComplete { get; set; }
|
||||
public string? FileName { get; set; }
|
||||
public string? ErrorMessage { get; set; }
|
||||
public long BytesDownloaded { get; set; }
|
||||
public long TotalBytesToDownload { get; set; }
|
||||
public double TotalSpeed { get; set; }
|
||||
public long TimeLeft { get; set; }
|
||||
public int NumFilesDownloaded { get; set; }
|
||||
public int TotalNumFiles { get; set; }
|
||||
public int NumFilesPacked { get; set; }
|
||||
public int NumFilesUnpacked { get; set; }
|
||||
public bool Panel { get; set; }
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
public bool ShowFileNameLabel { get; set; }
|
||||
public bool ShowSpeedLabel { get; set; }
|
||||
public bool ShowTimeLabel { get; set; }
|
||||
public bool ShowFileSizeLabel { get; set; }
|
||||
public bool ShowFileCountLabel { get; set; }
|
||||
}
|
||||
}
|
||||
86
RHLauncher/ProgressReporter.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System.Diagnostics;
|
||||
|
||||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
internal class ProgressReporter
|
||||
{
|
||||
public static void ReportInstallProgress(IProgress<ProgressReport> progress, string label, string file, int pos, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
ProgressReport report = new()
|
||||
{
|
||||
Panel = true,
|
||||
ShowFileNameLabel = true,
|
||||
ShowSpeedLabel = false,
|
||||
ShowTimeLabel = false,
|
||||
ShowFileSizeLabel = false,
|
||||
ShowFileCountLabel = true,
|
||||
Label = label,
|
||||
FileName = Path.GetFileName(file),
|
||||
PercentComplete = (int)Math.Round(pos * 100.0 / count),
|
||||
NumFilesPacked = pos,
|
||||
TotalNumFiles = count,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
|
||||
progress.Report(report);
|
||||
}
|
||||
|
||||
public static void ReportDownloadProgress(IProgress<ProgressReport> progress, string fileName, long downloadedSize, long totalBytesToDownload, int downloadedFileCount, int totalFilesToDownload, Stopwatch sw, CancellationToken cancellationToken)
|
||||
{
|
||||
int percentComplete = totalBytesToDownload > 0 ? (int)Math.Round(downloadedSize * 100.0 / totalBytesToDownload) : 0;
|
||||
double totalSpeed = downloadedSize / sw.Elapsed.TotalSeconds;
|
||||
long timeLeft = totalBytesToDownload > 0 ? (long)((totalBytesToDownload - downloadedSize) / (downloadedSize / sw.Elapsed.TotalSeconds)) : 0;
|
||||
|
||||
ProgressReport report = new()
|
||||
{
|
||||
Panel = true,
|
||||
ShowFileNameLabel = true,
|
||||
ShowSpeedLabel = true,
|
||||
ShowTimeLabel = true,
|
||||
ShowFileSizeLabel = true,
|
||||
ShowFileCountLabel = true,
|
||||
Label = LocalizedStrings.Downloading,
|
||||
PercentComplete = percentComplete,
|
||||
FileName = fileName,
|
||||
BytesDownloaded = downloadedSize,
|
||||
TotalBytesToDownload = totalBytesToDownload,
|
||||
TotalSpeed = totalSpeed,
|
||||
TimeLeft = timeLeft,
|
||||
NumFilesDownloaded = downloadedFileCount,
|
||||
TotalNumFiles = totalFilesToDownload,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
|
||||
progress.Report(report);
|
||||
}
|
||||
|
||||
public static void ReportErrorProgress(IProgress<ProgressReport> progress, string message, CancellationToken cancellationToken)
|
||||
{
|
||||
ProgressReport report = new()
|
||||
{
|
||||
Panel = true,
|
||||
ShowFileNameLabel = false,
|
||||
ShowSpeedLabel = false,
|
||||
ShowTimeLabel = false,
|
||||
ShowFileSizeLabel = false,
|
||||
ShowFileCountLabel = false,
|
||||
Label = LocalizedStrings.Error,
|
||||
ErrorMessage = message,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
|
||||
progress.Report(report);
|
||||
}
|
||||
|
||||
public static void ReportFinishedProgress(IProgress<ProgressReport> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
ProgressReport report = new()
|
||||
{
|
||||
Panel = false,
|
||||
CancellationToken = cancellationToken
|
||||
};
|
||||
|
||||
progress.Report(report);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
RHLauncher/ProgressThrottler.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
public class ProgressThrottler : IProgress<ProgressReport>
|
||||
{
|
||||
private readonly IProgress<ProgressReport> _progress;
|
||||
private readonly int _intervalMs;
|
||||
private readonly TaskScheduler _scheduler;
|
||||
|
||||
private readonly object _lock = new();
|
||||
private bool _isScheduled = false;
|
||||
private ProgressReport? _latestReport;
|
||||
|
||||
public ProgressThrottler(IProgress<ProgressReport> progress, int intervalMs)
|
||||
{
|
||||
_progress = progress;
|
||||
_intervalMs = intervalMs;
|
||||
_scheduler = TaskScheduler.FromCurrentSynchronizationContext();
|
||||
}
|
||||
|
||||
public void Report(ProgressReport value)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_latestReport = value;
|
||||
if (!_isScheduled)
|
||||
{
|
||||
_isScheduled = true;
|
||||
Task.Delay(_intervalMs, _latestReport.CancellationToken).ContinueWith(_ =>
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_progress.Report(_latestReport);
|
||||
_isScheduled = false;
|
||||
}
|
||||
}, _latestReport.CancellationToken, TaskContinuationOptions.ExecuteSynchronously, _scheduler);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
226
RHLauncher/UpdateDownloader.cs
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
using RHLauncher.Helper;
|
||||
using RHLauncher.PCK;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Net;
|
||||
|
||||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
public class UpdateDownloader
|
||||
{
|
||||
private const int BufferSize = 8192;
|
||||
private const int TimeoutSeconds = 30;
|
||||
|
||||
public static async Task<UpdateState> CheckForUpdatesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
string fileListUrl = Configuration.Default.FileListUrl;
|
||||
using var client = new HttpClient();
|
||||
using var response = await client.GetAsync(fileListUrl);
|
||||
using var content = await response.Content.ReadAsStreamAsync();
|
||||
using var reader = new StreamReader(content);
|
||||
string filelistText = await reader.ReadToEndAsync();
|
||||
|
||||
List<PCKFile> fileList = PCKReader.GetPCKFileList();
|
||||
Dictionary<string, uint> fileHashes = fileList.ToDictionary(f => f.Name, f => f.Hash);
|
||||
|
||||
List<string> filesToUpdate = new();
|
||||
|
||||
foreach (string line in filelistText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
string[] parts = line.Split(' ');
|
||||
if (parts.Length != 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string fileName = parts[0];
|
||||
if (fileName.Contains(' '))
|
||||
{
|
||||
fileName = $"\"{fileName}\"";
|
||||
}
|
||||
|
||||
if (!ulong.TryParse(parts[2], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong fileHashFromServer))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!fileHashes.TryGetValue(fileName, out uint fileHash) || fileHash != fileHashFromServer)
|
||||
{
|
||||
filesToUpdate.Add(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
fileHashes.Clear();
|
||||
|
||||
return filesToUpdate.Count > 0 ? UpdateState.UpdateAvailable : UpdateState.NoUpdateAvailable;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMessage = LocalizedStrings.UpdateCheckError + "\n" + ex.Message;
|
||||
string errorLog = LocalizedStrings.UpdateCheckError + ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
|
||||
return UpdateState.Error;
|
||||
}
|
||||
}
|
||||
|
||||
public enum UpdateState
|
||||
{
|
||||
UpdateAvailable,
|
||||
NoUpdateAvailable,
|
||||
Error
|
||||
}
|
||||
|
||||
public static async Task DownloadUpdatesAsync(string installDirectory, IProgress<ProgressReport> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
using HttpClientHandler handler = new() { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate };
|
||||
using HttpClient client = new(handler, true) { Timeout = TimeSpan.FromSeconds(TimeoutSeconds) };
|
||||
|
||||
try
|
||||
{
|
||||
string filelistUrl = Configuration.Default.FileListUrl;
|
||||
string filelistText = await client.GetStringAsync(filelistUrl, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
List<PCKFile> fileList = PCKReader.GetPCKFileList();
|
||||
Dictionary<string, uint> fileHashes = fileList.ToDictionary(f => f.Name, f => f.Hash);
|
||||
|
||||
HashSet<string> localFileNames = new(fileHashes.Keys);
|
||||
|
||||
List<string> filesToBeDownloaded = new();
|
||||
long totalBytesToDownload = 0L;
|
||||
int totalFilesToDownload = 0;
|
||||
foreach (string line in filelistText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
string[] parts = line.Split(' ');
|
||||
if (parts.Length != 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string fileName = parts[0];
|
||||
if (string.IsNullOrWhiteSpace(parts[0]))
|
||||
{
|
||||
fileName = $"\"{fileName}\"";
|
||||
}
|
||||
|
||||
if (!ulong.TryParse(parts[2], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong fileHashFromServer))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!fileHashes.TryGetValue(fileName, out uint fileHash) || fileHash != fileHashFromServer)
|
||||
{
|
||||
filesToBeDownloaded.Add(fileName);
|
||||
long fileSize = await GetFileSizeAsync(client, $"{Configuration.Default.DownloadUpdateFileUrl}/{fileName}.mip", cancellationToken).ConfigureAwait(false);
|
||||
totalBytesToDownload += fileSize;
|
||||
totalFilesToDownload++;
|
||||
}
|
||||
}
|
||||
|
||||
string archiveDir = Path.Combine(installDirectory, "archive");
|
||||
if (!Directory.Exists(archiveDir))
|
||||
{
|
||||
Directory.CreateDirectory(archiveDir);
|
||||
}
|
||||
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
|
||||
long downloadedBytes = 0L;
|
||||
int downloadedSize = 0;
|
||||
int downloadedFileCount = 0;
|
||||
foreach (string fileName in filesToBeDownloaded)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
string finalfileName = fileName + ".mip";
|
||||
string fileUrl = $"{Configuration.Default.DownloadUpdateFileUrl}/{finalfileName}";
|
||||
string filePath = Path.Combine(archiveDir, finalfileName);
|
||||
|
||||
using HttpResponseMessage response = await client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
await using Stream contentStream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (!Directory.Exists(Path.GetDirectoryName(filePath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
|
||||
}
|
||||
|
||||
await using FileStream fileStream = new(filePath, FileMode.Create, FileAccess.Write, FileShare.None, BufferSize, true);
|
||||
byte[] buffer = new byte[BufferSize];
|
||||
int bytesRead;
|
||||
while ((bytesRead = await contentStream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)) > 0)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
downloadedBytes += bytesRead;
|
||||
downloadedSize += bytesRead;
|
||||
}
|
||||
|
||||
ProgressReporter.ReportDownloadProgress(progress, finalfileName, downloadedSize, totalBytesToDownload, downloadedFileCount, totalFilesToDownload, sw, cancellationToken);
|
||||
await Task.Yield();
|
||||
downloadedFileCount++;
|
||||
}
|
||||
fileHashes.Clear();
|
||||
|
||||
ProgressReporter.ReportFinishedProgress(progress, cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
Logger.WriteLog($"Download update cancelled: {ex.Message}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ProgressReporter.ReportErrorProgress(progress, ex.Message, cancellationToken);
|
||||
|
||||
string errorMessage = LocalizedStrings.UpdateDownloadError + "\n" + ex.Message;
|
||||
string errorLog = LocalizedStrings.UpdateDownloadError + ex.Message + ex.StackTrace;
|
||||
Exception newEx = new(errorMessage, ex);
|
||||
Exception newLogEx = new(errorLog, ex);
|
||||
ExceptionHandler.HandleException(newEx, newLogEx);
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<long> GetFileSizeAsync(HttpClient client, string fileUrl, CancellationToken cancellationToken)
|
||||
{
|
||||
using HttpRequestMessage request = new(HttpMethod.Get, fileUrl);
|
||||
using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
return response.Content.Headers.ContentLength ?? throw new Exception("Content-Length header not found in response headers.");
|
||||
}
|
||||
|
||||
public static string FormatDownloadSpeed(double totalDownloadSpeed)
|
||||
{
|
||||
string[] sizes = { "B/s", "KB/s", "MB/s", "GB/s" };
|
||||
int order = 0;
|
||||
while (totalDownloadSpeed >= 1024 && order < sizes.Length - 1)
|
||||
{
|
||||
order++;
|
||||
totalDownloadSpeed /= 1024;
|
||||
}
|
||||
|
||||
return $"{totalDownloadSpeed:0.#} {sizes[order]}";
|
||||
}
|
||||
|
||||
public static string FormatFileSize(long bytes)
|
||||
{
|
||||
string[] sizes = { "B", "KB", "MB", "GB" };
|
||||
int order = 0;
|
||||
while (bytes >= 1024 && order < sizes.Length - 1)
|
||||
{
|
||||
order++;
|
||||
bytes /= 1024;
|
||||
}
|
||||
|
||||
return $"{bytes:0.#} {sizes[order]}";
|
||||
}
|
||||
}
|
||||
}
|
||||
86
RHLauncher/UpdateInstaller.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using RHLauncher.Helper;
|
||||
using RHLauncher.PCK;
|
||||
|
||||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
public class UpdateInstaller
|
||||
{
|
||||
public static async Task PackDownloadedFilesAsync(string installDir, IProgress<ProgressReport> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
string archiveDir = Path.Combine(installDir, "archive");
|
||||
string updateRootFolder = Path.Combine(installDir, "Update");
|
||||
|
||||
if (!Directory.Exists(updateRootFolder))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> fileList = Directory.EnumerateFiles(updateRootFolder, "*", SearchOption.AllDirectories).ToList();
|
||||
List<PCKFile> existingFiles = PCKReader.GetPCKFileList();
|
||||
int count = fileList.Count;
|
||||
int pos = 0;
|
||||
|
||||
try
|
||||
{
|
||||
await PCKWriter.Packing(updateRootFolder, fileList, existingFiles, true,
|
||||
(string fileName, int curPos, int totalCount) =>
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
pos++;
|
||||
ProgressReporter.ReportInstallProgress(progress, LocalizedStrings.Packing, fileName, pos, count, cancellationToken);
|
||||
},
|
||||
cancellationToken
|
||||
).ConfigureAwait(false);
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
if (Directory.Exists(archiveDir))
|
||||
{
|
||||
Directory.Delete(archiveDir, true);
|
||||
Directory.CreateDirectory(archiveDir);
|
||||
}
|
||||
|
||||
if (Directory.Exists(updateRootFolder))
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
||||
Directory.Delete(updateRootFolder, true);
|
||||
}
|
||||
Logger.WriteLog($"Update installation canceled: {ex.Message}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLog($"An error occurred while packing: {ex.Message}");
|
||||
ProgressReporter.ReportErrorProgress(progress, ex.Message, cancellationToken);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
fileList.Clear();
|
||||
existingFiles.Clear();
|
||||
}
|
||||
|
||||
ProgressReporter.ReportFinishedProgress(progress, cancellationToken);
|
||||
|
||||
// Pause for a short time to allow other tasks to run
|
||||
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (Directory.Exists(archiveDir))
|
||||
{
|
||||
Directory.Delete(archiveDir, true);
|
||||
Directory.CreateDirectory(archiveDir);
|
||||
}
|
||||
|
||||
if (Directory.Exists(updateRootFolder))
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
||||
Directory.Delete(updateRootFolder, true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
74
RHLauncher/UpdateUnpacker.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using RHLauncher.Helper;
|
||||
|
||||
namespace RHLauncher.RHLauncher
|
||||
{
|
||||
public class UpdateUnpacker
|
||||
{
|
||||
public static async Task UnpackDownloadedFilesAsync(string installDir, IProgress<ProgressReport> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
if (installDir == null)
|
||||
throw new ArgumentNullException(nameof(installDir));
|
||||
if (progress == null)
|
||||
throw new ArgumentNullException(nameof(progress));
|
||||
|
||||
string archiveDir = Path.Combine(installDir, "archive");
|
||||
string updateRootFolder = Path.Combine(installDir, "Update");
|
||||
|
||||
if (!Directory.Exists(archiveDir))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(updateRootFolder))
|
||||
{
|
||||
Directory.CreateDirectory(updateRootFolder);
|
||||
}
|
||||
|
||||
List<string> files = Directory.EnumerateFiles(archiveDir, "*.mip", SearchOption.AllDirectories)
|
||||
.OrderBy(f => f, StringComparer.OrdinalIgnoreCase)
|
||||
.ToList();
|
||||
int count = files.Count;
|
||||
int pos = 0;
|
||||
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
foreach (string file in files)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
string relativePath = Path.GetRelativePath(archiveDir, file);
|
||||
string outputPath = Path.Combine(updateRootFolder, relativePath.Substring(0, relativePath.Length - 4)); // Remove the ".mip" extension
|
||||
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
|
||||
await MIPDecoder.DecompressFileAsync(file, outputPath, cancellationToken);
|
||||
|
||||
pos++;
|
||||
ProgressReporter.ReportInstallProgress(progress, LocalizedStrings.Unpacking, file, pos, count, cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
{
|
||||
Logger.WriteLog($"Update unpack canceled: {ex.Message}");
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Logger.WriteLog($"An error occurred while unpacking: {file} {ex}");
|
||||
ProgressReporter.ReportErrorProgress(progress, ex.Message, cancellationToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLog($"Error: {ex.Message} {ex.StackTrace} ");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
ProgressReporter.ReportFinishedProgress(progress, cancellationToken);
|
||||
}, cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
BIN
Resources.rar
Normal file
BIN
Resources/bg/bg.png
Normal file
|
After Width: | Height: | Size: 301 KiB |
BIN
Resources/bg/character_select_cut_angela.png
Normal file
|
After Width: | Height: | Size: 306 KiB |
BIN
Resources/bg/character_select_cut_edgar.png
Normal file
|
After Width: | Height: | Size: 233 KiB |
BIN
Resources/bg/character_select_cut_frantz.png
Normal file
|
After Width: | Height: | Size: 284 KiB |
BIN
Resources/bg/character_select_cut_ian.png
Normal file
|
After Width: | Height: | Size: 427 KiB |
BIN
Resources/bg/character_select_cut_leila.png
Normal file
|
After Width: | Height: | Size: 256 KiB |
BIN
Resources/bg/character_select_cut_meilinchen.png
Normal file
|
After Width: | Height: | Size: 303 KiB |
BIN
Resources/bg/character_select_cut_natasha.png
Normal file
|
After Width: | Height: | Size: 284 KiB |
BIN
Resources/bg/character_select_cut_roselle.png
Normal file
|
After Width: | Height: | Size: 257 KiB |
BIN
Resources/bg/character_select_cut_tude.png
Normal file
|
After Width: | Height: | Size: 263 KiB |
BIN
Resources/bg/help_panel_bkg.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
Resources/bg/launcher_bg.png
Normal file
|
After Width: | Height: | Size: 979 KiB |
BIN
Resources/bg/login_bg.png
Normal file
|
After Width: | Height: | Size: 667 KiB |
BIN
Resources/bg/message_bkg.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
Resources/buttons/ChangePwwnd.button.email.active.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Resources/buttons/ChangePwwnd.button.email.down.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
Resources/buttons/ChangePwwnd.button.email.normal.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Resources/buttons/Registerwnd.button.continue.active.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Resources/buttons/Registerwnd.button.continue.down.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
Resources/buttons/Registerwnd.button.continue.normal.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Resources/buttons/Registerwndwnd.button.sendemail.active.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Resources/buttons/Registerwndwnd.button.sendemail.down.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Resources/buttons/Registerwndwnd.button.sendemail.normal.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Resources/buttons/button_active.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
Resources/buttons/button_close_active.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
Resources/buttons/button_close_down.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Resources/buttons/button_close_normal.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Resources/buttons/button_down.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Resources/buttons/button_login_active.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
Resources/buttons/button_login_down.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
Resources/buttons/button_login_normal.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Resources/buttons/button_minimize_active.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
Resources/buttons/button_minimize_down.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
Resources/buttons/button_minimize_normal.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
Resources/buttons/button_normal.png
Normal file
|
After Width: | Height: | Size: 883 B |
BIN
Resources/buttons/button_register_active.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
Resources/buttons/button_register_down.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
Resources/buttons/button_register_normal.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
Resources/buttons/button_stop_active.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
Resources/buttons/button_stop_down.png
Normal file
|
After Width: | Height: | Size: 381 B |
BIN
Resources/buttons/button_stop_normal.png
Normal file
|
After Width: | Height: | Size: 358 B |
BIN
Resources/buttons/launchbutton_bkg_active.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
Resources/buttons/launchbutton_bkg_down.png
Normal file
|
After Width: | Height: | Size: 9 KiB |