mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Using logger for config
This commit is contained in:
parent
ea3d6204d3
commit
dbaf7d5de0
5
.gitignore
vendored
5
.gitignore
vendored
@ -440,3 +440,8 @@ out/build/x86-Debug/.cmake/api/v1/reply/index-2020-01-28T12-30-44-0946.json
|
|||||||
out/build/x86-Debug/.cmake/api/v1/reply/codemodel-v2-3eaabe43603befc605b1.json
|
out/build/x86-Debug/.cmake/api/v1/reply/codemodel-v2-3eaabe43603befc605b1.json
|
||||||
out/build/x86-Debug/.cmake/api/v1/reply/target-cmake-main-Debug-70eff68e1e381b42992e.json
|
out/build/x86-Debug/.cmake/api/v1/reply/target-cmake-main-Debug-70eff68e1e381b42992e.json
|
||||||
*.xml
|
*.xml
|
||||||
|
out/build/x86-Debug/.cmake/api/v1/reply/target-enet-Debug-48db38ae5d08e27876b8.json
|
||||||
|
out/build/x86-Debug/.cmake/api/v1/reply/target-cmake-main-Debug-540e487569703b71c785.json
|
||||||
|
out/build/x86-Debug/.cmake/api/v1/reply/index-2020-01-28T17-35-38-0764.json
|
||||||
|
out/build/x86-Debug/.cmake/api/v1/reply/codemodel-v2-6a61e390ef8eaf17e9f8.json
|
||||||
|
out/build/x86-Debug/Server.cfg
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "logger.h"
|
||||||
using namespace std; //nameSpace STD
|
using namespace std; //nameSpace STD
|
||||||
void GenerateConfig();
|
void GenerateConfig();
|
||||||
string RemoveComments(string Line);
|
string RemoveComments(string Line);
|
||||||
@ -23,7 +24,7 @@ void ParseConfig(){
|
|||||||
ifstream InFileStream;
|
ifstream InFileStream;
|
||||||
InFileStream.open("Server.cfg");
|
InFileStream.open("Server.cfg");
|
||||||
if(InFileStream.good()){ //Checks if Config Exists
|
if(InFileStream.good()){ //Checks if Config Exists
|
||||||
cout << "Config Found Updating Values \n\n";
|
info("Config Found Updating Values");
|
||||||
string line;
|
string line;
|
||||||
int index = 1;
|
int index = 1;
|
||||||
while (getline(InFileStream, line)) {
|
while (getline(InFileStream, line)) {
|
||||||
@ -35,7 +36,7 @@ void ParseConfig(){
|
|||||||
}
|
}
|
||||||
SetMainValues(D,P,M,S); //gives the values to Main
|
SetMainValues(D,P,M,S); //gives the values to Main
|
||||||
}else{
|
}else{
|
||||||
cout << "Config Not Found Generating A new One \n";
|
info("Config Not Found Generating A new One");
|
||||||
GenerateConfig();
|
GenerateConfig();
|
||||||
}
|
}
|
||||||
InFileStream.close();
|
InFileStream.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user