mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: 开始初步调试
This commit is contained in:
parent
f7c1951191
commit
25e42720cf
@ -29,7 +29,7 @@ export class NativePacketClient extends PacketClient {
|
|||||||
logger.logError(`[NativePacketClient] Unsupported platform: ${platform}`);
|
logger.logError(`[NativePacketClient] Unsupported platform: ${platform}`);
|
||||||
return 0;
|
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)) {
|
if (!fs.existsSync(moehoo_path)) {
|
||||||
logger.logError(`[NativePacketClient] Missing moehoo binary: ${moehoo_path}`);
|
logger.logError(`[NativePacketClient] Missing moehoo binary: ${moehoo_path}`);
|
||||||
return 0;
|
return 0;
|
||||||
@ -43,7 +43,7 @@ export class NativePacketClient extends PacketClient {
|
|||||||
|
|
||||||
async init(pid: number, recv: string, send: string): Promise<void> {
|
async init(pid: number, recv: string, send: string): Promise<void> {
|
||||||
const platform = process.platform + '.' + process.arch;
|
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);
|
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) => {
|
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'));
|
const callback = this.cb.get(createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex') + (type === 0 ? 'send' : 'recv'));
|
||||||
|
BIN
src/native/packet/MoeHoo.win32.node
Normal file
BIN
src/native/packet/MoeHoo.win32.node
Normal file
Binary file not shown.
@ -26,6 +26,7 @@ const FrameworkBaseConfigPlugin: PluginOption[] = [
|
|||||||
targets: [
|
targets: [
|
||||||
{ src: './manifest.json', dest: 'dist' },
|
{ src: './manifest.json', dest: 'dist' },
|
||||||
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
{ 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: './static/', dest: 'dist/static/', flatten: false },
|
||||||
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },
|
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },
|
||||||
{ src: './src/framework/liteloader.cjs', dest: 'dist' },
|
{ src: './src/framework/liteloader.cjs', dest: 'dist' },
|
||||||
@ -42,6 +43,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [
|
|||||||
cp({
|
cp({
|
||||||
targets: [
|
targets: [
|
||||||
{ src: './src/native/external', dest: 'dist/native', flatten: false },
|
{ 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: './static/', dest: 'dist/static/', flatten: false },
|
||||||
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
||||||
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },
|
{ src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user