X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3334627402c6bf40e156f9dc7592e941d81b574c..8c7a6befad791ac242f15233365893b18953a627:/projects/sgconf/info.cpp?ds=sidebyside diff --git a/projects/sgconf/info.cpp b/projects/sgconf/info.cpp index 0e98d3dc..cf6d44a4 100644 --- a/projects/sgconf/info.cpp +++ b/projects/sgconf/info.cpp @@ -2,6 +2,7 @@ #include "api_action.h" #include "options.h" +#include "makeproto.h" #include "config.h" #include "stg/servconf.h" @@ -15,7 +16,7 @@ namespace { -void PrintInfo(const STG::SERVER_INFO::INFO& info) +void PrintInfo(const STG::ServerInfo::Info& info) { std::cout << "Server version: '" << info.version << "'\n" << "Number of tariffs: " << info.tariffNum << "\n" @@ -28,7 +29,7 @@ void PrintInfo(const STG::SERVER_INFO::INFO& info) std::cout << "\t - '" << info.dirName[i] << "'\n"; } -void InfoCallback(bool result, const std::string & reason, const STG::SERVER_INFO::INFO & info, void * /*data*/) +void InfoCallback(bool result, const std::string & reason, const STG::ServerInfo::Info & info, void * /*data*/) { if (!result) { @@ -42,13 +43,7 @@ bool InfoFunction(const SGCONF::CONFIG & config, const std::string& /*arg*/, const std::map & /*options*/) { -STG::SERVCONF proto(config.server.data(), - config.port.data(), - config.localAddress.data(), - config.localPort.data(), - config.userName.data(), - config.userPass.data()); -return proto.ServerInfo(InfoCallback, NULL) == STG::st_ok; +return makeProto(config).ServerInfo(InfoCallback, NULL) == STG::st_ok; } }