Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
SMNETSTUDIO
MCSP
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
MCSP
/
server.js
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
21 lines (20 loc) · 977 Bytes
main
Breadcrumbs
MCSP
/
server.js
Copy path
Top
File metadata and controls
Code
Blame
21 lines (20 loc) · 977 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* MCSP — MineCraft Server Panel
*
* 真实的多实例 Minecraft 服务器管理面板:
* 实例 = 真实 java 子进程,控制台 = 真实 stdin/stdout,
* 指标来自 /proc,备份是真实 tar.gz,穿透是真实隧道进程。
*
* 代码结构见 src/(分层说明在 ARCHITECTURE.md)。
*/
/* 最后一道兜底。面板里跑着别人的 Minecraft 服务器 —— 一个后台定时器里的
意外异常不该让所有服务端跟着进程一起消失。记下来继续跑,比静默退出、
再由 PM2 拉起、再 resumeInstances 把服务端重启一遍要好得多。
注意这不是"忽略错误":该修的照修,这里只是不让它变成全员停服。 */
process.on('uncaughtException', (err) => {
console.error('[MCSP] 未捕获异常(进程继续运行,请上报此堆栈):', err);
});
process.on('unhandledRejection', (reason) => {
console.error('[MCSP] 未处理的 Promise rejection:', reason);
});
require('./src/app').start();
You can’t perform that action at this time.