mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eeec905df0 | ||
![]() |
0c6aac7f66 | ||
![]() |
86d22db141 | ||
![]() |
48a5d0eef3 | ||
![]() |
bda174bed4 | ||
![]() |
caf98b8655 | ||
![]() |
c9833c5988 | ||
![]() |
55ef7e529e | ||
![]() |
9b04ddcefd |
@@ -4,7 +4,7 @@
|
|||||||
"name": "NapCatQQ",
|
"name": "NapCatQQ",
|
||||||
"slug": "NapCat.Framework",
|
"slug": "NapCat.Framework",
|
||||||
"description": "高性能的 OneBot 11 协议实现",
|
"description": "高性能的 OneBot 11 协议实现",
|
||||||
"version": "4.0.3",
|
"version": "4.1.2",
|
||||||
"icon": "./logo.png",
|
"icon": "./logo.png",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"name": "napcat",
|
"name": "napcat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "4.0.3",
|
"version": "4.1.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:framework": "npm run build:webui && vite build --mode framework",
|
"build:framework": "npm run build:webui && vite build --mode framework",
|
||||||
"build:shell": "npm run build:webui && vite build --mode shell",
|
"build:shell": "npm run build:webui && vite build --mode shell",
|
||||||
|
@@ -1 +1 @@
|
|||||||
export const napCatVersion = '4.0.3';
|
export const napCatVersion = '4.1.2';
|
||||||
|
@@ -43,7 +43,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
}
|
}
|
||||||
}, this.config.heartInterval);
|
}, this.config.heartInterval);
|
||||||
}
|
}
|
||||||
|
this.isEnable = true;
|
||||||
await this.tryConnect();
|
await this.tryConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
const oldUrl = this.config.url;
|
const oldUrl = this.config.url;
|
||||||
const oldHeartInterval = this.config.heartInterval;
|
const oldHeartInterval = this.config.heartInterval;
|
||||||
this.config = newConfig;
|
this.config = newConfig;
|
||||||
|
|
||||||
if (newConfig.enable && !wasEnabled) {
|
if (newConfig.enable && !wasEnabled) {
|
||||||
this.open();
|
this.open();
|
||||||
return OB11NetworkReloadType.NetWorkOpen;
|
return OB11NetworkReloadType.NetWorkOpen;
|
||||||
@@ -167,7 +167,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
this.close();
|
this.close();
|
||||||
return OB11NetworkReloadType.NetWorkClose;
|
return OB11NetworkReloadType.NetWorkClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldUrl !== newConfig.url) {
|
if (oldUrl !== newConfig.url) {
|
||||||
this.close();
|
this.close();
|
||||||
if (newConfig.enable) {
|
if (newConfig.enable) {
|
||||||
@@ -175,7 +175,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
}
|
}
|
||||||
return OB11NetworkReloadType.NetWorkReload;
|
return OB11NetworkReloadType.NetWorkReload;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldHeartInterval !== newConfig.heartInterval) {
|
if (oldHeartInterval !== newConfig.heartInterval) {
|
||||||
if (this.heartbeatRef) {
|
if (this.heartbeatRef) {
|
||||||
clearInterval(this.heartbeatRef);
|
clearInterval(this.heartbeatRef);
|
||||||
@@ -190,7 +190,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
}
|
}
|
||||||
return OB11NetworkReloadType.NetWorkReload;
|
return OB11NetworkReloadType.NetWorkReload;
|
||||||
}
|
}
|
||||||
|
|
||||||
return OB11NetworkReloadType.Normal;
|
return OB11NetworkReloadType.Normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
wsClients: WebSocket[] = [];
|
wsClients: WebSocket[] = [];
|
||||||
wsClientsMutex = new Mutex();
|
wsClientsMutex = new Mutex();
|
||||||
isEnable: boolean = false;
|
isEnable: boolean = false;
|
||||||
hasBeenClosed: boolean = false;
|
|
||||||
heartbeatInterval: number = 0;
|
heartbeatInterval: number = 0;
|
||||||
logger: LogWrapper;
|
logger: LogWrapper;
|
||||||
public config: WebsocketServerConfig;
|
public config: WebsocketServerConfig;
|
||||||
@@ -107,10 +106,6 @@ export class OB11PassiveWebSocketAdapter implements IOB11NetworkAdapter {
|
|||||||
this.logger.logError.bind(this.logger)('[OneBot] [WebSocket Server] Cannot open a opened WebSocket server');
|
this.logger.logError.bind(this.logger)('[OneBot] [WebSocket Server] Cannot open a opened WebSocket server');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.hasBeenClosed) {
|
|
||||||
this.logger.logError.bind(this.logger)('[OneBot] [WebSocket Server] Cannot open a WebSocket server that has been closed');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const addressInfo = this.wsServer.address();
|
const addressInfo = this.wsServer.address();
|
||||||
this.logger.log('[OneBot] [WebSocket Server] Server Started', typeof (addressInfo) === 'string' ? addressInfo : addressInfo?.address + ':' + addressInfo?.port);
|
this.logger.log('[OneBot] [WebSocket Server] Server Started', typeof (addressInfo) === 'string' ? addressInfo : addressInfo?.address + ':' + addressInfo?.port);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user