Compare commits

..
5 Commits
Author SHA1 Message Date
手瓜一十雪 bda174bed4 fix: 异常
Build Release / check-version (push) Canceled after 0s
Build Release / Build-LiteLoader (push) Canceled after 0s
Build Release / Build-Shell (push) Canceled after 0s
Build Release / release-napcat (push) Canceled after 0s
2024-11-16 20:13:36 +08:00
Mlikiowa caf98b8655 release: v4.1.1 2024-11-16 11:26:41 +00:00
手瓜一十雪 c9833c5988 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ
Build Release / check-version (push) Canceled after 0s
Build Release / Build-LiteLoader (push) Canceled after 0s
Build Release / Build-Shell (push) Canceled after 0s
Build Release / release-napcat (push) Canceled after 0s
2024-11-16 19:25:58 +08:00
手瓜一十雪 55ef7e529e fix: 4.1.1 2024-11-16 19:25:54 +08:00
Mlikiowa 9b04ddcefd release: v4.1.0 2024-11-16 10:41:27 +00:00
4 changed files with 10 additions and 10 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
"name": "NapCatQQ",
"slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现",
"version": "4.0.3",
"version": "4.1.1",
"icon": "./logo.png",
"authors": [
{
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "napcat",
"private": true,
"type": "module",
"version": "4.0.3",
"version": "4.1.1",
"scripts": {
"build:framework": "npm run build:webui && vite build --mode framework",
"build:shell": "npm run build:webui && vite build --mode shell",
+1 -1
View File
@@ -1 +1 @@
export const napCatVersion = '4.0.3';
export const napCatVersion = '4.1.1';
+7 -7
View File
@@ -70,7 +70,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
}
private async tryConnect() {
if (!this.connection && this.isEnable) {
if (!this.connection && !this.isEnable) {
let isClosedByError = false;
this.connection = new WebSocket(this.config.url, {
@@ -106,7 +106,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
if (!isClosedByError) {
this.logger.logError.bind(this.logger)(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接意外关闭`);
this.logger.logError.bind(this.logger)(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1000)} 秒后尝试重新连接`);
if (this.isEnable) {
if (!this.isEnable) {
this.connection = null;
setTimeout(() => this.tryConnect(), this.config.reconnectInterval);
}
@@ -116,7 +116,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
isClosedByError = true;
this.logger.logError.bind(this.logger)(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接错误`, err);
this.logger.logError.bind(this.logger)(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1000)} 秒后尝试重新连接`);
if (this.isEnable) {
if (!this.isEnable) {
this.connection = null;
setTimeout(() => this.tryConnect(), this.config.reconnectInterval);
}
@@ -159,7 +159,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
const oldUrl = this.config.url;
const oldHeartInterval = this.config.heartInterval;
this.config = newConfig;
if (newConfig.enable && !wasEnabled) {
this.open();
return OB11NetworkReloadType.NetWorkOpen;
@@ -167,7 +167,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
this.close();
return OB11NetworkReloadType.NetWorkClose;
}
if (oldUrl !== newConfig.url) {
this.close();
if (newConfig.enable) {
@@ -175,7 +175,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
}
return OB11NetworkReloadType.NetWorkReload;
}
if (oldHeartInterval !== newConfig.heartInterval) {
if (this.heartbeatRef) {
clearInterval(this.heartbeatRef);
@@ -190,7 +190,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
}
return OB11NetworkReloadType.NetWorkReload;
}
return OB11NetworkReloadType.Normal;
}
}