Closed drunderscore closed 1 year ago
How would the server even (accidentally) award achievements? There is no packet for it, only for NPC kills in packet 97, invasions in packet 98, and a few implicit ones from received packets, all of which are obviously part of the normal functionality.
@punchready By award achievements on the server, I meant the server invoking AchivementHelper
methods and awarding them. Like I said it shouldn't happen, and it would already be a problem now if it was happening.
Alright, this is now ready for review. Apologies about the somewhat-unrelated test suite changes in 0ac814c, but I wanted to add a test for this and was unable to without these changes.
CC @SignatureBeef for the changes to the test suite, and the test itself making sense.
This is good-to-go if @SignatureBeef is okay with it.
Merged as of 24bb002e646c88dacb1d1d864f8c171b48784435 (I fucked the rebase up 🙃 )
This formally fixes #2661
See the first commit's message for fine details about the fix itself.
Note that these changes should never cause achievements to be awarded or saved on the server. Some methods in
AchievementsHelper
check thenetMode
to ensure it is not on the server. For the methods that do not, it is either checked at the call site that it is not the server, or simply unreachable by control flow on the server. If you do know of an instance where the server could award an achievement, do let me know, because it is undesirable.Edit: To visualize what this PR is actually achieving (get it??), here's a demonstration
Chat message:
Console (no longer throws, and properly logs message):