ClientCommandManager.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * ClientCommandManager.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. VCMI_LIB_NAMESPACE_BEGIN
  12. class PlayerColor;
  13. VCMI_LIB_NAMESPACE_END
  14. class CIntObject;
  15. class ClientCommandManager //take mantis #2292 issue about account if thinking about handling cheats from command-line
  16. {
  17. bool currentCallFromIngameConsole = false; // commands can come from 2 sources: ingame console (chat) and client console
  18. // Quits the game (die, fool command)
  19. void handleQuitCommand();
  20. // Saves current game under the given filename
  21. void handleSaveCommand(std::istringstream & singleWordBuffer);
  22. // Loads a game with the given filename
  23. void handleLoadCommand(std::istringstream & singleWordBuffer);
  24. // AI takes over until the end of turn (unlike original H3 currently causes AI to take over until typed again)
  25. void handleGoSoloCommand();
  26. // Toggles autoskip mode on and off. In this mode, player turns are automatically skipped and only AI moves.
  27. // However, GUI is still present and allows to observe AI moves. After this option is activated, you need to end first turn manually.
  28. // Press [Shift] before your turn starts to not skip it.
  29. void handleAutoskipCommand();
  30. // Gives you control over specified AI player. If none is specified gives you control over all AI players
  31. void handleControlaiCommand(std::istringstream& singleWordBuffer);
  32. // Change battle AI used by neutral creatures to the one specified. Persists through game quit
  33. void handleSetBattleAICommand(std::istringstream& singleWordBuffer);
  34. // Redraw the current screen
  35. void handleRedrawCommand();
  36. // Prints information about current screen, and saves both screens as .bmp in root folder
  37. void handleScreenCommand();
  38. // Set the state indicating if dialog box is active to "no"
  39. void handleNotDialogCommand();
  40. // Dumps all game text, maps text and campaign maps text into Client log between BEGIN TEXT EXPORT and END TEXT EXPORT
  41. void handleConvertTextCommand();
  42. // Saves current game configuration into extracted/configuration folder
  43. void handleGetConfigCommand();
  44. // Dumps all scripts in Extracted/Scripts
  45. void handleGetScriptsCommand();
  46. // Dumps all .txt files from DATA into Extracted/DATA
  47. void handleGetTextCommand();
  48. // Extract .def animation as BMP files
  49. void handleDef2bmpCommand(std::istringstream& singleWordBuffer);
  50. // Export file into Extracted directory
  51. void handleExtractCommand(std::istringstream& singleWordBuffer);
  52. // Print in console the current bonuses for curent army
  53. void handleBonusesCommand(std::istringstream & singleWordBuffer);
  54. // Get what artifact is present on artifact slot with specified ID for hero with specified ID
  55. void handleTellCommand(std::istringstream& singleWordBuffer);
  56. // Show current movement points, max movement points on land / max movement points on water.
  57. void handleMpCommand();
  58. // set <command> <on/off> - sets special temporary settings that reset on game quit.
  59. void handleSetCommand(std::istringstream& singleWordBuffer);
  60. // Unlocks specific mutex known in VCMI code as "pim"
  61. void handleUnlockCommand(std::istringstream& singleWordBuffer);
  62. // Crashes the game forcing an exception
  63. void handleCrashCommand();
  64. // Prints in Chat the given message
  65. void printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType = ELogLevel::NOT_SET);
  66. void giveTurn(const PlayerColor &color);
  67. public:
  68. ClientCommandManager() = default;
  69. void processCommand(const std::string & message, bool calledFromIngameConsole);
  70. };