From 652fb277df5f492336cd5104f701b18c31c0e30e Mon Sep 17 00:00:00 2001 From: ljqing Date: Fri, 13 Jan 2023 16:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E8=9E=8D?= =?UTF-8?q?=E5=90=88=E9=80=89=E9=A1=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 12 ++++++++++++ src/entities/WSProtocol.ts | 26 ++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index c83e0fd..9ba1fc0 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1475,6 +1475,18 @@ export default class ClientConnection { ); } + public async SetBlendingOption( + id: number, + value: number + ) { + return await this.doRpc( + new Protocol.SetBlendingOptionRequestEntity( + id, + value + ) + ); + } + public destory() { this.ws?.close(); if (this.ws) { diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 1e64b73..5f88bf8 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -523,6 +523,9 @@ export namespace Protocol { public static get kResetBlending() { return Commands.PROTOCOL_PREFIX + "ResetBlending"; } + public static get kSetBlendingOption() { + return Commands.PROTOCOL_PREFIX + "SetBlendingOption"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -653,8 +656,9 @@ export namespace Protocol { Commands.kGetBlendingConfig, Commands.kSaveBlendingConfig, Commands.kSetBlendingHorDensity, - Commands.kSetBlendingVerDensity, - Commands.kResetBlending, + Commands.kSetBlendingVerDensity, + Commands.kResetBlending, + Commands.kSetBlendingOption, ]); public static get AllCommands() { return this._all_commands; @@ -3462,4 +3466,22 @@ export namespace Protocol { super.rpc_id = rpc_id; } } + + export class SetBlendingOptionRequestEntity extends PacketEntity { + constructor( + id: number, + value: number, + rpc_id = 0 + ) { + super(); + super.command = Commands.kSetBlendingOption; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.id = id ?? 0; + this.value = value ?? 0; + } + id = 0; + value = 0; + } }