Initial video commit

This commit is contained in:
WolverinDEV
2020-11-07 13:17:51 +01:00
parent 6cd481e824
commit a37ba81a4f
46 changed files with 913 additions and 966 deletions
+15 -8
View File
@@ -248,13 +248,6 @@ bool VirtualServer::could_default_create_channel() {
return false;
}
/*
*
for (auto &cl : this->server->getClients())
if (cl->isClientVisible(client) || client == cl)
cl->notifyClientLeftViewKicked(client, client->currentChannel, nullptr, cmd["reasonmsg"].as<std::string>(), this);
*/
void VirtualServer::notify_client_ban(const shared_ptr<ConnectedClient> &target, const std::shared_ptr<ts::server::ConnectedClient> &invoker, const std::string &reason, size_t time) {
/* the target is not allowed to execute anything; Must before channel tree lock because the target may waits for us to finish the channel stuff */
lock_guard command_lock(target->command_lock);
@@ -307,6 +300,9 @@ void VirtualServer::notify_client_kick(
auto s_channel = dynamic_pointer_cast<ServerChannel>(target->currentChannel);
s_channel->unregister_client(target);
if(auto client{dynamic_pointer_cast<SpeakingClient>(target)}; client) {
this->rtc_server().assign_channel(client->rtc_client_id, 0);
}
}
/* now disconnect the target itself */
@@ -473,9 +469,17 @@ void VirtualServer::client_move(
}
});
if(s_source_channel)
if(s_source_channel) {
s_source_channel->unregister_client(target);
}
s_target_channel->register_client(target);
if(auto client{dynamic_pointer_cast<SpeakingClient>(target)}; client) {
this->rtc_server().assign_channel(client->rtc_client_id, s_target_channel->rtc_channel_id);
}
if(auto client{dynamic_pointer_cast<VoiceClient>(target)}; client) {
/* Start normal broadcasting, what the client expects */
this->rtc_server().start_broadcast(client->rtc_client_id, 1, 1);
}
} else {
/* client left the server */
if(target->currentChannel) {
@@ -489,6 +493,9 @@ void VirtualServer::client_move(
}
s_source_channel->unregister_client(target);
if(auto client{dynamic_pointer_cast<SpeakingClient>(target)}; client) {
this->rtc_server().assign_channel(client->rtc_client_id, 0);
}
}
}
TIMING_STEP(timings, "notify view");