From 996d96639c221fa398cf5494f189d7c1a5479ff0 Mon Sep 17 00:00:00 2001 From: Anonymous275 Date: Mon, 3 Feb 2020 22:07:22 +0200 Subject: [PATCH] Small Bug fix --- src/Network/Server.cpp | 6 +++--- src/main.cpp | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Network/Server.cpp b/src/Network/Server.cpp index c3b8f5c..f5cc87c 100644 --- a/src/Network/Server.cpp +++ b/src/Network/Server.cpp @@ -52,14 +52,14 @@ void ServerMain(int Port, int MaxClients) { /* create a server */ - info("starting server with a maximum of " + to_string(MaxClients) + " Clients...\n"); + info("starting server with a maximum of " + to_string(MaxClients) + " Clients..."); server = enet_host_create(&address, MaxClients, 2, 0, 0); if (server == NULL) { - error("An error occurred while trying to create a server host.\n"); + error("An error occurred while trying to create a server host."); return; } - info("Waiting for clients on port "+to_string(Port)+"...\n"); + info("Waiting for clients on port "+to_string(Port)+"..."); while (true) { host_server(server); diff --git a/src/main.cpp b/src/main.cpp index a586487..cfe2ace 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,8 @@ #include #include #include "logger.h" +#include +#include using namespace std; //nameSpace STD void DebugData(); @@ -22,8 +24,8 @@ string ServerName = "BeamNG-MP FTW"; //Entry int main() { - ParseConfig(); LogInit(); + ParseConfig(); if(Debug){ //checks if debug is on DebugData(); //Prints Debug Data } @@ -49,12 +51,9 @@ void SetMainValues(bool D, int P,int MP,string Name,string serverName){ } void LogInit(){ - ifstream InFileStream; - InFileStream.open("Server.log"); - if(InFileStream.good()){ - remove("Server.log"); - } - InFileStream.close(); + ofstream LFS; + LFS.open ("Server.log"); + LFS.close(); } void addToLog(basic_string Data){