This commit is contained in:
Aria 2025-03-21 22:23:30 +11:00
commit 9c94d113d3
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
10260 changed files with 1237388 additions and 0 deletions

40
attic/authserver/main.cpp Normal file
View file

@ -0,0 +1,40 @@
#include "StarAuthenticationServer.hpp"
#include "StarRandom.hpp"
#include "StarLexicalCast.hpp"
#include "StarLogging.hpp"
#include "StarSignalHandler.hpp"
using namespace Star;
using namespace Star::Auth;
int main(int argc, char **argv) {
_unused(argc);
_unused(argv);
SignalHandler signalHandler;
try {
Logger::addSink(make_shared<FileLogSink>("starbound_auth.log", Logger::Debug));
Thread::prepareThread();
Auth::initializeKeyLogic();
StarException::initialize();
Logger::info("Auth server starting.");
auto authServer = make_shared<AuthenticationServer>();
signalHandler.setInterruptHandler([&authServer]() {
Logger::info("Interrupt received.");
if (authServer)
authServer->stop();
});
authServer->run();
authServer.reset();
Logger::info("Server shutdown gracefully");
} catch (std::exception const& e) {
fatalException(e);
}
return 0;
}