ClientCommandManager.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. // Extracts all translateable game texts into Translation directory, separating files on per-mod basis
  37. void handleTranslateGameCommand();
  38. // Extracts all translateable texts from maps and campaigns into Translation directory, separating files on per-mod basis
  39. void handleTranslateMapsCommand();
  40. // Saves current game configuration into extracted/configuration folder
  41. void handleGetConfigCommand();
  42. // Dumps all scripts in Extracted/Scripts
  43. void handleGetScriptsCommand();
  44. // Dumps all .txt files from DATA into Extracted/DATA
  45. void handleGetTextCommand();
  46. // Extract .def animation as BMP files
  47. void handleDef2bmpCommand(std::istringstream& singleWordBuffer);
  48. // Export file into Extracted directory
  49. void handleExtractCommand(std::istringstream& singleWordBuffer);
  50. // Print in console the current bonuses for current army
  51. void handleBonusesCommand(std::istringstream & singleWordBuffer);
  52. // Get what artifact is present on artifact slot with specified ID for hero with specified ID
  53. void handleTellCommand(std::istringstream& singleWordBuffer);
  54. // Show current movement points, max movement points on land / max movement points on water.
  55. void handleMpCommand();
  56. // set <command> <on/off> - sets special temporary settings that reset on game quit.
  57. void handleSetCommand(std::istringstream& singleWordBuffer);
  58. // Crashes the game forcing an exception
  59. void handleCrashCommand();
  60. // shows object graph
  61. void handleVsLog(std::istringstream & singleWordBuffer);
  62. // Prints in Chat the given message
  63. void printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType = ELogLevel::NOT_SET);
  64. void giveTurn(const PlayerColor &color);
  65. public:
  66. ClientCommandManager() = default;
  67. void processCommand(const std::string & message, bool calledFromIngameConsole);
  68. };