private static void SubmitNextReport() { if (RemoteLogger.QueuedReports.Count < 1) { return; } RemoteLogger.QueuedReport item = RemoteLogger.QueuedReports[0]; RemoteLogger.submittingReports = true; RemoteLogger.Webrequests.Enqueue(RemoteLogger.Url, item.Body, (int code, string response) => { if (code == 200) { RemoteLogger.QueuedReports.RemoveAt(0); RemoteLogger.submittingReports = false; RemoteLogger.SubmitNextReport(); return; } RemoteLogger.Timers.Once(5f, new Action(RemoteLogger.SubmitNextReport), null); }, null, RequestMethod.POST, item.Headers, 0f); }
private static void EnqueueReport(RemoteLogger.Report report) { Dictionary <string, string> .ValueCollection values = report.extra.Values; if (!values.Contains <string>("Oxide.Core") && !values.Contains <string>("Oxide.Plugins.Compiler")) { return; } string[] exceptionFilter = RemoteLogger.ExceptionFilter; for (int i = 0; i < (int)exceptionFilter.Length; i++) { string str = exceptionFilter[i]; if (values.Contains <string>(str) || values.Contains <string>(str)) { return; } } RemoteLogger.QueuedReports.Add(new RemoteLogger.QueuedReport(report)); if (!RemoteLogger.submittingReports) { RemoteLogger.SubmitNextReport(); } }