-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeagueChecker.cpp
More file actions
41 lines (36 loc) · 1.03 KB
/
Copy pathLeagueChecker.cpp
File metadata and controls
41 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Created by lketc on 9/14/2018.
//
#include <iostream>
#include <process.h>
#include "LeagueChecker.h"
#include "stdlib.h"
#include <fstream>
#include <cstring>
using namespace std;
bool LeagueChecker::isLeagueOnline() const {
return leagueOnline;
}
void LeagueChecker::setLeagueOnline(bool leagueOnline) {
LeagueChecker::leagueOnline = leagueOnline;
}
void LeagueChecker::checkSystemProcesses() {
// std::cout << system("tasklist /fi \"memusage gt 40000\"") << std::endl;
std::string hey;
hey = system("tasklist /fi \"memusage gt 40000\" > C:\\Users\\lketc\\CLionProjects\\LeagueLauncher\\process.txt");
std::cout << hey << std::endl;
}
void LeagueChecker::readProcesses() {
string line;
string lol = "LeagueLauncher.exe";
ifstream in ("process.txt");
while ( getline (in,line) )
{
if(strncmp(line.c_str(), lol.c_str(), lol.size()) == 0){
cout << line+"\n" << '\n';
setLeagueOnline(true);
cout << isLeagueOnline() << endl;
}
}
in.close();
}