2
0

ClientCommandManager.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. /*
  2. * ClientCommandManager.cpp, 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. #include "StdInc.h"
  11. #include "ClientCommandManager.h"
  12. #include "Client.h"
  13. #include "adventureMap/CInGameConsole.h"
  14. #include "CPlayerInterface.h"
  15. #include "PlayerLocalState.h"
  16. #include "CServerHandler.h"
  17. #include "GameEngine.h"
  18. #include "GameInstance.h"
  19. #include "gui/WindowHandler.h"
  20. #include "render/IRenderHandler.h"
  21. #include "ClientNetPackVisitors.h"
  22. #include "../lib/callback/CCallback.h"
  23. #include "../lib/callback/CGlobalAI.h"
  24. #include "../lib/callback/CDynLibHandler.h"
  25. #include "../lib/CConfigHandler.h"
  26. #include "../lib/gameState/CGameState.h"
  27. #include "../lib/CPlayerState.h"
  28. #include "../lib/constants/StringConstants.h"
  29. #include "../lib/campaign/CampaignHandler.h"
  30. #include "../lib/mapping/CMapService.h"
  31. #include "../lib/mapping/CMap.h"
  32. #include "windows/CCastleInterface.h"
  33. #include "../lib/mapObjects/CGHeroInstance.h"
  34. #include "render/CAnimation.h"
  35. #include "../lib/texts/CGeneralTextHandler.h"
  36. #include "../lib/filesystem/Filesystem.h"
  37. #include "../lib/modding/CModHandler.h"
  38. #include "../lib/modding/ContentTypeHandler.h"
  39. #include "../lib/modding/ModUtility.h"
  40. #include "../lib/VCMIDirs.h"
  41. #include "../lib/logging/VisualLogger.h"
  42. #include "../lib/serializer/Connection.h"
  43. #ifdef SCRIPTING_ENABLED
  44. #include "../lib/ScriptHandler.h"
  45. #endif
  46. void ClientCommandManager::handleQuitCommand()
  47. {
  48. exit(EXIT_SUCCESS);
  49. }
  50. void ClientCommandManager::handleSaveCommand(std::istringstream & singleWordBuffer)
  51. {
  52. if(!GAME->server().client)
  53. {
  54. printCommandMessage("Game is not in playing state");
  55. return;
  56. }
  57. std::string saveFilename;
  58. singleWordBuffer >> saveFilename;
  59. GAME->server().client->save(saveFilename);
  60. printCommandMessage("Game saved as: " + saveFilename);
  61. }
  62. void ClientCommandManager::handleLoadCommand(std::istringstream& singleWordBuffer)
  63. {
  64. // TODO: this code should end the running game and manage to call startGame instead
  65. //std::string fname;
  66. //singleWordBuffer >> fname;
  67. //GAME->server().client->loadGame(fname);
  68. }
  69. void ClientCommandManager::handleGoSoloCommand()
  70. {
  71. Settings session = settings.write["session"];
  72. std::scoped_lock interfaceLock(ENGINE->interfaceMutex);
  73. if(!GAME->server().client)
  74. {
  75. printCommandMessage("Game is not in playing state");
  76. return;
  77. }
  78. if(session["aiSolo"].Bool())
  79. {
  80. // unlikely it will work but just in case to be consistent
  81. for(auto & color : GAME->server().getAllClientPlayers(GAME->server().logicConnection->connectionID))
  82. {
  83. if(color.isValidPlayer() && GAME->server().client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
  84. {
  85. GAME->server().client->installNewPlayerInterface(std::make_shared<CPlayerInterface>(color), color);
  86. }
  87. }
  88. }
  89. else
  90. {
  91. PlayerColor currentColor = GAME->interface()->playerID;
  92. GAME->server().client->removeGUI();
  93. for(auto & color : GAME->server().getAllClientPlayers(GAME->server().logicConnection->connectionID))
  94. {
  95. if(color.isValidPlayer() && GAME->server().client->getStartInfo()->playerInfos.at(color).isControlledByHuman())
  96. {
  97. auto AiToGive = GAME->server().client->aiNameForPlayer(*GAME->server().client->getPlayerSettings(color), false, false);
  98. printCommandMessage("Player " + color.toString() + " will be lead by " + AiToGive, ELogLevel::INFO);
  99. GAME->server().client->installNewPlayerInterface(CDynLibHandler::getNewAI(AiToGive), color);
  100. }
  101. }
  102. ENGINE->windows().totalRedraw();
  103. giveTurn(currentColor);
  104. }
  105. session["aiSolo"].Bool() = !session["aiSolo"].Bool();
  106. }
  107. void ClientCommandManager::handleAutoskipCommand()
  108. {
  109. Settings session = settings.write["session"];
  110. session["autoSkip"].Bool() = !session["autoSkip"].Bool();
  111. }
  112. void ClientCommandManager::handleControlaiCommand(std::istringstream& singleWordBuffer)
  113. {
  114. std::string colorName;
  115. singleWordBuffer >> colorName;
  116. boost::to_lower(colorName);
  117. std::scoped_lock interfaceLock(ENGINE->interfaceMutex);
  118. if(!GAME->server().client)
  119. {
  120. printCommandMessage("Game is not in playing state");
  121. return;
  122. }
  123. PlayerColor color;
  124. if(GAME->interface())
  125. color = GAME->interface()->playerID;
  126. for(auto & elem : GAME->server().client->gameState().players)
  127. {
  128. if(!elem.first.isValidPlayer()
  129. || elem.second.human
  130. || (colorName.length() && elem.first.getNum() != vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, colorName)))
  131. {
  132. continue;
  133. }
  134. GAME->server().client->removeGUI();
  135. GAME->server().client->installNewPlayerInterface(std::make_shared<CPlayerInterface>(elem.first), elem.first);
  136. }
  137. ENGINE->windows().totalRedraw();
  138. if(color != PlayerColor::NEUTRAL)
  139. giveTurn(color);
  140. }
  141. void ClientCommandManager::handleSetBattleAICommand(std::istringstream& singleWordBuffer)
  142. {
  143. std::string aiName;
  144. singleWordBuffer >> aiName;
  145. printCommandMessage("Will try loading that AI to see if it is correct name...\n");
  146. try
  147. {
  148. if(auto ai = CDynLibHandler::getNewBattleAI(aiName)) //test that given AI is indeed available... heavy but it is easy to make a typo and break the game
  149. {
  150. Settings neutralAI = settings.write["server"]["neutralAI"];
  151. neutralAI->String() = aiName;
  152. printCommandMessage("Setting changed, from now the battle ai will be " + aiName + "!\n");
  153. }
  154. }
  155. catch(std::exception &e)
  156. {
  157. printCommandMessage("Failed opening " + aiName + ": " + e.what(), ELogLevel::WARN);
  158. printCommandMessage("Setting not changed, AI not found or invalid!", ELogLevel::WARN);
  159. }
  160. }
  161. void ClientCommandManager::handleRedrawCommand()
  162. {
  163. ENGINE->windows().totalRedraw();
  164. }
  165. void ClientCommandManager::handleTranslateGameCommand(bool onlyMissing)
  166. {
  167. std::map<std::string, std::map<std::string, std::string>> textsByMod;
  168. LIBRARY->generaltexth->exportAllTexts(textsByMod, onlyMissing);
  169. const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / ( onlyMissing ? "translationMissing" : "translation");
  170. boost::filesystem::create_directories(outPath);
  171. for(const auto & modEntry : textsByMod)
  172. {
  173. JsonNode output;
  174. for(const auto & stringEntry : modEntry.second)
  175. {
  176. if(boost::algorithm::starts_with(stringEntry.first, "map."))
  177. continue;
  178. if(boost::algorithm::starts_with(stringEntry.first, "campaign."))
  179. continue;
  180. output[stringEntry.first].String() = stringEntry.second;
  181. }
  182. if (!output.isNull())
  183. {
  184. const boost::filesystem::path filePath = outPath / (modEntry.first + ".json");
  185. std::ofstream file(filePath.c_str());
  186. file << output.toString();
  187. }
  188. }
  189. printCommandMessage("Translation export complete");
  190. }
  191. void ClientCommandManager::handleTranslateMapsCommand()
  192. {
  193. CMapService mapService;
  194. printCommandMessage("Searching for available maps");
  195. std::unordered_set<ResourcePath> mapList = CResourceHandler::get()->getFilteredFiles([&](const ResourcePath & ident)
  196. {
  197. return ident.getType() == EResType::MAP;
  198. });
  199. std::vector<std::unique_ptr<CMap>> loadedMaps;
  200. std::vector<std::shared_ptr<CampaignState>> loadedCampaigns;
  201. printCommandMessage("Loading maps for export");
  202. for (auto const & mapName : mapList)
  203. {
  204. try
  205. {
  206. // load and drop loaded map - we only need loader to run over all maps
  207. loadedMaps.push_back(mapService.loadMap(mapName, nullptr));
  208. }
  209. catch(std::exception & e)
  210. {
  211. logGlobal->warn("Map %s is invalid. Message: %s", mapName.getName(), e.what());
  212. }
  213. }
  214. printCommandMessage("Searching for available campaigns");
  215. std::unordered_set<ResourcePath> campaignList = CResourceHandler::get()->getFilteredFiles([&](const ResourcePath & ident)
  216. {
  217. return ident.getType() == EResType::CAMPAIGN;
  218. });
  219. logGlobal->info("Loading campaigns for export");
  220. for (auto const & campaignName : campaignList)
  221. {
  222. try
  223. {
  224. loadedCampaigns.push_back(CampaignHandler::getCampaign(campaignName.getName()));
  225. for (auto const & part : loadedCampaigns.back()->allScenarios())
  226. loadedCampaigns.back()->getMap(part, nullptr);
  227. }
  228. catch(std::exception & e)
  229. {
  230. logGlobal->warn("Campaign %s is invalid. Message: %s", campaignName.getName(), e.what());
  231. }
  232. }
  233. std::map<std::string, std::map<std::string, std::string>> textsByMod;
  234. LIBRARY->generaltexth->exportAllTexts(textsByMod, false);
  235. const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "translation";
  236. boost::filesystem::create_directories(outPath);
  237. for(const auto & modEntry : textsByMod)
  238. {
  239. JsonNode output;
  240. for(const auto & stringEntry : modEntry.second)
  241. {
  242. if(boost::algorithm::starts_with(stringEntry.first, "map."))
  243. output[stringEntry.first].String() = stringEntry.second;
  244. if(boost::algorithm::starts_with(stringEntry.first, "campaign."))
  245. output[stringEntry.first].String() = stringEntry.second;
  246. }
  247. if (!output.isNull())
  248. {
  249. const boost::filesystem::path filePath = outPath / (modEntry.first + ".json");
  250. std::ofstream file(filePath.c_str());
  251. file << output.toString();
  252. }
  253. }
  254. printCommandMessage("Translation export complete");
  255. }
  256. void ClientCommandManager::handleGetConfigCommand()
  257. {
  258. printCommandMessage("Command accepted.\t");
  259. const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "configuration";
  260. boost::filesystem::create_directories(outPath);
  261. const std::vector<std::string> contentNames = { "heroClasses", "artifacts", "creatures", "factions", "objects", "heroes", "spells", "skills" };
  262. for(auto contentName : contentNames)
  263. {
  264. auto const & handler = *LIBRARY->modh->content;
  265. auto const & content = handler[contentName];
  266. auto contentOutPath = outPath / contentName;
  267. boost::filesystem::create_directories(contentOutPath);
  268. for(auto& iter : content.modData)
  269. {
  270. const JsonNode& modData = iter.second.modData;
  271. for(auto& nameAndObject : modData.Struct())
  272. {
  273. const JsonNode& object = nameAndObject.second;
  274. std::string name = ModUtility::makeFullIdentifier(object.getModScope(), contentName, nameAndObject.first);
  275. boost::algorithm::replace_all(name, ":", "_");
  276. const boost::filesystem::path filePath = contentOutPath / (name + ".json");
  277. std::ofstream file(filePath.c_str());
  278. file << object.toString();
  279. }
  280. }
  281. }
  282. printCommandMessage("\rExtracting done :)\n");
  283. printCommandMessage("Extracted files can be found in " + outPath.string() + " directory\n");
  284. }
  285. void ClientCommandManager::handleGetScriptsCommand()
  286. {
  287. #if SCRIPTING_ENABLED
  288. printCommandMessage("Command accepted.\t");
  289. const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "scripts";
  290. boost::filesystem::create_directories(outPath);
  291. for(const auto & kv : LIBRARY->scriptHandler->objects)
  292. {
  293. std::string name = kv.first;
  294. boost::algorithm::replace_all(name,":","_");
  295. const scripting::ScriptImpl * script = kv.second.get();
  296. boost::filesystem::path filePath = outPath / (name + ".lua");
  297. std::ofstream file(filePath.c_str());
  298. file << script->getSource();
  299. }
  300. printCommandMessage("\rExtracting done :)\n");
  301. printCommandMessage("Extracted files can be found in " + outPath.string() + " directory\n");
  302. #endif
  303. }
  304. void ClientCommandManager::handleGetTextCommand()
  305. {
  306. printCommandMessage("Command accepted.\t");
  307. const boost::filesystem::path outPath =
  308. VCMIDirs::get().userExtractedPath();
  309. auto list =
  310. CResourceHandler::get()->getFilteredFiles([](const ResourcePath & ident)
  311. {
  312. return ident.getType() == EResType::TEXT && boost::algorithm::starts_with(ident.getName(), "DATA/");
  313. });
  314. for (auto & filename : list)
  315. {
  316. const boost::filesystem::path filePath = outPath / (filename.getName() + ".TXT");
  317. boost::filesystem::create_directories(filePath.parent_path());
  318. std::ofstream file(filePath.c_str());
  319. auto text = CResourceHandler::get()->load(filename)->readAll();
  320. file.write((char*)text.first.get(), text.second);
  321. }
  322. printCommandMessage("\rExtracting done :)\n");
  323. printCommandMessage("Extracted files can be found in " + outPath.string() + " directory\n");
  324. }
  325. void ClientCommandManager::handleDef2bmpCommand(std::istringstream& singleWordBuffer)
  326. {
  327. std::string URI;
  328. singleWordBuffer >> URI;
  329. auto anim = ENGINE->renderHandler().loadAnimation(AnimationPath::builtin(URI), EImageBlitMode::SIMPLE);
  330. anim->exportBitmaps(VCMIDirs::get().userExtractedPath());
  331. }
  332. void ClientCommandManager::handleExtractCommand(std::istringstream& singleWordBuffer)
  333. {
  334. std::string URI;
  335. singleWordBuffer >> URI;
  336. if(CResourceHandler::get()->existsResource(ResourcePath(URI)))
  337. {
  338. const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / URI;
  339. auto data = CResourceHandler::get()->load(ResourcePath(URI))->readAll();
  340. boost::filesystem::create_directories(outPath.parent_path());
  341. std::ofstream outFile(outPath.c_str(), std::ofstream::binary);
  342. outFile.write((char*)data.first.get(), data.second);
  343. }
  344. else
  345. printCommandMessage("File not found!", ELogLevel::ERROR);
  346. }
  347. void ClientCommandManager::handleBonusesCommand(std::istringstream & singleWordBuffer)
  348. {
  349. if(currentCallFromIngameConsole)
  350. {
  351. printCommandMessage("Output for this command is too large for ingame chat! Please run it from client console.\n");
  352. return;
  353. }
  354. std::string outputFormat;
  355. singleWordBuffer >> outputFormat;
  356. auto format = [outputFormat](const BonusList & b) -> std::string
  357. {
  358. if(outputFormat == "json")
  359. return b.toJsonNode().toCompactString();
  360. std::ostringstream ss;
  361. ss << b;
  362. return ss.str();
  363. };
  364. printCommandMessage("Bonuses of " + GAME->interface()->localState->getCurrentArmy()->getObjectName() + "\n");
  365. printCommandMessage(format(*GAME->interface()->localState->getCurrentArmy()->getAllBonuses(Selector::all, Selector::all)) + "\n");
  366. printCommandMessage("\nInherited bonuses:\n");
  367. TCNodes parents;
  368. GAME->interface()->localState->getCurrentArmy()->getParents(parents);
  369. for(const CBonusSystemNode *parent : parents)
  370. {
  371. printCommandMessage(std::string("\nBonuses from ") + typeid(*parent).name() + "\n" + format(*parent->getAllBonuses(Selector::all, Selector::all)) + "\n");
  372. }
  373. }
  374. void ClientCommandManager::handleTellCommand(std::istringstream& singleWordBuffer)
  375. {
  376. std::string what;
  377. int id1;
  378. int id2;
  379. singleWordBuffer >> what >> id1 >> id2;
  380. if(what == "hs")
  381. {
  382. for(const CGHeroInstance* h : GAME->interface()->cb->getHeroesInfo())
  383. if(h->getHeroTypeID().getNum() == id1)
  384. if(const CArtifactInstance* a = h->getArt(ArtifactPosition(id2)))
  385. printCommandMessage(a->nodeName());
  386. }
  387. }
  388. void ClientCommandManager::handleMpCommand()
  389. {
  390. if(const CGHeroInstance* h = GAME->interface()->localState->getCurrentHero())
  391. printCommandMessage(std::to_string(h->movementPointsRemaining()) + "; max: " + std::to_string(h->movementPointsLimit(true)) + "/" + std::to_string(h->movementPointsLimit(false)) + "\n");
  392. }
  393. void ClientCommandManager::handleSetCommand(std::istringstream& singleWordBuffer)
  394. {
  395. std::string what;
  396. std::string value;
  397. singleWordBuffer >> what;
  398. Settings config = settings.write["session"][what];
  399. singleWordBuffer >> value;
  400. if(value == "on")
  401. {
  402. config->Bool() = true;
  403. printCommandMessage("Option " + what + " enabled!", ELogLevel::INFO);
  404. }
  405. else if(value == "off")
  406. {
  407. config->Bool() = false;
  408. printCommandMessage("Option " + what + " disabled!", ELogLevel::INFO);
  409. }
  410. }
  411. void ClientCommandManager::handleCrashCommand()
  412. {
  413. int* ptr = nullptr;
  414. *ptr = 666;
  415. //disaster!
  416. }
  417. void ClientCommandManager::handleVsLog(std::istringstream & singleWordBuffer)
  418. {
  419. std::string key;
  420. singleWordBuffer >> key;
  421. logVisual->setKey(key);
  422. }
  423. void ClientCommandManager::handleGenerateAssets()
  424. {
  425. ENGINE->renderHandler().exportGeneratedAssets();
  426. printCommandMessage("All assets generated");
  427. }
  428. void ClientCommandManager::printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType)
  429. {
  430. switch(messageType)
  431. {
  432. case ELogLevel::NOT_SET:
  433. std::cout << commandMessage;
  434. break;
  435. case ELogLevel::TRACE:
  436. logGlobal->trace(commandMessage);
  437. break;
  438. case ELogLevel::DEBUG:
  439. logGlobal->debug(commandMessage);
  440. break;
  441. case ELogLevel::INFO:
  442. logGlobal->info(commandMessage);
  443. break;
  444. case ELogLevel::WARN:
  445. logGlobal->warn(commandMessage);
  446. break;
  447. case ELogLevel::ERROR:
  448. logGlobal->error(commandMessage);
  449. break;
  450. default:
  451. std::cout << commandMessage;
  452. break;
  453. }
  454. if(currentCallFromIngameConsole)
  455. {
  456. std::scoped_lock interfaceLock(ENGINE->interfaceMutex);
  457. if(GAME->interface() && GAME->interface()->cingconsole)
  458. {
  459. GAME->interface()->cingconsole->addMessage("", "System", commandMessage);
  460. }
  461. }
  462. }
  463. void ClientCommandManager::giveTurn(const PlayerColor &colorIdentifier)
  464. {
  465. PlayerStartsTurn yt;
  466. yt.player = colorIdentifier;
  467. yt.queryID = QueryID::NONE;
  468. ApplyClientNetPackVisitor visitor(*GAME->server().client, GAME->server().client->gameState());
  469. yt.visit(visitor);
  470. }
  471. void ClientCommandManager::processCommand(const std::string & message, bool calledFromIngameConsole)
  472. {
  473. // split the message into individual words
  474. std::istringstream singleWordBuffer;
  475. singleWordBuffer.str(message);
  476. // get command name, to be used for single word commands
  477. std::string commandName;
  478. singleWordBuffer >> commandName;
  479. currentCallFromIngameConsole = calledFromIngameConsole;
  480. if(message == std::string("die, fool"))
  481. handleQuitCommand();
  482. else if(commandName == "save")
  483. handleSaveCommand(singleWordBuffer);
  484. else if(commandName=="load")
  485. handleLoadCommand(singleWordBuffer); // not implemented
  486. else if(commandName == "gosolo")
  487. handleGoSoloCommand();
  488. else if(commandName == "autoskip")
  489. handleAutoskipCommand();
  490. else if(commandName == "controlai")
  491. handleControlaiCommand(singleWordBuffer);
  492. else if(commandName == "setBattleAI")
  493. handleSetBattleAICommand(singleWordBuffer);
  494. else if(commandName == "redraw")
  495. handleRedrawCommand();
  496. else if(message=="translate" || message=="translate game")
  497. handleTranslateGameCommand(false);
  498. else if(message=="translate missing")
  499. handleTranslateGameCommand(true);
  500. else if(message=="translate maps")
  501. handleTranslateMapsCommand();
  502. else if(message=="get config")
  503. handleGetConfigCommand();
  504. else if(message=="get scripts")
  505. handleGetScriptsCommand();
  506. else if(message=="get txt")
  507. handleGetTextCommand();
  508. else if(commandName == "def2bmp")
  509. handleDef2bmpCommand(singleWordBuffer);
  510. else if(commandName == "extract")
  511. handleExtractCommand(singleWordBuffer);
  512. else if(commandName == "bonuses")
  513. handleBonusesCommand(singleWordBuffer);
  514. else if(commandName == "tell")
  515. handleTellCommand(singleWordBuffer);
  516. else if(commandName == "mp" && GAME->interface())
  517. handleMpCommand();
  518. else if (commandName == "set")
  519. handleSetCommand(singleWordBuffer);
  520. else if(commandName == "crash")
  521. handleCrashCommand();
  522. else if(commandName == "vslog")
  523. handleVsLog(singleWordBuffer);
  524. else if(message=="generate assets")
  525. handleGenerateAssets();
  526. else
  527. {
  528. if (!commandName.empty() && !vstd::iswithin(commandName[0], 0, ' ')) // filter-out debugger/IDE noise
  529. printCommandMessage("Command not found :(", ELogLevel::ERROR);
  530. }
  531. }