-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
568 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- | ||
-- RPC unit actions | ||
-- https://wiki.hoggitworld.com/view/DCS_Class_Group | ||
-- | ||
|
||
local GRPC = GRPC | ||
|
||
GRPC.methods.getUnits = function(params) | ||
-- https://wiki.hoggitworld.com/view/DCS_func_getByName | ||
local group = Group.getByName(params.groupName) | ||
if group == nil then | ||
return GRPC.errorNotFound("group does not exist") | ||
end | ||
|
||
-- https://wiki.hoggitworld.com/view/DCS_func_getUnits | ||
local units = group:getUnits() | ||
|
||
local result = {} | ||
for i, unit in ipairs(units) do | ||
if params.active == nil or params.active == unit:isActive() then | ||
result[i] = GRPC.exporters.unit(unit) | ||
end | ||
end | ||
|
||
return GRPC.success({units = result}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
syntax = "proto3"; | ||
|
||
import "common.proto"; | ||
|
||
package dcs.group; | ||
|
||
enum GroupCategory { | ||
AIRPLANE = 0; | ||
HELICOPTER = 1; | ||
GROUND = 2; | ||
SHIP = 3; | ||
TRAIN = 4; | ||
} | ||
|
||
message GetUnitsRequest { | ||
string group_name = 1; | ||
// Whether the response should include only active units (`true`), only inactive units (`false`), | ||
// or all units (`nil`). | ||
optional bool active = 2; | ||
} | ||
|
||
message GetUnitsResponse { | ||
repeated Unit units = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.