Page MenuHomeWildfire Games

Disable control-all-units, reveal-map and promotion cheat if cheats are disabled
ClosedPublic

Authored by elexis on May 8 2017, 6:27 AM.

Details

Summary

As mentioned in #3551 and agreed by Itms and Imarok in todays staff meeting, controling units of enemies, even if cheats are disabled (especially but not only in rated games) must be prohibited.
The correct fix was committed in rP17282 already but reverted in rP17288 because the autostart mode didn't support cheats. This is added by D453.

Notice the developer overlay hotkey is disabled if cheats are disabled here too for the following reason:

  • Most developers debug in SP which has cheats always enabled.
  • Most of the time hosts enable the Rated game lobby option to prevent people opening the developer overlay (and likely will continue to do that, since the change perspective map revelation will still be bad),

but this is obviously a hacky workaround. The Lobby Rating setting should only be available in 1v1

  • Developers who happen to play an MP game and want to use the overlay may not forget to disable the rated game setting (which is enabled by default) before starting the game. If they can manage to not forget that, they can also manage to not forget to enable the cheat setting. (Besides, F9 + Engine.GetGUIObjectByName("devCommands").hidden=false circumvents that gui check)
Test Plan

Ensure that the developer overlay and its cheats still work in SP mode.
Ensure they work in MP mode if and only if cheats are enabled.
Remove the early return in menu.js to ensure that the cheats won't be executed, even if the GUI is hacked.
If D453 is applied, we can see that the developer overlay is available in autostarted SP mode too.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.May 8 2017, 6:27 AM
Vulcan added a subscriber: Vulcan.May 8 2017, 9:47 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/1083/ for more details.

echotangoecho accepted this revision.May 11 2017, 9:50 PM
echotangoecho added a reviewer: echotangoecho.
This revision is now accepted and ready to land.May 11 2017, 9:50 PM
elexis updated this revision to Diff 1857.May 11 2017, 9:59 PM

Make cheat-check independent safe for observermode, which is required for D453.

elexis requested review of this revision.May 11 2017, 9:59 PM
elexis edited edge metadata.
echotangoecho accepted this revision.May 12 2017, 12:27 AM
This revision is now accepted and ready to land.May 12 2017, 12:27 AM

Thanks for the review, testing in combination with D453 which revealed a bug!

This revision was automatically updated to reflect the committed changes.

Build has FAILED

Link to build: http://jw:8080/job/phabricator/1153/
See console output for more information: http://jw:8080/job/phabricator/1153/console