0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/console: Add stage broadcast cmd.

This commit is contained in:
Jason Volk 2018-06-08 20:25:53 -07:00
parent cd611f4245
commit a683c52c66

View file

@ -3067,6 +3067,40 @@ console_cmd__stage__send(opt &out, const string_view &line)
return true;
}
bool
console_cmd__stage__broadcast(opt &out, const string_view &line)
{
const params param{line, " ",
{
"[id]"
}};
const int &id
{
param.at<int>(0, -1)
};
const auto start
{
id > -1? id : 0
};
const auto stop
{
id > -1? id + 1 : stage.size()
};
for(size_t i(start); i < stop; ++i)
{
const m::vm::opts opts;
const m::event event{stage.at(i)};
m::vm::accepted a{event, &opts, &opts.report};
m::vm::accept(a);
}
return true;
}
int
console_command_numeric(opt &out, const string_view &line)
{