switch from tabs to spaces & set indent size to 4

This commit is contained in:
Hichem Fantar 2022-07-26 15:41:07 +01:00
parent 51a876cf2b
commit fd92f2de5e
10 changed files with 9128 additions and 9105 deletions

View File

@ -1,12 +1,12 @@
{ {
"trailingComma": "es5", "trailingComma": "es5",
"tabWidth": 2, "useTabs": false,
"useTabs": true, "tabWidth": 4,
"singleQuote": false, "singleQuote": false,
"semi": true, "semi": true,
"bracketSameLine": false, "bracketSameLine": false,
"bracketSpacing": true, "bracketSpacing": true,
"jsxSingleQuote": false, "jsxSingleQuote": false,
"quoteProps": "as-needed", "quoteProps": "as-needed",
"endOfLine": "lf" "endOfLine": "lf"
} }

View File

@ -1,9 +1,9 @@
{ {
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": ["esbenp.prettier-vscode"], "recommendations": ["esbenp.prettier-vscode"],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [] "unwantedRecommendations": []
} }

View File

@ -1,5 +1,5 @@
{ {
"autoupdate-check": true, "autoupdate-check": true,
"cache-swapping": true, "cache-swapping": true,
"last-version-initialized": "1.4" "last-version-initialized": "1.4"
} }

View File

@ -1,19 +1,19 @@
{ {
"servers": [ "servers": [
{ {
"uuid": "d9773558-6ddf-4d00-8803-d830a22a842b", "uuid": "d9773558-6ddf-4d00-8803-d830a22a842b",
"description": "OpenFusion Public Server - Original", "description": "OpenFusion Public Server - Original",
"ip": "play.dexlabs.systems:23000", "ip": "play.dexlabs.systems:23000",
"version": "beta-20100104", "version": "beta-20100104",
"endpoint": "https://api.dexlabs.systems/" "endpoint": "https://api.dexlabs.systems/"
}, },
{ {
"uuid": "b84f6859-f500-41f2-bdfa-8e3746639ee9", "uuid": "b84f6859-f500-41f2-bdfa-8e3746639ee9",
"description": "OpenFusion Public Server - Academy", "description": "OpenFusion Public Server - Academy",
"ip": "play.dexlabs.systems:24000", "ip": "play.dexlabs.systems:24000",
"version": "beta-20111013", "version": "beta-20111013",
"endpoint": "https://api.dexlabs.systems/academy/" "endpoint": "https://api.dexlabs.systems/academy/"
} }
], ],
"favorites": [] "favorites": []
} }

View File

@ -1,108 +1,108 @@
{ {
"versions": [ "versions": [
{ {
"name": "beta-20100104", "name": "beta-20100104",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100104/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100104/"
}, },
{ {
"name": "beta-20100119", "name": "beta-20100119",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100119/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100119/"
}, },
{ {
"name": "beta-20100207", "name": "beta-20100207",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100207/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100207/"
}, },
{ {
"name": "beta-20100307", "name": "beta-20100307",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100307/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100307/"
}, },
{ {
"name": "beta-20100322", "name": "beta-20100322",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100322/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100322/"
}, },
{ {
"name": "beta-20100413", "name": "beta-20100413",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100413/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100413/"
}, },
{ {
"name": "beta-20100502", "name": "beta-20100502",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100502/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100502/"
}, },
{ {
"name": "beta-20100524", "name": "beta-20100524",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100524/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100524/"
}, },
{ {
"name": "beta-20100604", "name": "beta-20100604",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100604/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100604/"
}, },
{ {
"name": "beta-20100616", "name": "beta-20100616",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100616/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100616/"
}, },
{ {
"name": "beta-20100711", "name": "beta-20100711",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100711/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100711/"
}, },
{ {
"name": "beta-20100728", "name": "beta-20100728",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100728/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100728/"
}, },
{ {
"name": "beta-20100909", "name": "beta-20100909",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20100909/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20100909/"
}, },
{ {
"name": "beta-20101003", "name": "beta-20101003",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20101003/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20101003/"
}, },
{ {
"name": "beta-20101011", "name": "beta-20101011",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20101011/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20101011/"
}, },
{ {
"name": "beta-20101028", "name": "beta-20101028",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20101028/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20101028/"
}, },
{ {
"name": "beta-20101123", "name": "beta-20101123",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20101123/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20101123/"
}, },
{ {
"name": "beta-20110213", "name": "beta-20110213",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110213/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110213/"
}, },
{ {
"name": "beta-20110314", "name": "beta-20110314",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110314/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110314/"
}, },
{ {
"name": "beta-20110330", "name": "beta-20110330",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110330/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110330/"
}, },
{ {
"name": "beta-20110424", "name": "beta-20110424",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110424/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110424/"
}, },
{ {
"name": "beta-20110523", "name": "beta-20110523",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110523/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110523/"
}, },
{ {
"name": "beta-20110725", "name": "beta-20110725",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110725/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110725/"
}, },
{ {
"name": "beta-20110818", "name": "beta-20110818",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110818/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110818/"
}, },
{ {
"name": "beta-20110912", "name": "beta-20110912",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20110912/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20110912/"
}, },
{ {
"name": "beta-20111013", "name": "beta-20111013",
"url": "http://cdn.dexlabs.systems/ff/big/beta-20111013/" "url": "http://cdn.dexlabs.systems/ff/big/beta-20111013/"
} }
] ]
} }

