Rename NetworkAITester to NetworkAIInstance for a proper name

This commit is contained in:
Benau
2020-02-10 09:38:23 +08:00
parent c9c4149139
commit 92a11c075a
6 changed files with 13 additions and 11 deletions

View File

@@ -1370,7 +1370,7 @@ int handleCmdLine(bool has_server_config, bool has_parent_process)
{
// We need an existing current player
PlayerManager::get()->enforceCurrentPlayer();
NetworkConfig::get()->setNetworkAITester(true);
NetworkConfig::get()->setNetworkAIInstance(true);
PlayerManager::get()->createGuestPlayers(n);
for (int i = 0; i < n; i++)
{

View File

@@ -468,7 +468,7 @@ std::shared_ptr<AbstractKart> World::createKart
{
case RaceManager::KT_PLAYER:
{
if (NetworkConfig::get()->isNetworkAITester())
if (NetworkConfig::get()->isNetworkAIInstance())
{
AIBaseController* ai = NULL;
if (race_manager->isBattleMode())

View File

@@ -70,7 +70,7 @@ NetworkConfig::NetworkConfig()
m_cur_user_token = "";
m_client_port = 0;
m_joined_server_version = 0;
m_network_ai_tester = false;
m_network_ai_instance = false;
m_state_frequency = 10;
m_nat64_prefix_data.fill(-1);
} // NetworkConfig

View File

@@ -81,7 +81,9 @@ private:
bool m_done_adding_network_players;
bool m_network_ai_tester;
/** True if this STK instance is an AI instance which is used for server
* AI. (usually used together with ai-handling in server config) */
bool m_network_ai_instance;
/** The LAN port on which a client is waiting for a server connection. */
uint16_t m_client_port;
@@ -177,7 +179,7 @@ public:
{
for (auto& p : m_network_players)
{
if (std::get<0>(p) == device && !m_network_ai_tester)
if (std::get<0>(p) == device && !m_network_ai_instance)
return false;
if (std::get<1>(p) == profile)
return false;
@@ -215,9 +217,9 @@ public:
* requested. */
bool isAutoConnect() const { return m_auto_connect; }
// ------------------------------------------------------------------------
void setNetworkAITester(bool b) { m_network_ai_tester = b; }
void setNetworkAIInstance(bool b) { m_network_ai_instance = b; }
// ------------------------------------------------------------------------
bool isNetworkAITester() const { return m_network_ai_tester; }
bool isNetworkAIInstance() const { return m_network_ai_instance; }
// ------------------------------------------------------------------------
void setCurrentUserId(uint32_t id) { m_cur_user_id = id ; }
// ------------------------------------------------------------------------

View File

@@ -367,7 +367,7 @@ void ClientLobby::update(int ticks)
{
NetworkConfig::get()->clearServerCapabilities();
std::string ua = StringUtils::getUserAgentString();
if (NetworkConfig::get()->isNetworkAITester())
if (NetworkConfig::get()->isNetworkAIInstance())
ua = "AI";
NetworkString* ns = getNetworkString();
ns->addUInt8(LE_CONNECTION_REQUESTED)
@@ -387,7 +387,7 @@ void ClientLobby::update(int ticks)
PlayerManager::get()->enforceCurrentPlayer();
uint32_t id = PlayerManager::getCurrentOnlineId();
bool lan_ai = !m_server->supportsEncryption() &&
NetworkConfig::get()->isNetworkAITester();
NetworkConfig::get()->isNetworkAIInstance();
if (lan_ai)
id = 0;
BareNetworkString* rest = new BareNetworkString();
@@ -414,7 +414,7 @@ void ClientLobby::update(int ticks)
auto& p = NetworkConfig::get()->getNetworkPlayers()[i];
PlayerProfile* player = std::get<1>(p);
core::stringw name = player->getName();
if (NetworkConfig::get()->isNetworkAITester())
if (NetworkConfig::get()->isNetworkAIInstance())
{
// I18N: Shown in lobby to indicate it's a bot in LAN game
#ifdef SERVER_ONLY

View File

@@ -485,7 +485,7 @@ bool KartSelectionScreen::joinPlayer(InputDevice* device, PlayerProfile* p)
}
else if (device == NULL)
{
if (!NetworkConfig::get()->isNetworkAITester())
if (!NetworkConfig::get()->isNetworkAIInstance())
{
Log::error("KartSelectionScreen", "joinPlayer(): Received null "
"device pointer");