Renamed TSServer to VirtualServer
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <protocol/buffers.h>
|
||||
#include "client/voice/VoiceClient.h"
|
||||
#include "client/InternalClient.h"
|
||||
#include "TSServer.h"
|
||||
#include "VirtualServer.h"
|
||||
#include <misc/timer.h>
|
||||
#include <log/LogUtils.h>
|
||||
#include <misc/sassert.h>
|
||||
@@ -15,7 +15,7 @@ using namespace ts::buffer;
|
||||
using namespace ts::permission;
|
||||
using namespace std::chrono;
|
||||
|
||||
bool TSServer::registerClient(shared_ptr<ConnectedClient> client) {
|
||||
bool VirtualServer::registerClient(shared_ptr<ConnectedClient> client) {
|
||||
sassert(client);
|
||||
|
||||
{
|
||||
@@ -86,7 +86,7 @@ bool TSServer::registerClient(shared_ptr<ConnectedClient> client) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TSServer::unregisterClient(shared_ptr<ConnectedClient> cl, std::string reason, std::unique_lock<std::shared_mutex>& chan_tree_lock) {
|
||||
bool VirtualServer::unregisterClient(shared_ptr<ConnectedClient> cl, std::string reason, std::unique_lock<std::shared_mutex>& chan_tree_lock) {
|
||||
if(cl->getType() == ClientType::CLIENT_TEAMSPEAK && cl->getType() == ClientType::CLIENT_WEB) {
|
||||
sassert(cl->state == ConnectionState::DISCONNECTED);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ bool TSServer::unregisterClient(shared_ptr<ConnectedClient> cl, std::string reas
|
||||
return true;
|
||||
}
|
||||
|
||||
void TSServer::registerInternalClient(std::shared_ptr<ConnectedClient> client) {
|
||||
void VirtualServer::registerInternalClient(std::shared_ptr<ConnectedClient> client) {
|
||||
client->state = ConnectionState::CONNECTED;
|
||||
{
|
||||
lock_guard lock(this->clients.lock);
|
||||
@@ -151,7 +151,7 @@ void TSServer::registerInternalClient(std::shared_ptr<ConnectedClient> client) {
|
||||
}
|
||||
}
|
||||
|
||||
void TSServer::unregisterInternalClient(std::shared_ptr<ConnectedClient> client) {
|
||||
void VirtualServer::unregisterInternalClient(std::shared_ptr<ConnectedClient> client) {
|
||||
client->state = ConnectionState::DISCONNECTED;
|
||||
|
||||
{
|
||||
@@ -172,7 +172,7 @@ void TSServer::unregisterInternalClient(std::shared_ptr<ConnectedClient> client)
|
||||
}
|
||||
}
|
||||
|
||||
bool TSServer::assignDefaultChannel(const shared_ptr<ConnectedClient>& client, bool join) {
|
||||
bool VirtualServer::assignDefaultChannel(const shared_ptr<ConnectedClient>& client, bool join) {
|
||||
shared_lock server_channel_lock(this->channel_tree_lock);
|
||||
std::shared_ptr<BasicChannel> channel = nullptr;
|
||||
if(client->properties()->hasProperty(property::CLIENT_DEFAULT_CHANNEL) && !client->properties()[property::CLIENT_DEFAULT_CHANNEL].as<string>().empty()) {
|
||||
@@ -208,7 +208,7 @@ bool TSServer::assignDefaultChannel(const shared_ptr<ConnectedClient>& client, b
|
||||
return true;
|
||||
}
|
||||
|
||||
void TSServer::testBanStateChange(const std::shared_ptr<ConnectedClient>& invoker) {
|
||||
void VirtualServer::testBanStateChange(const std::shared_ptr<ConnectedClient>& invoker) {
|
||||
this->forEachClient([&](shared_ptr<ConnectedClient> client) {
|
||||
auto ban = client->resolveActiveBan(client->getPeerIp());
|
||||
if(ban) {
|
||||
@@ -220,7 +220,7 @@ void TSServer::testBanStateChange(const std::shared_ptr<ConnectedClient>& invoke
|
||||
});
|
||||
}
|
||||
|
||||
bool TSServer::could_default_create_channel() {
|
||||
bool VirtualServer::could_default_create_channel() {
|
||||
{
|
||||
|
||||
auto default_group = this->getGroupManager()->defaultGroup(GroupTarget::GROUPTARGET_SERVER);
|
||||
@@ -254,7 +254,7 @@ bool TSServer::could_default_create_channel() {
|
||||
cl->notifyClientLeftViewKicked(client, client->currentChannel, nullptr, cmd["reasonmsg"].as<std::string>(), this);
|
||||
*/
|
||||
|
||||
void TSServer::notify_client_ban(const shared_ptr<ConnectedClient> &target, const std::shared_ptr<ts::server::ConnectedClient> &invoker, const std::string &reason, size_t time) {
|
||||
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);
|
||||
unique_lock server_channel_lock(this->channel_tree_lock); /* we're "moving" a client! */
|
||||
@@ -279,7 +279,7 @@ void TSServer::notify_client_ban(const shared_ptr<ConnectedClient> &target, cons
|
||||
target->currentChannel = nullptr;
|
||||
}
|
||||
|
||||
void TSServer::notify_client_kick(
|
||||
void VirtualServer::notify_client_kick(
|
||||
const std::shared_ptr<ts::server::ConnectedClient> &target,
|
||||
const std::shared_ptr<ts::server::ConnectedClient> &invoker,
|
||||
const std::string &reason,
|
||||
@@ -323,7 +323,7 @@ void TSServer::notify_client_kick(
|
||||
*
|
||||
* Note: channel cant be a ref because the channel itself gets deleted!
|
||||
*/
|
||||
void TSServer::delete_channel(shared_ptr<ts::ServerChannel> channel, const shared_ptr<ConnectedClient> &invoker, const std::string& kick_message, unique_lock<std::shared_mutex> &tree_lock) {
|
||||
void VirtualServer::delete_channel(shared_ptr<ts::ServerChannel> channel, const shared_ptr<ConnectedClient> &invoker, const std::string& kick_message, unique_lock<std::shared_mutex> &tree_lock) {
|
||||
if(!tree_lock.owns_lock())
|
||||
tree_lock.lock();
|
||||
if(channel->deleted)
|
||||
@@ -365,7 +365,7 @@ void TSServer::delete_channel(shared_ptr<ts::ServerChannel> channel, const share
|
||||
});
|
||||
}
|
||||
|
||||
void TSServer::client_move(
|
||||
void VirtualServer::client_move(
|
||||
const shared_ptr<ts::server::ConnectedClient> &target,
|
||||
shared_ptr<ts::BasicChannel> target_channel,
|
||||
const std::shared_ptr<ts::server::ConnectedClient> &invoker,
|
||||
|
||||
Reference in New Issue
Block a user