X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..7d8f69bd16c0e415d771a29c367519f26184ffae:/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp?ds=inline diff --git a/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp b/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp index cb156eed..e23df01d 100644 --- a/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp +++ b/projects/stargazer/plugins/configuration/xrconfig/xrconfig.cpp @@ -2,35 +2,23 @@ #include #include +#include "stg/plugin_creator.h" #include "xrconfig.h" #include "../../../tariff2.h" #include "../../../admins.h" #include "../../../users.h" -class XR_CONFIG_CREATOR -{ -private: - XR_CONFIG * xrconfig; - -public: - XR_CONFIG_CREATOR() - : xrconfig(new XR_CONFIG()) - { - }; - ~XR_CONFIG_CREATOR() - { - delete xrconfig; - }; - - XR_CONFIG * GetPlugin() - { - return xrconfig; - }; -}; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -XRCONFIG_CREATOR xrc; +PLUGIN_CREATOR xrc; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BASE_PLUGIN * GetPlugin() +{ +return xrc.GetPlugin(); +} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -44,41 +32,8 @@ const string & XR_CONFIG_SETTINGS::GetStrError() const return errorStr; } //----------------------------------------------------------------------------- -int XR_CONFIG_SETTINGS::ParseIntInRange(const string & str, int min, int max, int * val) -{ -if (strtoi2(str.c_str(), *val)) - { - errorStr = "Incorrect value \'" + str + "\'."; - return -1; - } -if (*val < min || *val > max) - { - errorStr = "Value \'" + str + "\' out of range."; - return -1; - } -return 0; -} -//----------------------------------------------------------------------------- int XR_CONFIG_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) { -/*int p; -PARAM_VALUE pv; -vector::const_iterator pvi; - -pv.param = "Port"; -pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) - { - errorStr = "Parameter \'Port\' not found."; - return -1; - } - -if (ParseIntInRange(pvi->value[0], 2, 65535, &p)) - { - errorStr = "Cannot parse parameter \'Port\': " + errorStr; - return -1; - } -port = p;*/ return 0; } @@ -90,13 +45,6 @@ return port; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BASE_PLUGIN * GetPlugin() -{ -return xrc.GetPlugin(); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- const string XR_CONFIG::GetVersion() const { return "XR_configurator v.0.01"; @@ -232,12 +180,12 @@ return NULL; //----------------------------------------------------------------------------- uint16_t XR_CONFIG::GetStartPosition() const { -return 221; +return 20; } //----------------------------------------------------------------------------- uint16_t XR_CONFIG::GetStopPosition() const { -return 221; +return 20; } //----------------------------------------------------------------------------- int XR_CONFIG::SetUserCash(const string & admLogin, const string & usrLogin, double cash) const