add simple installer/uninstaller

This commit is contained in:
Mikhail Thompson
2024-07-03 16:37:42 -04:00
parent 03373e7069
commit 4b1c5473d1
21 changed files with 857 additions and 35 deletions

381
.gitignore vendored
View File

@@ -1,33 +1,87 @@
## 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
.vs/
# 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/
[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/
# Tye
.tye/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
@@ -37,27 +91,40 @@ x64/
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.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
@@ -67,69 +134,321 @@ _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
*.Publish.xml
*.pubxml
*.[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
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
packages/
## TODO: If the tool you use requires repositories.config, also uncomment the next line
!packages/repositories.config
# 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/
# Windows Azure Build Output
# 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
# Windows Store app package directory
# 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
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
![Ss]tyle[Cc]op.targets
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.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 ;-)
# 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
App_Data/*.mdf
App_Data/*.ldf
*.mdf
*.ldf
*.ndf
# =========================
# Windows detritus
# =========================
# 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
# Windows image file caches
# 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
##
## Visual studio for Mac
##
# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/
# Mac bundle stuff
*.dmg
*.app
# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
Desktop.ini
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
_NCrunch*
# Windows shortcuts
*.lnk
# JetBrains Rider
.idea/
*.sln.iml
##
## Visual Studio Code
##
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

6
Directory.Build.props Normal file
View File

@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.0.2</AvaloniaVersion>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,24 @@
using System;
using Avalonia;
using Avalonia.ReactiveUI;
namespace ServerSelector.Desktop;
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI();
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
One for Windows with net7.0-windows TFM, one for MacOS with net7.0-macos and one with net7.0 TFM for Linux.-->
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<IncludeNativeLibrariesForSelfExtract>True</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-rc2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ServerSelector\ServerSelector.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embeded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="AvaloniaTest.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>

10
ServerSelector/App.axaml Normal file
View File

@@ -0,0 +1,10 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ServerSelector.App"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

View File

@@ -0,0 +1,36 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using ServerSelector.ViewModels;
using ServerSelector.Views;
namespace ServerSelector;
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow
{
DataContext = new MainViewModel()
};
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
singleViewPlatform.MainView = new MainView
{
DataContext = new MainViewModel()
};
}
base.OnFrameworkInitializationCompleted();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.0-rc2" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-rc2" />
</ItemGroup>
<ItemGroup>
<None Update="myCA.pem">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="myCA.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="site.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="sodium.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace ServerSelector
{
public class ServerSwitcher
{
public static bool IsUsingOfficalServer()
{
var hostsFile = File.ReadAllText("C:\\Windows\\System32\\drivers\\etc\\hosts");
return !hostsFile.Contains("cloud.nikke-kr.com");
}
public static void SaveCfg(bool useOffical, string gamePath, string launcherPath)
{
string sodiumLib = AppDomain.CurrentDomain.BaseDirectory + "sodium.dll";
string gameSodium = gamePath + "/nikke_Data/Plugins/x86_64/sodium.dll";
string sodiumBackup = gameSodium + ".bak";
string hostsFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/hosts");
var CAcert = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "myCA.pem");
string launcherCertList = launcherPath + "/intl_service/cacert.pem";
string gameCertList = gamePath + "/nikke_Data/Plugins/x86_64/cacert.pem";
// TODO: allow changing ip address
if (useOffical)
{
var txt = File.ReadAllText(hostsFilePath);
// remove stuff
int startIdx = txt.IndexOf("127.0.0.1 cloud.nikke-kr.com");
int endIdx = txt.IndexOf("y.io") + 3;
txt = txt.Substring(0, startIdx) + txt.Substring(endIdx);
File.WriteAllText(hostsFilePath, txt);
// remove cert
X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
store.Remove(new X509Certificate2(X509Certificate2.CreateFromCertFile(AppDomain.CurrentDomain.BaseDirectory + "myCA.pfx")));
store.Close();
// restore sodium
if (!File.Exists(sodiumBackup))
{
throw new Exception("sodium backup does not exist");
}
File.Copy(sodiumBackup, gameSodium, true);
}
else
{
// add to hosts file
string hosts = @"127.0.0.1 cloud.nikke-kr.com
127.0.0.1 global-lobby.nikke-kr.com
127.0.0.1 aws-na-dr.intlgame.com
127.0.0.1 sg-vas.intlgame.com
127.0.0.1 aws-na.intlgame.com
127.0.0.1 common-web.intlgame.com
127.0.0.1 li-sg.intlgame.com
127.0.0.1 data-aws-na.intlgame.com
255.255.221.21 sentry.io";
if (!File.ReadAllText(hostsFilePath).Contains("global-lobby.nikke-kr.com"))
{
using StreamWriter w = File.AppendText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/hosts"));
w.WriteLine(hosts);
}
// trust CA
X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadWrite);
store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(AppDomain.CurrentDomain.BaseDirectory + "myCA.pfx")));
store.Close();
// update sodium lib
if (!File.Exists(gameSodium))
{
throw new Exception("expected sodium library to exist at path " + gameSodium);
}
// copy backup if sodium size is correct
var sod = File.ReadAllBytes(gameSodium);
if (sod.Length <= 307200)
{
// orignal file size, copy backup
File.WriteAllBytes(sodiumBackup, sod);
}
// write new sodium library
File.WriteAllBytes(gameSodium, File.ReadAllBytes(sodiumLib));
// update launcher/game ca cert list
var certList1 = File.ReadAllText(launcherCertList);
certList1 += "\nGood SSL Ca\n===============================\n";
certList1 += CAcert;
File.WriteAllText(launcherCertList, certList1);
var certList2 = File.ReadAllText(gameCertList);
certList2 += "\nGood SSL Ca\n===============================\n";
certList2 += CAcert;
File.WriteAllText(gameCertList, certList2);
}
}
}
}

View File

@@ -0,0 +1,6 @@
namespace ServerSelector.ViewModels;
public class MainViewModel : ViewModelBase
{
public string Greeting => "Welcome to Avalonia!";
}

View File

@@ -0,0 +1,7 @@
using ReactiveUI;
namespace ServerSelector.ViewModels;
public class ViewModelBase : ReactiveObject
{
}

View File

@@ -0,0 +1,42 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:ServerSelector.ViewModels"
mc:Ignorable="d" d:DesignWidth="370" d:DesignHeight="170"
x:Class="ServerSelector.Views.MainView"
x:DataType="vm:MainViewModel"
>
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainViewModel />
</Design.DataContext>
<StackPanel>
<WrapPanel Margin="5">
<TextBlock VerticalAlignment="Center" Margin="5">Game path: </TextBlock>
<TextBox x:Name="txtGamePath">C:\NIKKE\NIKKE\game</TextBox>
</WrapPanel>
<WrapPanel Margin="5">
<TextBlock VerticalAlignment="Center" Margin="5">Launcher path: </TextBlock>
<TextBox x:Name="txtLauncherPath">C:\NIKKE\Launcher</TextBox>
</WrapPanel>
<WrapPanel Margin="5">
<TextBlock VerticalAlignment="Center" Margin="5">Server: </TextBlock>
<ComboBox SelectedIndex="0" x:Name="CmbServerSelection">
<ComboBox.Items>
<ComboBoxItem>Official</ComboBoxItem>
<ComboBoxItem>Local</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
</WrapPanel>
<Button HorizontalAlignment="Right" Margin="5" Click="Save_Click">Save</Button>
</StackPanel>
</UserControl>

View File

@@ -0,0 +1,37 @@
using Avalonia.Controls;
using System;
using System.Runtime.InteropServices;
using System.Security.Principal;
namespace ServerSelector.Views;
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
CmbServerSelection.SelectedIndex = ServerSwitcher.IsUsingOfficalServer() ? 0 : 1;
}
private void Save_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
try
{
ServerSwitcher.SaveCfg(CmbServerSelection.SelectedIndex == 0, txtGamePath.Text, txtLauncherPath.Text);
}
catch(Exception ex)
{
ShowWarningMsg("Failed to save configuration: " + ex.ToString(), "Error");
}
}
// for some stupid reason avalonia does not support message boxes.
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);
public static void ShowWarningMsg(string text, string title)
{
MessageBox(IntPtr.Zero, text, title, 0x00000030);
}
}

View File

@@ -0,0 +1,12 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:ServerSelector.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:ServerSelector.Views"
mc:Ignorable="d" d:DesignWidth="370" d:DesignHeight="170"
x:Class="ServerSelector.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico"
Title="Server Switcher Utility" Width="370" Height="170" CanResize="False">
<views:MainView />
</Window>

View File

@@ -0,0 +1,11 @@
using Avalonia.Controls;
namespace ServerSelector.Views;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}

21
ServerSelector/myCA.pem Normal file
View File

@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUZtfukOBnP/EnpNeODfZtnJychpQwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA3MDMyMDA0MzdaFw0yNjEw
MDYyMDA0MzdaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDGD6bSRP60u1ZYB3HpfrTa4aw+C0cVcez2vIz5Kyy7
DeMsNy4BA9mW+jhb+fU2UcrfS/890mHGTKWMeJqBL4kHo6jQdvaq9EP7JfQezDPi
6Qzro/En1ruscn8ckZ46jskNjsKgy/YaitAvRt2zUrVfdNIT1l7IPYCARUw9t+FE
UQJXVqmQEWX0gx1zv49uqZdNVeKraZzQim+18h8LmHfAeUN3251dIlQgX727O/pe
TTMNigtgBmKs29++DwIBwi1uIcM2nr/jyBrBGSDEdknKlWNLYD8WVLjnHYheID4f
0xDQBOP7eN+FLaCAI/dkxaUcWfLG0jVxQl+YQxWe0eoxAgMBAAGjUzBRMB0GA1Ud
DgQWBBR3fQt9iIxxmWUJdaDUvkQo1g2mKTAfBgNVHSMEGDAWgBR3fQt9iIxxmWUJ
daDUvkQo1g2mKTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB8
3HwhH1HmKdZpqSsHLmKt4tW7FCpcjrG29WzKMUi5POIGlgqI1MfO5QLe8IUGEVhK
uosOrZmDH5kF8aIGqHYii/o/MHw2p6eHg49hsKRQEU8trN5r3GQbZL0ce0hDTQL0
dVntSJJ4Pb+Qgm20P4sDPEoFoQ1u2utsYztW6wpw0ksTJtcO2BfMQM/k7egJEv/S
ZRhhl6yA131AI5JSHk3SnUQ/xL1kGL2p6Wixo9accLAcej00+gaDNgxHw1F6OjUt
+XsO807Rqx3TnQwHZyHSijFxSId2JLEO7oCkNeDuuKlU7rb4sh0YIYWWZgS/dG0n
jEOkU1vp7loFpqFdWYVy
-----END CERTIFICATE-----

BIN
ServerSelector/sodium.dll Normal file

Binary file not shown.

102
nksrv.sln
View File

@@ -7,16 +7,28 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nksrv", "nksrv\nksrv.csproj
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataFixupUtil", "DataFixupUtil\DataFixupUtil.csproj", "{13124DFB-448B-4F4F-A479-537EE067D836}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtobufViewUtil", "ProtobufViewUtil\ProtobufViewUtil.csproj", "{FDEDD0D6-9C02-4E58-8110-04E8D5639881}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtobufViewUtil", "ProtobufViewUtil\ProtobufViewUtil.csproj", "{FDEDD0D6-9C02-4E58-8110-04E8D5639881}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerSelector", "ServerSelector\ServerSelector.csproj", "{EC613C24-8A35-42E8-92C1-9A8431F74F58}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerSelector.Desktop", "ServerSelector.Desktop\ServerSelector.Desktop.csproj", "{01D0A73A-A881-439D-9318-54DB5B00D6F5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DebugDLL|Any CPU = DebugDLL|Any CPU
DebugDLL|x64 = DebugDLL|x64
DebugDLL|x86 = DebugDLL|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseDLL|Any CPU = ReleaseDLL|Any CPU
ReleaseDLL|x64 = ReleaseDLL|x64
ReleaseDLL|x86 = ReleaseDLL|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -25,40 +37,128 @@ Global
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Debug|x64.Build.0 = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Debug|x86.ActiveCfg = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Debug|x86.Build.0 = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|x64.Build.0 = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.DebugDLL|x86.Build.0 = Debug|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|Any CPU.Build.0 = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|x64.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|x64.Build.0 = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|x86.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.Release|x86.Build.0 = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|x64.Build.0 = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
{5C24A07E-9B8D-4625-BF91-0E9CCBEF5CB0}.ReleaseDLL|x86.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|x64.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|x64.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|x86.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Debug|x86.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|x64.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.DebugDLL|x86.Build.0 = Debug|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|Any CPU.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|x64.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|x64.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|x86.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.Release|x86.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|x64.Build.0 = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
{13124DFB-448B-4F4F-A479-537EE067D836}.ReleaseDLL|x86.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|x64.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|x64.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|x86.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Debug|x86.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|x64.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.DebugDLL|x86.Build.0 = Debug|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|Any CPU.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|x64.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|x64.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|x86.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.Release|x86.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|x64.Build.0 = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
{FDEDD0D6-9C02-4E58-8110-04E8D5639881}.ReleaseDLL|x86.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|x64.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|x64.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|x86.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Debug|x86.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|x64.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.DebugDLL|x86.Build.0 = Debug|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|Any CPU.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|x64.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|x64.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|x86.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.Release|x86.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|x64.Build.0 = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
{EC613C24-8A35-42E8-92C1-9A8431F74F58}.ReleaseDLL|x86.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|x64.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|x64.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|x86.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Debug|x86.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|Any CPU.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|Any CPU.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|x64.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|x64.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|x86.ActiveCfg = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.DebugDLL|x86.Build.0 = Debug|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|Any CPU.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|x64.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|x64.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|x86.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.Release|x86.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|Any CPU.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|Any CPU.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x64.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x64.Build.0 = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x86.ActiveCfg = Release|Any CPU
{01D0A73A-A881-439D-9318-54DB5B00D6F5}.ReleaseDLL|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{EC613C24-8A35-42E8-92C1-9A8431F74F58} = {4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}
{01D0A73A-A881-439D-9318-54DB5B00D6F5} = {4BB2E77F-84A6-4644-9FB3-38E2A7DCDEC0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F779F2DC-B207-4091-83B8-0EA250461DCE}
EndGlobalSection

View File

@@ -27,8 +27,8 @@ namespace nksrv.LobbyServer.Msgs.User
response.SynchroLv = 1;
response.OutpostBattleLevel = user.OutpostBattleLevel;
response.OutpostBattleTime = new NetOutpostBattleTime() { MaxBattleTime = 864000000000, MaxOverBattleTime = 12096000000000, BattleTime = battleTimeMs };
response.CommanderRoomJukeboxBgm = new NetJukeboxBgm() { JukeboxTableId = 8989001, Type = NetJukeboxBgmType.JukeboxTableId, Location = NetJukeboxLocation.CommanderRoom };
response.LobbyJukeboxBgm = new NetJukeboxBgm() { JukeboxTableId = 8989001, Type = NetJukeboxBgmType.JukeboxTableId, Location = NetJukeboxLocation.Lobby };
response.CommanderRoomJukeboxBgm = new NetJukeboxBgm() { JukeboxTableId = 10, Type = NetJukeboxBgmType.JukeboxTableId, Location = NetJukeboxLocation.CommanderRoom };
response.LobbyJukeboxBgm = new NetJukeboxBgm() { JukeboxTableId = 10, Type = NetJukeboxBgmType.JukeboxTableId, Location = NetJukeboxLocation.Lobby };
// Add default slot data
if (user.RepresentationTeamData.Slots.Count == 0)

View File

@@ -49,7 +49,7 @@ namespace nksrv
}
private static WebServer CreateWebServer()
{
var cert = new X509Certificate2(new X509Certificate(@"C:\Users\Misha\nkcert\site.pfx"));
var cert = new X509Certificate2(new X509Certificate(AppDomain.CurrentDomain.BaseDirectory + @"site.pfx"));
var server = new WebServer(o => o
.WithUrlPrefixes("https://*:443", "http://*:80")