From a135e55afec2450a15d91bfb1cefd760d49d481f Mon Sep 17 00:00:00 2001 From: Suwings Date: Thu, 28 Jul 2022 11:55:48 +0800 Subject: [PATCH] Refactor: change copyright info 2 --- src/app.ts | 4 +- src/common/compress.ts | 4 +- src/common/global_variable.ts | 4 +- src/common/instance_stream.ts | 5 +- src/common/mcping.ts | 4 +- src/common/process_tools.ts | 5 +- src/common/query_wrapper.ts | 4 +- src/common/system_info.ts | 4 +- src/common/system_storage.ts | 4 +- src/common/typecheck.ts | 4 +- src/const.ts | 4 +- src/entity/commands/base/command.ts | 4 +- src/entity/commands/base/command_parser.ts | 4 +- src/entity/commands/cmd.ts | 4 +- src/entity/commands/dispatcher.ts | 5 +- src/entity/commands/docker/docker_resize.ts | 21 +--- src/entity/commands/docker/docker_start.ts | 21 +--- .../commands/general/general_command.ts | 4 +- src/entity/commands/general/general_kill.ts | 4 +- .../commands/general/general_restart.ts | 4 +- src/entity/commands/general/general_start.ts | 4 +- src/entity/commands/general/general_stop.ts | 4 +- src/entity/commands/general/general_update.ts | 5 +- src/entity/commands/input.ts | 4 +- src/entity/commands/kill.ts | 4 +- src/entity/commands/nullfunc.ts | 4 +- src/entity/commands/process_info.ts | 4 +- src/entity/commands/pty/pty_start.ts | 4 +- src/entity/commands/pty/pty_stop.ts | 4 +- src/entity/commands/restart.ts | 4 +- src/entity/commands/start.ts | 4 +- src/entity/commands/stop.ts | 4 +- src/entity/commands/task/players.ts | 4 +- src/entity/commands/task/time.ts | 4 +- src/entity/commands/update.ts | 4 +- src/entity/config.ts | 4 +- src/entity/ctx.ts | 4 +- src/entity/instance/Instance_config.ts | 4 +- src/entity/instance/instance.ts | 4 +- src/entity/instance/interface.ts | 5 +- src/entity/instance/life_cycle.ts | 4 +- src/entity/instance/preset.ts | 4 +- src/entity/instance/process_config.ts | 4 +- src/entity/minecraft/mc_getplayer.ts | 4 +- src/entity/minecraft/mc_getplayer_bedrock.ts | 4 +- src/entity/minecraft/mc_update.ts | 4 +- src/i18n/index.ts | 4 +- src/routers/Instance_router.ts | 4 +- src/routers/auth_router.ts | 4 +- src/routers/environment_router.ts | 4 +- src/routers/file_router.ts | 4 +- src/routers/http_router.ts | 4 +- src/routers/info_router.ts | 4 +- src/routers/instance_event_router.ts | 4 +- src/routers/passport_router.ts | 4 +- src/routers/schedule_router.ts | 4 +- src/routers/stream_router.ts | 4 +- src/service/docker_service.ts | 4 +- src/service/file_router_service.ts | 4 +- src/service/http.ts | 4 +- src/service/install.ts | 4 +- src/service/interfaces.ts | 4 +- src/service/log.ts | 5 +- src/service/mission_passport.ts | 4 +- src/service/node_auth.ts | 4 +- src/service/protocol.ts | 4 +- src/service/router.ts | 4 +- src/service/system_file.ts | 4 +- src/service/system_instance.ts | 4 +- src/service/system_instance_control.ts | 4 +- src/service/ui.ts | 5 +- src/service/version.ts | 4 +- src/tools/filepath.ts | 4 +- src/types/properties.d.ts | 4 +- test/1.txt | 1 - test/docker.js | 116 ------------------ test/env_check.js | 0 test/extend_worker.js | 75 ----------- test/unzip.ts | 48 -------- test/zlibt.js | 17 --- 80 files changed, 81 insertions(+), 513 deletions(-) delete mode 100644 test/1.txt delete mode 100644 test/docker.js delete mode 100644 test/env_check.js delete mode 100644 test/extend_worker.js delete mode 100644 test/unzip.ts delete mode 100644 test/zlibt.js diff --git a/src/app.ts b/src/app.ts index 769a93b..a2cf546 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { $t } from "./i18n"; import { getVersion, initVersionManager } from "./service/version"; diff --git a/src/common/compress.ts b/src/common/compress.ts index c2f3ec1..a2569d3 100644 --- a/src/common/compress.ts +++ b/src/common/compress.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import fs from "fs-extra"; import path from "path"; diff --git a/src/common/global_variable.ts b/src/common/global_variable.ts index f34ec75..31ab703 100644 --- a/src/common/global_variable.ts +++ b/src/common/global_variable.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export default class GlobalVariable { public static readonly map = new Map(); diff --git a/src/common/instance_stream.ts b/src/common/instance_stream.ts index 74e818a..4810f81 100644 --- a/src/common/instance_stream.ts +++ b/src/common/instance_stream.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import { Socket } from "socket.io"; // 应用实例数据流转发适配器 diff --git a/src/common/mcping.ts b/src/common/mcping.ts index 2975878..c3afcb0 100644 --- a/src/common/mcping.ts +++ b/src/common/mcping.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team // Using SLT (Server List Ping) provided by Minecraft. // Since it is part of the protocol it is always enabled contrary to Query diff --git a/src/common/process_tools.ts b/src/common/process_tools.ts index 4ce317b..641ea2c 100644 --- a/src/common/process_tools.ts +++ b/src/common/process_tools.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import { ChildProcess, exec, execSync } from "child_process"; import os from "os"; diff --git a/src/common/query_wrapper.ts b/src/common/query_wrapper.ts index 4d08de9..ad57122 100644 --- a/src/common/query_wrapper.ts +++ b/src/common/query_wrapper.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team interface IMap { size: number; diff --git a/src/common/system_info.ts b/src/common/system_info.ts index 87fe096..89d1ab1 100644 --- a/src/common/system_info.ts +++ b/src/common/system_info.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import os from "os"; import osUtils from "os-utils"; diff --git a/src/common/system_storage.ts b/src/common/system_storage.ts index 328bfcf..72338aa 100644 --- a/src/common/system_storage.ts +++ b/src/common/system_storage.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import path from "path"; import fs from "fs-extra"; diff --git a/src/common/typecheck.ts b/src/common/typecheck.ts index a678450..3d79b5e 100644 --- a/src/common/typecheck.ts +++ b/src/common/typecheck.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export function configureEntityParams(self: any, args: any, key: string, typeFn?: Function): any { const selfDefaultValue = self[key] ?? null; diff --git a/src/const.ts b/src/const.ts index bfd2b55..2966c8a 100644 --- a/src/const.ts +++ b/src/const.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import os from "os"; import path from "path"; diff --git a/src/entity/commands/base/command.ts b/src/entity/commands/base/command.ts index f40bdbd..7b8dba3 100644 --- a/src/entity/commands/base/command.ts +++ b/src/entity/commands/base/command.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export default class InstanceCommand { constructor(public info?: string) {} diff --git a/src/entity/commands/base/command_parser.ts b/src/entity/commands/base/command_parser.ts index b7c4c65..c407e75 100644 --- a/src/entity/commands/base/command_parser.ts +++ b/src/entity/commands/base/command_parser.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export function commandStringToArray(cmd: string) { const QUOTES_KEY = "{quotes}"; diff --git a/src/entity/commands/cmd.ts b/src/entity/commands/cmd.ts index 3ed2f14..f3d3659 100644 --- a/src/entity/commands/cmd.ts +++ b/src/entity/commands/cmd.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/dispatcher.ts b/src/entity/commands/dispatcher.ts index 177856f..ce94bd9 100644 --- a/src/entity/commands/dispatcher.ts +++ b/src/entity/commands/dispatcher.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import path from "path"; import fs from "fs-extra"; import Instance from "../instance/instance"; diff --git a/src/entity/commands/docker/docker_resize.ts b/src/entity/commands/docker/docker_resize.ts index d9008af..4fe0551 100644 --- a/src/entity/commands/docker/docker_resize.ts +++ b/src/entity/commands/docker/docker_resize.ts @@ -1,23 +1,4 @@ -/* - Copyright (C) 2022 RimuruChan - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - According to the AGPL, 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 RimuruChan - - 该程序是免费软件,您可以重新分发和/或修改据 GNU Affero 通用公共许可证的条款, - 由自由软件基金会,许可证的第 3 版,或(由您选择)任何更高版本。 - - 根据 AGPL 与用户协议,您必须保留所有版权声明,如果修改源代码则必须开源修改后的源代码。 - 可以前往 https://mcsmanager.com/ 阅读用户协议,申请闭源开发授权等。 -*/ +// Copyright (C) 2022 MCSManager Team and RimuruChan import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/docker/docker_start.ts b/src/entity/commands/docker/docker_start.ts index 0b0f5b9..5f18130 100644 --- a/src/entity/commands/docker/docker_start.ts +++ b/src/entity/commands/docker/docker_start.ts @@ -1,23 +1,4 @@ -/* - Copyright (C) 2022 Suwings - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - According to the AGPL, 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 - - 该程序是免费软件,您可以重新分发和/或修改据 GNU Affero 通用公共许可证的条款, - 由自由软件基金会,许可证的第 3 版,或(由您选择)任何更高版本。 - - 根据 AGPL 与用户协议,您必须保留所有版权声明,如果修改源代码则必须开源修改后的源代码。 - 可以前往 https://mcsmanager.com/ 阅读用户协议,申请闭源开发授权等。 -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/general/general_command.ts b/src/entity/commands/general/general_command.ts index b1a3794..4701292 100644 --- a/src/entity/commands/general/general_command.ts +++ b/src/entity/commands/general/general_command.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import { encode } from "iconv-lite"; diff --git a/src/entity/commands/general/general_kill.ts b/src/entity/commands/general/general_kill.ts index a944675..9da0820 100644 --- a/src/entity/commands/general/general_kill.ts +++ b/src/entity/commands/general/general_kill.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/general/general_restart.ts b/src/entity/commands/general/general_restart.ts index 05a2dd4..0f84ebc 100644 --- a/src/entity/commands/general/general_restart.ts +++ b/src/entity/commands/general/general_restart.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/general/general_start.ts b/src/entity/commands/general/general_start.ts index ed32f6e..6560f12 100644 --- a/src/entity/commands/general/general_start.ts +++ b/src/entity/commands/general/general_start.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import os from "os"; import Instance from "../../instance/instance"; diff --git a/src/entity/commands/general/general_stop.ts b/src/entity/commands/general/general_stop.ts index 266cfcb..7000713 100644 --- a/src/entity/commands/general/general_stop.ts +++ b/src/entity/commands/general/general_stop.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/general/general_update.ts b/src/entity/commands/general/general_update.ts index 53bb2a2..556c241 100644 --- a/src/entity/commands/general/general_update.ts +++ b/src/entity/commands/general/general_update.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import { killProcess } from "../../../common/process_tools"; import { ChildProcess, exec, spawn } from "child_process"; import logger from "../../../service/log"; diff --git a/src/entity/commands/input.ts b/src/entity/commands/input.ts index 55aead1..d2328d8 100644 --- a/src/entity/commands/input.ts +++ b/src/entity/commands/input.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/kill.ts b/src/entity/commands/kill.ts index 9863e2d..4d91ede 100644 --- a/src/entity/commands/kill.ts +++ b/src/entity/commands/kill.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/nullfunc.ts b/src/entity/commands/nullfunc.ts index 35b187d..090affa 100644 --- a/src/entity/commands/nullfunc.ts +++ b/src/entity/commands/nullfunc.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/process_info.ts b/src/entity/commands/process_info.ts index cb27706..ab90e44 100644 --- a/src/entity/commands/process_info.ts +++ b/src/entity/commands/process_info.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { ProcessConfig } from "../instance/process_config"; import pidusage from "pidusage"; diff --git a/src/entity/commands/pty/pty_start.ts b/src/entity/commands/pty/pty_start.ts index 512a878..0190384 100644 --- a/src/entity/commands/pty/pty_start.ts +++ b/src/entity/commands/pty/pty_start.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import os from "os"; import Instance from "../../instance/instance"; diff --git a/src/entity/commands/pty/pty_stop.ts b/src/entity/commands/pty/pty_stop.ts index 314bec1..00762f7 100644 --- a/src/entity/commands/pty/pty_stop.ts +++ b/src/entity/commands/pty/pty_stop.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../../instance/instance"; import InstanceCommand from "../base/command"; diff --git a/src/entity/commands/restart.ts b/src/entity/commands/restart.ts index e8ab5c2..6fde1b1 100644 --- a/src/entity/commands/restart.ts +++ b/src/entity/commands/restart.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/start.ts b/src/entity/commands/start.ts index d549fd1..5f9944b 100644 --- a/src/entity/commands/start.ts +++ b/src/entity/commands/start.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import logger from "../../service/log"; diff --git a/src/entity/commands/stop.ts b/src/entity/commands/stop.ts index 2c6d1c2..6215124 100644 --- a/src/entity/commands/stop.ts +++ b/src/entity/commands/stop.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/commands/task/players.ts b/src/entity/commands/task/players.ts index 6686e8e..150c719 100644 --- a/src/entity/commands/task/players.ts +++ b/src/entity/commands/task/players.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { ILifeCycleTask } from "../../instance/life_cycle"; import Instance from "../../instance/instance"; diff --git a/src/entity/commands/task/time.ts b/src/entity/commands/task/time.ts index 4e1b167..4eeabdd 100644 --- a/src/entity/commands/task/time.ts +++ b/src/entity/commands/task/time.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { ILifeCycleTask } from "../../instance/life_cycle"; import Instance from "../../instance/instance"; diff --git a/src/entity/commands/update.ts b/src/entity/commands/update.ts index d2e9e56..510e892 100644 --- a/src/entity/commands/update.ts +++ b/src/entity/commands/update.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "./base/command"; diff --git a/src/entity/config.ts b/src/entity/config.ts index 2e5b26e..c836518 100644 --- a/src/entity/config.ts +++ b/src/entity/config.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { v4 } from "uuid"; import StorageSubsystem from "../common/system_storage"; diff --git a/src/entity/ctx.ts b/src/entity/ctx.ts index d469088..9168683 100644 --- a/src/entity/ctx.ts +++ b/src/entity/ctx.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { Socket } from "socket.io"; diff --git a/src/entity/instance/Instance_config.ts b/src/entity/instance/Instance_config.ts index 992b60e..de95078 100644 --- a/src/entity/instance/Instance_config.ts +++ b/src/entity/instance/Instance_config.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "./instance"; import { IDockerConfig } from "./interface"; diff --git a/src/entity/instance/instance.ts b/src/entity/instance/instance.ts index b2c644b..195a32c 100644 --- a/src/entity/instance/instance.ts +++ b/src/entity/instance/instance.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import iconv from "iconv-lite"; import path from "path"; diff --git a/src/entity/instance/interface.ts b/src/entity/instance/interface.ts index 1e79d18..3844b3b 100644 --- a/src/entity/instance/interface.ts +++ b/src/entity/instance/interface.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import { EventEmitter } from "events"; // interface of docker config diff --git a/src/entity/instance/life_cycle.ts b/src/entity/instance/life_cycle.ts index 4891bfe..e1225e9 100644 --- a/src/entity/instance/life_cycle.ts +++ b/src/entity/instance/life_cycle.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "./instance"; diff --git a/src/entity/instance/preset.ts b/src/entity/instance/preset.ts index 472ab3b..1e9a75f 100644 --- a/src/entity/instance/preset.ts +++ b/src/entity/instance/preset.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export interface IExecutable { exec: (a: any, b?: any) => Promise; diff --git a/src/entity/instance/process_config.ts b/src/entity/instance/process_config.ts index 5af88cb..0046b0a 100644 --- a/src/entity/instance/process_config.ts +++ b/src/entity/instance/process_config.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import yaml from "yaml"; import properties from "properties"; diff --git a/src/entity/minecraft/mc_getplayer.ts b/src/entity/minecraft/mc_getplayer.ts index df3ce12..5ba70a0 100644 --- a/src/entity/minecraft/mc_getplayer.ts +++ b/src/entity/minecraft/mc_getplayer.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "../commands/base/command"; diff --git a/src/entity/minecraft/mc_getplayer_bedrock.ts b/src/entity/minecraft/mc_getplayer_bedrock.ts index 9a1b2b3..a7ed3ee 100644 --- a/src/entity/minecraft/mc_getplayer_bedrock.ts +++ b/src/entity/minecraft/mc_getplayer_bedrock.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team const dgram = require("dgram"); diff --git a/src/entity/minecraft/mc_update.ts b/src/entity/minecraft/mc_update.ts index 3e04251..f7d13a3 100644 --- a/src/entity/minecraft/mc_update.ts +++ b/src/entity/minecraft/mc_update.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Instance from "../instance/instance"; import InstanceCommand from "../commands/base/command"; diff --git a/src/i18n/index.ts b/src/i18n/index.ts index b7ae4c7..18d73ce 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import i18next from "i18next"; diff --git a/src/routers/Instance_router.ts b/src/routers/Instance_router.ts index 6c7ade5..ac4baf6 100644 --- a/src/routers/Instance_router.ts +++ b/src/routers/Instance_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import fs from "fs-extra"; import * as protocol from "../service/protocol"; diff --git a/src/routers/auth_router.ts b/src/routers/auth_router.ts index 36d26d2..d06b84d 100644 --- a/src/routers/auth_router.ts +++ b/src/routers/auth_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { routerApp } from "../service/router"; import * as protocol from "../service/protocol"; diff --git a/src/routers/environment_router.ts b/src/routers/environment_router.ts index 86d680f..bb2b8b5 100644 --- a/src/routers/environment_router.ts +++ b/src/routers/environment_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { DockerManager } from "../service/docker_service"; import * as protocol from "../service/protocol"; diff --git a/src/routers/file_router.ts b/src/routers/file_router.ts index 50704da..b7663c6 100644 --- a/src/routers/file_router.ts +++ b/src/routers/file_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import * as protocol from "../service/protocol"; import { routerApp } from "../service/router"; diff --git a/src/routers/http_router.ts b/src/routers/http_router.ts index 55f1aa3..74db96d 100644 --- a/src/routers/http_router.ts +++ b/src/routers/http_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Router from "@koa/router"; import fs from "fs-extra"; diff --git a/src/routers/info_router.ts b/src/routers/info_router.ts index c5b8504..a61c173 100644 --- a/src/routers/info_router.ts +++ b/src/routers/info_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import * as protocol from "../service/protocol"; import { routerApp } from "../service/router"; diff --git a/src/routers/instance_event_router.ts b/src/routers/instance_event_router.ts index d81705d..e73aa97 100644 --- a/src/routers/instance_event_router.ts +++ b/src/routers/instance_event_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import path from "path"; diff --git a/src/routers/passport_router.ts b/src/routers/passport_router.ts index 1948f9a..67e6a8c 100644 --- a/src/routers/passport_router.ts +++ b/src/routers/passport_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { routerApp } from "../service/router"; import { missionPassport } from "../service/mission_passport"; diff --git a/src/routers/schedule_router.ts b/src/routers/schedule_router.ts index 61774f8..147aff2 100644 --- a/src/routers/schedule_router.ts +++ b/src/routers/schedule_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { routerApp } from "../service/router"; import * as protocol from "../service/protocol"; diff --git a/src/routers/stream_router.ts b/src/routers/stream_router.ts index 9f9dd26..8781370 100644 --- a/src/routers/stream_router.ts +++ b/src/routers/stream_router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import * as protocol from "../service/protocol"; import { routerApp } from "../service/router"; diff --git a/src/service/docker_service.ts b/src/service/docker_service.ts index 4103c95..9fd1bf4 100644 --- a/src/service/docker_service.ts +++ b/src/service/docker_service.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import dockerode from "dockerode"; import Docker from "dockerode"; diff --git a/src/service/file_router_service.ts b/src/service/file_router_service.ts index e4d801f..000fea6 100644 --- a/src/service/file_router_service.ts +++ b/src/service/file_router_service.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import InstanceSubsystem from "../service/system_instance"; import FileManager from "./system_file"; diff --git a/src/service/http.ts b/src/service/http.ts index b823568..0481d2a 100644 --- a/src/service/http.ts +++ b/src/service/http.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import Koa from "koa"; import koaBody from "koa-body"; diff --git a/src/service/install.ts b/src/service/install.ts index d154306..4006c4d 100644 --- a/src/service/install.ts +++ b/src/service/install.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import os from "os"; import fs from "fs-extra"; diff --git a/src/service/interfaces.ts b/src/service/interfaces.ts index 7a1bfe7..11ca9bb 100644 --- a/src/service/interfaces.ts +++ b/src/service/interfaces.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import InstanceConfig from "../entity/instance/Instance_config"; export interface IInstanceDetail { diff --git a/src/service/log.ts b/src/service/log.ts index 4270e80..3908c2a 100644 --- a/src/service/log.ts +++ b/src/service/log.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import fs from "fs-extra"; import * as log4js from "log4js"; diff --git a/src/service/mission_passport.ts b/src/service/mission_passport.ts index 57c2d4e..bc895e0 100644 --- a/src/service/mission_passport.ts +++ b/src/service/mission_passport.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team // 任务接口 interface IMission { diff --git a/src/service/node_auth.ts b/src/service/node_auth.ts index 1e21301..04e6a2c 100644 --- a/src/service/node_auth.ts +++ b/src/service/node_auth.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { globalConfiguration } from "../entity/config"; diff --git a/src/service/protocol.ts b/src/service/protocol.ts index d62ae83..a37a17b 100644 --- a/src/service/protocol.ts +++ b/src/service/protocol.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { Socket } from "socket.io"; import RouterContext from "../entity/ctx"; diff --git a/src/service/router.ts b/src/service/router.ts index 6f5a850..e7fe507 100644 --- a/src/service/router.ts +++ b/src/service/router.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import { EventEmitter } from "events"; import { Socket } from "socket.io"; diff --git a/src/service/system_file.ts b/src/service/system_file.ts index 7275647..b38fef7 100644 --- a/src/service/system_file.ts +++ b/src/service/system_file.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import path from "path"; import fs from "fs-extra"; diff --git a/src/service/system_instance.ts b/src/service/system_instance.ts index 0a45cbc..72952a1 100644 --- a/src/service/system_instance.ts +++ b/src/service/system_instance.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import fs from "fs-extra"; import path from "path"; diff --git a/src/service/system_instance_control.ts b/src/service/system_instance_control.ts index cc15014..5d77829 100644 --- a/src/service/system_instance_control.ts +++ b/src/service/system_instance_control.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import schedule from "node-schedule"; import InstanceSubsystem from "./system_instance"; diff --git a/src/service/ui.ts b/src/service/ui.ts index f7da51e..92f0205 100644 --- a/src/service/ui.ts +++ b/src/service/ui.ts @@ -1,6 +1,5 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team + import readline from "readline"; import * as protocol from "./protocol"; diff --git a/src/service/version.ts b/src/service/version.ts index 956f571..5edf4dc 100644 --- a/src/service/version.ts +++ b/src/service/version.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team import * as fs from "fs-extra"; import GlobalVariable from "../common/global_variable"; diff --git a/src/tools/filepath.ts b/src/tools/filepath.ts index f37973e..bc15183 100644 --- a/src/tools/filepath.ts +++ b/src/tools/filepath.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team export function checkFileName(fileName: string) { const blackKeys = ["/", "\\", "|", "?", "*", ">", "<", ";", '"']; diff --git a/src/types/properties.d.ts b/src/types/properties.d.ts index 5576966..37ebb05 100644 --- a/src/types/properties.d.ts +++ b/src/types/properties.d.ts @@ -1,6 +1,4 @@ -/* - Copyright (C) 2022 MCSManager Team -*/ +// Copyright (C) 2022 MCSManager Team declare module "properties" { function parse(data: string, options?: any): any; diff --git a/test/1.txt b/test/1.txt deleted file mode 100644 index 072d8c9..0000000 --- a/test/1.txt +++ /dev/null @@ -1 +0,0 @@ -你好中国123ABC你好 \ No newline at end of file diff --git a/test/docker.js b/test/docker.js deleted file mode 100644 index 7d66748..0000000 --- a/test/docker.js +++ /dev/null @@ -1,116 +0,0 @@ -var Docker = require("dockerode"); -// const path = require("path") -var localDocker = new Docker(); - -// console.log("PATH:", __dirname) - -async function main() { - // 镜像列表 - // const res = await localDocker.listImages(); - // console.log(res) - // [ - // { - // Containers: -1, - // Created: 1628797142, - // Id: 'sha256:f4489eef8885a8c994a0e9f5094b19596df58a89d1b18471ebb46cfbb84314c9', - // Labels: null, - // ParentId: '', - // RepoDigests: [ - // 'openjdk@sha256:ad240a929c34ed18ca8a4e1eec679813513391e74e882b15d69d9131ff72ec41' - // ], - // RepoTags: [ 'openjdk:16.0.2' ], - // SharedSize: -1, - // Size: 466931413, - // VirtualSize: 466931413 - // } - // ] - - // 创建镜像 - try { - // const res2 = await localDocker.buildImage(path.join(__dirname, "Dockerfile"), { t: "test1" }); - const res2 = await localDocker.buildImage( - { - context: "/home/suwings/Project2104-Daemon/test_file/test_docker", - src: ["Dockerfile"] - }, - { t: "test1:16" } - ); - console.log("创建指令发送"); - } catch (error) { - console.log("创建错误", error); - } - - // 删除镜像 - // await localDocker.getImage("test1").remove(); - - // 利用镜像创建容器 - // const container = await localDocker.createContainer({ - // Image: "openjdk:16.0.2", - // AttachStdin: true, - // AttachStdout: true, - // AttachStderr: true, - // Tty: true, - // User: `${process.getuid()}:${process.getgid()}`, - // WorkingDir: "/workspace/", - // Cmd: ["java", "-jar", "paper-1.17.1-186.jar"], - // OpenStdin: true, - // StdinOnce: false, - // HostConfig: { - // Binds: ["/home/suwings/dockernode/test_file/:/workspace/"] - // } - // }); - - // // 启动容器 - // await container.start(); - - // const stream = await container.attach({ stream: true, stdout: true, stderr: true, stdin: true }); - // stream.on("data", (data) => { - // process.stdout.write("[Container]" + data.toString()); - // }); - // stream.on("error", (data) => { - // console.log("[Container error]", data.toString()); - // }); - // stream.on("close", async () => { - // console.log("[Container close] ----------------"); - // }); - // // stream.write("help\n") - - // // stream.write("java -jar spigot-1.16.5.jar\n") - // // stream.write("exit\n") - // // 等待容器退出 - // container.wait(async () => { - // console.log("-------------------- container.wait() --------------------"); - // await container.remove(); - // }); - - // setTimeout(() => { - // stream.write("stop\n"); - // }, 10000); - - // setTimeout(async () => { - // await container.kill(); - // await container.remove(); - // }, 3000); - - // [ - // { - // Id: '2882659c40c60cd1ebca058b8b65014887a7126f7cda7c1309c88b510fc4852d', - // Names: [ '/musing_dirac' ], - // Image: 'openjdk:16.0.2', - // ImageID: 'sha256:f4489eef8885a8c994a0e9f5094b19596df58a89d1b18471ebb46cfbb84314c9', - // Command: '/bin/bash', - // Created: 1629017421, - // Ports: [], - // Labels: {}, - // State: 'running', - // Status: 'Up Less than a second', - // HostConfig: { NetworkMode: 'default' }, - // NetworkSettings: { Networks: [Object] }, - // Mounts: [] - // } - // ] - // const res3 = await localDocker.listContainers() - // console.log("容器列表:", res3) -} - -main(); diff --git a/test/env_check.js b/test/env_check.js deleted file mode 100644 index e69de29..0000000 diff --git a/test/extend_worker.js b/test/extend_worker.js deleted file mode 100644 index 189d1f6..0000000 --- a/test/extend_worker.js +++ /dev/null @@ -1,75 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const compressing = require("compressing"); -const fsex = require("fs-extra"); -// const os = require('os'); - -// 此处使用临时解决方案 -// let SYSTEM_CODE = null; -// if (os.platform() == "win32") -const SYSTEM_CODE = "GBK"; -// else -// SYSTEM_CODE = 'UTF-8'; - -// 任务参数获取 -const argv = process.argv; -const realArgv = argv.filter((val, index) => { - return index >= 2; -}); - -// 特殊文件操作子进程 -// 为了防止用户解压/压缩/删除 文件数量过大导致整个面板反应速度下降或者无反应 -// 所有耗时的文件操作(除非异步)均写入此。 -if (realArgv.length >= 1) { - const ACTION = realArgv[0]; - - //解压子进程开始执行 - if (ACTION === "extract") { - //执行解压 - const absPath = realArgv[1]; - //目录名与原文件同名 - const zipExtractDir = path.normalize(path.dirname(absPath) + "/解压文件_" + path.basename(absPath, path.extname(absPath))); - // 创建目标目录 - try { - fs.mkdirSync(zipExtractDir); - } catch (ignore) { - // 忽略创建目录错误 - } - // 进行解压操作 - compressing.zip - .uncompress(absPath, zipExtractDir, { - zipFileNameEncoding: SYSTEM_CODE - }) - .then(() => { - // BUG note: 此处无法使用 MCSM 全局变量,此为额外任务子进程。感谢 @ColorfulGhost - console.log("解压任务", absPath, "成功."); - }) - .catch((err) => { - console.log("解压任务", absPath, "失败,原因:\n", err); - }); - } - - // 文件删除子进程开始执行 - // 此进程用于删除大量文件时使用,以防造成面板卡顿 - if (ACTION === "remove") { - fsex.removeSync(realArgv[1]); - } - - // 文件压缩子进程 - // 此压缩库支持异步写法,但以防不测,依然列入子进程 - if (ACTION === "compress") { - const absPath = realArgv[1]; - const compressZipPath = path.normalize(path.dirname(absPath) + "/压缩文件_" + path.basename(absPath) + ".zip"); - // 进行压缩操作 - compressing.zip - .compressDir(absPath, compressZipPath, { - zipFileNameEncoding: SYSTEM_CODE - }) - .then(() => { - console.log("压缩任务", absPath, "成功."); - }) - .catch((err) => { - console.log("压缩任务", absPath, "失败,原因:\n", err); - }); - } -} diff --git a/test/unzip.ts b/test/unzip.ts deleted file mode 100644 index a1055e5..0000000 --- a/test/unzip.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * @Author: Copyright(c) 2021 Suwings - * @Date: 2021-08-24 19:34:48 - * @LastEditTime: 2021-08-24 20:12:02 - * @Description: - * @Projcet: MCSManager Daemon - */ - -import child_process from "child_process"; - -function zipFiles(zipName: string, files: string[]) { - const cmd = `7z.exe a ${zipName} ${files.join(" ")}`.split(" "); - console.log(`[7zip 压缩任务] ${cmd}`); - return new Promise((resolve, reject) => { - const p = cmd.splice(1); - const process = child_process.spawn(cmd[0], [...p], { - cwd: "../7zip/" - }); - if (!process || !process.pid) return reject(false); - process.on("exit", (code) => { - if (code) return reject(false); - return resolve(true); - }); - }); -} - -async function unzipArchive(sourceZip: string, destDir: string) { - // ./7z.exe x archive.zip -oD:\7-Zip - const cmd = `7z.exe x ${sourceZip} -o${destDir}`.split(" "); - console.log(`[7zip 解压任务] ${cmd.join(" ")}`); - return new Promise((resolve, reject) => { - const process = child_process.spawn(cmd[0], [cmd[1], cmd[2], cmd[3]], { - cwd: "../7zip/" - }); - if (!process || !process.pid) return reject(false); - process.on("exit", (code) => { - if (code) return reject(false); - return resolve(true); - }); - }); -} - -async function main() { - await zipFiles("a.zip", ["D:/MineSuwings/Project2104-Daemon/test_file"]); - await unzipArchive("a.zip", "D:/MineSuwings/Project2104-Daemon/test_file/a"); -} - -main(); diff --git a/test/zlibt.js b/test/zlibt.js deleted file mode 100644 index 2a837c2..0000000 --- a/test/zlibt.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @Author: Copyright(c) 2021 Suwings - * @Date: 2021-08-24 20:05:46 - * @LastEditTime: 2021-08-24 20:10:03 - * @Description: - * @Projcet: MCSManager Daemon - */ -const zlib = require("zlib"); -const fs = require("fs"); -// const Buffer = zlib.unzipSync(fs.readFileSync("abc.zip")); - -let gzip = zlib.createGunzip(); - -let inFile = fs.createReadStream("./a.zip"); -let out = fs.createWriteStream("./2.txt"); - -inFile.pipe(gzip).pipe(out);