Bladeren bron

Fix merge conflict

Bepis 6 jaren geleden
bovenliggende
commit
846c9c49c7

+ 10 - 0
BepInEx.Patcher/BepInEx.Patcher.csproj

@@ -42,6 +42,16 @@
   <PropertyGroup>
     <StartupObject>BepInEx.Patcher.Program</StartupObject>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'v2018|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\bin\patcher\</OutputPath>
+    <DefineConstants>TRACE;UNITY_2018</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>embedded</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
       <HintPath>..\packages\Mono.Cecil.0.10.0\lib\net35\Mono.Cecil.dll</HintPath>

+ 16 - 6
BepInEx.Patcher/Program.cs

@@ -42,9 +42,15 @@ namespace BepInEx.Patcher
                 string gameName = Path.GetFileNameWithoutExtension(exePath);
 
                 string managedDir = Environment.CurrentDirectory + $@"\{gameName}_Data\Managed";
-                string unityOutputDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.dll");
 
-                if (!Directory.Exists(managedDir) || !File.Exists(unityOutputDLL))
+#if UNITY_2018
+				string unityOutputDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.CoreModule.dll");
+#else
+				string unityOutputDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.dll");
+#endif
+
+
+				if (!Directory.Exists(managedDir) || !File.Exists(unityOutputDLL))
                     continue;
 
                 hasFound = true;
@@ -95,10 +101,14 @@ namespace BepInEx.Patcher
                     AssemblyResolver = defaultResolver
                 };
 
