fix: 开始初步调试

This commit is contained in:
手瓜一十雪 2024-11-05 10:14:00 +08:00
parent f7c1951191
commit 25e42720cf
3 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ export class NativePacketClient extends PacketClient {
logger.logError(`[NativePacketClient] Unsupported platform: ${platform}`);
return 0;
}
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/moehoo.' + platform + '.node');
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node');
if (!fs.existsSync(moehoo_path)) {
logger.logError(`[NativePacketClient] Missing moehoo binary: ${moehoo_path}`);
return 0;
@ -43,7 +43,7 @@ export class NativePacketClient extends PacketClient {
async init(pid: number, recv: string, send: string): Promise<void> {
const platform = process.platform + '.' + process.arch;
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/moehoo.' + platform + '.node');
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node');
process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY);
this.MoeHooExport.exports?.InitHook(recv, send, (type: number, uin: string, seq: number, cmd: string, hex_data: string) => {
const callback = this.cb.get(createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex') + (type === 0 ? 'send' : 'recv'));

Binary file not shown.

View File

@ -26,6 +26,7 @@ const FrameworkBaseConfigPlugin: PluginOption[] = [
targets: [
{ src: './manifest.json', dest: 'dist' },
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
{ src: './src/native/packet', dest: 'dist/moehoo', flatten: false },
{ src: './static/', dest: 'dist/static/', flatten: false },
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },
{ src: './src/framework/liteloader.cjs', dest: 'dist' },
@ -42,6 +43,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [
cp({
targets: [
{ src: './src/native/external', dest: 'dist/native', flatten: false },
{ src: './src/native/packet', dest: 'dist/moehoo', flatten: false },
{ src: './static/', dest: 'dist/static/', flatten: false },
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },