X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/76e975a593f0194edcbfbfc952eb391b2b8605cf..fd947779e36534941c5d7516ba34e4da21b8406b:/projects/stargazer/plugins/other/smux/sensors.cpp diff --git a/projects/stargazer/plugins/other/smux/sensors.cpp b/projects/stargazer/plugins/other/smux/sensors.cpp index 7721d7b7..6018566c 100644 --- a/projects/stargazer/plugins/other/smux/sensors.cpp +++ b/projects/stargazer/plugins/other/smux/sensors.cpp @@ -23,3 +23,26 @@ users.CloseSearch(handle); ValueToOS(count, objectSyntax); return true; } + +#ifdef DEBUG +std::string UsersSensor::ToString() const +{ +int handle = users.OpenSearch(); +if (!handle) + return ""; + +USER_PTR user; +size_t count = 0; +while (!users.SearchNext(handle, &user)) + { + if (UserPredicate(user)) + ++count; + } + +users.CloseSearch(handle); + +std::string res; +x2str(count, res); +return res; +} +#endif