| 1 |
/* |
| 2 |
* Copyright (C) 2005-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "PlayerCoreFactory.h" |
| 10 |
|
| 11 |
#include "FileItem.h" |
| 12 |
#include "PlayerCoreConfig.h" |
| 13 |
#include "PlayerSelectionRule.h" |
| 14 |
#include "URL.h" |
| 15 |
#include "cores/IPlayerCallback.h" |
| 16 |
#include "cores/VideoPlayer/Interface/InputStreamConstants.h" |
| 17 |
#include "dialogs/GUIDialogContextMenu.h" |
| 18 |
#include "guilib/LocalizeStrings.h" |
| 19 |
#include "profiles/ProfileManager.h" |
| 20 |
#include "settings/AdvancedSettings.h" |
| 21 |
#include "settings/Settings.h" |
| 22 |
#include "settings/SettingsComponent.h" |
| 23 |
#include "settings/lib/SettingsManager.h" |
| 24 |
#include "utils/FileUtils.h" |
| 25 |
#include "utils/StringUtils.h" |
| 26 |
#include "utils/XMLUtils.h" |
| 27 |
#include "utils/log.h" |
| 28 |
|
| 29 |
#include <mutex> |
| 30 |
#include <sstream> |
| 31 |
|
| 32 |
#define PLAYERCOREFACTORY_XML "playercorefactory.xml" |
| 33 |
|
| 34 |
CPlayerCoreFactory::CPlayerCoreFactory(const CProfileManager& profileManager) |
| 35 |
: m_settings(CServiceBroker::GetSettingsComponent()->GetSettings()), |
| 36 |
m_profileManager(profileManager) |
| 37 |
{ |
| 38 |
if (m_settings->IsLoaded()) |
| 39 |
OnSettingsLoaded(); |
| 40 |
|
| 41 |
m_settings->GetSettingsManager()->RegisterSettingsHandler(this); |
| 42 |
} |
| 43 |
|
| 44 |
CPlayerCoreFactory::~CPlayerCoreFactory() |
| 45 |
{ |
| 46 |
m_settings->GetSettingsManager()->UnregisterSettingsHandler(this); |
| 47 |
} |
| 48 |
|
| 49 |
void CPlayerCoreFactory::OnSettingsLoaded() |
| 50 |
{ |
| 51 |
LoadConfiguration("special://xbmc/system/" PLAYERCOREFACTORY_XML, true); |
| 52 |
LoadConfiguration(m_profileManager.GetUserDataItem(PLAYERCOREFACTORY_XML), false); |
| 53 |
} |
| 54 |
|
| 55 |
std::shared_ptr<IPlayer> CPlayerCoreFactory::CreatePlayer(const std::string& nameId, |
| 56 |
IPlayerCallback& callback) const |
| 57 |
{ |
| 58 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 59 |
size_t idx = GetPlayerIndex(nameId); |
| 60 |
|
| 61 |
if (m_vecPlayerConfigs.empty() || idx > m_vecPlayerConfigs.size()) |
| 62 |
return nullptr; |
| 63 |
|
| 64 |
return m_vecPlayerConfigs[idx]->CreatePlayer(callback); |
| 65 |
} |
| 66 |
|
| 67 |
void CPlayerCoreFactory::GetPlayers(std::vector<std::string>&players) const |
| 68 |
{ |
| 69 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 70 |
players.clear(); |
| 71 |
for (auto& conf : m_vecPlayerConfigs) |
| 72 |
{ |
| 73 |
if (conf->m_bPlaysAudio || conf->m_bPlaysVideo) |
| 74 |
players.emplace_back(conf->m_name); |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
void CPlayerCoreFactory::GetPlayers(std::vector<std::string>&players, const bool audio, const bool video) const |
| 79 |
{ |
| 80 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 81 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: for video={}, audio={}", video, audio); |
| 82 |
|
| 83 |
for (auto& conf : m_vecPlayerConfigs) |
| 84 |
{ |
| 85 |
if (audio == conf->m_bPlaysAudio && video == conf->m_bPlaysVideo) |
| 86 |
{ |
| 87 |
if (std::find(players.begin(), players.end(), conf->m_name) != players.end()) |
| 88 |
continue; |
| 89 |
|
| 90 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding player: {}", conf->m_name); |
| 91 |
players.emplace_back(conf->m_name); |
| 92 |
} |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
void CPlayerCoreFactory::GetPlayers(const CFileItem& item, std::vector<std::string>&players) const |
| 97 |
{ |
| 98 |
CURL url(item.GetDynPath()); |
| 99 |
|
| 100 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers({})", CURL::GetRedacted(item.GetDynPath())); |
| 101 |
|
| 102 |
enum class ForcedPlayer |
| 103 |
{ |
| 104 |
NONE, |
| 105 |
VIDEO_DEFAULT, |
| 106 |
AUDIO_DEFAULT |
| 107 |
}; |
| 108 |
|
| 109 |
ForcedPlayer defaultInputstreamPlayerOverride = ForcedPlayer::NONE; |
| 110 |
|
| 111 |
// If we are using an inpustream add-on |
| 112 |
if (!item.GetProperty(STREAM_PROPERTY_INPUTSTREAM).empty()) |
| 113 |
{ |
| 114 |
if (!item.GetProperty(STREAM_PROPERTY_INPUTSTREAM_PLAYER).empty()) |
| 115 |
{ |
| 116 |
const std::string inputstreamPlayerOverride = |
| 117 |
item.GetProperty(STREAM_PROPERTY_INPUTSTREAM_PLAYER).asString(); |
| 118 |
|
| 119 |
if (inputstreamPlayerOverride == "videodefaultplayer") |
| 120 |
defaultInputstreamPlayerOverride = ForcedPlayer::VIDEO_DEFAULT; |
| 121 |
else if ((inputstreamPlayerOverride == "audiodefaultplayer")) |
| 122 |
defaultInputstreamPlayerOverride = ForcedPlayer::AUDIO_DEFAULT; |
| 123 |
} |
| 124 |
} |
| 125 |
|
| 126 |
std::vector<std::string>validPlayers; |
| 127 |
GetPlayers(validPlayers); |
| 128 |
|
| 129 |
// Process rules |
| 130 |
for (auto& rule : m_vecCoreSelectionRules) |
| 131 |
rule->GetPlayers(item, validPlayers, players); |
| 132 |
|
| 133 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: matched {0} rules with players", players.size()); |
| 134 |
|
| 135 |
// Process defaults |
| 136 |
|
| 137 |
// Set video default player. Check whether it's video first (overrule audio and |
| 138 |
// game check). Also push these players in case it is NOT audio or game either. |
| 139 |
// |
| 140 |
// If an inputstream add-on is used, first check if we have an override to use |
| 141 |
// "videodefaultplayer" |
| 142 |
if (defaultInputstreamPlayerOverride == ForcedPlayer::VIDEO_DEFAULT || |
| 143 |
(defaultInputstreamPlayerOverride == ForcedPlayer::NONE && |
| 144 |
(item.IsVideo() || (!item.IsAudio() && !item.IsGame())))) |
| 145 |
{ |
| 146 |
int idx = GetPlayerIndex("videodefaultplayer"); |
| 147 |
if (idx > -1) |
| 148 |
{ |
| 149 |
const std::string videoDefault = GetPlayerName(idx); |
| 150 |
if (std::find(players.cbegin(), players.cend(), videoDefault) == players.cend()) |
| 151 |
{ |
| 152 |
players.emplace_back(videoDefault); |
| 153 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding videodefaultplayer ({})", |
| 154 |
videoDefault); |
| 155 |
} |
| 156 |
} |
| 157 |
GetPlayers(players, false, true); // Video-only players |
| 158 |
GetPlayers(players, true, true); // Audio & video players |
| 159 |
} |
| 160 |
|
| 161 |
// Set audio default player |
| 162 |
// Pushback all audio players in case we don't know the type |
| 163 |
if (defaultInputstreamPlayerOverride == ForcedPlayer::AUDIO_DEFAULT || |
| 164 |
(defaultInputstreamPlayerOverride == ForcedPlayer::NONE && item.IsAudio())) |
| 165 |
{ |
| 166 |
int idx = GetPlayerIndex("audiodefaultplayer"); |
| 167 |
if (idx > -1) |
| 168 |
{ |
| 169 |
const std::string audioDefault = GetPlayerName(idx); |
| 170 |
if (std::find(players.cbegin(), players.cend(), audioDefault) == players.cend()) |
| 171 |
{ |
| 172 |
players.emplace_back(audioDefault); |
| 173 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer ({})", |
| 174 |
audioDefault); |
| 175 |
} |
| 176 |
} |
| 177 |
GetPlayers(players, true, false); // Audio-only players |
| 178 |
GetPlayers(players, true, true); // Audio & video players |
| 179 |
} |
| 180 |
|
| 181 |
if (item.IsGame()) |
| 182 |
{ |
| 183 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: adding retroplayer"); |
| 184 |
players.emplace_back("RetroPlayer"); |
| 185 |
} |
| 186 |
|
| 187 |
CLog::Log(LOGDEBUG, "CPlayerCoreFactory::GetPlayers: added {0} players", players.size()); |
| 188 |
} |
| 189 |
|
| 190 |
int CPlayerCoreFactory::GetPlayerIndex(const std::string& strCoreName) const |
| 191 |
{ |
| 192 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 193 |
if (!strCoreName.empty()) |
| 194 |
{ |
| 195 |
// Dereference "*default*player" aliases |
| 196 |
std::string strRealCoreName; |
| 197 |
if (StringUtils::EqualsNoCase(strCoreName, "audiodefaultplayer")) |
| 198 |
strRealCoreName = CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_audioDefaultPlayer; |
| 199 |
else if (StringUtils::EqualsNoCase(strCoreName, "videodefaultplayer")) |
| 200 |
strRealCoreName = CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoDefaultPlayer; |
| 201 |
else |
| 202 |
strRealCoreName = strCoreName; |
| 203 |
|
| 204 |
for(size_t i = 0; i < m_vecPlayerConfigs.size(); i++) |
| 205 |
{ |
| 206 |
if (StringUtils::EqualsNoCase(m_vecPlayerConfigs[i]->GetName(), strRealCoreName)) |
| 207 |
return i; |
| 208 |
} |
| 209 |
CLog::Log(LOGWARNING, "CPlayerCoreFactory::GetPlayer({}): no such player: {}", strCoreName, |
| 210 |
strRealCoreName); |
| 211 |
} |
| 212 |
return -1; |
| 213 |
} |
| 214 |
|
| 215 |
std::string CPlayerCoreFactory::GetPlayerName(size_t idx) const |
| 216 |
{ |
| 217 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 218 |
if (m_vecPlayerConfigs.empty() || idx > m_vecPlayerConfigs.size()) |
| 219 |
return ""; |
| 220 |
|
| 221 |
return m_vecPlayerConfigs[idx]->m_name; |
| 222 |
} |
| 223 |
|
| 224 |
void CPlayerCoreFactory::GetPlayers(std::vector<std::string>&players, std::string &type) const |
| 225 |
{ |
| 226 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 227 |
for (auto& config : m_vecPlayerConfigs) |
| 228 |
{ |
| 229 |
if (config->m_type != type) |
| 230 |
continue; |
| 231 |
players.emplace_back(config->m_name); |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
void CPlayerCoreFactory::GetRemotePlayers(std::vector<std::string>&players) const |
| 236 |
{ |
| 237 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 238 |
for (auto& config : m_vecPlayerConfigs) |
| 239 |
{ |
| 240 |
if (config->m_type != "remote") |
| 241 |
continue; |
| 242 |
players.emplace_back(config->m_name); |
| 243 |
} |
| 244 |
} |
| 245 |
|
| 246 |
std::string CPlayerCoreFactory::GetPlayerType(const std::string& player) const |
| 247 |
{ |
| 248 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 249 |
size_t idx = GetPlayerIndex(player); |
| 250 |
|
| 251 |
if (m_vecPlayerConfigs.empty() || idx > m_vecPlayerConfigs.size()) |
| 252 |
return ""; |
| 253 |
|
| 254 |
return m_vecPlayerConfigs[idx]->m_type; |
| 255 |
} |
| 256 |
|
| 257 |
bool CPlayerCoreFactory::IsExternalPlayer(const std::string& player) const |
| 258 |
{ |
| 259 |
return (GetPlayerType(player) == "external"); |
| 260 |
} |
| 261 |
|
| 262 |
bool CPlayerCoreFactory::IsRemotePlayer(const std::string& player) const |
| 263 |
{ |
| 264 |
return (GetPlayerType(player) == "remote"); |
| 265 |
} |
| 266 |
|
| 267 |
bool CPlayerCoreFactory::PlaysAudio(const std::string& player) const |
| 268 |
{ |
| 269 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 270 |
size_t idx = GetPlayerIndex(player); |
| 271 |
|
| 272 |
if (m_vecPlayerConfigs.empty() || idx > m_vecPlayerConfigs.size()) |
| 273 |
return false; |
| 274 |
|
| 275 |
return m_vecPlayerConfigs[idx]->m_bPlaysAudio; |
| 276 |
} |
| 277 |
|
| 278 |
bool CPlayerCoreFactory::PlaysVideo(const std::string& player) const |
| 279 |
{ |
| 280 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 281 |
size_t idx = GetPlayerIndex(player); |
| 282 |
|
| 283 |
if (m_vecPlayerConfigs.empty() || idx > m_vecPlayerConfigs.size()) |
| 284 |
return false; |
| 285 |
|
| 286 |
return m_vecPlayerConfigs[idx]->m_bPlaysVideo; |
| 287 |
} |
| 288 |
|
| 289 |
std::string CPlayerCoreFactory::GetDefaultPlayer(const CFileItem& item) const |
| 290 |
{ |
| 291 |
std::vector<std::string>players; |
| 292 |
GetPlayers(item, players); |
| 293 |
|
| 294 |
//If we have any players return the first one |
| 295 |
if (!players.empty()) |
| 296 |
return players.at(0); |
| 297 |
|
| 298 |
return ""; |
| 299 |
} |
| 300 |
|
| 301 |
std::string CPlayerCoreFactory::SelectPlayerDialog(const std::vector<std::string>&players, float posX, float posY) const |
| 302 |
{ |
| 303 |
CContextButtons choices; |
| 304 |
if (players.size()) |
| 305 |
{ |
| 306 |
//Add default player |
| 307 |
std::string strCaption = players[0]; |
| 308 |
strCaption += " ("; |
| 309 |
strCaption += g_localizeStrings.Get(13278); |
| 310 |
strCaption += ")"; |
| 311 |
choices.Add(0, strCaption); |
| 312 |
|
| 313 |
//Add all other players |
| 314 |
for (unsigned int i = 1; i < players.size(); i++) |
| 315 |
choices.Add(i, players[i]); |
| 316 |
|
| 317 |
int choice = CGUIDialogContextMenu::ShowAndGetChoice(choices); |
| 318 |
if (choice >= 0) |
| 319 |
return players[choice]; |
| 320 |
} |
| 321 |
return ""; |
| 322 |
} |
| 323 |
|
| 324 |
std::string CPlayerCoreFactory::SelectPlayerDialog(float posX, float posY) const |
| 325 |
{ |
| 326 |
std::vector<std::string>players; |
| 327 |
GetPlayers(players); |
| 328 |
return SelectPlayerDialog(players, posX, posY); |
| 329 |
} |
| 330 |
|
| 331 |
bool CPlayerCoreFactory::LoadConfiguration(const std::string &file, bool clear) |
| 332 |
{ |
| 333 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 334 |
|
| 335 |
CLog::Log(LOGINFO, "Loading player core factory settings from {}.", file); |
| 336 |
if (!CFileUtils::Exists(file)) |
| 337 |
{ // tell the user it doesn't exist |
| 338 |
CLog::Log(LOGINFO, "{} does not exist. Skipping.", file); |
| 339 |
return false; |
| 340 |
} |
| 341 |
|
| 342 |
CXBMCTinyXML playerCoreFactoryXML; |
| 343 |
if (!playerCoreFactoryXML.LoadFile(file)) |
| 344 |
{ |
| 345 |
CLog::Log(LOGERROR, "Error loading {}, Line {} ({})", file, playerCoreFactoryXML.ErrorRow(), |
| 346 |
playerCoreFactoryXML.ErrorDesc()); |
| 347 |
return false; |
| 348 |
} |
| 349 |
|
| 350 |
TiXmlElement *pConfig = playerCoreFactoryXML.RootElement(); |
| 351 |
if (pConfig == NULL) |
| 352 |
{ |
| 353 |
CLog::Log(LOGERROR, "Error loading {}, Bad structure", file); |
| 354 |
return false; |
| 355 |
} |
| 356 |
|
| 357 |
if (clear) |
| 358 |
{ |
| 359 |
m_vecPlayerConfigs.clear(); |
| 360 |
m_vecCoreSelectionRules.clear(); |
| 361 |
|
| 362 |
// Builtin players |
| 363 |
auto VideoPlayer = std::make_unique<CPlayerCoreConfig>("VideoPlayer", "video", nullptr); |
| 364 |
VideoPlayer->m_bPlaysAudio = true; |
| 365 |
VideoPlayer->m_bPlaysVideo = true; |
| 366 |
m_vecPlayerConfigs.emplace_back(std::move(VideoPlayer)); |
| 367 |
|
| 368 |
auto paplayer = std::make_unique<CPlayerCoreConfig>("PAPlayer", "music", nullptr); |
| 369 |
paplayer->m_bPlaysAudio = true; |
| 370 |
m_vecPlayerConfigs.emplace_back(std::move(paplayer)); |
| 371 |
|
| 372 |
auto retroPlayer = std::make_unique<CPlayerCoreConfig>("RetroPlayer", "game", nullptr); |
| 373 |
m_vecPlayerConfigs.emplace_back(std::move(retroPlayer)); |
| 374 |
} |
| 375 |
|
| 376 |
if (StringUtils::CompareNoCase(pConfig->Value(), "playercorefactory") != 0) |
| 377 |
{ |
| 378 |
CLog::Log(LOGERROR, "Error loading configuration, no <playercorefactory> node"); |
| 379 |
return false; |
| 380 |
} |
| 381 |
|
| 382 |
TiXmlElement *pPlayers = pConfig->FirstChildElement("players"); |
| 383 |
if (pPlayers) |
| 384 |
{ |
| 385 |
TiXmlElement* pPlayer = pPlayers->FirstChildElement("player"); |
| 386 |
while (pPlayer) |
| 387 |
{ |
| 388 |
std::string name = XMLUtils::GetAttribute(pPlayer, "name"); |
| 389 |
std::string type = XMLUtils::GetAttribute(pPlayer, "type"); |
| 390 |
if (type.empty()) type = name; |
| 391 |
StringUtils::ToLower(type); |
| 392 |
|
| 393 |
std::string internaltype; |
| 394 |
if (type == "videoplayer") |
| 395 |
internaltype = "video"; |
| 396 |
else if (type == "paplayer") |
| 397 |
internaltype = "music"; |
| 398 |
else if (type == "externalplayer") |
| 399 |
internaltype = "external"; |
| 400 |
|
| 401 |
int count = 0; |
| 402 |
std::string playername = name; |
| 403 |
while (GetPlayerIndex(playername) >= 0) |
| 404 |
{ |
| 405 |
count++; |
| 406 |
std::stringstream itoa; |
| 407 |
itoa << count; |
| 408 |
playername = name + itoa.str(); |
| 409 |
} |
| 410 |
|
| 411 |
if (!internaltype.empty()) |
| 412 |
{ |
| 413 |
m_vecPlayerConfigs.emplace_back( |
| 414 |
std::make_unique<CPlayerCoreConfig>(playername, internaltype, pPlayer)); |
| 415 |
} |
| 416 |
|
| 417 |
pPlayer = pPlayer->NextSiblingElement("player"); |
| 418 |
} |
| 419 |
} |
| 420 |
|
| 421 |
TiXmlElement *pRule = pConfig->FirstChildElement("rules"); |
| 422 |
while (pRule) |
| 423 |
{ |
| 424 |
const char* szAction = pRule->Attribute("action"); |
| 425 |
if (szAction) |
| 426 |
{ |
| 427 |
if (StringUtils::CompareNoCase(szAction, "append") == 0) |
| 428 |
{ |
| 429 |
m_vecCoreSelectionRules.emplace_back(std::make_unique<CPlayerSelectionRule>(pRule)); |
| 430 |
} |
| 431 |
else if (StringUtils::CompareNoCase(szAction, "prepend") == 0) |
| 432 |
{ |
| 433 |
m_vecCoreSelectionRules.emplace_front(std::make_unique<CPlayerSelectionRule>(pRule)); |
| 434 |
} |
| 435 |
else |
| 436 |
{ |
| 437 |
m_vecCoreSelectionRules.clear(); |
| 438 |
m_vecCoreSelectionRules.emplace_back(std::make_unique<CPlayerSelectionRule>(pRule)); |
| 439 |
} |
| 440 |
} |
| 441 |
else |
| 442 |
{ |
| 443 |
m_vecCoreSelectionRules.emplace_back(std::make_unique<CPlayerSelectionRule>(pRule)); |
| 444 |
} |
| 445 |
|
| 446 |
pRule = pRule->NextSiblingElement("rules"); |
| 447 |
} |
| 448 |
|
| 449 |
// succeeded - tell the user it worked |
| 450 |
CLog::Log(LOGINFO, "Loaded playercorefactory configuration"); |
| 451 |
|
| 452 |
return true; |
| 453 |
} |
| 454 |
|
| 455 |
void CPlayerCoreFactory::OnPlayerDiscovered(const std::string& id, const std::string& name) |
| 456 |
{ |
| 457 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 458 |
for (auto& playerConfig : m_vecPlayerConfigs) |
| 459 |
{ |
| 460 |
if (playerConfig->GetId() == id) |
| 461 |
{ |
| 462 |
playerConfig->m_name = name; |
| 463 |
playerConfig->m_type = "remote"; |
| 464 |
return; |
| 465 |
} |
| 466 |
} |
| 467 |
|
| 468 |
int count = 0; |
| 469 |
std::string playername = name; |
| 470 |
while (GetPlayerIndex(playername) >= 0) |
| 471 |
{ |
| 472 |
count++; |
| 473 |
std::stringstream itoa; |
| 474 |
itoa << count; |
| 475 |
playername = name + itoa.str(); |
| 476 |
} |
| 477 |
|
| 478 |
auto player = std::make_unique<CPlayerCoreConfig>(playername, "remote", nullptr, id); |
| 479 |
player->m_bPlaysAudio = true; |
| 480 |
player->m_bPlaysVideo = true; |
| 481 |
m_vecPlayerConfigs.emplace_back(std::move(player)); |
| 482 |
} |
| 483 |
|
| 484 |
void CPlayerCoreFactory::OnPlayerRemoved(const std::string& id) |
| 485 |
{ |
| 486 |
std::unique_lock<CCriticalSection> lock(m_section); |
| 487 |
for (auto& playerConfig : m_vecPlayerConfigs) |
| 488 |
{ |
| 489 |
if (playerConfig->GetId() == id) |
| 490 |
playerConfig->m_type = ""; |
| 491 |
} |
| 492 |
} |