diff --git a/docs/RELEASES b/docs/RELEASES index 1e90293..1459b9f 100644 --- a/docs/RELEASES +++ b/docs/RELEASES @@ -1,8 +1,17 @@ -0.9.7 - Switched to SFML/OpenAL for the audio engine. WAV, - OGG/Vorbis and FLAC sounds are currently supported. MP3 - is not yet supported due to licensing issues with the - underlying library, but I expect it to be implemented in - the near future now that the patents have expired. +0.9.7 - Changed log watching logic to further work around the + post-Vista behavior where NTFS does not update file + modification times until the handle is closed. Hopefully + this fixes the problems where updates would not be seen + if additional characters were logged on/off or if IMP + were left open for extended periods. + + Updated Qt libraries in Windows build to v5.9.2. + +0.9.6.1 - Switched to SFML/OpenAL for the audio engine. WAV, + OGG/Vorbis and FLAC sounds are currently supported. MP3 + is not yet supported due to licensing issues with the + underlying library, but I expect it to be implemented in + the near future now that the patents have expired. @@ -391,18 +400,16 @@ Coming soon: - right-click to copy system name. -- kos msg for red by last should show person and corp. +- Rework KOS Checking: kos msg for red by last should show person and corp. - fix display of messages with backslashes. - better pilot cache/cleanup. -- if at war, and going hisec, play a "bad idea" sound. +- if at war (determine from corp/alliance message), and going hisec, play a "bad idea" sound. - TTS support - Maybe an option to auto-change region? -- Bubble icons +- Bubble indicators - Make mini militia faction count (RBL npc corps)? - Add some intelligence to handle dumb names like R3 Clear - Add option to autobuild jumpbridge list from dotlan instead of files. -- Break follow transistion mode on screen reposition. -- Don't cache every potential sound. - Add queue-play option to queue sounds. - Reload internal list when rules updated. -- Doublecheck windows file update hook +- Laugh at people reporting themselves diff --git a/src/imp.pro b/src/imp.pro index f1b0ffd..a376881 100644 --- a/src/imp.pro +++ b/src/imp.pro @@ -1,4 +1,4 @@ -#------------------------------------------------- +d#------------------------------------------------- # # Project created by QtCreator 2016-09-06T09:06:05 # @@ -13,7 +13,7 @@ QT += xml xmlpatterns svg widgets TARGET = imp TEMPLATE = app -VERSION = 0.9.6.1 +VERSION = 0.9.7 QMAKE_TARGET_COMPANY = EternalDusk QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton diff --git a/src/logcatcher.cpp b/src/logcatcher.cpp index 70bcc96..61921b2 100644 --- a/src/logcatcher.cpp +++ b/src/logcatcher.cpp @@ -105,15 +105,43 @@ void LogCatcher::fallbackPoller() } } +int LogCatcher::compareLastFileSize(QFileInfo fileInfo, QFileInfoList oldList) +{ + foreach(QFileInfo oldInfo, oldList) + { + if(oldInfo.absoluteFilePath() == fileInfo.absoluteFilePath()) + { + // Return the number of bytes different in file size + return fileInfo.size() - oldInfo.size(); + } + } + + // Files are the same, or file was not found in old list. + return 0; +} + void LogCatcher::findCurrentLogs(const QString& dirName) { #ifdef USE_FALLBACK_POLLER - //fallbackPollTimer->stop(); rebuilding = true; #endif + // TOFIX: On Windows, timestamps don't change until the file is flushed. So, if + // someone logs on a second character which has the same open channels, + // that characters channel files will start to get used. Then, if they + // log that character off, it still has the newer timestamps and IMP + // will look at the non-changing file rather than go back to looking + // at the one from the first character. + // + // Solution: Cache the timestamp, size, and line position of the files + // on Windows. Use newest file where size has changed. + + QFileInfoList lastInfoList; if(infoList.count() > 0) + { + lastInfoList = infoList; infoList.clear(); + } QRegExp logNameRegEx("(.*)_[0-9]+_[0-9]+\\.txt$"); @@ -126,10 +154,17 @@ void LogCatcher::findCurrentLogs(const QString& dirName) continue; } - if (fileInfo.lastModified() > (QDateTime::currentDateTime().addDays(-1))) { + // All files that have changed since last pass or were created in the last day. + if (fileInfo.lastModified() > (QDateTime::currentDateTime().addDays(-1)) + || (lastInfoList.count() > 0 && compareLastFileSize(fileInfo, lastInfoList) > 0)) + { // We only put non-local channels in the list once, no matter how many pilots // are in them. + // + // The exception is when the older file is growing and the newer one is + // not - which means they logged on a second character, creating a newer + // file, then logged that character out. QString channelName = logNameRegEx.cap(1); if(!localChannels.contains(channelName)) @@ -138,23 +173,28 @@ void LogCatcher::findCurrentLogs(const QString& dirName) while (i.hasNext()) { QString iFileName = i.next().fileName(); QString iChanName = iFileName.left(iFileName.length() - 20); - if (iChanName == channelName) { - if (i.value().lastModified() < fileInfo.lastModified()) { - qDebug() << "LogCatcher::findCurrentLogs: Found newer log for " << iChanName; + if (iChanName == channelName) + { + // If file has changed and file is newer than what we already + // have in list, remove what we previously put in list. + if ((lastInfoList.size() == 0 || + compareLastFileSize(fileInfo, lastInfoList)) && + (i.value().lastModified() < fileInfo.lastModified())) + { + qDebug() << "LogCatcher::findCurrentLogs: Found newer or changed log for " << iChanName; qDebug() << " ignoring " << iFileName; + qDebug() << " in favor of " << fileInfo.fileName(); i.remove(); } } } } - infoList.append(fileInfo); } } } #ifdef USE_FALLBACK_POLLER - //fallbackPollTimer->start(pollerInterval); rebuilding = false; #else diff --git a/src/logcatcher.h b/src/logcatcher.h index f65a34f..1a835f7 100644 --- a/src/logcatcher.h +++ b/src/logcatcher.h @@ -81,6 +81,8 @@ public slots: int pollerInterval = 1000; bool rebuilding = false; bool firstPass = true; + + int compareLastFileSize(QFileInfo fileInfo, QFileInfoList oldList); }; #endif // LOGCATCHER_H diff --git a/src/map.cpp b/src/map.cpp index a1a851f..7595cff 100755 --- a/src/map.cpp +++ b/src/map.cpp @@ -359,7 +359,8 @@ QString Map::getSystemByAbbreviation(const QString& word) } // Still no match? Maybe they mispelled it, like people do with 9-F0B2 (9-fob) - if(upperWord.contains('-') && upperWord.contains('O')) +// if(upperWord.contains('-') && upperWord.contains('O')) + if(upperWord.contains('O')) { upperWord.replace('O', '0'); return getSystemByAbbreviation(upperWord); diff --git a/src/meta.h b/src/meta.h index 4dedd6b..4d53a94 100644 --- a/src/meta.h +++ b/src/meta.h @@ -27,8 +27,8 @@ static const struct Version { Version(){} - QString release = "0.9.6.1"; //VERSION; - QString name = "SFML OpenAL FML"; + QString release = "0.9.7"; //VERSION; + QString name = "Black Exoplanet"; QString styleHeader1 = ""; QString styleFooter1 = "";