diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-09-24 22:10:19 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-09-24 22:10:19 +0200 |
| commit | 50d9907af2522a9a6e02a171b9a26938a743971c (patch) | |
| tree | b1f903bae3e13c2db94ba288666d5621e6389e19 /src/crsm.cpp | |
| parent | a1ea09de117bff522e08c4e5e3aa386ba192d276 (diff) | |
| download | manager-50d9907af2522a9a6e02a171b9a26938a743971c.tar.gz manager-50d9907af2522a9a6e02a171b9a26938a743971c.zip | |
Save session to CrServerManager.session on detach and load it on
reattaching
Diffstat (limited to 'src/crsm.cpp')
| -rw-r--r-- | src/crsm.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/crsm.cpp b/src/crsm.cpp index 4506c4b..2e7f1a4 100644 --- a/src/crsm.cpp +++ b/src/crsm.cpp @@ -62,8 +62,11 @@ CRSM::CRSM(QObject *parent) : if(processManager->isRunning()) { + Session.read(SESSION_FILE_NAME, false); writeToServer("Server Manager läuft wieder.\nBis zur nächsten Runde könnte unerwartetes Verhalten auftreten.\n"); } + QFile sessionFile(SESSION_FILE_NAME); + if(sessionFile.exists()) sessionFile.remove(); setupCmds(); @@ -275,6 +278,11 @@ void CRSM::readServerOutput() { Session.CountDown = countDownExp.cap(1).toInt(); } + static QRegExp countDownExp2(R"(^(\d+)\.\.\.)"); + if(countDownExp2.exactMatch(what)) + { + Session.CountDown = countDownExp2.cap(1).toInt(); + } static QRegExp countDownStopExp("^(?:Spielstart abgebrochen\\.|Game start aborted\\.)"); if(countDownStopExp.exactMatch(what)) @@ -294,6 +302,7 @@ void CRSM::readInput() } Config.Auto.ProcessManager.ReattachId = processManager->ID(); writeConfig(); + Session.write(SESSION_FILE_NAME); QCoreApplication::quit(); return; } @@ -2042,6 +2051,7 @@ CMD_FUNCTION_IMPL(exit) CMD_FUNCTION_IMPL(exitDetach) Config.Auto.ProcessManager.ReattachId = processManager->ID(); writeConfig(); + Session.write(SESSION_FILE_NAME); QCoreApplication::quit(); } |