-                string unityBackupDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.dll.bak");
-                
-                //determine which assembly to use as a base
-                AssemblyDefinition unity = AssemblyDefinition.ReadAssembly(unityOutputDLL, rp);
+#if UNITY_2018
+				string unityBackupDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.CoreModule.dll.bak");
+#else
+				string unityBackupDLL = Path.GetFullPath($"{managedDir}\\UnityEngine.dll.bak");
+#endif
+
+				//determine which assembly to use as a base
+				AssemblyDefinition unity = AssemblyDefinition.ReadAssembly(unityOutputDLL, rp);
 
                 if (!VerifyAssembly(unity, out message))
                 {

+ 2 - 2
BepInEx.Patcher/Properties/AssemblyInfo.cs

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.1.0.0")]
-[assembly: AssemblyFileVersion("4.1.0.0")]
+[assembly: AssemblyVersion("5.0.0.0")]
+[assembly: AssemblyFileVersion("5.0.0.0")]

+ 1 - 1
BepInEx.Preloader/Preloader.cs

@@ -87,7 +87,7 @@ namespace BepInEx.Preloader
                 {
                     File.WriteAllText(
                         Path.Combine(Paths.GameRootPath, $"preloader_{DateTime.Now:yyyyMMdd_HHmmss_fff}.log"),
-                        PreloaderLog.ToString());
+                        PreloaderLog + "\r\n" + ex);
 
                     PreloaderLog.Dispose();
                     PreloaderLog = null;

+ 0 - 2
BepInEx/BepInEx.csproj

@@ -57,8 +57,6 @@
     <Compile Include="ConsoleUtil\SafeConsole.cs" />
     <Compile Include="Bootstrap\Chainloader.cs" />
     <Compile Include="Contract\BaseUnityPlugin.cs" />
-    <Compile Include="Deprecated\BepInLogger.cs" />
-    <Compile Include="Deprecated\Utility.cs" />
     <Compile Include="Logging\BaseLogger.cs" />
     <Compile Include="Logging\Logger.cs" />
     <Compile Include="Logging\LogLevel.cs" />

+ 0 - 58
BepInEx/Deprecated/BepInLogger.cs

@@ -1,58 +0,0 @@
-using System;
-using BepInEx.Logging;
-
-namespace BepInEx
-{
-    /// <summary>
-    /// A helper class to use for logging.
-    /// </summary>
-    [Obsolete("This class has been deprecated; please use the Logger static class and BaseLogger implementations", true)]
-    public static class BepInLogger
-    {
-        /// <summary>
-        /// The handler for a entry logged event.
-        /// </summary>
-        /// <param name="entry">The text element of the log itself.</param>
-        /// <param name="show">Whether or not it should be dislpayed to the user.</param>
-        public delegate void EntryLoggedEventHandler(string entry, bool show = false);
-
-        /// <summary>
-        /// The listener event for an entry being logged.
-        /// </summary>
-        public static event EntryLoggedEventHandler EntryLogged;
-
-        /// <summary>
-        /// Logs an entry to the logger, and any listeners are notified of the entry.
-        /// </summary>
-        /// <param name="entry">The text element of the log itself.</param>
-        /// <param name="show">Whether or not it should be dislpayed to the user.</param>
-        public static void Log(string entry, bool show = false)
-        {
-	        Logger.Log(show ? LogLevel.Message : LogLevel.Info, entry);
-
-	        EntryLogged?.Invoke(entry, show);
-        }
-
-        /// <summary>
-        /// Logs an entry to the logger, and any listeners are notified of the entry.
-        /// </summary>
-        /// <param name="entry">The text element of the log itself. Uses .ToString().</param>
-        /// <param name="show">Whether or not it should be dislpayed to the user.</param>
-        /// <param name="color">The color of the text to show in the console.</param>
-        public static void Log(object entry, bool show, ConsoleColor color)
-        {
-	        Log(entry.ToString(), show);
-        }
-
-        /// <summary>
-        /// Logs an entry to the logger, and any listeners are notified of the entry.
-        /// </summary>
-        /// <param name="entry">The text element of the log itself.</param>
-        /// <param name="show">Whether or not it should be dislpayed to the user.</param>
-        /// <param name="color">The color of the text to show in the console.</param>
-        public static void Log(string entry, bool show, ConsoleColor color)
-        {
-			Log(entry, show);
-        }
-    }
-}

+ 0 - 80
BepInEx/Deprecated/Utility.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace BepInEx.Common
-{
-	/// <summary>
-	/// Generic helper properties and methods.
-	/// </summary>
-	[Obsolete("This class has moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-	public static class Utility
-	{
-		/// <summary>
-		/// The directory that the game .exe is being run from.
-		/// </summary>
-		[Obsolete("This property has been moved, please use Paths.GameRootPath instead", true)]
-		public static string ExecutingDirectory
-			=> Paths.GameRootPath;
-
-		/// <summary>
-		/// The path that the plugins folder is located.
-		/// </summary>
-		[Obsolete("This property has been moved, please use Paths.PluginPath instead", true)]
-		public static string PluginsDirectory
-			=> Paths.PluginPath;
-
-		/// <summary>
-		/// Combines multiple paths together, as the specfic method is not availble in .NET 3.5.
-		/// </summary>
-		/// <param name="parts">The multiple paths to combine together.</param>
-		/// <returns>A combined path.</returns>
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static string CombinePaths(params string[] parts) =>
-			BepInEx.Utility.CombinePaths(parts);
-
-		/// <summary>
-		/// Tries to parse a bool, with a default value if unable to parse.
-		/// </summary>
-		/// <param name="input">The string to parse</param>
-		/// <param name="defaultValue">The value to return if parsing is unsuccessful.</param>
-		/// <returns>Boolean value of input if able to be parsed, otherwise default value.</returns>
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static bool SafeParseBool(string input, bool defaultValue = false) =>
-			BepInEx.Utility.SafeParseBool(input, defaultValue);
-
-		/// <summary>
-		/// Converts a file path into a UnityEngine.WWW format.
-		/// </summary>
-		/// <param name="path">The file path to convert.</param>
-		/// <returns>A converted file path.</returns>
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static string ConvertToWWWFormat(string path)
-			=> BepInEx.Utility.ConvertToWWWFormat(path);
-
-		/// <summary>
-		/// Indicates whether a specified string is null, empty, or consists only of white-space characters.
-		/// </summary>
-		/// <param name="self">The string to test.</param>
-		/// <returns>True if the value parameter is null or empty, or if value consists exclusively of white-space characters.</returns>
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static bool IsNullOrWhiteSpace(this string self)
-			=> BepInEx.Utility.IsNullOrWhiteSpace(self);
-
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static IEnumerable<TNode> TopologicalSort<TNode>(IEnumerable<TNode> nodes,
-			Func<TNode, IEnumerable<TNode>> dependencySelector)
-			=> BepInEx.Utility.TopologicalSort(nodes, dependencySelector);
-
-		/// <summary>
-		/// Try to resolve and load the given assembly DLL.
-		/// </summary>
-		/// <param name="assemblyName">Name of the assembly, of the type <see cref="AssemblyName" />.</param>
-		/// <param name="directory">Directory to search the assembly from.</param>
-		/// <param name="assembly">The loaded assembly.</param>
-		/// <returns>True, if the assembly was found and loaded. Otherwise, false.</returns>
-		[Obsolete("This method has been moved, please use BepInEx.Utility instead of BepInEx.Common.Utility", true)]
-		public static bool TryResolveDllAssembly(AssemblyName assemblyName, string directory, out Assembly assembly)
-			=> BepInEx.Utility.TryResolveDllAssembly(assemblyName, directory, out assembly);
-	}
-}

+ 1 - 1
submodules/BepInEx.Harmony

@@ -1 +1 @@
-Subproject commit fda68e8458bec7d5850b175255535810dda46c6a
+Subproject commit 90cfc503f1e654caeaecdfef364295a750243c71