This commit is contained in:
手瓜一十雪
2025-02-07 17:25:48 +08:00
parent 8968c51cdc
commit 2f67bef139
2 changed files with 17 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
import { GeneralCallResult } from './common'; import { GeneralCallResult } from './common';
enum ProxyType {
HTTP = 1,
SOCKET = 2
}
export interface NodeIKernelMSFService { export interface NodeIKernelMSFService {
getServerTime(): string; getServerTime(): string;
setNetworkProxy(param: { setNetworkProxy(param: {
@@ -7,7 +10,7 @@ export interface NodeIKernelMSFService {
userPwd: string, userPwd: string,
address: string, address: string,
port: number, port: number,
proxyType: number, proxyType: ProxyType,
domain: string, domain: string,
isSocket: boolean isSocket: boolean
}): Promise<GeneralCallResult>; }): Promise<GeneralCallResult>;

View File

@@ -294,6 +294,18 @@ export async function NCoreInitShell() {
const dataTimestape = new Date().getTime().toString(); const dataTimestape = new Date().getTime().toString();
o3Service.reportAmgomWeather('login', 'a1', [dataTimestape, '0', '0']); o3Service.reportAmgomWeather('login', 'a1', [dataTimestape, '0', '0']);
if (process.env['NAPCAT_PROXY_PORT']) {
session.getMSFService().setNetworkProxy({
userName: '',
userPwd: '',
address: process.env['NAPCAT_PROXY_ADDRESS'] || '127.0.0.1',
port: +process.env['NAPCAT_PROXY_PORT'],
proxyType: 2,
domain: '',
isSocket: true
});
logger.logWarn('已设置代理', process.env['NAPCAT_PROXY_ADDRESS'], process.env['NAPCAT_PROXY_PORT']);
}
const selfInfo = await handleLogin(loginService, logger, pathWrapper, quickLoginUin, historyLoginList); const selfInfo = await handleLogin(loginService, logger, pathWrapper, quickLoginUin, historyLoginList);
const amgomDataPiece = 'eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129'; const amgomDataPiece = 'eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129';
o3Service.setAmgomDataPiece(basicInfoWrapper.QQVersionAppid, new Uint8Array(Buffer.from(amgomDataPiece, 'hex'))); o3Service.setAmgomDataPiece(basicInfoWrapper.QQVersionAppid, new Uint8Array(Buffer.from(amgomDataPiece, 'hex')));