本文整理汇总了C++中LogReader::GetState方法的典型用法代码示例。如果您正苦于以下问题:C++ LogReader::GetState方法的具体用法?C++ LogReader::GetState怎么用?C++ LogReader::GetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogReader
的用法示例。
在下文中一共展示了LogReader::GetState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MonitorThread
//.........这里部分代码省略.........
Log("INFO | LolSceneSwitch::MonitorThread | LoL client process exited!");
CloseHandle(clientProcess);
clientProcess = nullptr;
clientWindow = nullptr;
clientStateAddress = 0;
}
}
// we have a game handle
if (gameProcess != nullptr)
{
// check if it's still running
if (GetExitCodeProcess(gameProcess, &exitCode) && exitCode == STILL_ACTIVE)
{
if (gameWindow == nullptr)
{
gameWindow = GetWindowById(gamePid);
}
if (reader == nullptr)
{
HANDLE file = GetLogFile(instance->settings.lolPath, &gameStartTime);
if (file != nullptr)
{
reader = &LogReader(file);
}
}
if (mapAddress == 0)
{
mapAddress = PointerPath32::GetThreadAddress(gameProcess, gamePid, 0);
}
if (instance->currentMap == Map::UNKNOWN)
{
std::string mapString1 = map1Pointer.Deref(gameProcess, mapAddress, 5);
std::string mapString2 = map2Pointer.Deref(gameProcess, mapAddress, 5);
if (mapString1.compare("Map1") == 0 || mapString2.compare("Map1") == 0 ||
mapString1.compare("Map11") == 0 || mapString2.compare("Map11") == 0)
{
Log("INFO | LolSceneSwitch::MonitorThread | Map is Summoners Rift!");
instance->currentMap = Map::SUMMONERS_RIFT;
newMapInfo = true;
}
else if (mapString1.compare("Map8") == 0 || mapString2.compare("Map8") == 0)
{
Log("INFO | LolSceneSwitch::MonitorThread | Map is Crystal Scar!");
instance->currentMap = Map::CRYSTAL_SCAR;
newMapInfo = true;
}
else if (mapString1.compare("Map10") == 0 || mapString2.compare("Map10") == 0)
{
Log("INFO | LolSceneSwitch::MonitorThread | Map is Twisted Treeline!");
instance->currentMap = Map::TWISTED_TREELINE;
newMapInfo = true;
}
else if (mapString1.compare("Map12") == 0 || mapString2.compare("Map12") == 0)
{
Log("INFO | LolSceneSwitch::MonitorThread | Map is Howling Abyss!");
instance->currentMap = Map::HOWLING_ABYSS;
newMapInfo = true;
}
}
if (reader != nullptr && (instance->settings.scenes[State::GAMEOUT].single.IsEmpty() ||
(gameWindow != nullptr && HasFocus(gameWindow))))
{
state = reader->GetState();
}
else
{
state = State::GAMEOUT;
}
}
else
{
Log("INFO | LolSceneSwitch::MonitorThread | LoL game process exited!");
ingame = false;
postGame = true;
CloseHandle(gameProcess);
gameProcess = nullptr;
gameWindow = nullptr;
reader = nullptr;
instance->currentMap = Map::UNKNOWN;
mapAddress = 0;
}
}
if (state != oldState || newMapInfo)
{
// Something has changed!!!
Log("INFO | LolSceneSwitch::MonitorThread | New state:", static_cast<long long>(state));
oldState = state;
newMapInfo = false;
instance->ChangeScene(state);
}
Sleep(INTERVALL);
}
return 0;
}