diff --git a/src/newcore/index.ts b/src/newcore/index.ts new file mode 100644 index 00000000..89b9370c --- /dev/null +++ b/src/newcore/index.ts @@ -0,0 +1,2 @@ +//统一到处入口 +export * from './main'; \ No newline at end of file diff --git a/src/newcore/main.ts b/src/newcore/main.ts new file mode 100644 index 00000000..38c417c9 --- /dev/null +++ b/src/newcore/main.ts @@ -0,0 +1,29 @@ +enum NapCatCorePlatform { + Node = 'Node',//命令行模式加载 + LiteLoader = 'LiteLoader',//LL插件模式加载 +} +class NewNapCatCore { + platform: NapCatCorePlatform; // 平台 + constructor(platform: NapCatCorePlatform) { + this.platform = platform; + } +} +export class NapCatCoreManger { + static core: NewNapCatCore | undefined = undefined; + static defaultPlatform: NapCatCorePlatform = NapCatCorePlatform.Node; + static SetDefaultCore(platform: NapCatCorePlatform) { + if (this.core !== undefined) { + return; + } + this.defaultPlatform = platform; + } + static GetPlatform(): NapCatCorePlatform { + return NapCatCoreManger.defaultPlatform; + } + static GetInstance(): NewNapCatCore { + if (this.core === undefined) { + this.core = new NewNapCatCore(NapCatCoreManger.defaultPlatform); + } + return this.core; + } +} \ No newline at end of file diff --git a/src/newcore/platform/liteloader/index.ts b/src/newcore/platform/liteloader/index.ts new file mode 100644 index 00000000..7f2ec822 --- /dev/null +++ b/src/newcore/platform/liteloader/index.ts @@ -0,0 +1 @@ +//拦截proxy到会话 \ No newline at end of file diff --git a/src/newcore/platform/node/index.ts b/src/newcore/platform/node/index.ts new file mode 100644 index 00000000..6040b8db --- /dev/null +++ b/src/newcore/platform/node/index.ts @@ -0,0 +1 @@ +//初始化跟之前一样 \ No newline at end of file diff --git a/src/newcore/util/proxyWrapper.ts b/src/newcore/util/proxyWrapper.ts new file mode 100644 index 00000000..0fea8f66 --- /dev/null +++ b/src/newcore/util/proxyWrapper.ts @@ -0,0 +1 @@ +//proxy封装工具类 \ No newline at end of file