diff --git a/src/core/adapters/NodeIDependsAdapter.ts b/src/core/adapters/NodeIDependsAdapter.ts index dbf280e3..87baf540 100644 --- a/src/core/adapters/NodeIDependsAdapter.ts +++ b/src/core/adapters/NodeIDependsAdapter.ts @@ -1,9 +1,8 @@ +import { MsfChangeReasonType, MsfStatusType } from "../entities/adapter"; + export class NodeIDependsAdapter { - onMSFStatusChange(arg1: number, arg2: number) { - // console.log(arg1, arg2); - // if (arg1 == 2 && arg2 == 2) { - // log("NapCat丢失网络连接,请检查网络") - // } + onMSFStatusChange(statusType: MsfStatusType, changeReasonType: MsfChangeReasonType) { + } onMSFSsoError(args: unknown) { diff --git a/src/core/entities/adapter.ts b/src/core/entities/adapter.ts new file mode 100644 index 00000000..3f0113ea --- /dev/null +++ b/src/core/entities/adapter.ts @@ -0,0 +1,11 @@ +export enum MsfStatusType { + KUNKNOWN, + KDISCONNECTED, + KCONNECTED +} +export enum MsfChangeReasonType { + KUNKNOWN, + KUSERLOGININ, + KUSERLOGINOUT, + KAUTO +} \ No newline at end of file diff --git a/src/shell/napcat.ts b/src/shell/napcat.ts index 4beeded5..1a2a704b 100644 --- a/src/shell/napcat.ts +++ b/src/shell/napcat.ts @@ -229,7 +229,7 @@ export async function NCoreInitShell() { sessionConfig, new NodeIDependsAdapter(), new NodeIDispatcherAdapter(), - sessionListener as any, + sessionListener, ); try { session.startNT(0);