Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64beeba2d0 | ||
|
|
b3b946e91d | ||
|
|
7e9d852617 | ||
|
|
5da1586811 | ||
|
|
743de940df | ||
|
|
e37fa59b8c | ||
|
|
18d0f11320 |
No files matched your search
Binary file not shown.
+5
-5
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "qq-chat",
|
||||
"verHash": "2c9d3f6c",
|
||||
"version": "9.9.22-40990",
|
||||
"linuxVersion": "3.2.20-40990",
|
||||
"linuxVerHash": "ec800879",
|
||||
"verHash": "c50d6326",
|
||||
"version": "9.9.22-40768",
|
||||
"linuxVersion": "3.2.20-40768",
|
||||
"linuxVerHash": "ab90fdfa",
|
||||
"private": true,
|
||||
"description": "QQ",
|
||||
"productName": "QQ",
|
||||
@@ -17,7 +17,7 @@
|
||||
"qd": "externals/devtools/cli/index.js"
|
||||
},
|
||||
"main": "./loadNapCat.js",
|
||||
"buildVersion": "40990",
|
||||
"buildVersion": "40768",
|
||||
"isPureShell": true,
|
||||
"isByteCodeShell": true,
|
||||
"platform": "win32",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "4.9.11",
|
||||
"version": "4.9.0",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "4.9.11",
|
||||
"version": "4.9.0",
|
||||
"scripts": {
|
||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||
|
||||
@@ -20,9 +20,9 @@ function getAddonPath(binaryPath: string): string {
|
||||
const archName = arch();
|
||||
|
||||
let addonFileName: string = process.platform + '.' + process.arch;
|
||||
let addonPath = path.join(binaryPath, "./native/ffmpeg/", `ffmpegAddon.${addonFileName}.node`);
|
||||
if (!existsSync(addonPath)) {
|
||||
throw new Error(`Unsupported platform: ${platformName} ${archName} - Addon not found at ${addonPath}`);
|
||||
let addonPath = path.join(binaryPath, "./native/ffmpeg/", `${addonFileName}.node`);
|
||||
if (existsSync(addonPath)) {
|
||||
throw new Error(`Unsupported platform: ${platformName} ${archName}`);
|
||||
}
|
||||
return addonPath;
|
||||
}
|
||||
@@ -44,12 +44,16 @@ export class FFmpegAddonAdapter implements IFFmpegAdapter {
|
||||
*/
|
||||
async isAvailable(): Promise<boolean> {
|
||||
try {
|
||||
const addonPath = getAddonPath(this.binaryPath);
|
||||
if (!existsSync(addonPath)) {
|
||||
return false;
|
||||
}
|
||||
let temp_addon = { exports: {} };
|
||||
dlopen(temp_addon, getAddonPath(this.binaryPath));
|
||||
dlopen(temp_addon, addonPath);
|
||||
this.addon = temp_addon.exports as FFmpeg;
|
||||
return this.addon !== null;
|
||||
} catch (error) {
|
||||
console.log('[FFmpegAddonAdapter] Failed to load addon:', error);
|
||||
console.error('[FFmpegAddonAdapter] Failed to load addon:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const napCatVersion = '4.9.11';
|
||||
export const napCatVersion = '4.9.0';
|
||||
Vendored
-8
@@ -426,13 +426,5 @@
|
||||
"3.2.20-40990": {
|
||||
"appid": 537319891,
|
||||
"qua": "V1_LNX_NQ_3.2.20_40990_GW_B"
|
||||
},
|
||||
"9.9.23-41679": {
|
||||
"appid": 537320110,
|
||||
"qua": "V1_WIN_NQ_9.9.23.41679_GW_B"
|
||||
},
|
||||
"6.8.83-41679": {
|
||||
"appid": 537320135,
|
||||
"qua": "V1_MAC_NQ_6.9.83_41679_GW_B"
|
||||
}
|
||||
}
|
||||
Vendored
+3
-15
@@ -12,15 +12,15 @@
|
||||
"recv": "1D8CA9D"
|
||||
},
|
||||
"3.2.20-40768-x64": {
|
||||
"send": "2A1B840",
|
||||
"send": "2CC8120",
|
||||
"recv": "2D28F20"
|
||||
},
|
||||
"3.2.20-40824-x64": {
|
||||
"send": "2A1B840",
|
||||
"send": "2CC8120",
|
||||
"recv": "2D28F20"
|
||||
},
|
||||
"3.2.20-40990-x64": {
|
||||
"send": "2A1B840",
|
||||
"send": "2CC8120",
|
||||
"recv": "2D28F20"
|
||||
},
|
||||
"3.2.20-40990-arm64": {
|
||||
@@ -34,17 +34,5 @@
|
||||
"3.2.20-40768-arm64": {
|
||||
"send": "157C0E8",
|
||||
"recv": "1546658"
|
||||
},
|
||||
"9.9.23-41679-x64": {
|
||||
"send": "09FF0F4",
|
||||
"recv": "1D1A039"
|
||||
},
|
||||
"6.9.82-40990-arm64": {
|
||||
"send": "0822F0C",
|
||||
"recv": "0B41B90"
|
||||
},
|
||||
"6.9.83-41679-arm64": {
|
||||
"send": "06DFD30",
|
||||
"recv": "0957648"
|
||||
}
|
||||
}
|
||||
Vendored
-8
@@ -558,13 +558,5 @@
|
||||
"6.9.82-40990-arm64": {
|
||||
"send": "202A198",
|
||||
"recv": "202B718"
|
||||
},
|
||||
"9.9.23-41679-x64": {
|
||||
"send": "2C94520",
|
||||
"recv": "2C97AA0"
|
||||
},
|
||||
"6.9.83-41679-arm64": {
|
||||
"send": "3D718F8",
|
||||
"recv": "3D74208"
|
||||
}
|
||||
}
|
||||
+1
-14
@@ -139,20 +139,8 @@ export interface NodeQQNTWrapperUtil {
|
||||
|
||||
isNull(): unknown;
|
||||
}
|
||||
export interface NodeIQQNTStartupSessionWrapper {
|
||||
create(): NodeIQQNTStartupSessionWrapper;
|
||||
stop(): void;
|
||||
start(): void;
|
||||
createWithModuleList(uk: unknown): unknown;
|
||||
getSessionIdList(): unknown;
|
||||
}
|
||||
|
||||
export interface NodeIQQNTWrapperSession {
|
||||
getNTWrapperSession(str: string): NodeIQQNTWrapperSession;
|
||||
|
||||
get(): NodeIQQNTWrapperSession;
|
||||
|
||||
new(): NodeIQQNTWrapperSession;
|
||||
|
||||
create(): NodeIQQNTWrapperSession;
|
||||
|
||||
init(
|
||||
@@ -281,7 +269,6 @@ export interface WrapperNodeApi {
|
||||
NodeIO3MiscService: NodeIO3MiscService;
|
||||
NodeQQNTWrapperUtil: NodeQQNTWrapperUtil;
|
||||
NodeIQQNTWrapperSession: NodeIQQNTWrapperSession;
|
||||
NodeIQQNTStartupSessionWrapper: NodeIQQNTStartupSessionWrapper
|
||||
NodeIQQNTWrapperEngine: NodeIQQNTWrapperEngine;
|
||||
NodeIKernelLoginService: NodeIKernelLoginService;
|
||||
|
||||
|
||||
@@ -39,9 +39,9 @@ export async function NCoreInitFramework(
|
||||
const basicInfoWrapper = new QQBasicInfoWrapper({ logger });
|
||||
const wrapper = loadQQWrapper(basicInfoWrapper.getFullQQVersion());
|
||||
const nativePacketHandler = new NativePacketHandler({ logger }); // 初始化 NativePacketHandler 用于后续使用
|
||||
// nativePacketHandler.onAll((packet) => {
|
||||
// console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
||||
// });
|
||||
nativePacketHandler.onAll((packet) => {
|
||||
console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
||||
});
|
||||
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion());
|
||||
// 在 init 之后注册监听器
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -126,11 +126,7 @@ export class OneBotGroupApi {
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
async registerParseGroupReactEvent() {
|
||||
this.obContext.core.context.packetHandler.onCmd('trpc.msg.olpush.OlPushService.MsgPush', async (packet) => {
|
||||
console.log(packet.seq, packet.hex_data);
|
||||
});
|
||||
}
|
||||
|
||||
async parsePaiYiPai(msg: RawMessage, jsonStr: string) {
|
||||
const json = JSON.parse(jsonStr);
|
||||
//判断业务类型
|
||||
|
||||
+13
-28
@@ -10,7 +10,6 @@ import {
|
||||
loadQQWrapper,
|
||||
NapCatCore,
|
||||
NapCatCoreWorkingEnv,
|
||||
NodeIQQNTStartupSessionWrapper,
|
||||
NodeIQQNTWrapperEngine,
|
||||
NodeIQQNTWrapperSession,
|
||||
PlatformType,
|
||||
@@ -243,8 +242,7 @@ async function handleLoginInner(context: { isLogined: boolean }, logger: LogWrap
|
||||
|
||||
async function initializeSession(
|
||||
session: NodeIQQNTWrapperSession,
|
||||
sessionConfig: WrapperSessionInitConfig,
|
||||
startupSession: NodeIQQNTStartupSessionWrapper | null
|
||||
sessionConfig: WrapperSessionInitConfig
|
||||
) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const sessionListener = new NodeIKernelSessionListener();
|
||||
@@ -261,17 +259,13 @@ async function initializeSession(
|
||||
new NodeIDispatcherAdapter(),
|
||||
sessionListener,
|
||||
);
|
||||
if (startupSession) {
|
||||
startupSession.start();
|
||||
} else {
|
||||
try {
|
||||
session.startNT(0);
|
||||
} catch {
|
||||
try {
|
||||
session.startNT(0);
|
||||
} catch {
|
||||
try {
|
||||
session.startNT();
|
||||
} catch (e: unknown) {
|
||||
reject(new Error('init failed ' + (e as Error).message));
|
||||
}
|
||||
session.startNT();
|
||||
} catch (e: unknown) {
|
||||
reject(new Error('init failed ' + (e as Error).message));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -328,9 +322,9 @@ export async function NCoreInitShell() {
|
||||
const wrapper = loadQQWrapper(basicInfoWrapper.getFullQQVersion());
|
||||
const nativePacketHandler = new NativePacketHandler({ logger }); // 初始化 NativePacketHandler 用于后续使用
|
||||
|
||||
// nativePacketHandler.onAll((packet) => {
|
||||
// console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
||||
// });
|
||||
nativePacketHandler.onAll((packet) => {
|
||||
console.log('[Packet]', packet.uin, packet.cmd, packet.hex_data);
|
||||
});
|
||||
await nativePacketHandler.init(basicInfoWrapper.getFullQQVersion());
|
||||
|
||||
const o3Service = wrapper.NodeIO3MiscService.get();
|
||||
@@ -341,17 +335,8 @@ export async function NCoreInitShell() {
|
||||
|
||||
const engine = wrapper.NodeIQQNTWrapperEngine.get();
|
||||
const loginService = wrapper.NodeIKernelLoginService.get();
|
||||
let session: NodeIQQNTWrapperSession;
|
||||
let startupSession: NodeIQQNTStartupSessionWrapper | null = null;
|
||||
try {
|
||||
//session = new wrapper.NodeIQQNTWrapperSession();
|
||||
startupSession = wrapper.NodeIQQNTStartupSessionWrapper.create();
|
||||
// data.start();
|
||||
session = wrapper.NodeIQQNTWrapperSession.getNTWrapperSession('nt_1');
|
||||
} catch (e: unknown) {
|
||||
session = wrapper.NodeIQQNTWrapperSession.create();
|
||||
console.log('Error creating session:', e);
|
||||
}
|
||||
const session = wrapper.NodeIQQNTWrapperSession.create();
|
||||
|
||||
const [dataPath, dataPathGlobal] = getDataPaths(wrapper);
|
||||
const systemPlatform = getPlatformType();
|
||||
|
||||
@@ -385,7 +370,7 @@ export async function NCoreInitShell() {
|
||||
dataPath,
|
||||
);
|
||||
|
||||
await initializeSession(session, sessionConfig, startupSession);
|
||||
await initializeSession(session, sessionConfig);
|
||||
|
||||
const accountDataPath = path.resolve(dataPath, './NapCat/data');
|
||||
//判断dataPath是否为根目录 或者 D:/ 之类的盘目录
|
||||
|
||||
Reference in new issue
Block a user