custom launcher UI

This commit is contained in:
Mikhail
2024-07-04 11:17:27 -04:00
parent bb4dafa823
commit e6985b6178
7 changed files with 57 additions and 21 deletions

2
.gitattributes vendored
View File

@@ -1,3 +1,3 @@
# Auto detect text files and perform LF normalization # Auto detect text files and perform LF normalization
* text=auto * text=auto
cert.sh text eol=lf cert.sh eol=lf

View File

@@ -76,6 +76,7 @@ namespace ServerSelector
127.0.0.1 aws-na-dr.intlgame.com 127.0.0.1 aws-na-dr.intlgame.com
127.0.0.1 sg-vas.intlgame.com 127.0.0.1 sg-vas.intlgame.com
127.0.0.1 aws-na.intlgame.com 127.0.0.1 aws-na.intlgame.com
127.0.0.1 na-community.playerinfinite.com
127.0.0.1 common-web.intlgame.com 127.0.0.1 common-web.intlgame.com
127.0.0.1 li-sg.intlgame.com 127.0.0.1 li-sg.intlgame.com
127.0.0.1 data-aws-na.intlgame.com 127.0.0.1 data-aws-na.intlgame.com

View File

@@ -1,21 +1,21 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDazCCAlOgAwIBAgIUZtfukOBnP/EnpNeODfZtnJychpQwDQYJKoZIhvcNAQEL MIIDazCCAlOgAwIBAgIUcJP1SCl3PCMhEjSXcn1Ps1Wx+2kwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA3MDMyMDA0MzdaFw0yNjEw GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA3MDQxNTAwNDRaFw0yNjEw
MDYyMDA0MzdaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw MDcxNTAwNDRaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSE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BAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB8 sQjIoLMOhb88LTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBx
3HwhH1HmKdZpqSsHLmKt4tW7FCpcjrG29WzKMUi5POIGlgqI1MfO5QLe8IUGEVhK cXZMZwV8Q4Lfxm3z9cOlG8zp0b5JujeVqv6OV2p+CQ8Py8/R7/DD+IjpZ2QpKJ74
uosOrZmDH5kF8aIGqHYii/o/MHw2p6eHg49hsKRQEU8trN5r3GQbZL0ce0hDTQL0 UUSuqyyrL8zM21yiksgjYYZVxK4USjjL8kIB28Ml0+UmYtfkKmiXJNWs1gGPt8Q3
dVntSJJ4Pb+Qgm20P4sDPEoFoQ1u2utsYztW6wpw0ksTJtcO2BfMQM/k7egJEv/S aKLMNAj2aHx2vt1+Eu3iex8Pn9RZFsf/tUmxkara1jfVjEeNG/qjt1iM8yXbeyc0
ZRhhl6yA131AI5JSHk3SnUQ/xL1kGL2p6Wixo9accLAcej00+gaDNgxHw1F6OjUt bx1y8LJKxWo8alux7ncNnDBF3td1ZchhoSg36IX+i6RTM8j/BNCTx3IiiY3hbfaH
+XsO807Rqx3TnQwHZyHSijFxSId2JLEO7oCkNeDuuKlU7rb4sh0YIYWWZgS/dG0n hH3FPD4U/Do9+GjidDFVku8OK8MIggYdD02AqR56tG+Sw2RNP35Ky23HcqUyRK5/
jEOkU1vp7loFpqFdWYVy NkmdLtIH+gwww/0oBb4I
-----END CERTIFICATE----- -----END CERTIFICATE-----

Binary file not shown.

View File

