using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using MEC;
using UnityEngine;

// Token: 0x02000034 RID: 52
[Token(Token = "0x2000034")]
public class ExpirationChecker
{
	// Token: 0x06000191 RID: 401 RVA: 0x00006900 File Offset: 0x00004B00
	[Token(Token = "0x6000191")]
	[Address(RVA = "0xD0C3E0", Offset = "0xD0B3E0", VA = "0x180D0C3E0")]
	public ExpirationChecker(string passCode)
	{
		/*
An exception occurred when decompiling this method (06000191)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void ExpirationChecker::.ctor(System.String)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	call:void(object::.ctor, ldloc:ExpirationChecker[exp:object](this)); 	stfld:string(ExpirationChecker::passCode, ldloc:ExpirationChecker(this), ldloc:string(passCode)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x06000192 RID: 402 RVA: 0x0000691C File Offset: 0x00004B1C
	[Token(Token = "0x6000192")]
	[Address(RVA = "0xD0C330", Offset = "0xD0B330", VA = "0x180D0C330")]
	public void Run()
	{
		int num;
		ExpirationChecker.<CheckNetwork>d__13 <CheckNetwork>d__ = new ExpirationChecker.<CheckNetwork>d__13(num);
		num = 0;
		<CheckNetwork>d__.<>4__this = this;
		CoroutineHandle coroutineHandle = Timing.RunCoroutine(<CheckNetwork>d__);
	}

	// Token: 0x06000193 RID: 403 RVA: 0x00006948 File Offset: 0x00004B48
	[Token(Token = "0x6000193")]
	[Address(RVA = "0xD0C310", Offset = "0xD0B310", VA = "0x180D0C310")]
	private bool IsNetReachable()
	{
		return Application.internetReachability != NetworkReachability.NotReachable;
	}

	// Token: 0x06000194 RID: 404 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000194")]
	[Address(RVA = "0xD0C1D0", Offset = "0xD0B1D0", VA = "0x180D0C1D0")]
	private IEnumerator<float> CheckNetwork()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06000195 RID: 405 RVA: 0x00006964 File Offset: 0x00004B64
	[Token(Token = "0x6000195")]
	[Address(RVA = "0xD0C2F0", Offset = "0xD0B2F0", VA = "0x180D0C2F0")]
	private void InternetIsNotAvailable()
	{
		ExpirationChecker.ExpiryCheckingEventHandler onNetworkDisconnected = this.OnNetworkDisconnected;
		if (onNetworkDisconnected != 0)
		{
			onNetworkDisconnected();
			return;
		}
	}

	// Token: 0x06000196 RID: 406 RVA: 0x00006984 File Offset: 0x00004B84
	[Token(Token = "0x6000196")]
	[Address(RVA = "0xD0C240", Offset = "0xD0B240", VA = "0x180D0C240")]
	private void InternetAvailable()
	{
		int num;
		ExpirationChecker.<CheckExpirationDate>d__16 <CheckExpirationDate>d__ = new ExpirationChecker.<CheckExpirationDate>d__16(num);
		num = 0;
		<CheckExpirationDate>d__.<>4__this = this;
		CoroutineHandle coroutineHandle = Timing.RunCoroutine(<CheckExpirationDate>d__);
	}

	// Token: 0x06000197 RID: 407 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6000197")]
	[Address(RVA = "0xD0C160", Offset = "0xD0B160", VA = "0x180D0C160")]
	private IEnumerator<float> CheckExpirationDate()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x040001FC RID: 508
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x40001FC")]
	public ExpirationChecker.ExpiryCheckingEventHandler OnNetworkDisconnected;

	// Token: 0x040001FD RID: 509
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x40001FD")]
	public ExpirationChecker.ExpiryCheckingEventHandler OnExpired;

	// Token: 0x040001FE RID: 510
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x40001FE")]
	public ExpirationChecker.ExpiryCheckingEventHandler OnSuccess;

	// Token: 0x040001FF RID: 511
	[Token(Token = "0x40001FF")]
	private const string HOST_URL = "https://www.sunkindown.com/lwn";

	// Token: 0x04000200 RID: 512
	[Token(Token = "0x4000200")]
	private const string PING_ADDRESS = "8.8.8.8";

	// Token: 0x04000201 RID: 513
	[Token(Token = "0x4000201")]
	private const float WAITING_TIME = 3f;

	// Token: 0x04000202 RID: 514
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4000202")]
	private Ping ping;

	// Token: 0x04000203 RID: 515
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4000203")]
	private float pingStartTime;

	// Token: 0x04000204 RID: 516
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4000204")]
	private string passCode;

	// Token: 0x02000035 RID: 53
	[Token(Token = "0x2000035")]
	public sealed class ExpiryCheckingEventHandler : MulticastDelegate
	{
		// Token: 0x06000198 RID: 408 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6000198")]
		[Address(RVA = "0x4932A0", Offset = "0x4922A0", VA = "0x1804932A0")]
		public ExpiryCheckingEventHandler(object @object, IntPtr method)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06000199 RID: 409 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6000199")]
		[Address(RVA = "0x12C2020", Offset = "0x12C1020", VA = "0x1812C2020", Slot = "13")]
		public void Invoke()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600019A RID: 410 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600019A")]
		[Address(RVA = "0x6D7F10", Offset = "0x6D6F10", VA = "0x1806D7F10", Slot = "14")]
		public IAsyncResult BeginInvoke(AsyncCallback callback, object @object)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600019B RID: 411 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600019B")]
		[Address(RVA = "0x492FC0", Offset = "0x491FC0", VA = "0x180492FC0", Slot = "15")]
		public void EndInvoke(IAsyncResult result)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}
	}

	// Token: 0x02000036 RID: 54
	[Token(Token = "0x2000036")]
	private class ExpiryData
	{
		// Token: 0x0600019C RID: 412 RVA: 0x000069B0 File Offset: 0x00004BB0
		[Token(Token = "0x600019C")]
		[Address(RVA = "0x36ABD0", Offset = "0x369BD0", VA = "0x18036ABD0")]
		public ExpiryData()
		{
		}

		// Token: 0x04000205 RID: 517
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4000205")]
		public int ExpiryDate;

		// Token: 0x04000206 RID: 518
		[FieldOffset(Offset = "0x14")]
		[Token(Token = "0x4000206")]
		public int CurrentDate;

		// Token: 0x04000207 RID: 519
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4000207")]
		public bool HasExpired;
	}
}
