MCPcopy Create free account
hub / github.com/amule-project/amule / AddTagFromFile

Method AddTagFromFile

src/Server.cpp:150–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150bool CServer::AddTagFromFile(CFileDataIO* servermet)
151{
152 uint64_t val;
153 if (servermet == NULL) {
154 return false;
155 }
156
157 CTag tag(*servermet, true);
158
159 switch(tag.GetNameID()){
160 case ST_SERVERNAME:
161 if (listname.IsEmpty()) {
162 listname = tag.GetStr();
163 }
164 break;
165
166 case ST_DESCRIPTION:
167 if (description.IsEmpty()) {
168 description = tag.GetStr();
169 }
170 break;
171
172 case ST_PREFERENCE:
173 preferences = tag.GetInt();
174 break;
175
176 case ST_PING:
177 ping = tag.GetInt();
178 break;
179
180 case ST_DYNIP:
181 if (dynip.IsEmpty()) {
182 dynip = tag.GetStr();
183 }
184 break;
185
186 case ST_FAIL:
187 failedcount = tag.GetInt();
188 break;
189
190 case ST_LASTPING:
191 val = tag.GetInt();
192 // Pre-fix aMule wrote ms-since-boot here; reject obviously-future values.
193 lastpingedtime = (val > (uint64_t)time(NULL)) ? 0 : (time_t)val;
194 break;
195
196 case ST_MAXUSERS:
197 maxusers = tag.GetInt();
198 break;
199
200 case ST_SOFTFILES:
201 softfiles = tag.GetInt();
202 break;
203
204 case ST_HARDFILES:
205 hardfiles = tag.GetInt();
206 break;
207

Callers 1

LoadServerMetMethod · 0.80

Calls 8

CFormatClass · 0.85
StrToULongFunction · 0.85
GetNameIDMethod · 0.80
IsStrMethod · 0.80
GetNameMethod · 0.80
IsEmptyMethod · 0.45
GetIntMethod · 0.45
IsIntMethod · 0.45

Tested by

no test coverage detected