aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/advancedDetector.cpp41
-rw-r--r--engines/advancedDetector.h7
-rw-r--r--engines/gob/detection/detection.cpp5
3 files changed, 39 insertions, 14 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index a66fe3d2a1..9d695058dd 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -325,17 +325,30 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
return Common::kNoError;
}
-void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps) const {
- // TODO: This message should be cleaned up / made more specific.
- // For example, we should specify at least which engine triggered this.
- //
- // Might also be helpful to display the full path (for when this is used
- // from the mass detector).
+void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds) const {
Common::String report = Common::String::format(
- _("The game in '%s' seems to be unknown.\n"
- "Please, report the following data to the ScummVM team along with name\n"
- "of the game you tried to add and its version, language, etc.:"), path.getPath().c_str()) + "\n";
- report += "\n";
+ _("The game in '%s' seems to be an unknown %s engine game "
+ "variant.\n\nPlease report the following data to the ScummVM "
+ "team at %s along with the name of the game you tried to add and "
+ "its version, language, etc.:"),
+ path.getPath().c_str(), getName(), "https://bugs.scummvm.org/");
+
+ if (matchedGameIds.size()) {
+ report += "\n\n";
+ report += _("Matched game IDs:");
+ report += " ";
+
+ for (ADGameIdList::const_iterator gameId = matchedGameIds.begin(); gameId != matchedGameIds.end(); ++gameId) {
+ if (gameId != matchedGameIds.begin()) {
+ report += ", ";
+ }
+ report += *gameId;
+ }
+ }
+
+ report += "\n\n";
+
+ report.wordWrap(80);
for (ADFilePropertiesMap::const_iterator file = filesProps.begin(); file != filesProps.end(); ++file)
report += Common::String::format(" {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
@@ -444,6 +457,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
}
ADGameDescList matched;
+ ADGameIdList matchedGameIds;
int maxFilesMatched = 0;
bool gotAnyMatchesWithAllFiles = false;
@@ -508,8 +522,11 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
// Potentially this could rule out variants where some particular file
// is really missing, but the developers should better know about such
// cases.
- if (allFilesPresent)
+ if (allFilesPresent) {
gotAnyMatchesWithAllFiles = true;
+ if (!matchedGameIds.size() || strcmp(matchedGameIds.back(), g->gameId) != 0)
+ matchedGameIds.push_back(g->gameId);
+ }
if (!fileMissing) {
debug(2, "Found game: %s (%s %s/%s) (%d)", g->gameId, g->extra,
@@ -536,7 +553,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
// We didn't find a match
if (matched.empty()) {
if (!filesProps.empty() && gotAnyMatchesWithAllFiles) {
- reportUnknown(parent, filesProps);
+ reportUnknown(parent, filesProps, matchedGameIds);
}
// Filename based fallback
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index e218c41b52..61693d10fa 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -117,6 +117,11 @@ struct ADGameDescription {
typedef Common::Array<const ADGameDescription *> ADGameDescList;
/**
+ * A list of raw game ID strings.
+ */
+typedef Common::Array<const char *> ADGameIdList;
+
+/**
* End marker for a table of ADGameDescription structs. Use this to
* terminate a list to be passed to the AdvancedDetector API.
*/
@@ -328,7 +333,7 @@ protected:
* Log and print a report that we found an unknown game variant, together with the file
* names, sizes and MD5 sums.
*/
- void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps) const;
+ void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds = ADGameIdList()) const;
// TODO
void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const;
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index b0aa78f416..e204ced1e8 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -77,7 +77,10 @@ const ADGameDescription *GobMetaEngine::fallbackDetect(const FileMap &allFiles,
return 0;
}
- reportUnknown(fslist.begin()->getParent(), filesProps);
+ ADGameIdList gameIds;
+ gameIds.push_back(game->desc.gameId);
+
+ reportUnknown(fslist.begin()->getParent(), filesProps, gameIds);
return (const ADGameDescription *)game;
}