diff --git a/inc/product.h b/inc/product.h index 0ab8bef..35baf88 100644 --- a/inc/product.h +++ b/inc/product.h @@ -47,6 +47,8 @@ public: const StringRef dtime { __DATE__ " " __TIME__ }; const StringRef date { __DATE__ }; const StringRef version { MODULE_BOT_VERSION }; + const StringRef cmdPri { "yb" }; + const StringRef cmdSec { "yapb" }; }; // expose product info diff --git a/src/config.cpp b/src/config.cpp index 7545c92..ae368de 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -58,7 +58,7 @@ void BotConfig::loadMainConfig () { MemFile file; // this is does the same as exec of engine, but not overwriting values of cvars spcified in cv_ignore_cvars_on_changelevel - if (util.openConfig ("yapb.cfg", "YaPB main config file is not found.", &file, false)) { + if (util.openConfig (strings.format ("%s.cfg", product.folder), "Bot main config file is not found.", &file, false)) { while (file.getLine (line)) { line.trim (); diff --git a/src/control.cpp b/src/control.cpp index 470051b..6e45f95 100644 --- a/src/control.cpp +++ b/src/control.cpp @@ -1549,7 +1549,7 @@ bool BotControl::executeCommands () { const auto &prefix = m_args[0]; // no handling if not for us - if (prefix != "yb" && prefix != "yapb") { + if (prefix != product.cmdPri && prefix != product.cmdSec) { return false; } Client &client = util.getClient (game.indexOfPlayer (m_ent)); diff --git a/src/engine.cpp b/src/engine.cpp index c307dc5..7804abd 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -747,7 +747,7 @@ bool Game::postload () { game.registerCvars (); // handle prefixes - static StringArray prefixes = { "yb", "yapb" }; + static StringArray prefixes = { product.cmdPri, product.cmdSec }; // register all our handlers for (const auto &prefix : prefixes) { diff --git a/src/graph.cpp b/src/graph.cpp index 547c41a..5843c2a 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -1832,11 +1832,11 @@ bool BotGraph::saveGraphData () { author = m_editor->v.netname.chars (); } else { - author = "YAPB"; + author = product.name; } // mark as official - if (author.startsWith ("YAPB")) { + if (author.startsWith (product.name)) { options |= StorageOption::Official; } diff --git a/src/manager.cpp b/src/manager.cpp index eae6b0e..82b1639 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -198,7 +198,7 @@ BotCreateResult BotManager::create (StringRef name, int difficulty, int personal resultName = botName->name; } else { - resultName.assignf ("yapb_%d.%d", rg.int_ (100, 10000), rg.int_ (100, 10000)); // just pick ugly random name + resultName.assignf ("%s_%d.%d", product.folder, rg.int_ (100, 10000), rg.int_ (100, 10000)); // just pick ugly random name } } else {