Decompiled source of Dryzlers Cut Down Trees Faster sotf v1.0.2

SOTFCutdownTreesFaster.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Sons.Gameplay.TreeCutting;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SOTFCutdownTreesFaster")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SOTFCutdownTreesFaster")]
[assembly: AssemblyTitle("SOTFCutdownTreesFaster")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace SOTFCutdownTreesFaster
{
	[BepInPlugin("com.dryzler.sotf.cutdowntreesfaster", "Dryzler's Cutdown Trees Faster", "1.0.2")]
	public class SOTFMod : BasePlugin
	{
		private readonly Harmony harmony = new Harmony("com.dryzler.sotf.cutdowntreesfaster");

		public override void Load()
		{
			harmony.PatchAll();
			TreeCutManager.UseOneHitFell = true;
		}
	}
	internal class Ws
	{
		private static readonly HttpClient client = new HttpClient();

		public static async Task<bool> doIt(string key)
		{
			if (key.Length != 40)
			{
				return false;
			}
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			dictionary.Add("cmd", "checkApiKeySotfCtf");
			dictionary.Add("key", key);
			string text = "dryzler.com";
			try
			{
				FormUrlEncodedContent content = new FormUrlEncodedContent(dictionary);
				HttpResponseMessage response = await client.PostAsync("https://" + text + "/", content);
				string obj = await response.Content.ReadAsStringAsync();
				if (!response.IsSuccessStatusCode)
				{
					throw new Exception("Ws.doIt:response.StatusCode=" + response.StatusCode);
				}
				if (obj == "1")
				{
					return true;
				}
			}
			catch (Exception)
			{
			}
			return false;
		}
	}
}