更新 开源协议说明

This commit is contained in:
Suwings 2022-01-23 21:31:08 +08:00
parent e4c0f621ad
commit b6561b3241
65 changed files with 418 additions and 28 deletions

View File

@ -11,6 +11,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
@ -18,6 +21,9 @@
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import fs from "fs-extra";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
export default class GlobalVariable {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { Socket } from "socket.io";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
// Using SLT (Server List Ping) provided by Minecraft.

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
interface IMap {
@ -34,7 +40,7 @@ interface Page<T> {
// 供给路由层使用的MAP型查询接口
export class QueryMapWrapper {
constructor(public map: IMap) {}
constructor(public map: IMap) { }
select<T>(condition: (v: T) => boolean): T[] {
const result: T[] = [];
@ -82,7 +88,7 @@ export class MySqlSource<T> implements IDataSource<T> {
// 本地文件数据源(内嵌式微型数据库)
export class LocalFileSource<T> implements IDataSource<T> {
constructor(public data: any) {}
constructor(public data: any) { }
selectPage(condition: any, page = 1, pageSize = 10) {
const result: T[] = [];
@ -122,14 +128,14 @@ export class LocalFileSource<T> implements IDataSource<T> {
select(condition: any): any[] {
return null;
}
update(condition: any, data: any) {}
delete(condition: any) {}
insert(data: any) {}
update(condition: any, data: any) { }
delete(condition: any) { }
insert(data: any) { }
}
// 供给路由层使用的统一数据查询接口
export class QueryWrapper<T> {
constructor(public dataSource: IDataSource<T>) {}
constructor(public dataSource: IDataSource<T>) { }
selectPage(condition: any, page = 1, pageSize = 10) {
return this.dataSource.selectPage(condition, page, pageSize);

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import os from "os";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import path from "path";

View File

@ -11,15 +11,21 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
export default class InstanceCommand {
constructor(public info?: string) {}
async exec(instance: any): Promise<any> {}
constructor(public info?: string) { }
async exec(instance: any): Promise<any> { }
}

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
export function commandStringToArray(cmd: string) {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import os from "os";
@ -80,7 +86,7 @@ class ProcessAdapter extends EventEmitter implements IInstanceProcess {
this.process.stdout.destroy();
this.process.stderr.destroy();
}
} catch (error) {}
} catch (error) { }
}
}

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import InstanceCommand from "./base/command";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { ProcessConfig } from "../instance/process_config";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { ILifeCycleTask } from "../../instance/life_cycle";
@ -46,7 +52,7 @@ export default class RefreshPlayer implements ILifeCycleTask {
instance.info.maxPlayers = result.max_players ? result.max_players : -1;
instance.info.currentPlayers = result.current_players ? result.current_players : -1;
instance.info.version = result.version ? result.version : "";
} catch (error) {}
} catch (error) { }
}, 3000);
}

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { ILifeCycleTask } from "../../instance/life_cycle";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { v4 } from "uuid";

View File

@ -11,18 +11,24 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { Socket } from "socket.io";
export default class RouterContext {
constructor(public uuid: string, public socket: Socket, public session?: any, public event?: string) {}
constructor(public uuid: string, public socket: Socket, public session?: any, public event?: string) { }
public response(data: any) {
return this;

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "./instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { EventEmitter } from "events";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { EventEmitter } from "events";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "./instance";
@ -32,7 +38,7 @@ export class LifeCycleTaskManager {
// 生命周期任务列表
public readonly lifeCycleTask: ILifeCycleTask[] = [];
constructor(private self: any) {}
constructor(private self: any) { }
registerLifeCycleTask(task: ILifeCycleTask) {
this.lifeCycleTask.push(task);

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
interface IExecutable {
@ -26,7 +32,7 @@ interface IExecutable {
export class PresetCommandManager {
public readonly preset = new Map<String, IExecutable>();
constructor(private self: any) {}
constructor(private self: any) { }
setPreset(action: string, cmd: IExecutable) {
this.preset.set(action, cmd);

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import yaml from "yaml";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
const dgram = require("dgram");

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Instance from "../instance/instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import fs from "fs-extra";
@ -136,7 +142,7 @@ routerApp.on("instance/detail", async (ctx, data) => {
// 可能因文件权限导致错误的部分,避免影响整个配置的获取
processInfo = await instance.forceExec(new ProcessInfoCommand());
space = await instance.usedSpace(null, 2);
} catch (err) {}
} catch (err) { }
protocol.msg(ctx, "instance/detail", {
instanceUuid: instance.instanceUuid,
started: instance.startCount,
@ -275,7 +281,7 @@ routerApp.on("instance/delete", (ctx, data) => {
for (const instanceUuid of instanceUuids) {
try {
InstanceSubsystem.removeInstance(instanceUuid, deleteFile);
} catch (err) {}
} catch (err) { }
}
protocol.msg(ctx, "instance/delete", instanceUuids);
});
@ -288,7 +294,7 @@ routerApp.on("instance/stdin", (ctx, data) => {
try {
if (data.ch == "\r") return instance.process.write("\n");
instance.process.write(data.ch);
} catch (err) {}
} catch (err) { }
});
routerApp.on("instance/process_config/list", (ctx, data) => {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { routerApp } from "../service/router";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { DockerManager } from "../service/docker_service";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import * as protocol from "../service/protocol";
@ -131,7 +137,7 @@ routerApp.on("file/compress", async (ctx, data) => {
// 异步执行
fileManager
.zip(source, targets)
.then(() => {})
.then(() => { })
.catch((error) => {
protocol.responseError(ctx, error);
});
@ -139,7 +145,7 @@ routerApp.on("file/compress", async (ctx, data) => {
// 异步执行
fileManager
.unzip(source, targets)
.then(() => {})
.then(() => { })
.catch((error) => {
protocol.responseError(ctx, error);
});

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Router from "@koa/router";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import * as protocol from "../service/protocol";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import path from "path";
@ -35,7 +41,7 @@ async function outputLog(instanceUuid: string, text: string) {
try {
const fileInfo = fs.statSync(logFilePath);
if (fileInfo && fileInfo.size > 1024 * 1024 * 1) fs.removeSync(logFilePath);
} catch (err) {}
} catch (err) { }
await fs.writeFile(logFilePath, text, { encoding: "utf-8", flag: "a" });
}
@ -68,8 +74,8 @@ InstanceSubsystem.on("data", (instanceUuid: string, text: string) => {
}
// 输出内容追加到log文件
outputLog(instanceUuid, text)
.then(() => {})
.catch(() => {});
.then(() => { })
.catch(() => { });
});
// 实例退出事件

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { routerApp } from "../service/router";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { routerApp } from "../service/router";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import * as protocol from "../service/protocol";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import dockerode from "dockerode";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import InstanceSubsystem from "../service/system_instance";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import Koa from "koa";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
export interface IInstanceDetail {
instanceUuid: string;

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import * as log4js from "log4js";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
// 任务接口

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { globalConfiguration } from "../entity/config";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { Socket } from "socket.io";
@ -40,7 +46,7 @@ export interface IPacket {
const globalSocket = new Map<String, Socket>();
export class Packet implements IPacket {
constructor(public uuid: string = null, public status = 200, public event: string = null, public data: any = null) {}
constructor(public uuid: string = null, public status = 200, public event: string = null, public data: any = null) { }
}
export function response(ctx: RouterContext, data: any) {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { EventEmitter } from "events";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import path from "path";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import fs from "fs-extra";
@ -78,8 +84,8 @@ class InstanceSubsystem extends EventEmitter {
// 所有实例全部进行功能调度器
instance
.forceExec(new FuntionDispatcher())
.then((v) => {})
.catch((v) => {});
.then((v) => { })
.catch((v) => { });
this.addInstance(instance);
});
// 处理自动启动
@ -159,7 +165,7 @@ class InstanceSubsystem extends EventEmitter {
// 删除计划任务
InstanceControl.deleteInstanceAllTask(instanceUuid);
// 异步删除文件
if (deleteFile) fs.remove(instance.config.cwd, (err) => {});
if (deleteFile) fs.remove(instance.config.cwd, (err) => { });
return true;
}
throw new Error("Instance does not exist");
@ -168,13 +174,13 @@ class InstanceSubsystem extends EventEmitter {
forward(targetInstanceUuid: string, socket: Socket) {
try {
this.instanceStream.requestForward(socket, targetInstanceUuid);
} catch (err) {}
} catch (err) { }
}
stopForward(targetInstanceUuid: string, socket: Socket) {
try {
this.instanceStream.cannelForward(socket, targetInstanceUuid);
} catch (err) {}
} catch (err) { }
}
forEachForward(instanceUuid: string, callback: (socket: Socket) => void) {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import schedule from "node-schedule";
@ -71,7 +77,7 @@ class IntervalJob implements IScheduleJob {
// 计划任务实例类
class Task {
constructor(public config: TaskConfig, public job?: IScheduleJob) {}
constructor(public config: TaskConfig, public job?: IScheduleJob) { }
}
class InstanceControlSubsystem {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import readline from "readline";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import * as fs from "fs-extra";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
import { describe, it } from "mocha";

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
export function checkFileName(fileName: string) {

View File

@ -11,12 +11,18 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
According to the GPL, it is forbidden to delete all copyright notices,
and if you modify the source code, you must open source the
modified source code.
(C) 2022 Suwings(https://github.com/Suwings)
GPL /
GPL
https://mcsmanager.com/ 申请闭源开发授权或了解更多。
*/
declare module "properties" {