Add managed channel administration and moderation
This commit is contained in:
@@ -6,6 +6,22 @@ int main(int argc, char **argv) {
|
||||
voicecat::server::Database database(argv[2]);
|
||||
std::string error;
|
||||
if (!database.open(error)) return 1;
|
||||
if (std::string(argv[1]) == "create-protected") {
|
||||
voicecat::server::ChannelRecord channel;
|
||||
channel.name = "Native protected";
|
||||
channel.audio.set_sample_rate(48000);
|
||||
channel.audio.set_bitrate_bps(24000);
|
||||
channel.audio.set_frame_ms(20);
|
||||
return database.create_channel(channel, "channel password", error) ? 0 : 1;
|
||||
}
|
||||
if (std::string(argv[1]) == "verify-protected") {
|
||||
for (const auto& channel : database.list_channels()) {
|
||||
if (channel.name == "Managed protected")
|
||||
return database.check_channel_password(channel.id, "channel password") &&
|
||||
!database.check_channel_password(channel.id, "wrong") ? 0 : 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (std::string(argv[1]) == "create") {
|
||||
if (!database.create_account("legacy", "legacy password", true, error)) return 1;
|
||||
voicecat::server::ChannelRecord lobby;
|
||||
|
||||
Reference in New Issue
Block a user