| 304 | void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> &filesSize) { |
| 305 | // TODO: This message should be cleaned up / made more specific. |
| 306 | // For example, we should specify at least which engine triggered this. |
| 307 | // |
| 308 | // Might also be helpful to display the full path (for when this is used |
| 309 | // from the mass detector). |
| 310 | printf("Your game version appears to be unknown. Please, report the following\n"); |
| 311 | printf("data to the ScummVM team along with name of the game you tried to add\n"); |
| 312 | printf("and its version/language/etc.:\n"); |
| 313 | |
| 314 | for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file) |
| 315 | printf(" \"%s\", \"%s\", %d\n", file->_key.c_str(), file->_value.c_str(), filesSize[file->_key]); |
| 316 | |
| 317 | printf("\n"); |
| 318 | } |
| 319 | |
| 320 | void reportUnknown(StringList &files, int md5Bytes) { |
| 321 | StringMap filesMD5; |
| 322 | HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> filesSize; |
| 323 | |
| 324 | char md5str[32+1]; |
| 325 | File testFile; |
| 326 | |
| 327 | // Fill the data structures for the requested files |
| 328 | for (StringList::iterator file = files.begin(); file != files.end(); file++) { |
| 329 | |
| 330 | if (testFile.open(*file)) { |
| 331 | filesSize[*file] = (int32)testFile.size(); |
| 332 | |
| 333 | if (md5_file_string(testFile, md5str, md5Bytes)) |
| 334 | filesMD5[*file] = md5str; |
| 335 | |
| 336 | testFile.close(); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | reportUnknown(filesMD5, filesSize); |
| 341 | } |
| 342 | |
463 | | if (!filesMD5.empty()) { |
464 | | // TODO: This message should be cleaned up / made more specific. |
465 | | // For example, we should specify at least which engine triggered this. |
466 | | // |
467 | | // Might also be helpful to display the full path (for when this is used |
468 | | // from the mass detector). |
469 | | printf("Your game version appears to be unknown. Please, report the following\n"); |
470 | | printf("data to the ScummVM team along with name of the game you tried to add\n"); |
471 | | printf("and its version/language/etc.:\n"); |
| 502 | if (!filesMD5.empty()) |
| 503 | reportUnknown(filesMD5, filesSize); |