1.4.10 updates
This commit is contained in:
+19
-13
@@ -1,6 +1,5 @@
|
||||
#include <client/linux/handler/exception_handler.h>
|
||||
#include <iostream>
|
||||
#include <misc/endianness.h>
|
||||
#include <misc/strobf.h>
|
||||
#include <CXXTerminal/QuickTerminal.h>
|
||||
#include <event2/thread.h>
|
||||
@@ -14,7 +13,6 @@
|
||||
#include "src/server/file/FileServer.h"
|
||||
#include "src/terminal/CommandHandler.h"
|
||||
#include "src/client/InternalClient.h"
|
||||
#include "src/music/MusicBotManager.h"
|
||||
#include "src/SignalHandler.h"
|
||||
#include "src/build.h"
|
||||
|
||||
@@ -126,8 +124,11 @@ int main(int argc, char** argv) {
|
||||
assert(evthread_use_pthreads_result == 0);
|
||||
(void) evthread_use_pthreads_result;
|
||||
}
|
||||
terminal::install();
|
||||
if(!terminal::active()){ cerr << "could not setup terminal!" << endl; return -1; }
|
||||
|
||||
if(!arguments.cmdOptionExists("--no-terminal")) {
|
||||
terminal::install();
|
||||
if(!terminal::active()){ cerr << "could not setup terminal!" << endl; return -1; }
|
||||
}
|
||||
assert(ts::property::impl::validateUnique());
|
||||
|
||||
if(arguments.cmdOptionExists("--help") || arguments.cmdOptionExists("-h")) {
|
||||
@@ -276,6 +277,8 @@ int main(int argc, char** argv) {
|
||||
logConfig->file_colored = ts::config::log::logfileColored;
|
||||
logConfig->logPath = ts::config::log::path;
|
||||
logConfig->vs_group_size = ts::config::log::vs_size;
|
||||
logConfig->sync = !terminal::instance();
|
||||
|
||||
logger::setup(logConfig);
|
||||
threads::timer::function_log = [](const std::string& message, bool debug) {
|
||||
auto msg = message.find('\n') == std::string::npos ? message : message.substr(0, message.find('\n'));
|
||||
@@ -309,13 +312,13 @@ int main(int argc, char** argv) {
|
||||
logMessage(LOG_GENERAL, "Starting TeaSpeak-Server v{}", build::version()->string(true));
|
||||
logMessage(LOG_GENERAL, "Starting music providers");
|
||||
|
||||
terminal::instance()->setPrompt("§aStarting server. §7[§aloading music§7]");
|
||||
if(terminal::instance()) terminal::instance()->setPrompt("§aStarting server. §7[§aloading music§7]");
|
||||
if(ts::config::music::enabled && !arguments.cmdOptionExists("--no-providers")) {
|
||||
::music::manager::loadProviders("providers");
|
||||
::music::manager::register_provider(::music::provider::ChannelProvider::create_provider());
|
||||
}
|
||||
|
||||
terminal::instance()->setPrompt("§aStarting server. §7[§aloading geoloc§7]");
|
||||
if(terminal::instance()) terminal::instance()->setPrompt("§aStarting server. §7[§aloading geoloc§7]");
|
||||
|
||||
if(!ts::config::geo::staticFlag) {
|
||||
if(ts::config::geo::type == geoloc::PROVIDER_SOFTWARE77)
|
||||
@@ -342,7 +345,7 @@ int main(int argc, char** argv) {
|
||||
errorMessage = "";
|
||||
}
|
||||
}
|
||||
terminal::instance()->setPrompt("§aStarting server. §7[§aloading sql§7]");
|
||||
if(terminal::instance()) terminal::instance()->setPrompt("§aStarting server. §7[§aloading sql§7]");
|
||||
|
||||
sql = new ts::server::SqlDataManager();
|
||||
if(!sql->initialize(errorMessage)) {
|
||||
@@ -358,7 +361,7 @@ int main(int argc, char** argv) {
|
||||
goto stopApp;
|
||||
}
|
||||
|
||||
terminal::instance()->setPrompt("§aStarting server. §7[§astarting instance§7]");
|
||||
if(terminal::instance()) terminal::instance()->setPrompt("§aStarting server. §7[§astarting instance§7]");
|
||||
|
||||
serverInstance = new ts::server::InstanceHandler(sql); //if error than mainThreadActive = false
|
||||
if(!mainThreadActive || !serverInstance->startInstance())
|
||||
@@ -384,13 +387,15 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
terminal::instance()->setPrompt("§7> §f");
|
||||
if(terminal::instance()) terminal::instance()->setPrompt("§7> §f");
|
||||
while(mainThreadActive) {
|
||||
usleep(5 * 1000);
|
||||
|
||||
if(terminal::instance()->linesAvailable() > 0){
|
||||
while(!(line = terminal::instance()->readLine("§7> §f")).empty())
|
||||
threads::Thread(THREAD_DETACHED, [line](){ terminal::chandler::handleCommand(line); });
|
||||
if(terminal::instance()) {
|
||||
if(terminal::instance()->linesAvailable() > 0){
|
||||
while(!(line = terminal::instance()->readLine("§7> §f")).empty())
|
||||
threads::Thread(THREAD_DETACHED, [line](){ terminal::chandler::handleCommand(line); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +416,8 @@ int main(int argc, char** argv) {
|
||||
logMessageFmt(true, LOG_GENERAL, "Application suspend successful!");
|
||||
|
||||
logger::uninstall();
|
||||
terminal::uninstall();
|
||||
if(terminal::active())
|
||||
terminal::uninstall();
|
||||
mainThreadDone = true;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user