From 0f4c08c068d8e56597778008b8ad842a8ae19bfc Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 23 Dec 2020 23:30:33 +0100 Subject: [PATCH] reformat all --- include/Client.hpp | 23 ++++++++++++----------- include/Json.h | 2 +- include/Network.h | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/Client.hpp b/include/Client.hpp index a01d5ea..48f3ffd 100644 --- a/include/Client.hpp +++ b/include/Client.hpp @@ -14,13 +14,13 @@ #define SOCKET int #endif #include "CustomAssert.h" -#include -#include +#include #include #include -#include +#include +#include -struct VData{ +struct VData { int ID = -1; std::string Data; }; @@ -29,15 +29,16 @@ class Client { private: std::set> VehicleData; //ID and Data; std::string Name = "Unknown Client"; - SOCKET SOCK[2]{SOCKET(-1)}; + SOCKET SOCK[2] { SOCKET(-1) }; sockaddr_in UDPADDR; std::string Role; std::string DID; int Status = 0; int ID = -1; + public: - void AddNewCar(int ident,const std::string& Data); - void SetCarData(int ident,const std::string&Data); + void AddNewCar(int ident, const std::string& Data); + void SetCarData(int ident, const std::string& Data); std::set>& GetAllCars(); void SetName(const std::string& name); void SetRoles(const std::string& role); @@ -62,9 +63,9 @@ public: int GetStatus(); int GetID(); }; -struct ClientInterface{ +struct ClientInterface { std::set> Clients; - void RemoveClient(Client*& c){ + void RemoveClient(Client*& c) { Assert(c); c->ClearCars(); auto Iter = std::find_if(Clients.begin(), Clients.end(), [&](auto& ptr) { @@ -77,11 +78,11 @@ struct ClientInterface{ Clients.erase(Iter); c = nullptr; } - void AddClient(Client*&& c){ + void AddClient(Client*&& c) { Assert(c); Clients.insert(std::move(std::unique_ptr(c))); } - int Size(){ + int Size() { return int(Clients.size()); } }; diff --git a/include/Json.h b/include/Json.h index e04d7a7..839bba1 100644 --- a/include/Json.h +++ b/include/Json.h @@ -6,7 +6,7 @@ /// Created by Anonymous275 on 11/27/2020 /// #pragma once -#include "rapidjson/stringbuffer.h" #include "rapidjson/document.h" +#include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" namespace json = rapidjson; \ No newline at end of file diff --git a/include/Network.h b/include/Network.h index 5a0c905..15d6f4b 100644 --- a/include/Network.h +++ b/include/Network.h @@ -20,6 +20,6 @@ void UDPSend(Client* c, std::string Data); void SendLarge(Client* c, std::string Data); bool TCPSend(Client* c, const std::string& Data); void GParser(Client* c, const std::string& Packet); -std::string StaticReason(bool Set,const std::string& R); +std::string StaticReason(bool Set, const std::string& R); void Respond(Client* c, const std::string& MSG, bool Rel); void SendToAll(Client* c, const std::string& Data, bool Self, bool Rel);