From 30eb6cd56d43fe69026617228478c7c373739a09 Mon Sep 17 00:00:00 2001 From: Naffanya Date: Sun, 1 Dec 2013 23:35:05 +0200 Subject: [PATCH] Correcting small mistakes --- include/stg/user_property.h | 6 +++--- include/stg/users.h | 1 - projects/stargazer/main.cpp | 1 + projects/stargazer/user_impl.cpp | 27 +-------------------------- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/include/stg/user_property.h b/include/stg/user_property.h index 6eb17666..aee32e3e 100644 --- a/include/stg/user_property.h +++ b/include/stg/user_property.h @@ -12,6 +12,7 @@ $Author: faust $ #include #include #include +#include #include #include @@ -26,7 +27,6 @@ $Author: faust $ extern volatile time_t stgTime; //----------------------------------------------------------------------------- -//template class USER_PROPERTY_BASE { public: virtual std::string ToString() const = 0; @@ -124,7 +124,7 @@ private: USER_STAT stat; USER_CONF conf; - std::map properties; + std::map properties; public: USER_PROPERTIES(const std::string & sd); @@ -409,7 +409,7 @@ template inline std::string USER_PROPERTY::ToString() const { -std::stringstream stream; +std::ostringstream stream; stream << value; return stream.str(); } diff --git a/include/stg/users.h b/include/stg/users.h index ed9af901..2ba23833 100644 --- a/include/stg/users.h +++ b/include/stg/users.h @@ -60,7 +60,6 @@ public: virtual int Start() = 0; virtual int Stop() = 0; - }; #endif diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index b7bb91f5..eb61e2d5 100644 --- a/projects/stargazer/main.cpp +++ b/projects/stargazer/main.cpp @@ -271,6 +271,7 @@ if (settings->ReadSettings()) WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str()); exit(1); } + #ifndef NO_DAEMON std::string startFile(settings->GetConfDir() + START_FILE); #endif diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 08087883..ac4dc9a9 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1476,38 +1476,13 @@ std::string USER_IMPL::GetParamValue(const std::string & name) const { if (name == "id") { - std::stringstream stream; + std::ostringstream stream; stream << id; return stream.str();; } if (name == "login") return login; if (name == "ip") return currIP.ToString(); return property.GetPropertyValue(name); -//if (name == "freeMb") return property.freeMb.ToString(); -//if (name == "passive") return property.passive.ToString(); -//if (name == "disabled") return property.disabled.ToString(); -//if (name == "alwaysOnline") return property.alwaysOnline.ToString(); -//if (name == "tariffName") return property.tariffName; -//if (name == "nextTariff") return property.nextTariff; -//if (name == "address") return property.address; -//if (name == "note") return property.note; -//if (name == "group") return property.group; -//if (name == "email") return property.email; -//if (name == "phone") return property.phone; -//if (name == "realName") return property.realName; -//if (name == "credit") return property.credit.ToString(); -//if (name == "userdata0") return property.userdata0; -//if (name == "userdata1") return property.userdata1; -//if (name == "userdata2") return property.userdata2; -//if (name == "userdata3") return property.userdata3; -//if (name == "userdata4") return property.userdata4; -//if (name == "userdata5") return property.userdata5; -//if (name == "userdata6") return property.userdata6; -//if (name == "userdata7") return property.userdata7; -//if (name == "userdata8") return property.userdata8; -//if (name == "userdata9") return property.userdata9; -//if (name == "cash") return property.cash.ToString(); -//return ""; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -- 2.44.2