From 04cc14085117673e72373e47609c885883667811 Mon Sep 17 00:00:00 2001 From: Anonymous275 <36374260+Anonymous-275@users.noreply.github.com> Date: Tue, 28 Jan 2020 17:09:16 +0200 Subject: [PATCH] Main Fix you overwrote my main in the master branch so i added your logger code in the main i had on my local machine --- src/main.cpp | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7078b8d..bc137b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,12 +2,49 @@ // Created by Антон on 28.01.2020. // +// +// Created by Anonymous275 on 28.01.2020. +// + #include "main.h" +#include +#include +#include "enet/enet.h" #include "network.h" #include "logger.h" +using namespace std; //nameSpace STD + +void DebugData(); +void ParseConfig(); + +bool Debug = false; +int Port = 30813; +string MapName = "levels/gridmap/level.json"; +string ServerName = "BeamNG-MP FTW"; + +//Entry int main() { - // ALL > DEBUG > INFO > WARN > ERROR > OFF - setLoggerLevel("ALL"); - startRUDP("localhost", 30814); + ParseConfig(); + if(Debug){ //checks if debug is on + DebugData(); //Prints Debug Data + } + setLoggerLevel("ALL"); + startRUDP("localhost", 30814); } + + +void DebugData(){ + cout << "Debug : true" << "\n"; + cout << "Port : " << Port << "\n"; + cout << "MapName : " << MapName << "\n"; + cout << "ServerName : " << ServerName << "\n"; +} + +void SetMainValues(bool D, int P,string Name,string serverName){ + Debug = D; + Port = P; + MapName = Name; + ServerName = serverName; +} +