From 27ae33135267ab21d92db8246038e87a99bb0bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 27 Aug 2024 20:37:23 +0800 Subject: [PATCH] chore: new adapter --- src/nekodog/Readme.md | 2 ++ src/nekodog/api/index.ts | 0 src/nekodog/event/index.ts | 0 src/nekodog/helper/index.ts | 0 src/nekodog/index.ts | 1 + src/nekodog/network/socket.ts | 18 ++++++++++++++++++ src/onebot/external/onebot11.json | 2 +- 7 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/nekodog/Readme.md create mode 100644 src/nekodog/api/index.ts create mode 100644 src/nekodog/event/index.ts create mode 100644 src/nekodog/helper/index.ts create mode 100644 src/nekodog/index.ts create mode 100644 src/nekodog/network/socket.ts diff --git a/src/nekodog/Readme.md b/src/nekodog/Readme.md new file mode 100644 index 00000000..a8f5bee6 --- /dev/null +++ b/src/nekodog/Readme.md @@ -0,0 +1,2 @@ +# nekodog +此协议为替代QQ平台 OnebotV11长期不可靠问题 \ No newline at end of file diff --git a/src/nekodog/api/index.ts b/src/nekodog/api/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/nekodog/event/index.ts b/src/nekodog/event/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/nekodog/helper/index.ts b/src/nekodog/helper/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/nekodog/index.ts b/src/nekodog/index.ts new file mode 100644 index 00000000..5e895a7c --- /dev/null +++ b/src/nekodog/index.ts @@ -0,0 +1 @@ +import { createServer } from 'node:net'; \ No newline at end of file diff --git a/src/nekodog/network/socket.ts b/src/nekodog/network/socket.ts new file mode 100644 index 00000000..00f8b014 --- /dev/null +++ b/src/nekodog/network/socket.ts @@ -0,0 +1,18 @@ +import { createServer } from 'node:net'; +export class NewAdapterNetwork { + constructor(public host: number, public port: number) { } + async open() { + const server = createServer((socket) => { + socket.on('data', (data) => { + + }); + socket.on('end', () => { + + }); + socket.on('connect', () => { + + }) + }); + server.listen(this.port, this.host); + } +} \ No newline at end of file diff --git a/src/onebot/external/onebot11.json b/src/onebot/external/onebot11.json index 8ee5a368..3901fa73 100644 --- a/src/onebot/external/onebot11.json +++ b/src/onebot/external/onebot11.json @@ -1,6 +1,6 @@ { "http": { - "enable": false, + "enable": true, "host": "", "port": 3000, "secret": "",