diff --git a/server/config.cpp b/server/config.cpp index f89d2ba0..0aebba25 100644 --- a/server/config.cpp +++ b/server/config.cpp @@ -42,12 +42,11 @@ Config::Config() { ClientInfoPtr client = make_shared(); client->fromJson(*it); + client->connected = false; clients.push_back(client); std::cout << "Client:\n" << std::setw(4) << client->toJson() << '\n'; } } - -// fs::create_directory(filename_.parent_path()); } @@ -62,22 +61,6 @@ void Config::save() } -void Config::test() -{ - ifstream ifs("snapserver.json", std::ifstream::in); - json j; - ifs >> j; - std::cout << std::setw(4) << j << std::endl; - json j1 = j["Client"]; - for (json::iterator it = j1.begin(); it != j1.end(); ++it) - { - ClientInfo client; - client.fromJson(*it); - std::cout << "Client:\n" << std::setw(4) << client.toJson() << '\n'; - } -} - - ClientInfoPtr Config::getClientInfo(const std::string& macAddress, bool add) { if (macAddress.empty()) diff --git a/server/config.h b/server/config.h index 59b96268..df051111 100644 --- a/server/config.h +++ b/server/config.h @@ -128,7 +128,6 @@ public: return instance_; } - void test(); ClientInfoPtr getClientInfo(const std::string& mac, bool add = true); std::vector clients; @@ -139,7 +138,6 @@ public: private: Config(); std::string filename_; - };