@@ -3,6 +3,8 @@
# Become a Certificate Authority # Become a Certificate Authority
###################### ######################
set +e
# Generate private key # Generate private key
openssl genrsa -des3 -out myCA.key 2048 openssl genrsa -des3 -out myCA.key 2048
# Generate root certificate # Generate root certificate
@@ -12,7 +14,7 @@ openssl req -x509 -new -nodes -key myCA.key -sha256 -days 825 -out myCA.pem
# Create CA-signed certs # Create CA-signed certs
###################### ######################
NAME=mydomain.example # Use your own domain name NAME=nikkedomains # Use your own domain name
# Generate a private key # Generate a private key
openssl genrsa -out $NAME.key 2048 openssl genrsa -out $NAME.key 2048
# Create a certificate-signing request # Create a certificate-signing request
@@ -27,6 +29,7 @@ subjectAltName = @alt_names
DNS.1 = *.nikke-kr.com DNS.1 = *.nikke-kr.com
DNS.2 = aws-na-dr.intlgame.com DNS.2 = aws-na-dr.intlgame.com
DNS.3 = *.intlgame.com DNS.3 = *.intlgame.com
DNS.4 = *.playerinfinite.com
IP.1 = 192.168.3.13 # Optionally, add an IP address (if the connection which you have planned requires it) IP.1 = 192.168.3.13 # Optionally, add an IP address (if the connection which you have planned requires it)
EOF EOF
# Create the signed certificate # Create the signed certificate
@@ -37,4 +40,12 @@ openssl x509 -req -in $NAME.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial \
openssl pkcs12 -export -out myCA.pfx -inkey myCA.key -in myCA.pem openssl pkcs12 -export -out myCA.pfx -inkey myCA.key -in myCA.pem
# Convert site cert to pfx # Convert site cert to pfx
openssl pkcs12 -export -out site.pfx -inkey mydomain.example.key -in mydomain.example.crt openssl pkcs12 -export -out site.pfx -inkey $NAME.key -in $NAME.crt
# copy certs
cp site.pfx nksrv/site.pfx
cp myCA.pem ServerSelector/myCA.pem
cp myCA.pfx ServerSelector/myCA.pfx
# clean up
rm nikkedomains* myCA*

View File

@@ -63,13 +63,37 @@ namespace nksrv
.WithModule(new ActionModule("/account/", HttpVerbs.Any, IntlHandler.Handle)) .WithModule(new ActionModule("/account/", HttpVerbs.Any, IntlHandler.Handle))
.WithModule(new ActionModule("/data/", HttpVerbs.Any, HandleDataEndpoint)) .WithModule(new ActionModule("/data/", HttpVerbs.Any, HandleDataEndpoint))
.WithModule(new ActionModule("/media/", HttpVerbs.Any, HandleAsset)) .WithModule(new ActionModule("/media/", HttpVerbs.Any, HandleAsset))
.WithModule(new ActionModule("/$batch", HttpVerbs.Any, HandleBatchRequests)); .WithModule(new ActionModule("/$batch", HttpVerbs.Any, HandleBatchRequests))
.WithModule(new ActionModule("/nikke_launcher", HttpVerbs.Any, HandleLauncherUI));
// Listen for state changes. // Listen for state changes.
//server.StateChanged += (s, e) => $"WebServer New State - {e.NewState}".Info(); //server.StateChanged += (s, e) => $"WebServer New State - {e.NewState}".Info();
return server; return server;
} }
private static async Task HandleLauncherUI(IHttpContext ctx)
{
await ctx.SendStringAsync(@"<!DOCTYPE html>
<html>
<head>
<title>Private Nikke Server Launcher</title>
<style>
* {
color:white;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
</style>
</head>
<body>
<h1>What's new in Nikke Private Server<h1>
<p>This is the inital release, only story mode works except that you can't collect items and a few other things don't work.</p>
<p>In order to level up characters, you manually have to edit db.json</p>
</body>
</html>
", "text/html", Encoding.UTF8);
}
private static async Task HandleBatchRequests(IHttpContext ctx) private static async Task HandleBatchRequests(IHttpContext ctx)
{ {
var theBytes = await PacketDecryption.DecryptOrReturnContentAsync(ctx); var theBytes = await PacketDecryption.DecryptOrReturnContentAsync(ctx);

Binary file not shown.