{"id":68,"date":"2024-07-28T11:28:29","date_gmt":"2024-07-28T11:28:29","guid":{"rendered":"https:\/\/blogs.scummvm.org\/chico\/?p=68"},"modified":"2024-07-28T11:29:05","modified_gmt":"2024-07-28T11:29:05","slug":"week-9-major-features-finished","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/chico\/2024\/07\/28\/week-9-major-features-finished\/","title":{"rendered":"Week 9 \u2014 Major Features Finished"},"content":{"rendered":"<p>Week 9 \u2014 Wrapping Up Major Features<\/p>\n<p>This week, I mainly focused on the last scenario, which involves performing integrity checks submitted from the user side. Structurally, this task is not very different from the previous scenarios. However, I initially adopted an unreliable matching method:<\/p>\n<p>I first searched the database for filesets where the game ID, engine ID, platform, and language matched the metadata provided by the user. Then, I used a two-pointer approach to check each file within these filesets.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-69\" src=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/QQ\u622a\u56fe20240728192612-235x300.jpg\" alt=\"\" width=\"578\" height=\"738\" srcset=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/QQ\u622a\u56fe20240728192612-235x300.jpg 235w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/QQ\u622a\u56fe20240728192612.jpg 510w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/p>\n<p>If any file did not match, I marked it as &#8216;size_mismatch&#8217; or &#8216;checksum_mismatch&#8217;. However, I quickly realized that this comparison approach was unreliable; it did not conduct boundary checks and overlooked many unexpected situations.<\/p>\n<p>Given the files of a single game, comparing them one by one is an acceptable time complexity (referring to the implementation of the match args in the previous <code>dat_parser.py<\/code>). Moreover, based on my experience playing games, it is unnecessary to report &#8216;checksum_mismatch&#8217; or &#8216;size_mismatch&#8217;. Providing three responses: &#8216;ok,&#8217; &#8216;extra,&#8217; and &#8216;missing&#8217; would be sufficient. Therefore, I restructured this part of the logic and ran some tests, and it looks like it\u2019s working very well now!<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-70\" src=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/image-2-300x224.png\" alt=\"\" width=\"655\" height=\"489\" srcset=\"https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/image-2-300x224.png 300w, https:\/\/blogs.scummvm.org\/chico\/wp-content\/uploads\/sites\/74\/2024\/07\/image-2.png 634w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Week 9 \u2014 Wrapping Up Major Features This week, I mainly focused on the last scenario, which involves performing integrity checks submitted from the user side. Structurally, this task is not very different from the previous scenarios. However, I initially adopted an unreliable matching method: I first searched the database for filesets where the game [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-cli"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/posts\/68\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/chico\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}