1 #include "asn1/INTEGER.h"
4 #include "stg/user_property.h"
8 void Int2OS(ObjectSyntax_t * dst, long src)
10 dst->present = ObjectSyntax_PR_simple;
11 SimpleSyntax_t * simpleSyntax = &dst->choice.simple;
12 simpleSyntax->present = SimpleSyntax_PR_number;
13 asn_long2INTEGER(&simpleSyntax->choice.number, src);
16 bool ConnectedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
18 int handle = users.OpenSearch();
24 while (!users.SearchNext(handle, &user))
26 if (user->GetConnected())
30 users.CloseSearch(handle);
32 Int2OS(objectSyntax, count);
36 bool AuthorizedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
38 int handle = users.OpenSearch();
44 while (!users.SearchNext(handle, &user))
46 if (user->GetAuthorized())
50 users.CloseSearch(handle);
52 Int2OS(objectSyntax, count);
56 bool AlwaysOnlineUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
58 int handle = users.OpenSearch();
64 while (!users.SearchNext(handle, &user))
66 if (user->GetProperty().alwaysOnline)
70 users.CloseSearch(handle);
72 Int2OS(objectSyntax, count);
76 bool NoCashUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
78 int handle = users.OpenSearch();
84 while (!users.SearchNext(handle, &user))
86 if (user->GetProperty().cash < 0)
90 users.CloseSearch(handle);
92 Int2OS(objectSyntax, count);
96 bool DisabledDetailStatsUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
98 int handle = users.OpenSearch();
104 while (!users.SearchNext(handle, &user))
106 if (user->GetProperty().disabledDetailStat)
110 users.CloseSearch(handle);
112 Int2OS(objectSyntax, count);
116 bool DisabledUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
118 int handle = users.OpenSearch();
124 while (!users.SearchNext(handle, &user))
126 if (user->GetProperty().disabled)
130 users.CloseSearch(handle);
132 Int2OS(objectSyntax, count);
136 bool PassiveUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
138 int handle = users.OpenSearch();
144 while (!users.SearchNext(handle, &user))
146 if (user->GetProperty().passive)
150 users.CloseSearch(handle);
152 Int2OS(objectSyntax, count);
156 bool CreditUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
158 int handle = users.OpenSearch();
164 while (!users.SearchNext(handle, &user))
166 if (user->GetProperty().credit > 0)
170 users.CloseSearch(handle);
172 Int2OS(objectSyntax, count);
176 bool FreeMbUsersSensor::GetValue(ObjectSyntax_t * objectSyntax)
178 int handle = users.OpenSearch();
184 while (!users.SearchNext(handle, &user))
186 if (user->GetProperty().freeMb > 0)
190 users.CloseSearch(handle);
192 Int2OS(objectSyntax, count);