X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/feed7e6b905650306ae3166ecf91c144ecffa6e7..69172e0e3684d849825b90b01e53026852e01a97:/projects/sgconf/services.cpp diff --git a/projects/sgconf/services.cpp b/projects/sgconf/services.cpp index b6ce1a33..e2bf9bf6 100644 --- a/projects/sgconf/services.cpp +++ b/projects/sgconf/services.cpp @@ -28,7 +28,7 @@ void PrintService(const STG::GET_SERVICE::INFO & info, size_t level = 0) { std::cout << Indent(level, true) << "name: " << info.name << "\n" << Indent(level) << "cost: " << info.cost << "\n" - << Indent(level) << "payment day: " << info.payDay << "\n" + << Indent(level) << "payment day: " << static_cast(info.payDay) << "\n" << Indent(level) << "comment: " << info.comment << "\n"; } @@ -87,6 +87,8 @@ bool GetServicesFunction(const SGCONF::CONFIG & config, { STG::SERVCONF proto(config.server.data(), config.port.data(), + config.localAddress.data(), + config.localPort.data(), config.userName.data(), config.userPass.data()); return proto.GetServices(GetServicesCallback, NULL) == STG::st_ok; @@ -98,6 +100,8 @@ bool GetServiceFunction(const SGCONF::CONFIG & config, { STG::SERVCONF proto(config.server.data(), config.port.data(), + config.localAddress.data(), + config.localPort.data(), config.userName.data(), config.userPass.data()); return proto.GetService(arg, GetServiceCallback, NULL) == STG::st_ok; @@ -109,6 +113,8 @@ bool DelServiceFunction(const SGCONF::CONFIG & config, { STG::SERVCONF proto(config.server.data(), config.port.data(), + config.localAddress.data(), + config.localPort.data(), config.userName.data(), config.userPass.data()); return proto.DelService(arg, SimpleCallback, NULL) == STG::st_ok; @@ -125,6 +131,8 @@ SGCONF::MaybeSet(options, "pay-day", conf.payDay); SGCONF::MaybeSet(options, "comment", conf.comment); STG::SERVCONF proto(config.server.data(), config.port.data(), + config.localAddress.data(), + config.localPort.data(), config.userName.data(), config.userPass.data()); return proto.AddService(arg, conf, SimpleCallback, NULL) == STG::st_ok; @@ -141,6 +149,8 @@ SGCONF::MaybeSet(options, "pay-day", conf.payDay); SGCONF::MaybeSet(options, "comment", conf.comment); STG::SERVCONF proto(config.server.data(), config.port.data(), + config.localAddress.data(), + config.localPort.data(), config.userName.data(), config.userPass.data()); return proto.ChgService(conf, SimpleCallback, NULL) == STG::st_ok; @@ -155,6 +165,6 @@ blocks.Add("Service management options") .Add("get-services", SGCONF::MakeAPIAction(commands, GetServicesFunction), "\tget service list") .Add("get-service", SGCONF::MakeAPIAction(commands, "", GetServiceFunction), "get service") .Add("add-service", SGCONF::MakeAPIAction(commands, "", params, AddServiceFunction), "add service") - .Add("del-service", SGCONF::MakeAPIAction(commands, "", DelServiceFunction), "del service") + .Add("del-service", SGCONF::MakeAPIAction(commands, "", DelServiceFunction), "delete service") .Add("chg-service", SGCONF::MakeAPIAction(commands, "", params, ChgServiceFunction), "change service"); }