Compare commits

...

4 Commits

Author SHA1 Message Date
手瓜一十雪
cc8a387bde re: glibc 2025-10-31 15:12:46 +08:00
Mlikiowa
962685ade6 release: v4.9.11 2025-10-31 06:43:40 +00:00
手瓜一十雪
36fdaac406 feat: 适配41697 2025-10-31 14:42:46 +08:00
Mlikiowa
db16db911b release: v4.9.10 2025-10-31 04:38:12 +00:00
8 changed files with 45 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
"name": "NapCatQQ",
"slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现",
"version": "4.9.9",
"version": "4.9.11",
"icon": "./logo.png",
"authors": [
{

View File

@@ -2,7 +2,7 @@
"name": "napcat",
"private": true,
"type": "module",
"version": "4.9.9",
"version": "4.9.11",
"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",

View File

@@ -1 +1 @@
export const napCatVersion = '4.9.9';
export const napCatVersion = '4.9.11';

View File

@@ -139,10 +139,20 @@ 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(
@@ -271,6 +281,7 @@ export interface WrapperNodeApi {
NodeIO3MiscService: NodeIO3MiscService;
NodeQQNTWrapperUtil: NodeQQNTWrapperUtil;
NodeIQQNTWrapperSession: NodeIQQNTWrapperSession;
NodeIQQNTStartupSessionWrapper: NodeIQQNTStartupSessionWrapper
NodeIQQNTWrapperEngine: NodeIQQNTWrapperEngine;
NodeIKernelLoginService: NodeIKernelLoginService;

View File

@@ -126,7 +126,11 @@ 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);
//判断业务类型

View File

@@ -10,6 +10,7 @@ import {
loadQQWrapper,
NapCatCore,
NapCatCoreWorkingEnv,
NodeIQQNTStartupSessionWrapper,
NodeIQQNTWrapperEngine,
NodeIQQNTWrapperSession,
PlatformType,
@@ -242,7 +243,8 @@ async function handleLoginInner(context: { isLogined: boolean }, logger: LogWrap
async function initializeSession(
session: NodeIQQNTWrapperSession,
sessionConfig: WrapperSessionInitConfig
sessionConfig: WrapperSessionInitConfig,
startupSession: NodeIQQNTStartupSessionWrapper | null
) {
return new Promise<void>((resolve, reject) => {
const sessionListener = new NodeIKernelSessionListener();
@@ -259,13 +261,17 @@ async function initializeSession(
new NodeIDispatcherAdapter(),
sessionListener,
);
try {
session.startNT(0);
} catch {
if (startupSession) {
startupSession.start();
} else {
try {
session.startNT();
} catch (e: unknown) {
reject(new Error('init failed ' + (e as Error).message));
session.startNT(0);
} catch {
try {
session.startNT();
} catch (e: unknown) {
reject(new Error('init failed ' + (e as Error).message));
}
}
}
});
@@ -335,8 +341,17 @@ export async function NCoreInitShell() {
const engine = wrapper.NodeIQQNTWrapperEngine.get();
const loginService = wrapper.NodeIKernelLoginService.get();
const session = new wrapper.NodeIQQNTWrapperSession();
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 [dataPath, dataPathGlobal] = getDataPaths(wrapper);
const systemPlatform = getPlatformType();
@@ -370,7 +385,7 @@ export async function NCoreInitShell() {
dataPath,
);
await initializeSession(session, sessionConfig);
await initializeSession(session, sessionConfig, startupSession);
const accountDataPath = path.resolve(dataPath, './NapCat/data');
//判断dataPath是否为根目录 或者 D:/ 之类的盘目录