Host: added update function

This commit is contained in:
badaix 2016-07-03 21:34:44 +02:00
parent 5cc3c157a7
commit cc057eef29
2 changed files with 9 additions and 1 deletions

View file

@ -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<std::string>(j, "name", ""));

View file

@ -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 = {