View File

@ -1,466 +1,485 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta <meta
name="viewport" name="viewport"
content="width=device-width, initial-scale=1.0, shrink-to-fit=no" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
/> />
<title>OpenFusion: Server Selector</title> <title>OpenFusion: Server Selector</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" /> <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css" /> <link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css" />
<link rel="stylesheet" href="assets/css/openfusion.css" /> <link rel="stylesheet" href="assets/css/openfusion.css" />
<link rel="stylesheet" href="assets/css/styles.css" /> <link rel="stylesheet" href="assets/css/styles.css" />
</head> </head>
<body <body
style=" style="
background: rgb(0, 0, 0); background: rgb(0, 0, 0);
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
clear: both; clear: both;
" "
onresize="onResize()" onresize="onResize()"
> >
<section id="of-serverselector"> <section id="of-serverselector">
<div class="container" id="serverselector-container"> <div class="container" id="serverselector-container">
<div class="row text-center mt-3" id="of-logoheader"> <div class="row text-center mt-3" id="of-logoheader">
<div class="col"> <div class="col">
<img <img
class="img-fluid" class="img-fluid"
id="of-logo" id="of-logo"
src="assets/img/of-3.png" src="assets/img/of-3.png"
width="256" width="256"
/> />
<p id="of-intro-text"> <p id="of-intro-text">
Welcome to OpenFusion.<br />Select a server from the list below to Welcome to OpenFusion.<br />Select a server from the
get started. list below to get started.
</p> </p>
</div> </div>
</div> </div>
<div <div
class="row d-sm-flex d-xl-flex justify-content-center justify-content-sm-center justify-content-xl-center" class="row d-sm-flex d-xl-flex justify-content-center justify-content-sm-center justify-content-xl-center"
id="of-serverlist" id="of-serverlist"
> >
<div class="col-8 mb-2"> <div class="col-8 mb-2">
<div <div
class="table-responsive text-center border rounded border-primary" class="table-responsive text-center border rounded border-primary"
id="server-table" id="server-table"
> >
<table class="table table-striped table-hover mb-0"> <table class="table table-striped table-hover mb-0">
<thead> <thead>
<tr> <tr>
<th>Description</th> <th>Description</th>
<th>Game Version</th> <th>Game Version</th>
</tr> </tr>
</thead> </thead>
<tbody id="server-tablebody"> <tbody id="server-tablebody">
<tr id="server-listing-placeholder"> <tr id="server-listing-placeholder">
<td colspan="2"> <td colspan="2">
No servers added yet... perhaps you should find one? No servers added yet... perhaps you
</td> should find one?
</tr> </td>
</tbody> </tr>
</table> </tbody>
</div> </table>
</div> </div>
</div> </div>
<div </div>
class="row row-cols-2 d-xl-flex justify-content-center justify-content-xl-center" <div
id="of-serverbuttons" class="row row-cols-2 d-xl-flex justify-content-center justify-content-xl-center"
style="padding-bottom: 16px" id="of-serverbuttons"
> style="padding-bottom: 16px"
<div class="col-4 text-left d-inline-flex justify-content-xl-start"> >
<button <div
class="btn btn-success mr-1" class="col-4 text-left d-inline-flex justify-content-xl-start"
data-toggle="modal" >
data-bs-tooltip="" <button
data-placement="bottom" class="btn btn-success mr-1"
id="of-addserver-button" data-toggle="modal"
type="button" data-bs-tooltip=""
title="Add Server" data-placement="bottom"
data-target="#of-addservermodal" id="of-addserver-button"
onclick="deselectServer()" type="button"
> title="Add Server"
<i class="fas fa-plus"></i> data-target="#of-addservermodal"
</button> onclick="deselectServer()"
<button >
class="btn btn-primary mr-1 disabled" <i class="fas fa-plus"></i>
data-toggle="modal" </button>
data-bs-tooltip="" <button
data-placement="bottom" class="btn btn-primary mr-1 disabled"
id="of-editserver-button" data-toggle="modal"
type="button" data-bs-tooltip=""
title="Edit Server" data-placement="bottom"
data-target="#of-editservermodal" id="of-editserver-button"
disabled="" type="button"
> title="Edit Server"
<i class="fas fa-edit"></i> data-target="#of-editservermodal"
</button> disabled=""
<button >
class="btn btn-danger mr-1 disabled" <i class="fas fa-edit"></i>
data-toggle="modal" </button>
data-bs-tooltip="" <button
data-placement="bottom" class="btn btn-danger mr-1 disabled"
id="of-deleteserver-button" data-toggle="modal"
type="button" data-bs-tooltip=""
title="Delete Server" data-placement="bottom"
data-target="#of-deleteservermodal" id="of-deleteserver-button"
disabled="" type="button"
> title="Delete Server"
<i class="fas fa-trash-alt"></i> data-target="#of-deleteservermodal"
</button> disabled=""
</div> >
<div class="col-4 d-inline-flex justify-content-end"> <i class="fas fa-trash-alt"></i>
<button </button>
class="btn btn-primary disabled" </div>
id="of-connect-button" <div class="col-4 d-inline-flex justify-content-end">
type="button" <button
onclick="connectToServer()" class="btn btn-primary disabled"
disabled="" id="of-connect-button"
> type="button"
Connect&nbsp;<i class="fas fa-angle-double-right"></i> onclick="connectToServer()"
</button> disabled=""
</div> >
</div> Connect&nbsp;<i
</div> class="fas fa-angle-double-right"
<div class="modal fade" role="dialog" tabindex="-1" id="of-aboutmodal"> ></i>
<div class="modal-dialog modal-dialog-centered" role="document"> </button>
<div class="modal-content"> </div>
<div class="modal-header"> </div>
<h4 class="modal-title">About OpenFusionClient</h4> </div>
<button <div
type="button" class="modal fade"
class="close" role="dialog"
data-dismiss="modal" tabindex="-1"
aria-label="Close" id="of-aboutmodal"
> >
<span aria-hidden="true">×</span> <div class="modal-dialog modal-dialog-centered" role="document">
</button> <div class="modal-content">
</div> <div class="modal-header">
<div class="modal-body"> <h4 class="modal-title">About OpenFusionClient</h4>
<p class="text-monospace">Version 1.4</p> <button
<p> type="button"
©2020-2022 OpenFusion Contributors<br />OpenFusion is licensed class="close"
under MIT.<br /> data-dismiss="modal"
</p> aria-label="Close"
<a >
href="#of-restoreserversmodal" <span aria-hidden="true">×</span>
onclick="$('#of-aboutmodal').modal('toggle')" </button>
data-toggle="modal" </div>
data-target="#of-restoreserversmodal" <div class="modal-body">
>Reset to Default Servers</a <p class="text-monospace">Version 1.4</p>
> <p>
</div> ©2020-2022 OpenFusion Contributors<br />OpenFusion
<div class="modal-footer"> is licensed under MIT.<br />
<div class="row flex-fill"> </p>
<div class="col"> <a
<button href="#of-restoreserversmodal"
class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2" onclick="$('#of-aboutmodal').modal('toggle')"
data-toggle="tooltip" data-toggle="modal"
data-bs-tooltip="" data-target="#of-restoreserversmodal"
type="button" >Reset to Default Servers</a
title="Github Page" >
onclick="window.open(&#39;https://github.com/OpenFusionProject/OpenFusion&#39;,&#39;_blank&#39;);" </div>
> <div class="modal-footer">
<i <div class="row flex-fill">
class="fab fa-github" <div class="col">
style="font-size: 24px" <button
></i></button class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2"
><button data-toggle="tooltip"
class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2" data-bs-tooltip=""
data-toggle="tooltip" type="button"
data-bs-tooltip="" title="Github Page"
type="button" onclick="window.open(&#39;https://github.com/OpenFusionProject/OpenFusion&#39;,&#39;_blank&#39;);"
title="Discord Chat" >
onclick="window.open(&#39;https://discord.gg/DYavckB&#39;,&#39;_blank&#39;);" <i
> class="fab fa-github"
<i style="font-size: 24px"
class="fab fa-discord" ></i></button
style="font-size: 24px; position: relative; top: 1px" ><button
></i> class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2"
</button> data-toggle="tooltip"
</div> data-bs-tooltip=""
<div class="col text-right"> type="button"
<button title="Discord Chat"
class="btn btn-primary border rounded border-primary" onclick="window.open(&#39;https://discord.gg/DYavckB&#39;,&#39;_blank&#39;);"
type="button" >
data-dismiss="modal" <i
> class="fab fa-discord"
Close style="
</button> font-size: 24px;
</div> position: relative;
</div> top: 1px;
</div> "
</div> ></i>
</div> </button>
</div> </div>
<div <div class="col text-right">
class="modal fade" <button
role="dialog" class="btn btn-primary border rounded border-primary"
tabindex="-1" type="button"
id="of-addservermodal" data-dismiss="modal"
> >
<div class="modal-dialog modal-dialog-centered" role="document"> Close
<div class="modal-content"> </button>
<div class="modal-header"> </div>
<h4 class="modal-title">Add Server</h4> </div>
<button </div>
type="button" </div>
class="close" </div>
data-dismiss="modal" </div>
aria-label="Close" <div
> class="modal fade"
<span aria-hidden="true">×</span> role="dialog"
</button> tabindex="-1"
</div> id="of-addservermodal"
<div class="modal-body"> >
<form id="addserver-form" class="needs-validation"> <div class="modal-dialog modal-dialog-centered" role="document">
<label for="addserver-descinput">Server Description</label <div class="modal-content">
><input <div class="modal-header">
class="form-control form-row w-75" <h4 class="modal-title">Add Server</h4>
type="text" <button
id="addserver-descinput" type="button"
placeholder="My OpenFusion Server" class="close"
required="" data-dismiss="modal"
minlength="1" aria-label="Close"
maxlength="70" >
/><label for="addserver-ipinput">Server IP</label <span aria-hidden="true">×</span>
><input </button>
class="form-control form-row w-75" </div>
type="text" <div class="modal-body">
id="addserver-ipinput" <form id="addserver-form" class="needs-validation">
placeholder="127.0.0.1:23000" <label for="addserver-descinput"
required="" >Server Description</label
pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$" ><input
/><label for="addserver-versionselect" class="form-control form-row w-75"
>Game Version:&nbsp;</label type="text"
><select id="addserver-descinput"
class="form-control w-50" placeholder="My OpenFusion Server"
id="addserver-versionselect" required=""
required="" minlength="1"
style="margin-left: -5px" maxlength="70"
></select> /><label for="addserver-ipinput"
</form> >Server IP</label
</div> ><input
<div class="modal-footer"> class="form-control form-row w-75"
<button type="text"
class="btn btn-primary border rounded border-primary btn-danger border-danger" id="addserver-ipinput"
id="addserver-cancel" placeholder="127.0.0.1:23000"
type="button" required=""
data-dismiss="modal" pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$"
> /><label for="addserver-versionselect"
Cancel</button >Game Version:&nbsp;</label
><button ><select
class="btn btn-primary border rounded border-primary btn-success border-success" class="form-control w-50"
id="addserver-savebutton" id="addserver-versionselect"
type="submit" required=""
data-dismiss="modal" style="margin-left: -5px"
form="addserver-form" ></select>
onclick="addServer();" </form>
> </div>
Save <div class="modal-footer">
</button> <button
</div> class="btn btn-primary border rounded border-primary btn-danger border-danger"
</div> id="addserver-cancel"
</div> type="button"
</div> data-dismiss="modal"
<div >
class="modal fade" Cancel</button
role="dialog" ><button
tabindex="-1" class="btn btn-primary border rounded border-primary btn-success border-success"
id="of-editservermodal" id="addserver-savebutton"
> type="submit"
<div class="modal-dialog modal-dialog-centered" role="document"> data-dismiss="modal"
<div class="modal-content"> form="addserver-form"
<div class="modal-header"> onclick="addServer();"
<h4 class="modal-title">Edit Server</h4> >
<button Save
type="button" </button>
class="close" </div>
data-dismiss="modal" </div>
aria-label="Close" </div>
> </div>
<span aria-hidden="true">×</span> <div
</button> class="modal fade"
</div> role="dialog"
<div class="modal-body"> tabindex="-1"
<form id="editserver-form" class="needs-validation"> id="of-editservermodal"
<label for="editserver-descinput">Server Description</label >
><input <div class="modal-dialog modal-dialog-centered" role="document">
class="form-control form-row w-75" <div class="modal-content">
type="text" <div class="modal-header">
id="editserver-descinput" <h4 class="modal-title">Edit Server</h4>
placeholder="My OpenFusion Server" <button
required="" type="button"
minlength="1" class="close"
maxlength="70" data-dismiss="modal"
/><label for="addserver-ipinput">Server IP</label aria-label="Close"
><input >
class="form-control form-row w-75" <span aria-hidden="true">×</span>
type="text" </button>
id="editserver-ipinput" </div>
placeholder="127.0.0.1:23000" <div class="modal-body">
required="" <form id="editserver-form" class="needs-validation">
pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$" <label for="editserver-descinput"
/><label for="editserver-versionselect" >Server Description</label
>Game Version:&nbsp;</label ><input
><select class="form-control form-row w-75"
class="form-control w-50" type="text"
id="editserver-versionselect" id="editserver-descinput"
required="" placeholder="My OpenFusion Server"
style="margin-left: -5px" required=""
></select> minlength="1"
</form> maxlength="70"
</div> /><label for="addserver-ipinput"
<div class="modal-footer"> >Server IP</label
<button ><input
class="btn btn-primary border rounded border-primary btn-danger border-danger" class="form-control form-row w-75"
id="editserver-cancel" type="text"
type="button" id="editserver-ipinput"
data-dismiss="modal" placeholder="127.0.0.1:23000"
> required=""
Cancel</button pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$"
><button /><label for="editserver-versionselect"
class="btn btn-primary border rounded border-primary btn-success border-success" >Game Version:&nbsp;</label
id="addserver-savebutton" ><select
type="submit" class="form-control w-50"
data-dismiss="modal" id="editserver-versionselect"
form="editserver-form" required=""
onclick="editServer();" style="margin-left: -5px"
> ></select>
Save </form>
</button> </div>
</div> <div class="modal-footer">
</div> <button
</div> class="btn btn-primary border rounded border-primary btn-danger border-danger"
</div> id="editserver-cancel"
<div type="button"
class="modal fade" data-dismiss="modal"
role="dialog" >
tabindex="-1" Cancel</button
id="of-deleteservermodal" ><button
> class="btn btn-primary border rounded border-primary btn-success border-success"
<div class="modal-dialog modal-dialog-centered" role="document"> id="addserver-savebutton"
<div class="modal-content"> type="submit"
<div class="modal-header"> data-dismiss="modal"
<h4 class="modal-title">Are you sure?</h4> form="editserver-form"
<button onclick="editServer();"
type="button" >
class="close" Save
data-dismiss="modal" </button>
aria-label="Close" </div>
> </div>
<span aria-hidden="true">×</span> </div>
</button> </div>
</div> <div
<div class="modal-body"> class="modal fade"
<p class="lead"> role="dialog"
Do you really want to delete<br />"<a tabindex="-1"
id="deleteserver-servername" id="of-deleteservermodal"
>SERVER_NAME</a >
>"?<br /><br />You could always re-add it later. <div class="modal-dialog modal-dialog-centered" role="document">
</p> <div class="modal-content">
</div> <div class="modal-header">
<div class="modal-footer"> <h4 class="modal-title">Are you sure?</h4>
<button <button
class="btn btn-primary border rounded border-primary" type="button"
type="button" class="close"
data-dismiss="modal" data-dismiss="modal"
> aria-label="Close"
Cancel</button >
><button <span aria-hidden="true">×</span>
class="btn btn-primary border rounded border-primary btn-danger border-danger" </button>
id="deleteserver-button" </div>
type="button" <div class="modal-body">
data-dismiss="modal" <p class="lead">
onclick="deleteServer();" Do you really want to delete<br />"<a
> id="deleteserver-servername"
Yes, Delete >SERVER_NAME</a
</button> >"?<br /><br />You could always re-add it later.
</div> </p>
</div> </div>
</div> <div class="modal-footer">
</div> <button
<div class="btn btn-primary border rounded border-primary"
class="modal fade" type="button"
role="dialog" data-dismiss="modal"
tabindex="-1" >
id="of-restoreserversmodal" Cancel</button
> ><button
<div class="modal-dialog modal-dialog-centered" role="document"> class="btn btn-primary border rounded border-primary btn-danger border-danger"
<div class="modal-content"> id="deleteserver-button"
<div class="modal-header"> type="button"
<h4 class="modal-title">Are you sure?</h4> data-dismiss="modal"
<button onclick="deleteServer();"
type="button" >
class="close" Yes, Delete
data-dismiss="modal" </button>
aria-label="Close" </div>
> </div>
<span aria-hidden="true">×</span> </div>
</button> </div>
</div> <div
<div class="modal-body"> class="modal fade"
<p class="lead"> role="dialog"
Do you really want to restore the default servers? tabindex="-1"
</p> id="of-restoreserversmodal"
</div> >
<div class="modal-footer"> <div class="modal-dialog modal-dialog-centered" role="document">
<button <div class="modal-content">
class="btn btn-primary border rounded border-primary" <div class="modal-header">
type="button" <h4 class="modal-title">Are you sure?</h4>
data-dismiss="modal" <button
> type="button"
Cancel</button class="close"
><button data-dismiss="modal"
class="btn btn-primary border rounded border-primary btn-danger border-danger" aria-label="Close"
id="deleteserver-button" >
type="button" <span aria-hidden="true">×</span>
data-dismiss="modal" </button>
onclick="restoreDefaultServers();" </div>
> <div class="modal-body">
Yes, Restore <p class="lead">
</button> Do you really want to restore the default
</div> servers?
</div> </p>
</div> </div>
</div> <div class="modal-footer">
<div id="of-versionnumber"> <button
<a class="btn btn-primary border rounded border-primary"
class="text-monospace text-secondary" type="button"
href="#of-aboutmodal" data-dismiss="modal"
data-toggle="modal" >
data-target="#of-aboutmodal" Cancel</button
>v1.4</a ><button
> class="btn btn-primary border rounded border-primary btn-danger border-danger"
</div> id="deleteserver-button"
</section> type="button"
<section> data-dismiss="modal"
<div onclick="restoreDefaultServers();"
id="client" >
style=" Yes, Restore
width: 100%; </button>
height: 100%; </div>
margin: 0; </div>
padding: 0; </div>
background: #000; </div>
clear: both; <div id="of-versionnumber">
" <a
></div> class="text-monospace text-secondary"
</section> href="#of-aboutmodal"
<script data-toggle="modal"
src="assets/js/jquery.min.js" data-target="#of-aboutmodal"
onload="window.$ = window.jQuery = module.exports;" >v1.4</a
></script> >
<script src="assets/bootstrap/js/bootstrap.min.js"></script> </div>
<script src="assets/js/bs-init.js"></script> </section>
<script src="assets/js/uuidv4.min.js"></script> <section>
<script src="assets/js/serverselector.js"></script> <div
<script src="assets/js/gameclient.js"></script> id="client"
<script src="assets/js/snowflakes.min.js"></script> style="
<script src="assets/js/eastereggs.js"></script> width: 100%;
</body> height: 100%;
margin: 0;
padding: 0;
background: #000;
clear: both;
"
></div>
</section>
<script
src="assets/js/jquery.min.js"
onload="window.$ = window.jQuery = module.exports;"
></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="assets/js/uuidv4.min.js"></script>
<script src="assets/js/serverselector.js"></script>
<script src="assets/js/gameclient.js"></script>
<script src="assets/js/snowflakes.min.js"></script>
<script src="assets/js/eastereggs.js"></script>
</body>
</html> </html>

