From 9688c7ef01e3b3ac4b44e9e23a51d5cadb0d05d3 Mon Sep 17 00:00:00 2001 From: dogjutsu <49013203+dogjutsu@users.noreply.github.com> Date: Sun, 8 Jan 2023 08:34:52 -0800 Subject: [PATCH 1/3] Doc fixes related to MSRS w/ DCS-gRPC alt backend --- Moose Development/Moose/Sound/SRS.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Moose Development/Moose/Sound/SRS.lua b/Moose Development/Moose/Sound/SRS.lua index 341d978fc..047d34921 100644 --- a/Moose Development/Moose/Sound/SRS.lua +++ b/Moose Development/Moose/Sound/SRS.lua @@ -131,13 +131,13 @@ -- all of the features and options available with 'DCS-SR-ExternalAudio.exe'. Of note, only text-to-speech is supported and it it cannot be used to transmit audio files. -- -- DCS-gRPC must be installed and configured per the [DCS-gRPC documentation](https://github.com/DCS-gRPC/rust-server) and already running via either the 'autostart' mechanism --- or a Lua call to 'GRPC.load()' prior to useof the alternate DCS-gRPC backend. Note that if a cloud TTS provider is being used, the API key must be set via the 'Config\dcs-grpc.lua' --- configuration file prior DCS-gRPC being started. +-- or a Lua call to 'GRPC.load()' prior to use of the alternate DCS-gRPC backend. If a cloud TTS provider is being used, the API key must be set via the 'Config\dcs-grpc.lua' +-- configuration file prior DCS-gRPC being started. DCS-gRPC can be used both with DCS dedicated server and regular DCS installations. -- --- To use the default DCS-gRPC the local Windows TTS, Windows 2019 Server (or newer) or Windows 10/11 are required. Voices for non-local languages and dialects may need to +-- To use the default local Windows TTS with DCS-gRPC, Windows 2019 Server (or newer) or Windows 10/11 are required. Voices for non-local languages and dialects may need to -- be explicitly installed. -- --- To set the MSRS class to use the DCS-gRPC backend for all future instances, call the function `MSRS.SetDefaultBackendGRPC()` +-- To set the MSRS class to use the DCS-gRPC backend for all future instances, call the function `MSRS.SetDefaultBackendGRPC()`. -- -- **Note** - When using other classes that use MSRS with the alternate DCS-gRPC backend, pass them strings instead of nil values for non-applicable fields with filesystem paths, -- such as the SRS path or Google credential path. This will help maximize compatibility with other classes that were written for the default backend. @@ -298,7 +298,7 @@ MSRS.Voices = { -- @param #number Frequency Radio frequency in MHz. Default 143.00 MHz. Can also be given as a #table of multiple frequencies. -- @param #number Modulation Radio modulation: 0=AM (default), 1=FM. See `radio.modulation.AM` and `radio.modulation.FM` enumerators. Can also be given as a #table of multiple modulations. -- @param #number Volume Volume - 1.0 is max, 0.0 is silence --- @param #table (Optional) Table containing tables 'Functions' and 'Vars' which add/replace functions and variables for the MSRS instance to allow alternate backends for transmitting to SRS. +-- @param #table AltBackend Optional table containing tables 'Functions' and 'Vars' which add/replace functions and variables for the MSRS instance to allow alternate backends for transmitting to SRS. -- @return #MSRS self function MSRS:New(PathToSRS, Frequency, Modulation, Volume, AltBackend) @@ -991,13 +991,15 @@ end -- MSRS DCS-gRPC alternate backend ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- Alternate backend for MSRS to enable text-to-speech via DCS-gRPC. -- ### Author: **dogjutsu** --- @type MSRS_BACKEND_DCSGRPC A table containing functions and variables for MSRS to use DCS-gRPC [DCS-gRPC](https://github.com/DCS-gRPC/rust-server) 0.7.0 or newer as a backend to transmit over SRS. +-- A table containing functions and variables for MSRS to use DCS-gRPC [DCS-gRPC](https://github.com/DCS-gRPC/rust-server) 0.7.0 or newer as a backend to transmit over SRS. +-- This is not a standalone class. Instead, variables and functions under the `Vars` and `Functions` tables get added to or replace MSRS variables/functions when activated. +-- +-- @type MSRS_BACKEND_DCSGRPC -- @field #number version Version number of this alternate backend. -- @field #table Functions A table of functions that will add or replace the default MSRS class functions. -- @field #table Vars A table of variables that will add or replace the default MSRS class variables. --- - MSRS_BACKEND_DCSGRPC = {} MSRS_BACKEND_DCSGRPC.version = 0.1 From ef0b76a63255098bfeaf8aa3d87667ebdaf54d00 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 8 Jan 2023 18:09:22 +0100 Subject: [PATCH 2/3] #PLAYERTASK * Added FSM events PlayerJoinedTask and PlayerAbortedTask --- Moose Development/Moose/Ops/PlayerTask.lua | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 6297744d1..08b1e2d38 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -160,7 +160,7 @@ function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType) self:AddTransition("*", "Planned", "Planned") -- Task is in planning stage. self:AddTransition("*", "Requested", "Requested") -- Task clients have been requested to join. self:AddTransition("*", "ClientAdded", "*") -- Client has been added to the task - self:AddTransition("*", "ClientRemoved", "*") -- Client has been added to the task + self:AddTransition("*", "ClientRemoved", "*") -- Client has been removed from the task self:AddTransition("*", "Executing", "Executing") -- First client is executing the Task. self:AddTransition("*", "Done", "Done") -- All clients have reported that Task is done. self:AddTransition("*", "Cancel", "Done") -- Command to cancel the Task. @@ -1443,7 +1443,7 @@ PLAYERTASKCONTROLLER.Messages = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.55" +PLAYERTASKCONTROLLER.version="0.1.56" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -1536,6 +1536,8 @@ function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter) self:AddTransition("*", "TaskTargetFlared", "*") self:AddTransition("*", "TaskTargetIlluminated", "*") self:AddTransition("*", "TaskRepeatOnFailed", "*") + self:AddTransition("*", "PlayerJoinedTask", "*") + self:AddTransition("*", "PlayerAbortedTask", "*") self:AddTransition("*", "Stop", "Stopped") self:__Start(2) @@ -1629,6 +1631,26 @@ function PLAYERTASKCONTROLLER:New(Name, Coalition, Type, ClientFilter) -- @param #string To To state. -- @param Ops.PlayerTask#PLAYERTASK Task + --- On After "PlayerJoinedTask" event. Player joined a task. + -- @function [parent=#PLAYERTASKCONTROLLER] OnAfterPlayerJoinedTask + -- @param #PLAYERTASKCONTROLLER self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param Wrapper.Group#GROUP Group The player group object + -- @param Wrapper.Client#CLIENT Client The player client object + -- @param Ops.PlayerTask#PLAYERTASK Task + + --- On After "PlayerAbortedTask" event. Player aborted a task. + -- @function [parent=#PLAYERTASKCONTROLLER] OnAfterPlayerAbortedTask + -- @param #PLAYERTASKCONTROLLER self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param Wrapper.Group#GROUP Group The player group object + -- @param Wrapper.Client#CLIENT Client The player client object + -- @param Ops.PlayerTask#PLAYERTASK Task + end --- [Internal] Init localization @@ -2833,6 +2855,7 @@ function PLAYERTASKCONTROLLER:_JoinTask(Group, Client, Task, Force) self.SRSQueue:NewTransmission(text,nil,self.SRS,nil,2) end self.TasksPerPlayer:Push(Task,playername) + self:__PlayerJoinedTask(1, Group, Client, Task) -- clear menu self:_BuildMenus(Client,true) end @@ -3210,6 +3233,7 @@ function PLAYERTASKCONTROLLER:_AbortTask(Group, Client) if self.UseSRS then self.SRSQueue:NewTransmission(text,nil,self.SRS,nil,2) end + self:__PlayerAbortedTask(1,Group, Client,task) else text = self.gettext:GetEntry("NOACTIVETASK",self.locale) end From a7c89547400da25d6390147b725fd1c2fb689fd1 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 8 Jan 2023 18:38:12 +0100 Subject: [PATCH 3/3] Docu typo --- Moose Development/Moose/Ops/Auftrag.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 844ee537f..a505f3a4f 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -1332,7 +1332,7 @@ end -- @param #number OffsetDist Relative distance of the first race-track point wrt to the carrier. Default 6 NM. -- @param #number OffsetAngle Relative angle of the first race-track point wrt. to the carrier. Default 180 (behind the boat). -- @param #number UpdateDistance Threshold distance in NM before orbit pattern is updated. Default 5 NM. --- @param #table TargetTypes (Optional) Table of target types. Default `{"Helicopters", "Ground Units", "Light armed ships"}`. +-- @param #table TargetTypes (Optional) Table of target types. Default `{"Air"}`. -- @param #number EngageRange Max range in nautical miles that the escort group(s) will engage enemies. Default 32 NM (60 km). -- @return #AUFTRAG self function AUFTRAG:NewCAPGROUP(Grp, Altitude, Speed, RelHeading, Leg, OffsetDist, OffsetAngle, UpdateDistance, TargetTypes, EngageRange)