Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AgeCookies()

bool System.Net.CookieContainer.AgeCookies ( string domain)
inlineprivate

Definition at line 241 of file CookieContainer.cs.

242 {
243 int num = 0;
244 DateTime dateTime = DateTime.MaxValue;
245 CookieCollection cookieCollection = null;
246 string text = null;
247 int num2 = 0;
248 int num3 = 0;
249 float num4 = 1f;
250 if (m_count > m_maxCookies)
251 {
252 num4 = (float)m_maxCookies / (float)m_count;
253 }
255 {
256 foreach (object item in m_domainTable)
257 {
259 string text2;
260 PathList pathList;
261 if (domain == null)
262 {
264 pathList = (PathList)dictionaryEntry.Value;
265 }
266 else
267 {
268 text2 = domain;
269 pathList = (PathList)m_domainTable[domain];
270 }
271 num2 = 0;
273 {
274 foreach (CookieCollection value in pathList.Values)
275 {
277 num += num3;
278 m_count -= num3;
279 num2 += value.Count;
281 if (value.Count > 0 && (dateTime2 = value.TimeStamp(CookieCollection.Stamp.Check)) < dateTime)
282 {
283 text = text2;
286 }
287 }
288 }
289 int num5 = Math.Min((int)((float)num2 * num4), Math.Min(m_maxCookiesPerDomain, m_maxCookies) - 1);
290 if (num2 <= num5)
291 {
292 continue;
293 }
294 CookieCollection[] array;
297 {
298 array = new CookieCollection[pathList.Count];
300 foreach (CookieCollection value2 in pathList.Values)
301 {
302 array2[num3] = value2.TimeStamp(CookieCollection.Stamp.Check);
303 array[num3] = value2;
304 num3++;
305 }
306 }
307 Array.Sort(array2, array);
308 num3 = 0;
309 foreach (CookieCollection cookieCollection4 in array)
310 {
312 {
313 while (num2 > num5 && cookieCollection4.Count > 0)
314 {
315 cookieCollection4.RemoveAt(0);
316 num2--;
317 m_count--;
318 num++;
319 }
320 }
321 if (num2 <= num5)
322 {
323 break;
324 }
325 }
326 if (num2 > num5 && domain != null)
327 {
328 return false;
329 }
330 }
331 }
332 if (domain != null)
333 {
334 return true;
335 }
336 if (num != 0)
337 {
338 return true;
339 }
340 if (dateTime == DateTime.MaxValue)
341 {
342 return false;
343 }
345 {
347 {
348 cookieCollection.RemoveAt(0);
349 m_count--;
350 }
351 }
352 return true;
353 }
int ExpireCollection(CookieCollection cc)
readonly Hashtable m_domainTable

References System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Net.CookieContainer.ExpireCollection(), System.item, System.Net.CookieContainer.m_count, System.Net.CookieContainer.m_domainTable, System.Net.CookieContainer.m_maxCookies, System.Net.CookieContainer.m_maxCookiesPerDomain, System.DateTime.MaxValue, System.Math.Min(), System.Array.Sort(), System.Collections.Generic.Dictionary< TKey, TValue >.SyncRoot, System.Collections.Hashtable.SyncRoot, System.text, System.value, and System.Collections.Generic.Dictionary< TKey, TValue >.Values.

Referenced by System.Net.CookieContainer.Add().