code inconsistencies and parameter mismatch in inbound.VLESSSettings class

This commit is contained in:
MHSanaei 2023-12-09 20:06:12 +03:30
parent 56e456ff47
commit 4db42ba409

View File

@ -1776,10 +1776,10 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
constructor(protocol, constructor(protocol,
vlesses=[new Inbound.VLESSSettings.VLESS()], vlesses=[new Inbound.VLESSSettings.VLESS()],
decryption='none', decryption='none',
fallbacks=[],) { fallbacks=[]) {
super(protocol); super(protocol);
this.vlesses = vlesses; this.vlesses = vlesses;
this.decryption = 'none'; // Using decryption is not implemented here this.decryption = decryption;
this.fallbacks = fallbacks; this.fallbacks = fallbacks;
} }
@ -1796,20 +1796,20 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
return new Inbound.VLESSSettings( return new Inbound.VLESSSettings(
Protocols.VLESS, Protocols.VLESS,
json.clients.map(client => Inbound.VLESSSettings.VLESS.fromJson(client)), json.clients.map(client => Inbound.VLESSSettings.VLESS.fromJson(client)),
'none', json.decryption || 'none',
Inbound.VLESSSettings.Fallback.fromJson(json.fallbacks), json.fallbacks.map(fallback => Inbound.VLESSSettings.Fallback.fromJson(fallback)),
); );
} }
toJson() { toJson() {
return { return {
clients: Inbound.VLESSSettings.toJsonArray(this.vlesses), clients: Inbound.VLESSSettings.toJsonArray(this.vlesses),
decryption: 'none', decryption: this.decryption,
fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks), fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks),
}; };
} }
}; };
Inbound.VLESSSettings.VLESS = class extends XrayCommonClass { Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
constructor(id=RandomUtil.randomUUID(), flow='', email=RandomUtil.randomLowerAndNum(8),limitIp=0, totalGB=0, expiryTime=0, enable=true, tgId='', subId=RandomUtil.randomLowerAndNum(16), reset=0) { constructor(id=RandomUtil.randomUUID(), flow='', email=RandomUtil.randomLowerAndNum(8),limitIp=0, totalGB=0, expiryTime=0, enable=true, tgId='', subId=RandomUtil.randomLowerAndNum(16), reset=0) {
super(); super();