Added guide and allow importing skin data without entering a username.

This commit is contained in:
flash 2023-08-23 20:59:04 +00:00
parent dd69e0a0ea
commit 69799c6422
19 changed files with 212 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 26 KiB

28
public/dl/accounts.json Normal file
View file

@ -0,0 +1,28 @@
{
"accounts": [
{
"active": true,
"profile": {
"capes": [
],
"id": "4b4629833c1145359fb39f6d391350ab",
"name": "Anonymous",
"skin": {
"id": "",
"url": "",
"variant": ""
}
},
"type": "Offline",
"ygg": {
"extra": {
"clientToken": "eee41da7d06c4ef188b7fb8942395b00",
"userName": "Anonymous"
},
"iat": 1692818900,
"token": "0"
}
}
],
"formatVersion": 3
}

View file

@ -74,10 +74,9 @@ h1, h2 {
.footer {
color: #444;
height: 26px;
width: 100%;
text-align: center;
padding-top: 14px;
margin: 14px 0;
}
.content {
@ -85,7 +84,7 @@ h1, h2 {
width: 100%;
margin: 0 auto;
margin-top: 1em;
padding: 5px 10px 40px;
padding: 5px 10px;
}
.section {

View file

@ -14,6 +14,7 @@ class HomeRoutes {
public function register(IRouter $router): void {
$router->get('/', [$this, 'getIndex']);
$router->get('/downloads', [$this, 'getDownloads']);
$router->get('/guide', [$this, 'getGuide']);
$router->get('/login', fn($response) => $response->redirect($this->userInfo->success ? '/' : $this->loginUrl));
$router->get('/index.php', function($response) {
$response->redirect('/', true);
@ -65,4 +66,8 @@ class HomeRoutes {
public function getDownloads() {
return $this->templating->render('downloads');
}
public function getGuide() {
return $this->templating->render('guide');
}
}

View file

@ -122,6 +122,7 @@ class SkinsRoutes {
'skin_path' => $skinPath,
'cape' => $capeInfo,
'cape_path' => $capePath,
'link_info' => $this->linkInfo,
]);
}
@ -262,7 +263,11 @@ class SkinsRoutes {
$body = $request->getContent();
$userAgent = $request->getHeaderLine('User-Agent');
$resolveUUID = MojangInterop::getMinecraftUUID((string)$body->getParam('username'), $userAgent);
$userName = (string)$body->getParam('username');
if($userName === '')
$userName = $this->linkInfo->getName();
$resolveUUID = MojangInterop::getMinecraftUUID($userName, $userAgent);
if($resolveUUID !== null) {
$profileInfo = MojangInterop::getSessionMinecraftProfile($resolveUUID->id, $userAgent);

View file

@ -70,7 +70,7 @@
<form method="post" action="/clients/authorise">
<input type="hidden" name="csrfp" value="{{ csrfp }}">
<input type="hidden" name="auth" value="{{ client.id }}">
<input class="action action-authorise js-authorise-button" type="submit" value="Authorise" disabled onclick="return confirm('Are you sure?');">
<input class="action action-authorise js-authorise-button" type="submit" value="Approve" disabled onclick="return confirm('Are you sure?');">
</form>
{% endif %}
<form method="post" action="/clients/deauthorise">

View file

@ -8,11 +8,20 @@
<div class="section downloads-item">
<h2>Flashii Extensions</h2>
<p>This as a mod built on <a href="https://fabricmc.net/" target="_blank" rel="noopener">Fabric</a> to alter the server your Minecraft client uses to request skins from Mojang's to ours.{# This mod is likely why you're on this page. <-- add this is there's more downloads ever #}</p>
<p>This as a mod built on <a href="https://fabricmc.net/" target="_blank" rel="noopener">Fabric</a> to alter the server your Minecraft client uses to request skins from Mojang's to ours. This mod is likely why you're on this page.</p>
<ul>
<li><a href="/dl/flashii-extensions-1.0.0.jar">Download Flashii Extensions 1.0.0</a></li>
<li><a href="/dl/flashii-extensions-1.0.0.jar" download>Download Flashii Extensions 1.0.0</a></li>
<li><a href="https://git.flash.moe/flashii/mcexts" target="_blank" rel="noopener">Source Code</a></li>
</ul>
</div>
<div class="section downloads-item">
<h2>MultiMC/PolyMC/Prism Launcher spoofed accounts file</h2>
<p>This file is used in the <a href="/guide">guide</a> to allow you to add an Offline account of your own.</p>
<ul>
<li><a href="/dl/accounts.json" download>Download accounts.json</a></li>
</ul>
</div>
{% endblock %}

154
templates/guide.twig Normal file
View file

@ -0,0 +1,154 @@
{% extends 'master.twig' %}
{% block content %}
<div class="section" id="start">
<h1><a href="#start">Guide to getting you started</a></h1>
<p>This guide will walk you through the steps of settings up a client and connecting to one of our servers.</p>
</div>
<div class="section" id="gac">
<h2><a href="#gac">Getting a client</a></h2>
<p>
This part of the guide will walk you through setting up a client.
If you already have your own environment that can load Fabric mods, you may skip this part.
The client side mod is not required if you can't be bothered with it, but people will look awfully boring without their own skins.
</p>
</div>
<div class="section" id="gac1">
<h3><a href="#gac1">Step 1. Installing Adoptium JVM (Windows)</a></h3>
<p>
For some reason Oracle doesn't make their own new versions of Java and restrictive licences likely prevent Mojang and Prism from distributing their own, so we're going to have to download one ourselves.
This part may only apply to Windows, I'm not sure how it would go on macOS and I can't be bothered to test on Linux distributions so you might have to improvise for this step.
</p>
<p><a href="https://adoptium.net" target="_blank" rel="noopener">Go to the Adoptium Website</a></p>
<p>
Click on the "Latest LTS Release" download button and install it.
<em>Make sure the installer is set to install <strong>Set JAVA_HOME variable</strong> and <strong>JavaSoft (Oracle) registry keys</strong> or you will have issues later on.</em>
Just pick always install for everything.
</p>
<p><img src="/assets/guide-java.png" style="max-width: 400px;"></p>
</div>
<div class="section" id="gac2">
<h3><a href="#gac2">Step 2. Downloading Prism Launcher</a></h3>
<p>
Prism Launcher is the latest in a series of MultiMC forks and currently the most well maintained one, so that's the launcher we're currently recommending.
If you plan to use our client side mod, we recommend using a dedicated instance for it so you won't have to turn it off when connecting to other servers as will cause issues when trying to connect to them.
</p>
<p><a href="https://prismlauncher.org/download" target="_blank" rel="noopener">Prism Launcher Download Page</a></p>
<p>
Which installer or package you grab doesn't matter.
Install it or extract the zip somewhere and launch <strong>Prism Launcher.exe</strong> or any of the shortcuts it placed.
</p>
<p>
The first time you start it you'll be asked to pick a language and what version of Java to use.
If you properly followed the previous step the Adoptium JVM should be immediately selected.
If you did not properly follow the previous step, the path of the <code>javaw.exe</code> should be something among the lines of <code>C:/Program Files/Eclipse Adoptium/jdk-17.0.8.7-hotspot/bin/javaw.exe</code>.
During the next step of the Quick Setup, make sure to select <strong>Background Cat (from MultiMC)</strong> because he's epic.
</p>
<p>You should now be at the main screen of Prism Launcher!</p>
</div>
<div class="section" id="gac3">
<h3><a href="#gac3">Step 3. Adding your account</a></h3>
<p>
This step varies depending on whether you have a currently active Minecraft account or not.
The whole point of our server side mod is to provide people who chose to not convert/link their Mojang account to a Microsoft account with the ability to still play the game they paid for.
</p>
<h4>If you have a Microsoft account</h4>
<p>
In the top right of the main screen, click the <strong>Accounts</strong> button and pick <strong>Manage Accounts...</strong>.
If you have Minecraft linked to your Microsoft account, press <strong>Add Microsoft</strong> and follow the steps to logging in.
</p>
<p>Close the settings window and your Minecraft username and skin should now show up where it previously said <strong>Accounts</strong>.</p>
<h4>If you do not have a Microsoft account</h4>
<p>
One annoying restriction Prism Launcher has is that it does not allow you to add Offline profiles without having a Microsoft or Mojang account added first.
To circumvent this, you'll first want to close Prism Launcher.
</p>
<p>
If you used the Portable option when downloading, go to the folder than contains <strong>Prism Launcher.exe</strong>.
If you used the Installer option, press <kbd>Windows Key</kbd>+<kbd>R</kbd> to open the Run Dialog, put <code>%appdata%\PrismLauncher</code> in the Open field and hit OK or press the <kbd>Enter</kbd> key.
</p>
<p>
Once there you'll want to download <a href="/dl/accounts.json" download><code>accounts.json</code></a> to that folder.
When you've done that start Prism Launcher again and you should notice that the button in the top right that previously said <strong>Accounts</strong> now says <strong>Anonymous</strong>.
Press the button that says <strong>Anonymous</strong>, pick <strong>Manage Accounts...</strong> and then press <strong>Add Offline</strong> on the right of the new window that popped up.
Pick a username, whether its your old Minecraft account name, your username on Flashii or something entirely different but still identifiable as you and press OK.
I have not tested whether the <strong>Allow long usernames</strong> option works with our servers but I also can't be bothered to try.
Now select the name you've just added in the list, press <strong>Set Default</strong> on the right side.
</p>
<p><img src="/assets/guide-accounts-installer.png" style="max-width: 400px;"> <img src="/assets/guide-accounts-portable.png" style="max-width: 400px;"></p>
<p>Close the settings window and your Minecraft username should now show up where it previously said <strong>Anonymous</strong>.</p>
<p>At the time of writing <strong>Add Mojang</strong> still shows up as an option, but as far as I'm aware it doesn't work anymore but you can try it if you want to and haven't converted to a Microsoft account yet.</p>
</div>
<div class="section" id="gac4">
<h3><a href="#gac4">Step 4. Setting up an instance</a></h3>
<p>Press the <strong>Add Instance</strong> button on the top left.</p>
<p>
Under <strong>Custom</strong> make sure the version the server you want to connect to is currently running is selected.
The versions of the servers are listing on the <a href="/">home page</a> along with their addresses for your convenience.
</p>
<p>If you plan on using our client side mod, select <strong>Fabric</strong> under <strong>Mod Loader</strong> and just pick whatever the latest version is, which is also what should be selected by default.</p>
<p>When you've done those things, press OK.</p>
<p><img src="/assets/guide-instance.png" style="max-width: 400px;"></p>
</div>
<div class="section" id="gac5">
<h3><a href="#gac5">Step 5. Installing the Flashii Extensions client side mod (Optional)</a></h3>
<p>
You can download the Flashii Extensions mod from the <a href="/downloads">downloads page</a>, the latest version of the mod is the first thing linked in the list.
Save it anywhere you like as long as you remember where you saved it.
</p>
<p>
Back in the main window of Prism Launcher, select the instance you've just created and then pick <strong>Edit</strong> in the menu on the right side of the window.
Select <strong>Mods</strong> in the sidebar, pick <strong>Add File</strong>, browse to the <code>.jar</code> file you just downloaded and press Open.
</p>
<p>Now close this window or <strong>Launch</strong> the game from here.</p>
</div>
<div class="section" id="gac6">
<h3><a href="#gac6">Step 6. Launching the game</a></h3>
<p>
You should now have a fully functional basic instance to connect to our servers!
From now on you can just launch this instance by double clicking it or selecting <strong>Launch</strong> from the sidebar.
</p>
</div>
<div class="section" id="ctos">
<h2><a href="#ctos">Connecting to a server</a></h2>
<p>We're assuming you've already picked a server to play from from the <a href="/">home page</a> and have added it to your server list.</p>
</div>
<div class="section" id="ctos1">
<h3><a href="#ctos1">First time connecting</a></h3>
<p>
The first time you connect to the server you'll be met with a message telling you to connect your Flashii ID.
Follow the steps provided in the message, unfortunately Minecraft does not allow you to copy text or click links from this screen so you'll have to type out the URL and code yourself.
</p>
<p>If you're not logged in to Flashii yet in your web browser you'll have to do that first.</p>
<p>Enter the code displayed in purple in the Link Code field on the website and press enter.</p>
<p>
You should now be greeted with more options on the website like the client list and the ability to upload a skin.
You'll also notice that a client in the list has already been authorised, you should now be able to connect to the server!
</p>
<p><img src="/assets/guide-link.png" style="max-width: 400px;"></p>
</div>
<div class="section" id="ctos2">
<h3><a href="#ctos2">Subsequent times connecting</a></h3>
<p>Provided your IP address remains unchanged, you should be able to connect to the server without issue. If you IP address does change you'll be met with a notice telling you to verify that you actually you.</p>
<p>
Again go to the URL displayed in blue in your web browser and then press <strong>Authorise</strong> on your client.
Only approve clients with IP addresses that you recognise otherwise someone will be able to impersonate you, for your own convenience your current IP address is displayed at the top of the page, usually this should be the same as your client so you can easily identify which one approve.
Press <strong>Deny</strong> or use the <strong>Deny pending clients</strong> under the <strong>Crowd Control</strong> header to remove ones you don't recognise.
Also make sure to deauthorise any clients that you don't use anymore, like your previous IP address that caused you to have to go back to this page in the first place.
</p>
<p><img src="/assets/guide-auth.png" style="max-width: 400px;"></p>
<p>You should now be able to connect to the server again until your IP address changes again!</p>
</div>
{% endblock %}

View file

@ -16,6 +16,7 @@
<div class="header-menu">
<a href="/">Home</a>
<a href="/downloads">Downloads</a>
<a href="/guide">Guide</a>
{% if is_authed %}
<a href="/clients">Clients</a>
<a href="/skins">Skins</a>
@ -36,7 +37,8 @@
{% endblock %}
</div>
<footer class="footer">
<a href="https://flash.moe">Flashwave</a> 2022-{{ 'now'|date('Y') }} | Site design "borrowed" from pre-Microsoft Mojang | "Minecraft" is a trademark of Mojang
<a href="https://flash.moe" target="_blank">flashwave</a> 2022-{{ 'now'|date('Y') }} | Site design based on the Minecraft.net of old | "Minecraft" is a trademark of Mojang<br>
NOT AN OFFICIAL MINECRAFT SERVICE, NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT
</footer>
</div>
</body>

View file

@ -71,12 +71,12 @@
<div class="section skinimport">
<h2>Import from Mojang account</h2>
<p>Import skin and cape textures from a Mojang Minecraft account.</p>
<p>Import skin and cape textures from a Mojang Minecraft account. If you linked the same username as your actual Minecraft account, you can just press Import without anything.</p>
<form method="post" action="/skins/import">
<input type="hidden" name="csrfp" value="{{ csrfp }}">
<label>
<div class="label-header">Minecraft Username</div>
<div class="label-input"><input type="text" name="username" spellcheck="false"></div>
<div class="label-input"><input type="text" name="username" spellcheck="false" placeholder="{{ link_info.name }}"></div>
</label>
<input type="submit" value="Import" class="form-btn-green">
</form>