mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
cleanups, games work with ISL, now we just need to clean up better when the ISL connection dies
This commit is contained in:
parent
c9a8429044
commit
5db0fcd6ae
28 changed files with 570 additions and 245 deletions
|
|
@ -118,6 +118,7 @@ int main(int argc, char *argv[])
|
|||
QStringList args = app.arguments();
|
||||
bool testRandom = args.contains("--test-random");
|
||||
bool testHashFunction = args.contains("--test-hash");
|
||||
bool logToConsole = args.contains("--log-to-console");
|
||||
|
||||
qRegisterMetaType<QList<int> >("QList<int>");
|
||||
|
||||
|
|
@ -126,13 +127,16 @@ int main(int argc, char *argv[])
|
|||
QSettings *settings = new QSettings("servatrice.ini", QSettings::IniFormat);
|
||||
|
||||
loggerThread = new QThread;
|
||||
logger = new ServerLogger;
|
||||
logger = new ServerLogger(logToConsole);
|
||||
logger->moveToThread(loggerThread);
|
||||
|
||||
loggerThread->start();
|
||||
QMetaObject::invokeMethod(logger, "startLog", Qt::BlockingQueuedConnection, Q_ARG(QString, settings->value("server/logfile").toString()));
|
||||
|
||||
qInstallMsgHandler(myMessageOutput2);
|
||||
if (logToConsole)
|
||||
qInstallMsgHandler(myMessageOutput);
|
||||
else
|
||||
qInstallMsgHandler(myMessageOutput2);
|
||||
#ifdef Q_OS_UNIX
|
||||
struct sigaction hup;
|
||||
hup.sa_handler = ServerLogger::hupSignalHandler;
|
||||
|
|
@ -159,6 +163,7 @@ int main(int argc, char *argv[])
|
|||
testHash();
|
||||
|
||||
Servatrice *server = new Servatrice(settings);
|
||||
QObject::connect(server, SIGNAL(logDebugMessage(QString, void *)), logger, SLOT(logMessage(QString, void *)));
|
||||
QObject::connect(server, SIGNAL(destroyed()), &app, SLOT(quit()), Qt::QueuedConnection);
|
||||
|
||||
std::cerr << "-------------------------" << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue