mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
新增 - 输入输出编码逻辑
This commit is contained in:
parent
5c709f94c2
commit
074d8c0419
@ -4,6 +4,7 @@ const os = require('os');
|
||||
|
||||
const properties = require("properties");
|
||||
const fs = require('fs');
|
||||
const tools = require('../tools');
|
||||
|
||||
class MinecraftServer extends ServerProcess {
|
||||
|
||||
@ -17,6 +18,11 @@ class MinecraftServer extends ServerProcess {
|
||||
this.dataModel.createDate = now; //创建时间
|
||||
this.dataModel.lastDate = now; //最后启动时间
|
||||
|
||||
//输入 输出编码
|
||||
systemCode = tools.getSystemCodeing();
|
||||
this.dataModel.ie = systemCode;
|
||||
this.dataModel.oe = systemCode;
|
||||
|
||||
this.dataModel.autoRestart = false; //是否自动重启
|
||||
this.dataModel.schedule = []; //计划任务配置项目
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
//工具箱
|
||||
|
||||
const os = require("os");
|
||||
|
||||
module.exports.getMineTime = () => {
|
||||
var date = new Date();
|
||||
return date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
|
||||
@ -53,4 +55,13 @@ module.exports.mCopyFileSync = (oldpath, newpath) => {
|
||||
encoding: 'UTF-8'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports.getSystemCodeing = () => {
|
||||
let auto_console_coding;
|
||||
if (os.platform() == "win32")
|
||||
auto_console_coding = 'GBK';
|
||||
else
|
||||
auto_console_coding = 'UTF-8';
|
||||
return auto_console_coding;
|
||||
}
|
Loading…
Reference in New Issue
Block a user