265
index.js
View File

@ -10,157 +10,160 @@ var mainWindow = null;
app.commandLine.appendSwitch("--enable-npapi"); app.commandLine.appendSwitch("--enable-npapi");
function initialSetup(firstTime) { function initialSetup(firstTime) {
// Display a small window to inform the user that the app is working // Display a small window to inform the user that the app is working
setupWindow = new BrowserWindow({ setupWindow = new BrowserWindow({
width: 275, width: 275,
height: 450, height: 450,
resizable: false, resizable: false,
center: true, center: true,
frame: false, frame: false,
}); });
setupWindow.loadUrl("file://" + __dirname + "/initialsetup.html"); setupWindow.loadUrl("file://" + __dirname + "/initialsetup.html");
// Exec installUnity.bat and wait for it to finish. // Exec installUnity.bat and wait for it to finish.
var child = require("child_process").spawn("cmd.exe", [ var child = require("child_process").spawn("cmd.exe", [
"/c", "/c",
"utils\\installUnity.bat", "utils\\installUnity.bat",
]); ]);
child.on("exit", function () { child.on("exit", function () {
console.log("Unity installed."); console.log("Unity installed.");
if (!firstTime) { if (!firstTime) {
// migration from pre-1.4 // migration from pre-1.4
// Back everything up, just in case // Back everything up, just in case
fs.copySync( fs.copySync(
app.getPath("userData") + "\\config.json", app.getPath("userData") + "\\config.json",
app.getPath("userData") + "\\config.json.bak" app.getPath("userData") + "\\config.json.bak"
); );
fs.copySync( fs.copySync(
app.getPath("userData") + "\\servers.json", app.getPath("userData") + "\\servers.json",
app.getPath("userData") + "\\servers.json.bak" app.getPath("userData") + "\\servers.json.bak"
); );
fs.copySync( fs.copySync(
app.getPath("userData") + "\\versions.json", app.getPath("userData") + "\\versions.json",
app.getPath("userData") + "\\versions.json.bak" app.getPath("userData") + "\\versions.json.bak"
); );
} else { } else {
// first-time setup // first-time setup
// Copy default servers // Copy default servers
fs.copySync( fs.copySync(
__dirname + "\\defaults\\servers.json", __dirname + "\\defaults\\servers.json",
app.getPath("userData") + "\\servers.json" app.getPath("userData") + "\\servers.json"
); );
} }
// Copy default versions and config // Copy default versions and config
fs.copySync( fs.copySync(
__dirname + "\\defaults\\versions.json", __dirname + "\\defaults\\versions.json",
app.getPath("userData") + "\\versions.json" app.getPath("userData") + "\\versions.json"
); );
fs.copySync( fs.copySync(
__dirname + "\\defaults\\config.json", __dirname + "\\defaults\\config.json",
app.getPath("userData") + "\\config.json" app.getPath("userData") + "\\config.json"
); );
console.log("JSON files copied."); console.log("JSON files copied.");
setupWindow.destroy(); setupWindow.destroy();
showMainWindow(); showMainWindow();
}); });
} }
ipc.on("exit", function (id) { ipc.on("exit", function (id) {
mainWindow.destroy(); mainWindow.destroy();
}); });
// Quit when all windows are closed. // Quit when all windows are closed.
app.on("window-all-closed", function () { app.on("window-all-closed", function () {
if (process.platform != "darwin") app.quit(); if (process.platform != "darwin") app.quit();
}); });
app.on("ready", function () { app.on("ready", function () {
// Check just in case the user forgot to extract the zip. // Check just in case the user forgot to extract the zip.
zip_check = app.getPath("exe").includes(os.tmpdir()); zip_check = app.getPath("exe").includes(os.tmpdir());
if (zip_check) { if (zip_check) {
errormsg = errormsg =
"It has been detected that OpenFusionClient is running from the TEMP folder.\n\n" + "It has been detected that OpenFusionClient is running from the TEMP folder.\n\n" +
"Please extract the entire Client folder to a location of your choice before starting OpenFusionClient."; "Please extract the entire Client folder to a location of your choice before starting OpenFusionClient.";
dialog.showErrorBox("Error!", errormsg); dialog.showErrorBox("Error!", errormsg);
return; return;
} }
// Create the browser window. // Create the browser window.
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1280, width: 1280,
height: 720, height: 720,
show: false, show: false,
"web-preferences": { plugins: true }, "web-preferences": { plugins: true },
}); });
mainWindow.setMinimumSize(640, 480); mainWindow.setMinimumSize(640, 480);
// Check for first run // Check for first run
var configPath = app.getPath("userData") + "\\config.json"; var configPath = app.getPath("userData") + "\\config.json";
try { try {
if (!fs.existsSync(configPath)) { if (!fs.existsSync(configPath)) {
console.log("Config file not found. Running initial setup."); console.log("Config file not found. Running initial setup.");
initialSetup(true); initialSetup(true);
} else { } else {
var config = fs.readJsonSync(configPath); var config = fs.readJsonSync(configPath);
if (!config["last-version-initialized"]) { if (!config["last-version-initialized"]) {
console.log("Pre-1.4 config detected. Running migration."); console.log("Pre-1.4 config detected. Running migration.");
initialSetup(false); initialSetup(false);
} else { } else {
showMainWindow(); showMainWindow();
} }
} }
} catch (e) { } catch (e) {
console.log("An error occurred while checking for the config."); console.log("An error occurred while checking for the config.");
} }
// Makes it so external links are opened in the system browser, not Electron // Makes it so external links are opened in the system browser, not Electron
mainWindow.webContents.on("new-window", function (e, url) { mainWindow.webContents.on("new-window", function (e, url) {
e.preventDefault(); e.preventDefault();
require("shell").openExternal(url); require("shell").openExternal(url);
}); });
mainWindow.on("closed", function () { mainWindow.on("closed", function () {
mainWindow = null; mainWindow = null;
}); });
}); });
function showMainWindow() { function showMainWindow() {
// Load the index.html of the app. // Load the index.html of the app.
mainWindow.loadUrl("file://" + __dirname + "/index.html"); mainWindow.loadUrl("file://" + __dirname + "/index.html");
// Reduces white flash when opening the program // Reduces white flash when opening the program
mainWindow.webContents.on("did-finish-load", function () { mainWindow.webContents.on("did-finish-load", function () {
mainWindow.show(); mainWindow.show();
// everything's loaded, tell the renderer process to do its thing // everything's loaded, tell the renderer process to do its thing
mainWindow.webContents.executeJavaScript("loadConfig();"); mainWindow.webContents.executeJavaScript("loadConfig();");
mainWindow.webContents.executeJavaScript("loadGameVersions();"); mainWindow.webContents.executeJavaScript("loadGameVersions();");
mainWindow.webContents.executeJavaScript("loadServerList();"); mainWindow.webContents.executeJavaScript("loadServerList();");
}); });
mainWindow.webContents.on("plugin-crashed", function () { mainWindow.webContents.on("plugin-crashed", function () {
console.log("Unity Web Player crashed."); console.log("Unity Web Player crashed.");
}); });
mainWindow.webContents.on("will-navigate", function (evt, url) { mainWindow.webContents.on("will-navigate", function (evt, url) {
evt.preventDefault(); evt.preventDefault();
// TODO: showMessageBox rather than showErrorBox? // TODO: showMessageBox rather than showErrorBox?
switch (url) { switch (url) {
case "https://audience.fusionfall.com/ff/regWizard.do?_flowId=fusionfall-registration-flow": case "https://audience.fusionfall.com/ff/regWizard.do?_flowId=fusionfall-registration-flow":
errormsg = errormsg =
"The register page is currently unimplemented.\n\n" + "The register page is currently unimplemented.\n\n" +
'You can still create an account: type your desired username and password into the provided boxes and click "Log In". ' + 'You can still create an account: type your desired username and password into the provided boxes and click "Log In". ' +
"Your account will then be automatically created on the server. \nBe sure to remember these details!"; "Your account will then be automatically created on the server. \nBe sure to remember these details!";
dialog.showErrorBox("Sorry!", errormsg); dialog.showErrorBox("Sorry!", errormsg);
break; break;
case "https://audience.fusionfall.com/ff/login.do": case "https://audience.fusionfall.com/ff/login.do":
dialog.showErrorBox("Sorry!", "Account management is not available."); dialog.showErrorBox(
break; "Sorry!",
case "http://forums.fusionfall.com/": "Account management is not available."
require("shell").openExternal("https://discord.gg/DYavckB"); );
break; break;
default: case "http://forums.fusionfall.com/":
mainWindow.webContents.loadURL(url); require("shell").openExternal("https://discord.gg/DYavckB");
} break;
}); default:
mainWindow.webContents.loadURL(url);
}
});
} }

