diff --git a/server/src/FileServerHandler.cpp b/server/src/FileServerHandler.cpp index 5fc443f..e9c853b 100644 --- a/server/src/FileServerHandler.cpp +++ b/server/src/FileServerHandler.cpp @@ -151,6 +151,9 @@ void FileServerHandler::callback_transfer_statistics(const std::shared_ptrgetConnectionStatistics()->logFileTransferOut(statistics.delta_file_bytes_transferred); } + if(client->getType() == ClientType::CLIENT_TEAMSPEAK) + return; /* TS3 does not know this notify */ + ts::command_builder notify{"notifyfiletransferprogress"}; notify.put_unchecked(0, "clientftfid", transfer->client_transfer_id); diff --git a/server/src/client/query/QueryClientCommands.cpp b/server/src/client/query/QueryClientCommands.cpp index cebe471..f0b32eb 100644 --- a/server/src/client/query/QueryClientCommands.cpp +++ b/server/src/client/query/QueryClientCommands.cpp @@ -864,6 +864,15 @@ command_result QueryClient::handleCommandServerSnapshotDeploy(Command& cmd) { } unique_lock server_create_lock(serverInstance->getVoiceServerManager()->server_create_lock); + { + auto instances = serverInstance->getVoiceServerManager()->serverInstances(); + if(config::server::max_virtual_server != -1 && instances.size() > config::server::max_virtual_server) + return command_result{error::server_max_vs_reached, "You reached the via config.yml enabled virtual server limit."}; + + if(instances.size() >= 65535) + return command_result{error::server_max_vs_reached, "You cant create anymore virtual servers. (Software limit reached)"}; + } + if(port == 0) port = serverInstance->getVoiceServerManager()->next_available_port(host); auto result = serverInstance->getVoiceServerManager()->createServerFromSnapshot(this->server, host, port, cmd, error); @@ -911,6 +920,16 @@ command_result QueryClient::handleCommandServerSnapshotDeployNew(const ts::comma std::string error{}; unique_lock server_create_lock(serverInstance->getVoiceServerManager()->server_create_lock); //TODO: Create a server if no exists + + { /* TODO: Only check if we're creating a new server */ + auto instances = serverInstance->getVoiceServerManager()->serverInstances(); + if(config::server::max_virtual_server != -1 && instances.size() > config::server::max_virtual_server) + return command_result{error::server_max_vs_reached, "You reached the via config.yml enabled virtual server limit."}; + + if(instances.size() >= 65535) + return command_result{error::server_max_vs_reached, "You cant create anymore virtual servers. (Software limit reached)"}; + } + server_create_lock.unlock(); //TODO: Stop the server completely diff --git a/server/src/client/voice/CryptSetupHandler.cpp b/server/src/client/voice/CryptSetupHandler.cpp index b9461a6..2485f09 100644 --- a/server/src/client/voice/CryptSetupHandler.cpp +++ b/server/src/client/voice/CryptSetupHandler.cpp @@ -148,11 +148,10 @@ CryptSetupHandler::CommandResult CryptSetupHandler::handleCommandClientInitIv(co return ts::command_result{error::client_could_not_validate_identity}; } - client->properties()[property::CLIENT_UNIQUE_IDENTIFIER] = base64::encode(digest::sha1(clientOmega)); + client->properties()[property::CLIENT_UNIQUE_IDENTIFIER] = base64::encode(digest::sha1(cmd.value("omega"))); } this->new_protocol = !use_teaspeak && ot && config::experimental_31 && (this->client_protocol_time_ >= 173265950ULL || this->client_protocol_time_ == (uint32_t) 5680278000ULL); - this->new_protocol = true; { size_t server_seed_length = this->new_protocol ? 54 : 10;