From cc057eef296483e8ae3e771b6f17ad229ca6ba59 Mon Sep 17 00:00:00 2001 From: badaix Date: Sun, 3 Jul 2016 21:34:44 +0200 Subject: [PATCH] Host: added update function --- server/config.h | 9 ++++++++- server/streamServer.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/config.h b/server/config.h index 9723fa25..0929b03d 100644 --- a/server/config.h +++ b/server/config.h @@ -71,10 +71,17 @@ struct Volume struct Host { - Host(const std::string& _macAddress = "") : name(getHostName()), mac(_macAddress), os(getOS()), arch(getArch()), ip("") + Host(const std::string& _macAddress = "") : name(""), mac(_macAddress), os(""), arch(""), ip("") { } + void update() + { + name = getHostName(); + os = getOS(); + arch = getArch(); + } + void fromJson(const json& j) { name = trim_copy(jGet(j, "name", "")); diff --git a/server/streamServer.cpp b/server/streamServer.cpp index 9022b05b..dcdb5c7d 100644 --- a/server/streamServer.cpp +++ b/server/streamServer.cpp @@ -147,6 +147,7 @@ void StreamServer::onMessageReceived(ControlSession* controlSession, const std:: jClient = Config::instance().getClientInfos(); Host host; + host.update(); //TODO: Set MAC and IP Snapserver snapserver("Snapserver", VERSION); response = {