View File

@ -1,39 +1,40 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>OpenFusion: Initial Setup</title> <title>OpenFusion: Initial Setup</title>
</head> </head>
<body <body
style=" style="
overflow: hidden; overflow: hidden;
background-color: #000; background-color: #000;
user-select: none; user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
" "
> >
<center> <center>
<div> <div>
<img src="assets/img/of-3.png" width="256" /> <img src="assets/img/of-3.png" width="256" />
<div> <div>
<img src="assets/img/spinner.gif" width="50px" /> <img src="assets/img/spinner.gif" width="50px" />
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<p <p
style=" style="
text-shadow: 1px 1px 8px #4349c4; text-shadow: 1px 1px 8px #4349c4;
color: #4a76b7; color: #4a76b7;
font-size: 18px; font-size: 18px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, font-family: -apple-system, BlinkMacSystemFont,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Sans', sans-serif, 'Apple Color Emoji',
'Noto Color Emoji'; 'Segoe UI Emoji', 'Segoe UI Symbol',
" 'Noto Color Emoji';
> "
OpenFusion is setting up...<br />Please wait - this should take >
<br />less than a minute. OpenFusion is setting up...<br />Please wait - this
</p> should take <br />less than a minute.
</div> </p>
</div> </div>
</center> </div>
</body> </center>
</body>
</html> </html>

