This commit is contained in:
SuperNovaa41 2022-03-06 11:03:11 -05:00
parent ea7297fa37
commit 508af3d9d1
2 changed files with 0 additions and 68 deletions

View File

@ -1,6 +1,5 @@
#include "gbp.cpp" #include "gbp.cpp"
#include <string> #include <string>
#include <unordered_map>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <time.h> #include <time.h>
@ -232,27 +231,3 @@ void initCommands()
vecArgs.emplace("findname", &findName); vecArgs.emplace("findname", &findName);
vecArgs.emplace("copypasta", &copypasta); vecArgs.emplace("copypasta", &copypasta);
} }
////finish this, make it return a string
//use THIS to ping the users, and call it from a separate thread
void pingUsers()
{
std::ifstream file;
file.open("toPing.txt");
if (!file) {
file.close();
return;
}
std::string line;
std::string username;
int gbpPos;
std::string toPing;
while(getline(file, line)) {
username = line.substr(0, line.find(" "));
gbpPos = std::stoi(line.substr(line.find(" ") + 1, line.length() - (line.find(" ") + 1)));
toPing = line.substr(line.rfind(" "), line.length() - line.rfind(" "));
}
}

View File

@ -1,43 +0,0 @@
#include <thread>
#include <fstream>
#include <iostream>
#include <vector>
#include "gbp.cpp"
void startScanning()
{
while (1) {
// read from the cached file contianing names to watch, if the gbp their position is > or < what is marked down, Ping the original recpiient that their locatoin has changed and then sleep for an hour,
}
}
void pingUsers()
{
std::ifstream file;
file.open("toPing.txt");
if (!file) {
file.close();
return;
}
std::string line;
std::string username;
int gbpPos;
std::string toPing;
while(getline(file, line)) {
username = line.substr(0, line.find(" "));
gbpPos = std::stoi(line.substr(line.find(" ") + 1, line.length() - (line.find(" ") + 1)));
toPing = line.substr(line.rfind(" "), line.length() - line.rfind(" "));
std::map<unsigned short int, std::pair<int, std::string>> gbp = fetchAndReadGBP();
if (gbp[gbpPos].second == username) {
std::cout << "chungus" << std::endl;
} else {
// message
}
}
}