totally fucked up

This commit is contained in:
WolverinDEV
2020-03-17 12:08:07 +01:00
parent 58666b8906
commit d6f483a019
43 changed files with 1155 additions and 985 deletions
+13 -6
View File
@@ -23,6 +23,7 @@
#include <misc/strobf.h>
#include <jemalloc/jemalloc.h>
#include <protocol/buffers.h>
#include "src/server/udp-server/UDPServer.h"
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE
@@ -389,6 +390,12 @@ FwIDAQAB
}
}
this->udpServer = new server::udp::Server{};
if(std::string error{}; !this->udpServer->initialize(error)) {
logCritical(LOG_INSTANCE, "Failed to allocate UDP server.");
return false;
}
this->voiceServerManager = new VirtualServerManager(this);
if (!this->voiceServerManager->initialize(true)) {
logCritical(LOG_INSTANCE, "Could not load servers!");
@@ -433,22 +440,22 @@ void InstanceHandler::stopInstance() {
debugMessage(LOG_INSTANCE, "Stopping all virtual servers");
if (this->voiceServerManager)
this->voiceServerManager->shutdownAll(ts::config::messages::applicationStopped);
delete this->voiceServerManager;
this->voiceServerManager = nullptr;
delete std::exchange(this->voiceServerManager, nullptr);
debugMessage(LOG_INSTANCE, "All virtual server stopped");
debugMessage(LOG_QUERY, "Stopping query server");
if (this->queryServer) this->queryServer->stop();
delete this->queryServer;
this->queryServer = nullptr;
delete std::exchange(this->queryServer, nullptr);
debugMessage(LOG_QUERY, "Query server stopped");
debugMessage(LOG_FT, "Stopping file server");
if (this->fileServer) this->fileServer->stop();
delete this->fileServer;
this->fileServer = nullptr;
delete std::exchange(this->fileServer, nullptr);
debugMessage(LOG_FT, "File server stopped");
if(this->udpServer) this->udpServer->finalize();
delete std::exchange(this->udpServer, nullptr);
this->save_channel_permissions();
this->save_group_permissions();