create-yeow 0.2.66 → 0.2.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -76,27 +76,22 @@ let proc = null;
|
|
|
76
76
|
let wss = null;
|
|
77
77
|
|
|
78
78
|
// ── Graceful shutdown ────────────────────────────────────────────
|
|
79
|
+
let cleaning = false;
|
|
79
80
|
function cleanup() {
|
|
81
|
+
if (cleaning) return;
|
|
82
|
+
cleaning = true;
|
|
83
|
+
if (wss) { try { wss.close(); } catch {} }
|
|
80
84
|
if (proc && !proc.killed) {
|
|
81
85
|
try { proc.stdin.write('stop\n'); } catch {}
|
|
82
|
-
setTimeout(() => { if (proc && !proc.killed) try { proc.kill(); } catch {} },
|
|
86
|
+
const killer = setTimeout(() => { if (proc && !proc.killed) try { proc.kill('SIGKILL'); } catch {} }, 10000);
|
|
87
|
+
proc.on('close', () => { clearTimeout(killer); process.exit(0); });
|
|
88
|
+
} else {
|
|
89
|
+
process.exit(0);
|
|
83
90
|
}
|
|
84
|
-
if (wss) { try { wss.close(); } catch {} }
|
|
85
|
-
process.exit(0);
|
|
86
91
|
}
|
|
87
92
|
process.on('SIGINT', cleanup);
|
|
88
93
|
process.on('SIGTERM', cleanup);
|
|
89
|
-
process.on('
|
|
90
|
-
// Windows Ctrl+C in terminal
|
|
91
|
-
if (process.platform === 'win32') {
|
|
92
|
-
import('readline').then(rl => {
|
|
93
|
-
rl.emitKeypressEvents(process.stdin);
|
|
94
|
-
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
95
|
-
process.stdin.on('keypress', (str, key) => {
|
|
96
|
-
if ((key.ctrl && key.name === 'c') || key.name === 'escape') cleanup();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}
|
|
94
|
+
process.on('beforeExit', () => { if (proc && !proc.killed) try { proc.kill(); } catch {} });
|
|
100
95
|
|
|
101
96
|
// ── WebSocket Server ────────────────────────────────────────────
|
|
102
97
|
function startWebSocket() {
|
|
@@ -365,6 +360,7 @@ function startServer() {
|
|
|
365
360
|
info(`\nStarting Paper ${PAPER_VERSION} server...`);
|
|
366
361
|
proc = spawn('java', [...jvmArgs, '-jar', resolve(SERVER, PAPER_JAR), '--nogui'], { cwd: SERVER, stdio: ['pipe', 'inherit', 'inherit'] });
|
|
367
362
|
proc.on('exit', code => { warn(`Server exited (${code})`); if (wss) wss.close(); process.exit(0); });
|
|
363
|
+
process.stdin.on('data', d => { if (proc && !proc.killed) try { proc.stdin.write(d); } catch {} });
|
|
368
364
|
if (STOP) { info(`Auto-stop in ${STOP}s`); setTimeout(() => { warn('Auto-stop'); cleanup(); }, STOP * 1000); }
|
|
369
365
|
}
|
|
370
366
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-yeow-plugin",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"author": "
|
|
4
|
+
"author": "",
|
|
5
5
|
"description": "A Yeow plugin",
|
|
6
6
|
"api": "1.18",
|
|
7
7
|
"java": 21,
|
|
8
8
|
"typecheck": true,
|
|
9
9
|
"dev": {
|
|
10
10
|
"port": 17367,
|
|
11
|
-
"memory": "4G"
|
|
11
|
+
"memory": "4G",
|
|
12
|
+
"paperJar": "https://fill-data.papermc.io/v1/objects/5ee4f542f628a14c644410b08c94ea42e772ef4d29fe92973636b6813d4eaffc/paper-1.21.4-232.jar"
|
|
12
13
|
}
|
|
13
|
-
}
|
|
14
|
+
}
|