16530
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +1,71 @@
{ {
"name": "openfusionclient", "name": "openfusionclient",
"version": "1.4.0", "version": "1.4.0",
"description": "OpenFusionClient", "description": "OpenFusionClient",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"postinstall": "npx patch-package && npm explore electron-prebuilt -- npm run postinstall", "postinstall": "npx patch-package && npm explore electron-prebuilt -- npm run postinstall",
"start": "electron .", "start": "electron .",
"build": "node build.js", "build": "node build.js",
"pack": "electron-builder --win --ia32 --dir", "pack": "electron-builder --win --ia32 --dir",
"dist": "electron-builder --win --ia32", "dist": "electron-builder --win --ia32",
"prettier": "npx prettier --write ." "prettier": "npx prettier --write ."
}, },
"author": "OpenFusion Contributors", "author": "OpenFusion Contributors",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"electron-builder": "^22.10.5", "electron-builder": "^22.10.5",
"electron-prebuilt": "^0.31.2", "electron-prebuilt": "^0.31.2",
"patch-package": "^6.4.7", "patch-package": "^6.4.7",
"prettier": "^2.7.1" "prettier": "^2.7.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/OpenFusionProject/Client.git" "url": "https://github.com/OpenFusionProject/Client.git"
}, },
"build": { "build": {
"appId": "xyz.openfusion.client", "appId": "xyz.openfusion.client",
"productName": "OpenFusionClient", "productName": "OpenFusionClient",
"copyright": "© 2020-2022 OpenFusion Contributors", "copyright": "© 2020-2022 OpenFusion Contributors",
"electronDownload": { "electronDownload": {
"version": "0.31.2", "version": "0.31.2",
"platform": "win32", "platform": "win32",
"arch": "ia32" "arch": "ia32"
}, },
"electronVersion": "0.31.2", "electronVersion": "0.31.2",
"win": { "win": {
"asar": false, "asar": false,
"target": [ "target": [
{ {
"target": "nsis", "target": "nsis",
"arch": "ia32" "arch": "ia32"
}, },
{ {
"target": "zip", "target": "zip",
"arch": "ia32" "arch": "ia32"
} }
] ]
}, },
"nsis": { "nsis": {
"createDesktopShortcut": true, "createDesktopShortcut": true,
"createStartMenuShortcut": true "createStartMenuShortcut": true
}, },
"files": [ "files": [
"!patches${/*}", "!patches${/*}",
"!*.php", "!*.php",
"!rankurl.txt", "!rankurl.txt",
"!README.md", "!README.md",
"!.npmrc" "!.npmrc"
], ],
"extraFiles": [ "extraFiles": [
{ {
"from": "build/utils", "from": "build/utils",
"to": "utils" "to": "utils"
} }
], ],
"afterPack": "./build/delete-default-app.js" "afterPack": "./build/delete-default-app.js"
}, },
"dependencies": { "dependencies": {
"fs-extra": "^0.30.0" "fs-extra": "^0.30.0"
} }
} }