mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 05:50:00 -04:00
pkg fixes
This commit is contained in:
parent
5ce4f60514
commit
30bf6cb8f1
5 changed files with 22 additions and 6 deletions
|
@ -12,8 +12,20 @@ build({
|
|||
platform: "node",
|
||||
// format: "esm",
|
||||
bundle: true,
|
||||
minify: true,
|
||||
|
||||
outfile: "dist/main.js",
|
||||
plugins: [
|
||||
makeAllPackagesExternalPlugin
|
||||
],
|
||||
})
|
||||
build({
|
||||
entryPoints: ["src/autoupdater.ts"],
|
||||
platform: "node",
|
||||
bundle: true,
|
||||
minify: true,
|
||||
outfile: "dist/autoupdater.js",
|
||||
plugins: [
|
||||
makeAllPackagesExternalPlugin
|
||||
],
|
||||
})
|
|
@ -4,9 +4,9 @@
|
|||
"description": "",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"start": "tsx src/main.ts",
|
||||
"start": "tsx src/main.ts --start",
|
||||
"dev": "nodemon -x tsx src/dev.ts",
|
||||
"prod": "node esbuild.bundle.js && pkg src/main.js"
|
||||
"prod": "node esbuild.bundle.js && pkg dist/main.js --targets node18 -o dist/adrift-server && pkg dist/autoupdater.js --targets node18 -o dist/adrift-server-autoupdate"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
|
@ -53,5 +53,4 @@ function start() {
|
|||
|
||||
}
|
||||
|
||||
// downloadAndStart();
|
||||
start();
|
||||
downloadAndStart();
|
|
@ -20,6 +20,8 @@ import { exit } from "process";
|
|||
import { datadir } from "./lib";
|
||||
import { PROTOCOL_VERSION } from "protocol";
|
||||
|
||||
export const SERVER_MILESTONE = "1.0";
|
||||
|
||||
|
||||
async function config() {
|
||||
let dir = datadir();
|
||||
|
@ -102,6 +104,7 @@ async function login(credentials: any) {
|
|||
async function start() {
|
||||
let dir = datadir();
|
||||
|
||||
|
||||
let conf;
|
||||
try {
|
||||
conf = JSON.parse(fs.readFileSync(`${dir}/config.json`).toString());
|
||||
|
@ -111,6 +114,8 @@ async function start() {
|
|||
let tracker = TrackerList[conf.tracker as keyof typeof TrackerList];
|
||||
|
||||
console.log(chalk.blue("Starting server!"));
|
||||
console.log(chalk.blue(`Server version: ${SERVER_MILESTONE} - Protocol version: ${PROTOCOL_VERSION}`));
|
||||
|
||||
if (conf.type == "swarm") {
|
||||
let connect = () => {
|
||||
let trackerws = new WebSocket(`${tracker.tracker}/join?protocol=${PROTOCOL_VERSION}`);
|
||||
|
|
|
@ -26,5 +26,5 @@ let trackers = {
|
|||
tracker: "wss://rafftracker.mercurywork.shop",
|
||||
description: "a second official backup tracker",
|
||||
}
|
||||
};
|
||||
} as const;
|
||||
export default trackers;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue