v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
40
attic/authserver/main.cpp
Normal file
40
attic/authserver/main.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue