mirror of
https://github.com/OpenFusionProject/Client.git
synced 2026-02-05 16:20:04 +00:00
Compare commits
30 Commits
1.4
...
e19098a13e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e19098a13e | ||
|
|
48e2052748 | ||
|
|
7b3de1fe52 | ||
|
|
675a5fce50 | ||
|
|
2bf916ea58 | ||
|
|
d554b6b968 | ||
|
|
5da0da1981 | ||
|
|
101de9d68b | ||
|
|
d0f947c4a5 | ||
|
|
4726a50be7 | ||
|
|
3d9107a7f1 | ||
|
|
c1db7bc047 | ||
|
|
51f7eaf33d | ||
|
|
7bc438d76a | ||
|
|
3c0b07e61a | ||
|
|
f9c041edc9 | ||
|
|
fd92f2de5e | ||
|
|
51a876cf2b | ||
|
|
2640c8f1a6 | ||
|
|
e2b704a701 | ||
|
|
9a083d7a04 | ||
|
|
c964e840e4 | ||
| 0060f37e6c | |||
| 9bfe3d6d99 | |||
| 63c4616645 | |||
|
|
645e5d4279 | ||
|
|
7ce21cdddc | ||
|
|
8d6e546628 | ||
|
|
6e881cbfaf | ||
|
|
8d5a8df023 |
33
.prettierignore
Normal file
33
.prettierignore
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.js
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
.env.local
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
locales/
|
||||||
|
*.pak
|
||||||
|
*.bin
|
||||||
|
*.php
|
||||||
|
rankurl.txt
|
||||||
|
icudtl.dat
|
||||||
|
version
|
||||||
|
resources/app/files/rankurl.txt
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
UnityBugReporter.exe
|
||||||
|
*.min.*
|
||||||
12
.prettierrc
Normal file
12
.prettierrc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"useTabs": false,
|
||||||
|
"tabWidth": 4,
|
||||||
|
"singleQuote": false,
|
||||||
|
"semi": true,
|
||||||
|
"bracketSameLine": false,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"jsxSingleQuote": false,
|
||||||
|
"quoteProps": "as-needed",
|
||||||
|
"endOfLine": "lf"
|
||||||
|
}
|
||||||
9
.vscode/extensions.json
vendored
Normal file
9
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
|
||||||
|
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||||
|
|
||||||
|
// List of extensions which should be recommended for users of this workspace.
|
||||||
|
"recommendations": ["esbenp.prettier-vscode"],
|
||||||
|
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||||
|
"unwantedRecommendations": []
|
||||||
|
}
|
||||||
21
LICENSE.md
Normal file
21
LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020-2023 OpenFusion Contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
45
README.md
45
README.md
@@ -1,2 +1,45 @@
|
|||||||
# OpenFusionClient
|
# OpenFusionClient
|
||||||
Electron app for joining OpenFusion servers
|
[](https://github.com/OpenFusionProject/OpenFusionClient/releases/latest) [](https://discord.gg/DYavckB)[](https://github.com/OpenFusionProject/OpenFusionClient/blob/master/LICENSE.md)
|
||||||
|
|
||||||
|
An Electron app that allows you to easily join FusionFall servers.
|
||||||
|
|
||||||
|
It automatically installs FF's custom build of Unity Web Player, manages text files such as `assetInfo.php`/`loginInfo.php`, and embeds the game, all in a few clicks!
|
||||||
|
|
||||||
|
For an overview of how the game client worked originally, please see [this section in the OpenFusion README](https://github.com/OpenFusionProject/OpenFusion#architecture ).
|
||||||
|
|
||||||
|
## Disclaimer
|
||||||
|
|
||||||
|
This repository does not contain any code from the actual FusionFall game client. **Think of it more as a launcher:** it abstracts away having to use a NPAPI plugin capable web browser, along with having to host a HTTP server for it to connect to.
|
||||||
|
|
||||||
|
In addition, if you are interested in contributing: do note that **this project likely cannot utilize more modern Javascript techniques**. In order to use NPAPI plugins, a very old version of Electron was needed (0.31.0). This limits the project to only a portion of ES5 in non-strict mode, and a reduced subset of Node/Electron APIs.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Provided that you have npm installed, clone the repository, then run install like so:
|
||||||
|
```
|
||||||
|
git clone https://github.com/OpenFusionProject/OpenFusionClient.git
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
After that has completed you can then test OpenFusionClient:
|
||||||
|
```
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
If you would like to package it as a standalone win32 application:
|
||||||
|
```
|
||||||
|
npm run pack
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then compress the application directory into a zip file and installer for distribution:
|
||||||
|
```
|
||||||
|
npm run dist
|
||||||
|
```
|
||||||
|
|
||||||
|
Before opening a PR or running pack/dist, please do a code formatting pass:
|
||||||
|
```
|
||||||
|
npm run prettier
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
MIT unless specified otherwise
|
||||||
|
|||||||
@@ -49,29 +49,29 @@ img {
|
|||||||
body {
|
body {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
|
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
|
||||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||||
}
|
}
|
||||||
|
|
||||||
#of-versionnumber {
|
#of-versionnumberdiv {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 4px;
|
bottom: 4px;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-image: url('../../assets/img/btn-primary-bg.png');
|
background-image: url("../../assets/img/btn-primary-bg.png");
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-success {
|
.btn-success {
|
||||||
background-image: url('../../assets/img/btn-success-bg.png');
|
background-image: url("../../assets/img/btn-success-bg.png");
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-danger {
|
.btn-danger {
|
||||||
background-image: url('../../assets/img/btn-danger-bg.png');
|
background-image: url("../../assets/img/btn-danger-bg.png");
|
||||||
background-repeat: repeat;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
$('[data-bs-tooltip]').tooltip();
|
$("[data-bs-tooltip]").tooltip();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,17 +3,17 @@ var today = new Date();
|
|||||||
|
|
||||||
// Check Christmas season: Date constructor in Javascript uses an index
|
// Check Christmas season: Date constructor in Javascript uses an index
|
||||||
// so 11 is Dec. of this year, and 12 is Jan. of the next
|
// so 11 is Dec. of this year, and 12 is Jan. of the next
|
||||||
var christmasBegin = new Date(today.getFullYear(), 11, 23);
|
var christmasBegin = new Date(today.getFullYear(), 11, 23);
|
||||||
var christmasEnd = new Date(today.getFullYear(), 12, 8);
|
var christmasEnd = new Date(today.getFullYear(), 12, 8);
|
||||||
var sf
|
var sf;
|
||||||
|
|
||||||
if((today >= christmasBegin && today <= christmasEnd)) {
|
if (today >= christmasBegin && today <= christmasEnd) {
|
||||||
console.log("Christmas Activated.");
|
console.log("Christmas Activated.");
|
||||||
sf = new Snowflakes({zIndex: -100});
|
sf = new Snowflakes({ zIndex: -100 });
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopEasterEggs(){
|
function stopEasterEggs() {
|
||||||
if (sf != null) {
|
if (sf != null) {
|
||||||
sf.destroy();
|
sf.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ var gameRunning = false;
|
|||||||
|
|
||||||
// Uncomment and enter credentials to skip login screen
|
// Uncomment and enter credentials to skip login screen
|
||||||
function authDoCallback(param) {
|
function authDoCallback(param) {
|
||||||
/*var unity = document.getElementById('Unity_embed');
|
/*var unity = document.getElementById('Unity_embed');
|
||||||
unity.SendMessage("GlobalManager", "SetTEGid", "player");
|
unity.SendMessage("GlobalManager", "SetTEGid", "player");
|
||||||
unity.SendMessage("GlobalManager", "SetAuthid", "0");
|
unity.SendMessage("GlobalManager", "SetAuthid", "0");
|
||||||
unity.SendMessage("GlobalManager", "DoAuth", 0);*/
|
unity.SendMessage("GlobalManager", "DoAuth", 0);*/
|
||||||
@@ -14,67 +14,85 @@ function authDoCallback(param) {
|
|||||||
function MarkProgress(param) {}
|
function MarkProgress(param) {}
|
||||||
|
|
||||||
function redirect(html) {
|
function redirect(html) {
|
||||||
ipc.send("exit", 0);
|
ipc.send("exit", 0);
|
||||||
}
|
}
|
||||||
function HomePage(param) {
|
function HomePage(param) {
|
||||||
ipc.send("exit", 0);
|
ipc.send("exit", 0);
|
||||||
}
|
}
|
||||||
function PageOut(param) {
|
function PageOut(param) {
|
||||||
ipc.send("exit", 0);
|
ipc.send("exit", 0);
|
||||||
}
|
}
|
||||||
function updateSocialOptions(param) {
|
function updateSocialOptions(param) {
|
||||||
ipc.send("exit", 0);
|
ipc.send("exit", 0);
|
||||||
}
|
}
|
||||||
function PayPage(param) {
|
function PayPage(param) {
|
||||||
ipc.send("exit", 0);
|
ipc.send("exit", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unity invoked methods end //
|
// Unity invoked methods end //
|
||||||
|
|
||||||
function onResize() {
|
function onResize() {
|
||||||
if (gameRunning == true) {
|
if (gameRunning == true) {
|
||||||
var unity = document.getElementById('Unity_embed');
|
var unity = document.getElementById("Unity_embed");
|
||||||
unity.style.width = window.innerWidth + 'px';
|
unity.style.width = window.innerWidth + "px";
|
||||||
unity.style.height = window.innerHeight + 'px';
|
unity.style.height = window.innerHeight + "px";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function launchGame() {
|
function launchGame() {
|
||||||
gameRunning = true
|
gameRunning = true;
|
||||||
|
|
||||||
var sel = document.getElementById("of-serverselector");
|
var sel = document.getElementById("of-serverselector");
|
||||||
sel.remove()
|
sel.remove();
|
||||||
|
|
||||||
document.body.style.overflow = "hidden";
|
|
||||||
|
|
||||||
var object = document.createElement('object');
|
document.body.style.overflow = "hidden";
|
||||||
object.setAttribute('classid', "clsid:444785F1-DE89-4295-863A-D46C3A781394");
|
|
||||||
object.setAttribute('codebase', "undefined/UnityWebPlayer.cab#version=2,0,0,0");
|
|
||||||
object.setAttribute('id', "Unity_object");
|
|
||||||
object.setAttribute('width', "1264");
|
|
||||||
object.setAttribute('height', "661");
|
|
||||||
|
|
||||||
var embed = document.createElement('embed');
|
var object = document.createElement("object");
|
||||||
embed.setAttribute('type', "application/vnd.unity");
|
object.setAttribute(
|
||||||
embed.setAttribute('pluginspage', "http://www.unity3d.com/unity-web-player-2.x");
|
"classid",
|
||||||
embed.setAttribute('id', "Unity_embed");
|
"clsid:444785F1-DE89-4295-863A-D46C3A781394"
|
||||||
embed.setAttribute('width', "1280");
|
);
|
||||||
embed.setAttribute('height', "680");
|
object.setAttribute(
|
||||||
embed.setAttribute('src', window.asseturl+"main.unity3d");
|
"codebase",
|
||||||
embed.setAttribute('disablecontdparaextmenu', "true");
|
"undefined/UnityWebPlayer.cab#version=2,0,0,0"
|
||||||
embed.setAttribute('bordercolor', "000000");
|
);
|
||||||
embed.setAttribute('backgroundcolor', "000000");
|
object.setAttribute("id", "Unity_object");
|
||||||
embed.setAttribute('disableContextMenu', true);
|
object.setAttribute("width", "1264");
|
||||||
embed.setAttribute('textcolor', "ccffff");
|
object.setAttribute("height", "661");
|
||||||
embed.setAttribute('logoimage', "assets/img/unity_dexlabs.png");
|
|
||||||
embed.setAttribute('progressbarimage', "assets/img/unity_loadingbar.png");
|
|
||||||
embed.setAttribute('progressframeimage', "assets/img/unity_loadingframe.png");
|
|
||||||
embed.setAttribute('autoupdateurlsignature', "42180ee5edc4e3d4dd706bcc17cedd8d6ec7b7ac463071fd34ab97fe181f1a78df31db5feb4526677e4f69ef53acaff44471591e68b87f041c80fd54765f0d5725b08aa28f5acf7716ffb2a04e971269f35925c7e38d57dd78f6a206530caaa3da7e32f07f19810efc0ebf29a4eae976a925ad9cc5beb4dd51564c67dc489033");
|
|
||||||
embed.setAttribute('autoupdateurl', "http://wp-cartoonnetwork.unity3d.com/ff/big/beta-20111013/autodownload_webplugin_beta");
|
|
||||||
|
|
||||||
var div = document.getElementById('client');
|
var embed = document.createElement("embed");
|
||||||
object.appendChild(embed);
|
embed.setAttribute("type", "application/vnd.unity");
|
||||||
div.appendChild(object);
|
embed.setAttribute(
|
||||||
document.title = "OpenFusion"
|
"pluginspage",
|
||||||
onResize();
|
"http://www.unity3d.com/unity-web-player-2.x"
|
||||||
}
|
);
|
||||||
|
embed.setAttribute("id", "Unity_embed");
|
||||||
|
embed.setAttribute("width", "1280");
|
||||||
|
embed.setAttribute("height", "680");
|
||||||
|
embed.setAttribute("src", window.asseturl + "main.unity3d");
|
||||||
|
embed.setAttribute("disablecontdparaextmenu", "true");
|
||||||
|
embed.setAttribute("bordercolor", "000000");
|
||||||
|
embed.setAttribute("backgroundcolor", "000000");
|
||||||
|
embed.setAttribute("disableContextMenu", true);
|
||||||
|
embed.setAttribute("textcolor", "ccffff");
|
||||||
|
embed.setAttribute("logoimage", "assets/img/unity_dexlabs.png");
|
||||||
|
embed.setAttribute("progressbarimage", "assets/img/unity_loadingbar.png");
|
||||||
|
embed.setAttribute(
|
||||||
|
"progressframeimage",
|
||||||
|
"assets/img/unity_loadingframe.png"
|
||||||
|
);
|
||||||
|
embed.setAttribute(
|
||||||
|
"autoupdateurlsignature",
|
||||||
|
"42180ee5edc4e3d4dd706bcc17cedd8d6ec7b7ac463071fd34ab97fe181f1a78df31db5feb4526677e4f69ef53acaff44471591e68b87f041c80fd54765f0d5725b08aa28f5acf7716ffb2a04e971269f35925c7e38d57dd78f6a206530caaa3da7e32f07f19810efc0ebf29a4eae976a925ad9cc5beb4dd51564c67dc489033"
|
||||||
|
);
|
||||||
|
embed.setAttribute(
|
||||||
|
"autoupdateurl",
|
||||||
|
"http://wp-cartoonnetwork.unity3d.com/ff/big/beta-20111013/autodownload_webplugin_beta"
|
||||||
|
);
|
||||||
|
|
||||||
|
var div = document.getElementById("client");
|
||||||
|
object.appendChild(embed);
|
||||||
|
div.appendChild(object);
|
||||||
|
document.title = "OpenFusion";
|
||||||
|
onResize();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,237 +1,368 @@
|
|||||||
var remote = require("remote");
|
var remote = require("remote");
|
||||||
var remotefs = remote.require('fs-extra');
|
var remotefs = remote.require("fs-extra");
|
||||||
|
var dns = remote.require("dns");
|
||||||
|
|
||||||
var userdir = remote.require('app').getPath('userData');
|
var userdir = remote.require("app").getPath("userData");
|
||||||
var versionarray
|
var versionarray;
|
||||||
var serverarray
|
var serverarray;
|
||||||
var config
|
var config;
|
||||||
|
|
||||||
function enableServerListButtons() {
|
function enableServerListButtons() {
|
||||||
$('#of-connect-button').removeClass('disabled');
|
$("#of-connect-button").removeClass("disabled");
|
||||||
$('#of-connect-button').prop('disabled', false);
|
$("#of-connect-button").prop("disabled", false);
|
||||||
$('#of-editserver-button').removeClass('disabled');
|
$("#of-editserver-button").removeClass("disabled");
|
||||||
$('#of-editserver-button').prop('disabled', false);
|
$("#of-editserver-button").prop("disabled", false);
|
||||||
$('#of-deleteserver-button').removeClass('disabled');
|
$("#of-deleteserver-button").removeClass("disabled");
|
||||||
$('#of-deleteserver-button').prop('disabled', false);
|
$("#of-deleteserver-button").prop("disabled", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableServerListButtons() {
|
function disableServerListButtons() {
|
||||||
$('#of-connect-button').addClass('disabled');
|
$("#of-connect-button").addClass("disabled");
|
||||||
$('#of-connect-button').prop('disabled', true);
|
$("#of-connect-button").prop("disabled", true);
|
||||||
$('#of-editserver-button').addClass('disabled');
|
$("#of-editserver-button").addClass("disabled");
|
||||||
$('#of-editserver-button').prop('disabled', true);
|
$("#of-editserver-button").prop("disabled", true);
|
||||||
$('#of-deleteserver-button').addClass('disabled');
|
$("#of-deleteserver-button").addClass("disabled");
|
||||||
$('#of-deleteserver-button').prop('disabled', true);
|
$("#of-deleteserver-button").prop("disabled", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAppVersion() {
|
||||||
|
appversion = remote.require("app").getVersion();
|
||||||
|
|
||||||
|
// simplify version, ex. 1.4.0 -> 1.4,
|
||||||
|
// but only if a revision number isn't present
|
||||||
|
if (appversion.endsWith(".0")) {
|
||||||
|
return appversion.substr(0, appversion.length - 2);
|
||||||
|
} else {
|
||||||
|
return appversion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setAppVersionText() {
|
||||||
|
$("#of-aboutversionnumber").text("Version " + getAppVersion());
|
||||||
|
$("#of-versionnumber").text("v" + getAppVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
function addServer() {
|
function addServer() {
|
||||||
var jsontomodify = JSON.parse(remotefs.readFileSync(userdir+"\\servers.json"));
|
var jsontomodify = JSON.parse(
|
||||||
|
remotefs.readFileSync(userdir + "\\servers.json")
|
||||||
|
);
|
||||||
|
|
||||||
var server = {};
|
var server = {};
|
||||||
server['uuid'] = uuidv4();
|
server["uuid"] = uuidv4();
|
||||||
server['description'] = $("#addserver-descinput").val().length == 0 ? "My OpenFusion Server" : $("#addserver-descinput").val();
|
server["description"] =
|
||||||
server['ip'] = $("#addserver-ipinput").val().length == 0 ? "127.0.0.1:23000" : $("#addserver-ipinput").val();
|
$("#addserver-descinput").val().length == 0
|
||||||
server['version'] = $("#addserver-versionselect option:selected").text();
|
? "My OpenFusion Server"
|
||||||
//server['endpoint'] =
|
: $("#addserver-descinput").val();
|
||||||
|
server["ip"] =
|
||||||
|
$("#addserver-ipinput").val().length == 0
|
||||||
|
? "127.0.0.1:23000"
|
||||||
|
: $("#addserver-ipinput").val();
|
||||||
|
server["version"] = $("#addserver-versionselect option:selected").text();
|
||||||
|
//server['endpoint'] =
|
||||||
|
|
||||||
jsontomodify['servers'].push(server)
|
jsontomodify["servers"].push(server);
|
||||||
|
|
||||||
remotefs.writeFileSync(userdir+"\\servers.json", JSON.stringify(jsontomodify, null, 4));
|
remotefs.writeFileSync(
|
||||||
loadServerList();
|
userdir + "\\servers.json",
|
||||||
|
JSON.stringify(jsontomodify, null, 4)
|
||||||
|
);
|
||||||
|
loadServerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function editServer() {
|
function editServer() {
|
||||||
var jsontomodify = JSON.parse(remotefs.readFileSync(userdir+"\\servers.json"));
|
var jsontomodify = JSON.parse(
|
||||||
$.each(jsontomodify["servers"], function( key, value ) {
|
remotefs.readFileSync(userdir + "\\servers.json")
|
||||||
if(value["uuid"] == getSelectedServer()) {
|
);
|
||||||
value['description'] = $("#editserver-descinput").val().length == 0 ? value['description'] : $("#editserver-descinput").val();
|
$.each(jsontomodify["servers"], function (key, value) {
|
||||||
value['ip'] = $("#editserver-ipinput").val().length == 0 ? value['ip'] : $("#editserver-ipinput").val();
|
if (value["uuid"] == getSelectedServer()) {
|
||||||
value['version'] = $("#editserver-versionselect option:selected").text();
|
value["description"] =
|
||||||
}
|
$("#editserver-descinput").val().length == 0
|
||||||
});
|
? value["description"]
|
||||||
|
: $("#editserver-descinput").val();
|
||||||
|
value["ip"] =
|
||||||
|
$("#editserver-ipinput").val().length == 0
|
||||||
|
? value["ip"]
|
||||||
|
: $("#editserver-ipinput").val();
|
||||||
|
value["version"] = $(
|
||||||
|
"#editserver-versionselect option:selected"
|
||||||
|
).text();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
remotefs.writeFileSync(userdir+"\\servers.json", JSON.stringify(jsontomodify, null, 4));
|
remotefs.writeFileSync(
|
||||||
loadServerList();
|
userdir + "\\servers.json",
|
||||||
|
JSON.stringify(jsontomodify, null, 4)
|
||||||
|
);
|
||||||
|
loadServerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteServer() {
|
function deleteServer() {
|
||||||
var jsontomodify = JSON.parse(remotefs.readFileSync(userdir+"\\servers.json"));
|
var jsontomodify = JSON.parse(
|
||||||
var result = jsontomodify['servers'].filter(function(obj) {return (obj.uuid === getSelectedServer())})[0];
|
remotefs.readFileSync(userdir + "\\servers.json")
|
||||||
|
);
|
||||||
|
var result = jsontomodify["servers"].filter(function (obj) {
|
||||||
|
return obj.uuid === getSelectedServer();
|
||||||
|
})[0];
|
||||||
|
|
||||||
var resultindex = jsontomodify['servers'].indexOf(result);
|
var resultindex = jsontomodify["servers"].indexOf(result);
|
||||||
|
|
||||||
jsontomodify['servers'].splice(resultindex, 1);
|
jsontomodify["servers"].splice(resultindex, 1);
|
||||||
|
|
||||||
remotefs.writeFileSync(userdir+"\\servers.json", JSON.stringify(jsontomodify, null, 4));
|
remotefs.writeFileSync(
|
||||||
loadServerList();
|
userdir + "\\servers.json",
|
||||||
|
JSON.stringify(jsontomodify, null, 4)
|
||||||
|
);
|
||||||
|
loadServerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreDefaultServers() {
|
function restoreDefaultServers() {
|
||||||
remotefs.copySync(__dirname+"\\defaults\\servers.json", userdir+"\\servers.json");
|
remotefs.copySync(
|
||||||
loadServerList();
|
__dirname + "\\defaults\\servers.json",
|
||||||
|
userdir + "\\servers.json"
|
||||||
|
);
|
||||||
|
loadServerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadGameVersions() {
|
function loadGameVersions() {
|
||||||
var versionjson = JSON.parse(remotefs.readFileSync(userdir+"\\versions.json"));
|
var versionjson = JSON.parse(
|
||||||
versionarray = versionjson['versions'];
|
remotefs.readFileSync(userdir + "\\versions.json")
|
||||||
$.each(versionarray, function( key, value ) {
|
);
|
||||||
$(new Option(value.name, 'val')).appendTo('#addserver-versionselect');
|
versionarray = versionjson["versions"];
|
||||||
$(new Option(value.name, 'val')).appendTo('#editserver-versionselect');
|
$.each(versionarray, function (key, value) {
|
||||||
});
|
$(new Option(value.name, "val")).appendTo("#addserver-versionselect");
|
||||||
|
$(new Option(value.name, "val")).appendTo("#editserver-versionselect");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadConfig() {
|
function loadConfig() {
|
||||||
// load config object globally
|
// load config object globally
|
||||||
config = JSON.parse(remotefs.readFileSync(userdir+"\\config.json"));
|
config = JSON.parse(remotefs.readFileSync(userdir + "\\config.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadServerList() {
|
function loadServerList() {
|
||||||
var serverjson = JSON.parse(remotefs.readFileSync(userdir+"\\servers.json"));
|
var serverjson = JSON.parse(
|
||||||
serverarray = serverjson['servers'];
|
remotefs.readFileSync(userdir + "\\servers.json")
|
||||||
|
);
|
||||||
|
serverarray = serverjson["servers"];
|
||||||
|
|
||||||
$(".server-listing-entry").remove(); // Clear out old stuff, if any
|
$(".server-listing-entry").remove(); // Clear out old stuff, if any
|
||||||
disableServerListButtons(); // Disable buttons until another server is selected
|
disableServerListButtons(); // Disable buttons until another server is selected
|
||||||
|
|
||||||
if (serverarray.length > 0) {
|
if (serverarray.length > 0) {
|
||||||
// Servers were found in the JSON
|
// Servers were found in the JSON
|
||||||
$("#server-listing-placeholder").attr("hidden",true);
|
$("#server-listing-placeholder").attr("hidden", true);
|
||||||
$.each(serverarray, function( key, value ) {
|
$.each(serverarray, function (key, value) {
|
||||||
// Create the row, and populate the cells
|
// Create the row, and populate the cells
|
||||||
var row = document.createElement('tr');
|
var row = document.createElement("tr");
|
||||||
row.className = 'server-listing-entry'
|
row.className = "server-listing-entry";
|
||||||
row.setAttribute('id', value.uuid);
|
row.setAttribute("id", value.uuid);
|
||||||
var cellName = document.createElement('td');
|
var cellName = document.createElement("td");
|
||||||
cellName.textContent = value.description
|
cellName.textContent = value.description;
|
||||||
var cellVersion = document.createElement('td');
|
var cellVersion = document.createElement("td");
|
||||||
cellVersion.textContent = value.version
|
cellVersion.textContent = value.version;
|
||||||
cellVersion.className = 'text-monospace'
|
cellVersion.className = "text-monospace";
|
||||||
|
|
||||||
row.appendChild(cellName);
|
row.appendChild(cellName);
|
||||||
row.appendChild(cellVersion);
|
row.appendChild(cellVersion);
|
||||||
$("#server-tablebody").append(row);
|
$("#server-tablebody").append(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// No servers are added, make sure placeholder is visible
|
// No servers are added, make sure placeholder is visible
|
||||||
$("#server-listing-placeholder").attr("hidden",false);
|
$("#server-listing-placeholder").attr("hidden", false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function performCacheSwap(newversion) {
|
||||||
|
var cacheroot = userdir + "\\..\\..\\LocalLow\\Unity\\Web Player\\Cache";
|
||||||
|
var currentcache = cacheroot + "\\Fusionfall";
|
||||||
|
var newcache = cacheroot + "\\" + newversion;
|
||||||
|
var record = userdir + "\\.lastver";
|
||||||
|
|
||||||
|
// if cache renaming would result in a no-op (ex. launching the same version
|
||||||
|
// two times), then skip it. this avoids permissions errors with multiple clients
|
||||||
|
// (file/folder is already open in another process)
|
||||||
|
var skip = false;
|
||||||
|
|
||||||
|
if (remotefs.existsSync(currentcache)) {
|
||||||
|
// cache already exists, find out what version it belongs to
|
||||||
|
if (remotefs.existsSync(record)) {
|
||||||
|
lastversion = remotefs.readFileSync(record);
|
||||||
|
if (lastversion != newversion) {
|
||||||
|
remotefs.renameSync(
|
||||||
|
currentcache,
|
||||||
|
cacheroot + "\\" + lastversion
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
"Cached version unchanged, renaming will be skipped"
|
||||||
|
);
|
||||||
|
skip = true;
|
||||||
|
}
|
||||||
|
console.log("Current cache is " + lastversion);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
"Couldn't find last version record; cache may get overwritten"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (remotefs.existsSync(newcache) || !skip) {
|
||||||
|
// rename saved cache to FusionFall
|
||||||
|
remotefs.renameSync(newcache, currentcache);
|
||||||
|
console.log("Current cache swapped to " + newversion);
|
||||||
|
}
|
||||||
|
|
||||||
|
// make note of what version we are launching for next launch
|
||||||
|
remotefs.writeFileSync(record, newversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For writing loginInfo.php, assetInfo.php, etc.
|
// For writing loginInfo.php, assetInfo.php, etc.
|
||||||
function setGameInfo(serverUUID) {
|
function setGameInfo(serverUUID) {
|
||||||
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
|
var result = serverarray.filter(function (obj) {
|
||||||
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
|
return obj.uuid === serverUUID;
|
||||||
|
})[0];
|
||||||
if(config['cache-swapping']) { // if cache swapping property exists AND is `true`, run cache swapping logic
|
var gameversion = versionarray.filter(function (obj) {
|
||||||
// Cache folder renaming
|
return obj.name === result.version;
|
||||||
var cachedir = userdir + '\\..\\..\\LocalLow\\Unity\\Web Player\\Cache';
|
})[0];
|
||||||
var curversion = cachedir + '\\Fusionfall';
|
|
||||||
var newversion = cachedir + '\\' + gameversion.name;
|
|
||||||
var record = userdir + '\\.lastver';
|
|
||||||
|
|
||||||
if (remotefs.existsSync(curversion)) {
|
// if cache swapping property exists AND is `true`, run cache swapping logic
|
||||||
// cache already exists
|
if (config["cache-swapping"]) {
|
||||||
// find out what version it belongs to
|
try {
|
||||||
if (remotefs.existsSync(record)) {
|
performCacheSwap(gameversion.name);
|
||||||
var lastversion = remotefs.readFileSync(record);
|
} catch (ex) {
|
||||||
remotefs.renameSync(curversion, cachedir + '\\' + lastversion);
|
console.log(
|
||||||
console.log('Cached version ' + lastversion);
|
"Error when swapping cache, it may get overwritten:\n" + ex
|
||||||
} else {
|
);
|
||||||
console.log(
|
}
|
||||||
"Couldn't find last version record; cache may get overwritten"
|
}
|
||||||
|
|
||||||
|
window.asseturl = gameversion.url; // gameclient.js needs to access this
|
||||||
|
|
||||||
|
remotefs.writeFileSync(__dirname + "\\assetInfo.php", asseturl);
|
||||||
|
if (result.hasOwnProperty("endpoint")) {
|
||||||
|
var httpendpoint = result.endpoint.replace("https://", "http://");
|
||||||
|
remotefs.writeFileSync(
|
||||||
|
__dirname + "\\rankurl.txt",
|
||||||
|
httpendpoint + "getranks"
|
||||||
);
|
);
|
||||||
}
|
// Write these out too
|
||||||
|
remotefs.writeFileSync(
|
||||||
|
__dirname + "\\sponsor.php",
|
||||||
|
httpendpoint + "upsell/sponsor.png"
|
||||||
|
);
|
||||||
|
remotefs.writeFileSync(
|
||||||
|
__dirname + "\\images.php",
|
||||||
|
httpendpoint + "upsell/"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Remove/default the endpoint related stuff, this server won't be using it
|
||||||
|
if (remotefs.existsSync(__dirname + "\\rankurl.txt")) {
|
||||||
|
remotefs.unlinkSync(__dirname + "\\rankurl.txt");
|
||||||
|
remotefs.writeFileSync(
|
||||||
|
__dirname + "\\sponsor.php",
|
||||||
|
"assets/img/welcome.png"
|
||||||
|
);
|
||||||
|
remotefs.writeFileSync(__dirname + "\\images.php", "assets/img/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remotefs.existsSync(newversion)) {
|
// Server address parsing
|
||||||
// rename saved cache to FusionFall
|
var address;
|
||||||
remotefs.renameSync(newversion, curversion);
|
var port;
|
||||||
console.log('Loaded cached ' + gameversion.name);
|
var sepPos = result.ip.indexOf(":");
|
||||||
|
if (sepPos > -1) {
|
||||||
|
address = result.ip.substr(0, sepPos);
|
||||||
|
port = result.ip.substr(sepPos + 1);
|
||||||
|
} else {
|
||||||
|
address = result.ip;
|
||||||
|
port = 23000; // default
|
||||||
}
|
}
|
||||||
|
|
||||||
// make note of what version we are launching for next launch
|
// DNS resolution. there is no synchronous version for some stupid reason
|
||||||
remotefs.writeFileSync(record, gameversion.name);
|
if (!address.match(/^[0-9.]+$/))
|
||||||
}
|
dns.resolve4(address, function (err, res) {
|
||||||
|
if (!err) {
|
||||||
window.asseturl = gameversion.url; // gameclient.js needs to access this
|
console.log("Resolved " + address + " to " + res[0]);
|
||||||
|
address = res[0];
|
||||||
remotefs.writeFileSync(__dirname+"\\assetInfo.php", asseturl);
|
} else {
|
||||||
remotefs.writeFileSync(__dirname+"\\loginInfo.php", result.ip);
|
console.log("Err: " + err.code);
|
||||||
|
}
|
||||||
if (result.hasOwnProperty('endpoint')) {
|
prepConnection(address, port);
|
||||||
var httpendpoint = result.endpoint.replace("https://", "http://")
|
});
|
||||||
remotefs.writeFileSync(__dirname+"\\rankurl.txt", httpendpoint+"getranks");
|
else {
|
||||||
// Write these out too
|
console.log(address + " is an IP; skipping DNS lookup");
|
||||||
remotefs.writeFileSync(__dirname+"\\sponsor.php", httpendpoint+"upsell/sponsor.png");
|
prepConnection(address, port);
|
||||||
remotefs.writeFileSync(__dirname+"\\images.php", httpendpoint+"upsell/");
|
|
||||||
} else {
|
|
||||||
// Remove/default the endpoint related stuff, this server won't be using it
|
|
||||||
if (remotefs.existsSync(__dirname+"\\rankurl.txt")) {
|
|
||||||
remotefs.unlinkSync(__dirname+"\\rankurl.txt");
|
|
||||||
remotefs.writeFileSync(__dirname+"\\sponsor.php", "assets/img/welcome.png");
|
|
||||||
remotefs.writeFileSync(__dirname+"\\images.php", "assets/img/");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prepConnection(address, port) {
|
||||||
|
var full = address + ":" + port;
|
||||||
|
console.log("Will connect to " + full);
|
||||||
|
remotefs.writeFileSync(__dirname + "\\loginInfo.php", full);
|
||||||
|
launchGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the UUID of the server with the selected background color.
|
// Returns the UUID of the server with the selected background color.
|
||||||
// Yes, there are probably better ways to go about this, but it works well enough.
|
// Yes, there are probably better ways to go about this, but it works well enough.
|
||||||
function getSelectedServer() {
|
function getSelectedServer() {
|
||||||
return $("#server-tablebody > tr.bg-primary").prop("id");
|
return $("#server-tablebody > tr.bg-primary").prop("id");
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToServer() {
|
function connectToServer() {
|
||||||
// Get ID of the selected server, which corresponds to its UUID in the json
|
// Get ID of the selected server, which corresponds to its UUID in the json
|
||||||
console.log("Connecting to server with UUID of " + getSelectedServer());
|
console.log("Connecting to server with UUID of " + getSelectedServer());
|
||||||
|
|
||||||
// Prevent the user from clicking anywhere else during the transition
|
// Prevent the user from clicking anywhere else during the transition
|
||||||
$('body,html').css('pointer-events','none');
|
$("body,html").css("pointer-events", "none");
|
||||||
stopEasterEggs();
|
stopEasterEggs();
|
||||||
$('#of-serverselector').fadeOut('slow', function() {
|
$("#of-serverselector").fadeOut("slow", function () {
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
$('body,html').css('pointer-events','');
|
$("body,html").css("pointer-events", "");
|
||||||
setGameInfo(getSelectedServer());
|
setGameInfo(getSelectedServer());
|
||||||
launchGame();
|
}, 200);
|
||||||
}, 200);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If applicable, deselect currently selected server.
|
// If applicable, deselect currently selected server.
|
||||||
function deselectServer() {
|
function deselectServer() {
|
||||||
disableServerListButtons();
|
disableServerListButtons();
|
||||||
$(".server-listing-entry").removeClass('bg-primary');
|
$(".server-listing-entry").removeClass("bg-primary");
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#server-table').on('click', '.server-listing-entry', function(event) {
|
$("#server-table").on("click", ".server-listing-entry", function (event) {
|
||||||
enableServerListButtons();
|
enableServerListButtons();
|
||||||
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
$(this).addClass("bg-primary").siblings().removeClass("bg-primary");
|
||||||
});
|
});
|
||||||
|
|
||||||
// QoL feature: if you double click on a server it will connect
|
// QoL feature: if you double click on a server it will connect
|
||||||
$('#server-table').on('dblclick', '.server-listing-entry', function(event) {
|
$("#server-table").on("dblclick", ".server-listing-entry", function (event) {
|
||||||
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
$(this).addClass("bg-primary").siblings().removeClass("bg-primary");
|
||||||
connectToServer();
|
connectToServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#of-editservermodal').on('show.bs.modal', function (e) {
|
$("#of-editservermodal").on("show.bs.modal", function (e) {
|
||||||
|
var jsontomodify = JSON.parse(
|
||||||
|
remotefs.readFileSync(userdir + "\\servers.json")
|
||||||
|
);
|
||||||
|
$.each(jsontomodify["servers"], function (key, value) {
|
||||||
|
if (value["uuid"] == getSelectedServer()) {
|
||||||
|
$("#editserver-descinput")[0].value = value["description"];
|
||||||
|
$("#editserver-ipinput")[0].value = value["ip"];
|
||||||
|
|
||||||
var jsontomodify = JSON.parse(remotefs.readFileSync(userdir+"\\servers.json"));
|
var versionIndex = -1;
|
||||||
$.each(jsontomodify["servers"], function( key, value ) {
|
$.each($("#editserver-versionselect")[0], function (key, val) {
|
||||||
if(value["uuid"] == getSelectedServer()) {
|
if (val.text === value["version"]) {
|
||||||
$("#editserver-descinput")[0].value = value['description'];
|
versionIndex = key;
|
||||||
$("#editserver-ipinput")[0].value = value['ip'];
|
}
|
||||||
|
});
|
||||||
var versionIndex = -1;
|
$("#editserver-versionselect")[0].selectedIndex = versionIndex;
|
||||||
$.each($("#editserver-versionselect")[0], function( key, val ) {
|
|
||||||
if(val.text === value['version']) {
|
|
||||||
versionIndex = key;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#editserver-versionselect")[0].selectedIndex = versionIndex;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#of-deleteservermodal').on('show.bs.modal', function (e) {
|
$("#of-deleteservermodal").on("show.bs.modal", function (e) {
|
||||||
var result = serverarray.filter(function(obj) {return (obj.uuid === getSelectedServer());})[0];
|
var result = serverarray.filter(function (obj) {
|
||||||
$("#deleteserver-servername").html(result.description);
|
return obj.uuid === getSelectedServer();
|
||||||
|
})[0];
|
||||||
|
$("#deleteserver-servername").html(result.description);
|
||||||
});
|
});
|
||||||
|
|||||||
28
build/afterpack.js
Normal file
28
build/afterpack.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const defaultdir = './dist/win-ia32-unpacked/resources/default_app'
|
||||||
|
const exefile = './dist/win-ia32-unpacked/OpenFusionClient.exe'
|
||||||
|
|
||||||
|
exports.default = function() {
|
||||||
|
// remove leftover files from default electron app
|
||||||
|
fs.rm(defaultdir, { recursive: true }, (err) => {
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// patch executable for large address awareness
|
||||||
|
fs.open(exefile, "r+", (err, fd) => {
|
||||||
|
if(!err) {
|
||||||
|
fs.write(
|
||||||
|
fd, new Uint8Array([0x22]), 0, 1, 0x166,
|
||||||
|
(err) => {
|
||||||
|
if(err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
fs.closeSync(fd);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
const dir = './dist/win-ia32-unpacked/resources/default_app'
|
|
||||||
|
|
||||||
exports.default = async function(context) {
|
|
||||||
fs.rmdir(dir, { recursive: true }, (err) => {
|
|
||||||
if (err) {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
62
build/utils/LICENSE.WEBPLAYER.md
Normal file
62
build/utils/LICENSE.WEBPLAYER.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
Web Player License Agreement
|
||||||
|
|
||||||
|
Last updated: June 21, 2013
|
||||||
|
|
||||||
|
PLEASE READ CAREFULLY: BY INSTALLING THE SOFTWARE (AS DEFINED BELOW), YOU (EITHER ON BEHALF OF YOURSELF AS AN INDIVIDUAL OR ON BEHALF OF AN ENTITY AS ITS AUTHORIZED REPRESENTATIVE) AGREE TO ALL OF THE TERMS OF THIS END USER LICENSE AGREEMENT REGARDING THE USE OF THE SOFTWARE.
|
||||||
|
1. GRANT OF LICENSE:
|
||||||
|
|
||||||
|
You may install this Software on your computer to experience Unity web content.
|
||||||
|
2. TITLE:
|
||||||
|
|
||||||
|
You acknowledge that no title to the intellectual property in the Software is transferred to you. Title, ownership, rights, and intellectual property rights in and to the Software shall remain that of Unity Technologies. The Software is protected by copyright laws of the United States and international treaties.
|
||||||
|
3. ANONYMOUS USAGE STATISTICS:
|
||||||
|
|
||||||
|
You accept that the first time the Unity Web Player is used, anonymous information about the computer it's loaded on is submitted to Unity Technologies ApS. This only happens once time, and contains no personally identifiable information. The information submitted is:
|
||||||
|
|
||||||
|
(a) Operating system and version
|
||||||
|
|
||||||
|
(b) The make of the CPU, and number of CPUs present
|
||||||
|
|
||||||
|
(c) The graphics card type and vendor name
|
||||||
|
|
||||||
|
(d) Graphics card driver name and version (example: "nv4disp.dll 6.10.93.71")
|
||||||
|
|
||||||
|
(e) Which graphics API is in use (example: "OpenGL 2.1" or "Direct3D 9.0c")
|
||||||
|
|
||||||
|
(f) Amount of system and video RAM present
|
||||||
|
|
||||||
|
(g) Current desktop resolution
|
||||||
|
|
||||||
|
(h) Version of the Unity Web Player
|
||||||
|
|
||||||
|
(i) A number describing whether running on Mac or Windows
|
||||||
|
|
||||||
|
(j) A checksum of all the data that gets sent to verify that it did transmit correctly
|
||||||
|
3. DISTRIBUTION:
|
||||||
|
|
||||||
|
You acknowledge that only Unity Technologies ApS and its designated distribution partners may distribute the Unity Web Player, without a special permission.
|
||||||
|
4. CEASE OF DISTRIBUTION:
|
||||||
|
|
||||||
|
In case Unity Technologies ApS and its designated distribution partners permanently cease to distribute the Unity Web Player, versions of the Unity Web Player that have previously been distributed by Unity Technologies ApS become freely redistributable.
|
||||||
|
5. DISCLAIMER OF WARRANTY:
|
||||||
|
|
||||||
|
YOU AGREE THAT UNITY TECHNOLOGIES APS HAS MADE NO EXPRESS WARRANTIES, ORAL OR WRITTEN, TO YOU REGARDING THE PRODUCTS AND THAT THE PRODUCTS ARE BEING PROVIDED TO YOU 'AS IS' WITHOUT WARRANTY OF ANY KIND. UNITY TECHNOLOGIES APS DISCLAIMS ANY AND ALL OTHER WARRANTIES, WHETHER EXPRESSED, IMPLIED, OR STATUTORY. YOUR RIGHTS MAY VARY DEPENDING ON THE STATE IN WHICH YOU LIVE. UNITY TECHNOLOGIES APS SHALL NOT BE LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, COVER, RELIANCE, OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THIS PRODUCT.
|
||||||
|
6. LIMITATION OF LIABILITY:
|
||||||
|
|
||||||
|
YOU USE THIS PROGRAM SOLELY AT YOUR OWN RISK. IN NO EVENT SHALL UNITY TECHNOLOGIES APS BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO ANY LOSS, OR OTHER INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND ARISING OUT OF THE USE OF THE SOFTWARE, EVEN IF UNITY TECHNOLOGIES APS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL UNITY TECHNOLOGIES APS BE LIABLE FOR ANY CLAIM, WHETHER IN CONTRACT, TORT, OR ANY OTHER THEORY OF LIABILITY, EXCEED THE COST OF THE SOFTWARE. THIS LIMITATION SHALL APPLY TO CLAIMS OF PERSONAL INJURY TO THE EXTENT PERMITTED BY LAW.
|
||||||
|
7. TERMINATION:
|
||||||
|
|
||||||
|
This Agreement shall terminate automatically if you fail to comply with the limitations described in this Agreement. No notice shall be required to effectuate such termination. Upon termination, you must remove and destroy all copies of the Software.
|
||||||
|
8. MISCELLANEOUS:
|
||||||
|
|
||||||
|
Severability: In the event of invalidity of any provision of this Agreement, the parties agree that such invalidity shall not affect the validity of the remaining portions of this Agreement.
|
||||||
|
|
||||||
|
Export: You agree that you will not export or re-export the Software outside of the jurisdiction in which you obtained it without the appropriate United States or foreign government licenses.
|
||||||
|
|
||||||
|
Governing Law: This Agreement will be governed by the laws of the State of Denmark as they are applied to agreements between Denmark residents entered into and to be performed entirely within Denmark. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed.
|
||||||
|
|
||||||
|
Entire Agreement: You agree that this is the entire agreement between you and Unity Technologies ApS, which supersedes any prior agreement, whether written or oral, and all other communications between Unity Technologies ApS and you relating to the subject matter of this Agreement.
|
||||||
|
|
||||||
|
Reservation of rights: All rights not expressly granted in this Agreement are reserved by Unity Technologies ApS.
|
||||||
|
|
||||||
|
Derivative work: Whether you are licensing the Software as an individual or on behalf of an entity, you may not: (a) reverse engineer, decompile, or disassemble the Software or attempt to discover the source code; (b) modify, or create derivative works based upon, the Software in whole or in part without the express written consent of Unity Technologies ApS; (c) distribute copies of the Software; (d) remove any proprietary notices or labels on the Software; (e) resell, lease, rent, transfer, sublicense, or otherwise transfer rights to the Software.
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
PUSHD %~dp0
|
|
||||||
.\UnityWebPlayer.exe /quiet /S
|
|
||||||
robocopy WebPlayer "%USERPROFILE%\AppData\LocalLow\Unity\WebPlayer" /s /e
|
|
||||||
del "%USERPROFILE%\AppData\LocalLow\Unity\WebPlayer\UnityBugReporter.exe"
|
|
||||||
POPD
|
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
"autoupdate-check": true,
|
"autoupdate-check": true,
|
||||||
"cache-swapping": true,
|
"cache-swapping": true,
|
||||||
"last-version-initialized": "1.4"
|
"last-version-initialized": "1.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
{
|
{
|
||||||
"uuid": "d9773558-6ddf-4d00-8803-d830a22a842b",
|
"uuid": "d9773558-6ddf-4d00-8803-d830a22a842b",
|
||||||
"description": "OpenFusion Public Server - Original",
|
"description": "OpenFusion Public Server - Original",
|
||||||
"ip": "144.202.52.9: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": "144.202.52.9: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": []
|
||||||
}
|
}
|
||||||
|
|||||||
582
index.html
582
index.html
@@ -1,139 +1,491 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
|
||||||
|
/>
|
||||||
|
<title>OpenFusion: Server Selector</title>
|
||||||
|
<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/css/openfusion.css" />
|
||||||
|
<link rel="stylesheet" href="assets/css/styles.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
<head>
|
<body
|
||||||
<meta charset="utf-8">
|
style="
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
background: rgb(0, 0, 0);
|
||||||
<title>OpenFusion: Server Selector</title>
|
width: 100%;
|
||||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
height: 100%;
|
||||||
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
|
margin: 0;
|
||||||
<link rel="stylesheet" href="assets/css/openfusion.css">
|
padding: 0;
|
||||||
<link rel="stylesheet" href="assets/css/styles.css">
|
clear: both;
|
||||||
</head>
|
"
|
||||||
|
onresize="onResize()"
|
||||||
<body style="background: rgb(0,0,0);width: 100%;height: 100%;margin: 0;padding: 0;clear:both;" 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"><img class="img-fluid" id="of-logo" src="assets/img/of-3.png" width="256">
|
<div class="col">
|
||||||
<p id="of-intro-text">Welcome to OpenFusion.<br>Select a server from the list below to get started.</p>
|
<img
|
||||||
|
class="img-fluid"
|
||||||
|
id="of-logo"
|
||||||
|
src="assets/img/of-3.png"
|
||||||
|
width="256"
|
||||||
|
/>
|
||||||
|
<p id="of-intro-text">
|
||||||
|
Welcome to OpenFusion.<br />Select a server from the
|
||||||
|
list below to get started.
|
||||||
|
</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" id="of-serverlist">
|
class="row d-sm-flex d-xl-flex justify-content-center justify-content-sm-center justify-content-xl-center"
|
||||||
<div class="col-8 mb-2">
|
id="of-serverlist"
|
||||||
<div class="table-responsive text-center border rounded border-primary" id="server-table">
|
>
|
||||||
<table class="table table-striped table-hover mb-0">
|
<div class="col-8 mb-2">
|
||||||
<thead>
|
<div
|
||||||
<tr>
|
class="table-responsive text-center border rounded border-primary"
|
||||||
<th>Description</th>
|
id="server-table"
|
||||||
<th>Game Version</th>
|
>
|
||||||
</tr>
|
<table class="table table-striped table-hover mb-0">
|
||||||
</thead>
|
<thead>
|
||||||
<tbody id="server-tablebody">
|
<tr>
|
||||||
<tr id="server-listing-placeholder">
|
<th>Description</th>
|
||||||
<td colspan="2">No servers added yet... perhaps you should find one?</td>
|
<th>Game Version</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</thead>
|
||||||
</table>
|
<tbody id="server-tablebody">
|
||||||
|
<tr id="server-listing-placeholder">
|
||||||
|
<td colspan="2">
|
||||||
|
No servers added yet... perhaps you
|
||||||
|
should find one?
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="row row-cols-2 d-xl-flex justify-content-center justify-content-xl-center"
|
||||||
|
id="of-serverbuttons"
|
||||||
|
style="padding-bottom: 16px"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="col-4 text-left d-inline-flex justify-content-xl-start"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="btn btn-success mr-1"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-bs-tooltip=""
|
||||||
|
data-placement="bottom"
|
||||||
|
id="of-addserver-button"
|
||||||
|
type="button"
|
||||||
|
title="Add Server"
|
||||||
|
data-target="#of-addservermodal"
|
||||||
|
onclick="deselectServer()"
|
||||||
|
>
|
||||||
|
<i class="fas fa-plus"></i>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-primary mr-1 disabled"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-bs-tooltip=""
|
||||||
|
data-placement="bottom"
|
||||||
|
id="of-editserver-button"
|
||||||
|
type="button"
|
||||||
|
title="Edit Server"
|
||||||
|
data-target="#of-editservermodal"
|
||||||
|
disabled=""
|
||||||
|
>
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="btn btn-danger mr-1 disabled"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-bs-tooltip=""
|
||||||
|
data-placement="bottom"
|
||||||
|
id="of-deleteserver-button"
|
||||||
|
type="button"
|
||||||
|
title="Delete Server"
|
||||||
|
data-target="#of-deleteservermodal"
|
||||||
|
disabled=""
|
||||||
|
>
|
||||||
|
<i class="fas fa-trash-alt"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 d-inline-flex justify-content-end">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary disabled"
|
||||||
|
id="of-connect-button"
|
||||||
|
type="button"
|
||||||
|
onclick="connectToServer()"
|
||||||
|
disabled=""
|
||||||
|
>
|
||||||
|
Connect <i
|
||||||
|
class="fas fa-angle-double-right"
|
||||||
|
></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row row-cols-2 d-xl-flex justify-content-center justify-content-xl-center" id="of-serverbuttons" style="padding-bottom: 16px;">
|
<div
|
||||||
<div class="col-4 text-left d-inline-flex justify-content-xl-start">
|
class="modal fade"
|
||||||
<button class="btn btn-success mr-1" data-toggle="modal" data-bs-tooltip="" data-placement="bottom" id="of-addserver-button" type="button" title="Add Server" data-target="#of-addservermodal" onclick="deselectServer()"><i class="fas fa-plus"></i></button>
|
role="dialog"
|
||||||
<button class="btn btn-primary mr-1 disabled" data-toggle="modal" data-bs-tooltip="" data-placement="bottom" id="of-editserver-button" type="button" title="Edit Server" data-target="#of-editservermodal" disabled=""><i class="fas fa-edit"></i></button>
|
tabindex="-1"
|
||||||
<button class="btn btn-danger mr-1 disabled" data-toggle="modal" data-bs-tooltip="" data-placement="bottom" id="of-deleteserver-button" type="button" title="Delete Server" data-target="#of-deleteservermodal" disabled=""><i class="fas fa-trash-alt"></i></button>
|
id="of-aboutmodal"
|
||||||
</div>
|
>
|
||||||
<div class="col-4 d-inline-flex justify-content-end">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<button class="btn btn-primary disabled" id="of-connect-button" type="button" onclick="connectToServer()" disabled="">Connect <i class="fas fa-angle-double-right"></i></button>
|
<div class="modal-content">
|
||||||
</div>
|
<div class="modal-header">
|
||||||
</div>
|
<h4 class="modal-title">About OpenFusionClient</h4>
|
||||||
</div>
|
<button
|
||||||
<div class="modal fade" role="dialog" tabindex="-1" id="of-aboutmodal">
|
type="button"
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
class="close"
|
||||||
<div class="modal-content">
|
data-dismiss="modal"
|
||||||
<div class="modal-header">
|
aria-label="Close"
|
||||||
<h4 class="modal-title">About OpenFusionClient</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
>
|
||||||
</div>
|
<span aria-hidden="true">×</span>
|
||||||
<div class="modal-body">
|
</button>
|
||||||
<p class="text-monospace">Version 1.4</p>
|
</div>
|
||||||
<p>©2020-2021 OpenFusion Contributors<br>OpenFusion is licensed under MIT.<br></p>
|
<div class="modal-body">
|
||||||
<a href="#of-restoreserversmodal" onclick="$('#of-aboutmodal').modal('toggle')" data-toggle="modal" data-target="#of-restoreserversmodal">Reset to Default Servers</a>
|
<p
|
||||||
</div>
|
id="of-aboutversionnumber"
|
||||||
<div class="modal-footer">
|
class="text-monospace"
|
||||||
<div class="row flex-fill">
|
>
|
||||||
<div class="col"><button class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="Github Page" onclick="window.open('https://github.com/OpenFusionProject/OpenFusion','_blank');"><i class="fab fa-github" style="font-size: 24px;"></i></button><button class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2" data-toggle="tooltip" data-bs-tooltip="" type="button" title="DIscord Chat" onclick="window.open('https://discord.gg/DYavckB','_blank');"><i class="fab fa-discord" style="font-size: 24px; position:relative; top: 1px;"></i></button></div>
|
APP_VERSION_NUMBER
|
||||||
<div class="col text-right"><button class="btn btn-primary border rounded border-primary" type="button" data-dismiss="modal">Close</button></div>
|
</p>
|
||||||
|
<p>
|
||||||
|
©2020-2023 OpenFusion Contributors<br />OpenFusion
|
||||||
|
is licensed under MIT.<br />
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href="#of-restoreserversmodal"
|
||||||
|
onclick="$('#of-aboutmodal').modal('toggle')"
|
||||||
|
data-toggle="modal"
|
||||||
|
data-target="#of-restoreserversmodal"
|
||||||
|
>Reset to Default Servers</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="row flex-fill">
|
||||||
|
<div class="col">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary pb-1 pt-1 mr-2 pl-2 pr-2"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-bs-tooltip=""
|
||||||
|
type="button"
|
||||||
|
title="Github Page"
|
||||||
|
onclick="window.open('https://github.com/OpenFusionProject/OpenFusion','_blank');"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="fab fa-github"
|
||||||
|
style="font-size: 24px"
|
||||||
|
></i></button
|
||||||
|
><button
|
||||||
|
class="btn btn-primary border rounded border-primary pb-1 pt-1 pl-2 pr-2"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-bs-tooltip=""
|
||||||
|
type="button"
|
||||||
|
title="Discord Chat"
|
||||||
|
onclick="window.open('https://discord.gg/DYavckB','_blank');"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="fab fa-discord"
|
||||||
|
style="
|
||||||
|
font-size: 24px;
|
||||||
|
position: relative;
|
||||||
|
top: 1px;
|
||||||
|
"
|
||||||
|
></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col text-right">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
>
|
||||||
|
Close
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div class="modal fade" role="dialog" tabindex="-1" id="of-addservermodal">
|
class="modal fade"
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
role="dialog"
|
||||||
<div class="modal-content">
|
tabindex="-1"
|
||||||
<div class="modal-header">
|
id="of-addservermodal"
|
||||||
<h4 class="modal-title">Add Server</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">Add Server</h4>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="addserver-form" class="needs-validation">
|
||||||
|
<label for="addserver-descinput"
|
||||||
|
>Server Description</label
|
||||||
|
><input
|
||||||
|
class="form-control form-row w-75"
|
||||||
|
type="text"
|
||||||
|
id="addserver-descinput"
|
||||||
|
placeholder="My OpenFusion Server"
|
||||||
|
required=""
|
||||||
|
minlength="1"
|
||||||
|
maxlength="70"
|
||||||
|
/><label for="addserver-ipinput"
|
||||||
|
>Server IP</label
|
||||||
|
><input
|
||||||
|
class="form-control form-row w-75"
|
||||||
|
type="text"
|
||||||
|
id="addserver-ipinput"
|
||||||
|
placeholder="127.0.0.1:23000"
|
||||||
|
required=""
|
||||||
|
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"
|
||||||
|
>Game Version: </label
|
||||||
|
><select
|
||||||
|
class="form-control w-50"
|
||||||
|
id="addserver-versionselect"
|
||||||
|
required=""
|
||||||
|
style="margin-left: -5px"
|
||||||
|
></select>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-danger border-danger"
|
||||||
|
id="addserver-cancel"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
>
|
||||||
|
Cancel</button
|
||||||
|
><button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-success border-success"
|
||||||
|
id="addserver-savebutton"
|
||||||
|
type="submit"
|
||||||
|
data-dismiss="modal"
|
||||||
|
form="addserver-form"
|
||||||
|
onclick="addServer();"
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
|
||||||
<form id="addserver-form" class="needs-validation"><label for="addserver-descinput">Server Description</label><input class="form-control form-row w-75" type="text" id="addserver-descinput" placeholder="My OpenFusion Server" required="" minlength="1" maxlength="70"><label for="addserver-ipinput">Server IP</label><input class="form-control form-row w-75" type="text" id="addserver-ipinput" placeholder="127.0.0.1:23000" required="" 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">Game Version: </label><select class="form-control w-50" id="addserver-versionselect" required="" style="margin-left: -5px;"></select></form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="addserver-cancel" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-success border-success" id="addserver-savebutton" type="submit" data-dismiss="modal" form="addserver-form" onclick="addServer();">Save</button></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div class="modal fade" role="dialog" tabindex="-1" id="of-editservermodal">
|
class="modal fade"
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
role="dialog"
|
||||||
<div class="modal-content">
|
tabindex="-1"
|
||||||
<div class="modal-header">
|
id="of-editservermodal"
|
||||||
<h4 class="modal-title">Edit Server</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">Edit Server</h4>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="editserver-form" class="needs-validation">
|
||||||
|
<label for="editserver-descinput"
|
||||||
|
>Server Description</label
|
||||||
|
><input
|
||||||
|
class="form-control form-row w-75"
|
||||||
|
type="text"
|
||||||
|
id="editserver-descinput"
|
||||||
|
placeholder="My OpenFusion Server"
|
||||||
|
required=""
|
||||||
|
minlength="1"
|
||||||
|
maxlength="70"
|
||||||
|
/><label for="addserver-ipinput"
|
||||||
|
>Server IP</label
|
||||||
|
><input
|
||||||
|
class="form-control form-row w-75"
|
||||||
|
type="text"
|
||||||
|
id="editserver-ipinput"
|
||||||
|
placeholder="127.0.0.1:23000"
|
||||||
|
required=""
|
||||||
|
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-versionselect"
|
||||||
|
>Game Version: </label
|
||||||
|
><select
|
||||||
|
class="form-control w-50"
|
||||||
|
id="editserver-versionselect"
|
||||||
|
required=""
|
||||||
|
style="margin-left: -5px"
|
||||||
|
></select>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-danger border-danger"
|
||||||
|
id="editserver-cancel"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
>
|
||||||
|
Cancel</button
|
||||||
|
><button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-success border-success"
|
||||||
|
id="addserver-savebutton"
|
||||||
|
type="submit"
|
||||||
|
data-dismiss="modal"
|
||||||
|
form="editserver-form"
|
||||||
|
onclick="editServer();"
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
|
||||||
<form id="editserver-form" class="needs-validation"><label for="editserver-descinput">Server Description</label><input class="form-control form-row w-75" type="text" id="editserver-descinput" placeholder="My OpenFusion Server" required="" minlength="1" maxlength="70"><label for="addserver-ipinput">Server IP</label><input class="form-control form-row w-75" type="text" id="editserver-ipinput" placeholder="127.0.0.1:23000" required="" 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-versionselect">Game Version: </label><select class="form-control w-50" id="editserver-versionselect" required="" style="margin-left: -5px;"></select></form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="editserver-cancel" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-success border-success" id="addserver-savebutton" type="submit" data-dismiss="modal" form="editserver-form" onclick="editServer();">Save</button></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div class="modal fade" role="dialog" tabindex="-1" id="of-deleteservermodal">
|
class="modal fade"
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
role="dialog"
|
||||||
<div class="modal-content">
|
tabindex="-1"
|
||||||
<div class="modal-header">
|
id="of-deleteservermodal"
|
||||||
<h4 class="modal-title">Are you sure?</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">Are you sure?</h4>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p class="lead">
|
||||||
|
Do you really want to delete<br />"<a
|
||||||
|
id="deleteserver-servername"
|
||||||
|
>SERVER_NAME</a
|
||||||
|
>"?<br /><br />You could always re-add it later.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
>
|
||||||
|
Cancel</button
|
||||||
|
><button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-danger border-danger"
|
||||||
|
id="deleteserver-button"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
onclick="deleteServer();"
|
||||||
|
>
|
||||||
|
Yes, Delete
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
|
||||||
<p class="lead">Do you really want to delete<br>"<a id="deleteserver-servername">SERVER_NAME</a>"?<br><br>You could always re-add it later.</p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="deleteserver-button" type="button" data-dismiss="modal" onclick="deleteServer();">Yes, Delete</button></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div
|
||||||
<div class="modal fade" role="dialog" tabindex="-1" id="of-restoreserversmodal">
|
class="modal fade"
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
role="dialog"
|
||||||
<div class="modal-content">
|
tabindex="-1"
|
||||||
<div class="modal-header">
|
id="of-restoreserversmodal"
|
||||||
<h4 class="modal-title">Are you sure?</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
>
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">Are you sure?</h4>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="close"
|
||||||
|
data-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
>
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p class="lead">
|
||||||
|
Do you really want to restore the default
|
||||||
|
servers?
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary border rounded border-primary"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
>
|
||||||
|
Cancel</button
|
||||||
|
><button
|
||||||
|
class="btn btn-primary border rounded border-primary btn-danger border-danger"
|
||||||
|
id="deleteserver-button"
|
||||||
|
type="button"
|
||||||
|
data-dismiss="modal"
|
||||||
|
onclick="restoreDefaultServers();"
|
||||||
|
>
|
||||||
|
Yes, Restore
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
|
||||||
<p class="lead">Do you really want to restore the default servers?</p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="deleteserver-button" type="button" data-dismiss="modal" onclick="restoreDefaultServers();">Yes, Restore</button></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div id="of-versionnumberdiv">
|
||||||
<div id="of-versionnumber"><a class="text-monospace text-secondary" href="#of-aboutmodal" data-toggle="modal" data-target="#of-aboutmodal">v1.4</a></div>
|
<a
|
||||||
</section>
|
id="of-versionnumber"
|
||||||
<section>
|
class="text-monospace text-secondary"
|
||||||
<div id="client" style="width: 100%;height: 100%;margin: 0;padding: 0;background: #000;clear:both;"></div>
|
href="#of-aboutmodal"
|
||||||
</section>
|
data-toggle="modal"
|
||||||
<script src="assets/js/jquery.min.js" onload="window.$ = window.jQuery = module.exports;"></script>
|
data-target="#of-aboutmodal"
|
||||||
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
>v0</a
|
||||||
<script src="assets/js/bs-init.js"></script>
|
>
|
||||||
<script src="assets/js/uuidv4.min.js"></script>
|
</div>
|
||||||
<script src="assets/js/serverselector.js"></script>
|
</section>
|
||||||
<script src="assets/js/gameclient.js"></script>
|
<section>
|
||||||
<script src="assets/js/snowflakes.min.js"></script>
|
<div
|
||||||
<script src="assets/js/eastereggs.js"></script>
|
id="client"
|
||||||
</body>
|
style="
|
||||||
|
width: 100%;
|
||||||
|
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>
|
||||||
|
|||||||
301
index.js
301
index.js
@@ -1,134 +1,211 @@
|
|||||||
var app = require('app'); // Module to control application life.
|
var app = require("app"); // Module to control application life.
|
||||||
var ipc = require('ipc');
|
var ipc = require("ipc");
|
||||||
var fs = require('fs-extra');
|
var fs = require("fs-extra");
|
||||||
var os = require('os');
|
var os = require("os");
|
||||||
var dialog = require('dialog');
|
var dialog = require("dialog");
|
||||||
var BrowserWindow = require('browser-window');
|
var BrowserWindow = require("browser-window");
|
||||||
|
|
||||||
var mainWindow = null;
|
var mainWindow = null;
|
||||||
|
|
||||||
app.commandLine.appendSwitch('--enable-npapi');
|
app.commandLine.appendSwitch("--enable-npapi");
|
||||||
|
|
||||||
function initialSetup(firstTime) {
|
function verifyUnity() {
|
||||||
// Display a small window to inform the user that the app is working
|
var dllpath =
|
||||||
setupWindow = new BrowserWindow({width: 275, height: 450, resizable: false, center:true, frame:false});
|
app.getPath("appData") +
|
||||||
setupWindow.loadUrl('file://' + __dirname + '/initialsetup.html');
|
"\\..\\LocalLow\\Unity\\WebPlayer\\player\\fusion-2.x.x\\webplayer_win.dll";
|
||||||
// Exec installUnity.bat and wait for it to finish.
|
|
||||||
var child = require('child_process').spawn('cmd.exe', ['/c', 'utils\\installUnity.bat']);
|
if (fs.existsSync(dllpath)) {
|
||||||
child.on('exit', function() {
|
var buff = fs.readFileSync(dllpath);
|
||||||
console.log("Unity installed.");
|
var hash = require("crypto")
|
||||||
if(!firstTime) { // migration from pre-1.4
|
.createHash("md5")
|
||||||
// Back everything up, just in case
|
.update(buff)
|
||||||
fs.copySync(app.getPath('userData')+"\\config.json", app.getPath('userData')+"\\config.json.bak");
|
.digest("hex");
|
||||||
fs.copySync(app.getPath('userData')+"\\servers.json", app.getPath('userData')+"\\servers.json.bak");
|
if (hash == "e5028405b4483de9e5e5fe9cd5f1e98f") {
|
||||||
fs.copySync(app.getPath('userData')+"\\versions.json", app.getPath('userData')+"\\versions.json.bak");
|
return true;
|
||||||
} else { // first-time setup
|
}
|
||||||
// Copy default servers
|
|
||||||
fs.copySync(__dirname+"\\defaults\\servers.json", app.getPath('userData')+"\\servers.json");
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
// Copy default versions and config
|
|
||||||
fs.copySync(__dirname+"\\defaults\\versions.json", app.getPath('userData')+"\\versions.json");
|
|
||||||
fs.copySync(__dirname+"\\defaults\\config.json", app.getPath('userData')+"\\config.json");
|
|
||||||
|
|
||||||
console.log("JSON files copied.");
|
|
||||||
setupWindow.destroy();
|
|
||||||
showMainWindow();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc.on("exit", function(id) {
|
function installUnity(callback) {
|
||||||
mainWindow.destroy();
|
var utilsdir = __dirname + "\\..\\..\\utils";
|
||||||
|
|
||||||
|
// if running in non-packaged / development mode, this dir will be slightly different
|
||||||
|
if (process.env.npm_node_execpath) {
|
||||||
|
utilsdir = app.getAppPath() + "\\build\\utils";
|
||||||
|
}
|
||||||
|
|
||||||
|
// run the installer silently
|
||||||
|
var child = require("child_process").spawn(
|
||||||
|
utilsdir + "\\UnityWebPlayer.exe",
|
||||||
|
["/quiet", "/S"]
|
||||||
|
);
|
||||||
|
child.on("exit", function () {
|
||||||
|
// overwrite 3.5.2 loader/player with FF's custom version
|
||||||
|
var dstfolder =
|
||||||
|
app.getPath("appData") + "\\..\\LocalLow\\Unity\\WebPlayer";
|
||||||
|
fs.copySync(utilsdir + "\\WebPlayer", dstfolder, { clobber: true });
|
||||||
|
// avoids error reporter popping up when closing Electron
|
||||||
|
fs.removeSync(dstfolder + "\\UnityBugReporter.exe");
|
||||||
|
console.log("Unity Web Player installed successfully.");
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initialSetup(firstTime) {
|
||||||
|
// Display a small window to inform the user that the app is working
|
||||||
|
setupWindow = new BrowserWindow({
|
||||||
|
width: 275,
|
||||||
|
height: 450,
|
||||||
|
resizable: false,
|
||||||
|
center: true,
|
||||||
|
frame: false,
|
||||||
|
});
|
||||||
|
setupWindow.loadUrl("file://" + __dirname + "/initialsetup.html");
|
||||||
|
installUnity(function () {
|
||||||
|
if (!firstTime) {
|
||||||
|
// migration from pre-1.4
|
||||||
|
// Back everything up, just in case
|
||||||
|
fs.copySync(
|
||||||
|
app.getPath("userData") + "\\config.json",
|
||||||
|
app.getPath("userData") + "\\config.json.bak"
|
||||||
|
);
|
||||||
|
fs.copySync(
|
||||||
|
app.getPath("userData") + "\\servers.json",
|
||||||
|
app.getPath("userData") + "\\servers.json.bak"
|
||||||
|
);
|
||||||
|
fs.copySync(
|
||||||
|
app.getPath("userData") + "\\versions.json",
|
||||||
|
app.getPath("userData") + "\\versions.json.bak"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// first-time setup
|
||||||
|
// Copy default servers
|
||||||
|
fs.copySync(
|
||||||
|
__dirname + "\\defaults\\servers.json",
|
||||||
|
app.getPath("userData") + "\\servers.json"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy default versions and config
|
||||||
|
fs.copySync(
|
||||||
|
__dirname + "\\defaults\\versions.json",
|
||||||
|
app.getPath("userData") + "\\versions.json"
|
||||||
|
);
|
||||||
|
fs.copySync(
|
||||||
|
__dirname + "\\defaults\\config.json",
|
||||||
|
app.getPath("userData") + "\\config.json"
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log("JSON files copied.");
|
||||||
|
setupWindow.destroy();
|
||||||
|
showMainWindow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ipc.on("exit", function (id) {
|
||||||
|
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')
|
if (process.platform != "darwin") app.quit();
|
||||||
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.
|
|
||||||
mainWindow = new BrowserWindow({width: 1280, height: 720, show: false, "web-preferences": {"plugins": true}});
|
|
||||||
mainWindow.setMinimumSize(640, 480);
|
|
||||||
|
|
||||||
// Check for first run
|
|
||||||
var configPath = app.getPath('userData') + "\\config.json";
|
|
||||||
try {
|
|
||||||
if (!fs.existsSync(configPath)) {
|
|
||||||
console.log("Config file not found. Running initial setup.");
|
|
||||||
initialSetup(true);
|
|
||||||
} else {
|
|
||||||
var config = fs.readJsonSync(configPath);
|
|
||||||
if(!config['last-version-initialized']) {
|
|
||||||
console.log("Pre-1.4 config detected. Running migration.");
|
|
||||||
initialSetup(false);
|
|
||||||
} else {
|
|
||||||
showMainWindow();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch(e) {
|
|
||||||
console.log("An error occurred while checking for the config.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Makes it so external links are opened in the system browser, not Electron
|
// Create the browser window.
|
||||||
mainWindow.webContents.on('new-window', function(e, url) {
|
mainWindow = new BrowserWindow({
|
||||||
e.preventDefault();
|
width: 1280,
|
||||||
require('shell').openExternal(url);
|
height: 720,
|
||||||
});
|
show: false,
|
||||||
|
"web-preferences": { plugins: true },
|
||||||
|
});
|
||||||
|
mainWindow.setMinimumSize(640, 480);
|
||||||
|
|
||||||
mainWindow.on('closed', function() {
|
// Check for first run
|
||||||
mainWindow = null;
|
var configPath = app.getPath("userData") + "\\config.json";
|
||||||
});
|
try {
|
||||||
|
if (!fs.existsSync(configPath)) {
|
||||||
|
console.log("Config file not found. Running initial setup.");
|
||||||
|
initialSetup(true);
|
||||||
|
} else {
|
||||||
|
var config = fs.readJsonSync(configPath);
|
||||||
|
if (!config["last-version-initialized"]) {
|
||||||
|
console.log("Pre-1.4 config detected. Running migration.");
|
||||||
|
initialSetup(false);
|
||||||
|
} else {
|
||||||
|
if (verifyUnity()) {
|
||||||
|
showMainWindow();
|
||||||
|
} else {
|
||||||
|
installUnity(showMainWindow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
console.log("An error occurred while checking for the config");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Makes it so external links are opened in the system browser, not Electron
|
||||||
|
mainWindow.webContents.on("new-window", function (e, url) {
|
||||||
|
e.preventDefault();
|
||||||
|
require("shell").openExternal(url);
|
||||||
|
});
|
||||||
|
|
||||||
|
mainWindow.on("closed", function () {
|
||||||
|
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.webContents.executeJavaScript("setAppVersionText();");
|
||||||
// everything's loaded, tell the renderer process to do its thing
|
mainWindow.show();
|
||||||
mainWindow.webContents.executeJavaScript("loadConfig();");
|
// everything's loaded, tell the renderer process to do its thing
|
||||||
mainWindow.webContents.executeJavaScript("loadGameVersions();");
|
mainWindow.webContents.executeJavaScript("loadConfig();");
|
||||||
mainWindow.webContents.executeJavaScript("loadServerList();");
|
mainWindow.webContents.executeJavaScript("loadGameVersions();");
|
||||||
});
|
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.loadURL(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,40 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenFusion: Initial Setup</title>
|
<title>OpenFusion: Initial Setup</title>
|
||||||
</head>
|
</head>
|
||||||
<body style="overflow:hidden;background-color:#000;user-select:none;-webkit-user-select:none;">
|
<body
|
||||||
<center>
|
style="
|
||||||
<div><img src="assets/img/of-3.png" width="256">
|
overflow: hidden;
|
||||||
|
background-color: #000;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<center>
|
||||||
<div>
|
<div>
|
||||||
<img src="assets/img/spinner.gif" width=50px/>
|
<img src="assets/img/of-3.png" width="256" />
|
||||||
|
<div>
|
||||||
|
<img src="assets/img/spinner.gif" width="50px" />
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 15px">
|
||||||
|
<p
|
||||||
|
style="
|
||||||
|
text-shadow: 1px 1px 8px #4349c4;
|
||||||
|
color: #4a76b7;
|
||||||
|
font-size: 18px;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont,
|
||||||
|
'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
||||||
|
'Noto Sans', sans-serif, 'Apple 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.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 15px;">
|
</center>
|
||||||
<p style='text-shadow:1px 1px 8px #4349C4;color:#4A76B7;font-size:18px;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple 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.</p>
|
</body>
|
||||||
</div>
|
</html>
|
||||||
</div>
|
|
||||||
</center>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
11453
package-lock.json
generated
11453
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
134
package.json
134
package.json
@@ -1,69 +1,75 @@
|
|||||||
{
|
{
|
||||||
"name": "openfusionclient",
|
"name": "OpenFusionClient",
|
||||||
"version": "1.4.0",
|
"version": "1.4.1",
|
||||||
"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",
|
"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 ."
|
||||||
},
|
|
||||||
"author": "OpenFusion Contributors",
|
|
||||||
"license": "MIT",
|
|
||||||
"devDependencies": {
|
|
||||||
"electron-prebuilt": "^0.31.2",
|
|
||||||
"patch-package": "^6.4.7",
|
|
||||||
"electron-builder": "^22.10.5"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/OpenFusionProject/Client.git"
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"appId": "xyz.openfusion.client",
|
|
||||||
"productName": "OpenFusionClient",
|
|
||||||
"copyright": "© 2020-2021 OpenFusion Contributors",
|
|
||||||
"electronDownload": {
|
|
||||||
"version": "0.31.2",
|
|
||||||
"platform": "win32",
|
|
||||||
"arch": "ia32"
|
|
||||||
},
|
},
|
||||||
"electronVersion": "0.31.2",
|
"author": "OpenFusion Contributors",
|
||||||
"win": {
|
"license": "MIT",
|
||||||
"asar": false,
|
"devDependencies": {
|
||||||
"target": [
|
"electron-builder": "^22.14.13",
|
||||||
{
|
"electron-prebuilt": "^0.31.2",
|
||||||
"target": "nsis",
|
"patch-package": "^6.5.1",
|
||||||
"arch": "ia32"
|
"prettier": "^2.7.1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/OpenFusionProject/OpenFusionClient.git"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"appId": "xyz.openfusion.client",
|
||||||
|
"productName": "OpenFusionClient",
|
||||||
|
"copyright": "© 2020-2023 OpenFusion Contributors",
|
||||||
|
"electronDownload": {
|
||||||
|
"version": "0.31.2",
|
||||||
|
"platform": "win32",
|
||||||
|
"arch": "ia32"
|
||||||
},
|
},
|
||||||
{
|
"electronVersion": "0.31.2",
|
||||||
"target": "zip",
|
"win": {
|
||||||
"arch": "ia32"
|
"asar": false,
|
||||||
}
|
"target": [
|
||||||
]
|
{
|
||||||
|
"target": "nsis",
|
||||||
|
"arch": "ia32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"target": "zip",
|
||||||
|
"arch": "ia32"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nsis": {
|
||||||
|
"createDesktopShortcut": true,
|
||||||
|
"createStartMenuShortcut": true
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"!patches${/*}",
|
||||||
|
"!.vscode${/*}",
|
||||||
|
"!*.php",
|
||||||
|
"!rankurl.txt",
|
||||||
|
"!README.md",
|
||||||
|
"!LICENSE.md",
|
||||||
|
"!.npmrc",
|
||||||
|
"!.prettierrc",
|
||||||
|
"!.prettierignore"
|
||||||
|
],
|
||||||
|
"extraFiles": [
|
||||||
|
"LICENSE.md",
|
||||||
|
{
|
||||||
|
"from": "build/utils",
|
||||||
|
"to": "utils"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"afterPack": "./build/afterpack.js"
|
||||||
},
|
},
|
||||||
"nsis": {
|
"dependencies": {
|
||||||
"createDesktopShortcut": true,
|
"fs-extra": "2.0.0"
|
||||||
"createStartMenuShortcut": true
|
}
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"!patches${/*}",
|
|
||||||
"!*.php",
|
|
||||||
"!rankurl.txt",
|
|
||||||
"!README.md",
|
|
||||||
"!.npmrc"
|
|
||||||
],
|
|
||||||
"extraFiles": [
|
|
||||||
{
|
|
||||||
"from": "build/utils",
|
|
||||||
"to": "utils"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"afterPack": "./build/delete-default-app.js"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"fs-extra": "^0.30.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user