From: Naffanya Date: Fri, 4 Apr 2014 22:01:40 +0000 (+0300) Subject: Move abbility get value 'tarrif' from parameter's name 'tarrifName' to GetParamValue X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/4e02ad6c394e407ed532da55a141605681f312c4?ds=inline;hp=-c Move abbility get value 'tarrif' from parameter's name 'tarrifName' to GetParamValue --- 4e02ad6c394e407ed532da55a141605681f312c4 diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index 7a0605a2..e781a8cb 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -429,11 +429,7 @@ for(it = rsSettings.GetUserParams().begin(); it != rsSettings.GetUserParams().end(); ++it) { - std::string parameter; - if (*it == "tariffName") - parameter = rsu.user->GetParamValue("tariff"); - else - parameter = rsu.user->GetParamValue(*it); + std::string parameter(rsu.user->GetParamValue(it->c_str())); if (params.length() + parameter.length() > RS_PARAMS_LEN - 1) { logger("Script params string length %d exceeds the limit of %d symbols.", params.length() + parameter.length(), RS_PARAMS_LEN); diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index f15b182a..30a3c171 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1521,6 +1521,7 @@ std::string USER_IMPL::GetParamValue(const std::string & name) const if (lowerName == "login") return login; if (lowerName == "currip") return currIP.ToString(); if (lowerName == "enableddirs") return GetEnabledDirs(); + if (lowerName == "tariffname") return property.GetPropertyValue("tarrif"); if (property.Exists(lowerName)) return property.GetPropertyValue(lowerName); else diff --git a/projects/stargazer/user_property.cpp b/projects/stargazer/user_property.cpp index 821b3ba3..feef2e59 100644 --- a/projects/stargazer/user_property.cpp +++ b/projects/stargazer/user_property.cpp @@ -18,7 +18,7 @@ USER_PROPERTIES::USER_PROPERTIES(const std::string & sd) disabledDetailStat(conf.disabledDetailStat, "DisabledDetailStat", false, false, GetStgLogger(), sd, properties), alwaysOnline(conf.alwaysOnline, "alwaysOnline", false, false, GetStgLogger(), sd, properties), tariffName (conf.tariffName, "tariff", false, false, GetStgLogger(), sd, properties), - nextTariff (conf.nextTariff, "next tariff", false, false, GetStgLogger(), sd, properties), + nextTariff (conf.nextTariff, "nextTariff", false, false, GetStgLogger(), sd, properties), address (conf.address, "address", false, false, GetStgLogger(), sd, properties), note (conf.note, "note", false, false, GetStgLogger(), sd, properties), group (conf.group, "group", false, false, GetStgLogger(), sd, properties),