-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
57 lines (50 loc) · 1.28 KB
/
Main.cpp
File metadata and controls
57 lines (50 loc) · 1.28 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include "ServerListener.hpp"
#include <sstream>
#include <fstream>
#include <filesystem>
#include <iostream>
std::string ReadMasterServersTest(const std::string& path)
{
std::ifstream file(path, std::ios::binary);
if (!file)
{
std::cerr << "Cannot open file: " << path << std::endl;
return {};
}
std::ostringstream ss;
ss << file.rdbuf();
return ss.str();
}
#ifdef _WIN32
#include <direct.h>
#define GetCurrentDir _getcwd
#else
#include <unistd.h>
#define GetCurrentDir getcwd
#endif
using namespace std;
int main(int argc, char** argv) {
SetConsoleOutputCP(CP_UTF8);
system("title EmuWF 4.10");
char buff[FILENAME_MAX]; // FILENAME_MAX is a large enough buffer size
if (!GetCurrentDir(buff, FILENAME_MAX)) {
perror("Error getting current directory");
return 1;
}
std::string currentPath(buff);
std::cout << "Current path is: " << currentPath << std::endl;
std::string masterservers = ReadMasterServersTest("../x64/Release/Configurations/MasterServers.xml");
printf("%s\n", masterservers.c_str());
argc = argc;
argv = argv;
//MySqlInitialization();
Custom::Socket::Listener();
return 1;
}
interface IF{
bool _bool(int a, int b) {
if (a != b) return false;
if (a == b) return true;
}
};