Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 43f0c8c

Browse files
committed
Revise loader DLL to work under Wine, loading screen beta text, cleanup
1 parent d4dc403 commit 43f0c8c

4 files changed

Lines changed: 25 additions & 30 deletions

File tree

assets/js/server-selector.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// TODO: path.join in this file, pass in json paths from index.js
12
var remote = require("remote");
23
var remotefs = remote.require("fs-extra");
34
var dns = remote.require("dns");
292 KB
Binary file not shown.

index.js

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
var app = require("app"); // Module to control application life.
2-
var ipc = require("ipc");
2+
var dialog = require("dialog");
33
var fs = require("fs-extra");
4+
var ipc = require("ipc");
45
var os = require("os");
5-
var dialog = require("dialog");
6-
var BrowserWindow = require("browser-window");
6+
var path = require("path");
77

8+
var BrowserWindow = require("browser-window");
89
var mainWindow = null;
9-
app.commandLine.appendSwitch("enable-npapi");
10-
app.commandLine.appendSwitch("no-proxy-server");
1110

1211
var userData = app.getPath("userData");
13-
var unityHomeDir = __dirname + "\\..\\..\\WebPlayer";
12+
var unityHomeDir = path.join(__dirname, "../../WebPlayer");
13+
1414
// if running in non-packaged / development mode, this dir will be slightly different
1515
if (process.env.npm_node_execpath) {
16-
unityHomeDir = app.getAppPath() + "\\build\\WebPlayer";
16+
unityHomeDir = path.join(app.getAppPath(), "/build/WebPlayer");
1717
}
1818

1919
process.env["UNITY_HOME_DIR"] = unityHomeDir;
2020
process.env["UNITY_DISABLE_PLUGIN_UPDATES"] = "yes";
2121

22+
app.commandLine.appendSwitch("enable-npapi");
23+
app.commandLine.appendSwitch("load-plugin", path.join(unityHomeDir, "/loader/npUnity3D32.dll"));
24+
app.commandLine.appendSwitch("no-proxy-server");
25+
26+
var configPath = path.join(userData, "/config.json");
27+
var serversPath = path.join(userData, "/servers.json");
28+
var versionsPath = path.join(userData, "/versions.json");
29+
2230
function initialSetup(firstTime) {
2331
// Display a small window to inform the user that the app is working
2432
setupWindow = new BrowserWindow({
@@ -32,33 +40,21 @@ function initialSetup(firstTime) {
3240
// migration from pre-1.4
3341
// Back everything up, just in case
3442
setupWindow.loadUrl("file://" + __dirname + "/initial-setup.html");
35-
fs.copySync(userData + "\\config.json", userData + "\\config.json.bak");
36-
fs.copySync(
37-
userData + "\\servers.json",
38-
userData + "\\servers.json.bak"
39-
);
40-
fs.copySync(
41-
userData + "\\versions.json",
42-
userData + "\\versions.json.bak"
43-
);
43+
fs.copySync(configPath, configPath + ".bak");
44+
fs.copySync(serversPath, serversPath + ".bak");
45+
fs.copySync(versionsPath, versionsPath + ".bak");
4446
} else {
4547
// first-time setup
4648
// Copy default servers
4749
fs.copySync(
48-
__dirname + "\\defaults\\servers.json",
49-
userData + "\\servers.json"
50+
path.join(__dirname, "/defaults/servers.json"),
51+
serversPath
5052
);
5153
}
5254

5355
// Copy default versions and config
54-
fs.copySync(
55-
__dirname + "\\defaults\\versions.json",
56-
userData + "\\versions.json"
57-
);
58-
fs.copySync(
59-
__dirname + "\\defaults\\config.json",
60-
userData + "\\config.json"
61-
);
56+
fs.copySync(path.join(__dirname, "/defaults/versions.json"), versionsPath);
57+
fs.copySync(path.join(__dirname, "/defaults/config.json"), configPath);
6258

6359
console.log("JSON files copied.");
6460
setupWindow.destroy();
@@ -90,14 +86,12 @@ app.on("ready", function () {
9086
height: 720,
9187
show: false,
9288
"web-preferences": {
93-
plugins: true,
94-
"extra-plugin-dirs": [unityHomeDir + "\\loader"],
89+
plugins: true
9590
},
9691
});
9792
mainWindow.setMinimumSize(640, 480);
9893

9994
// Check for first run
100-
var configPath = userData + "\\config.json";
10195
try {
10296
if (!fs.existsSync(configPath)) {
10397
console.log("Config file not found. Running initial setup.");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "OpenFusionClient",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "OpenFusionClient",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)