Decompiled source of RoR2 Mod Korean Patch v1.0.2

plugins/RoR2 Mod Ko.dll

Decompiled 4 days ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("RoR2 Mod Ko")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RoR2 Mod Ko")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7f25a382-5554-43af-a206-0f6df4b97c1e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.dice.ss2kopatch", "RoR2 Mod Korean Patch", "1.0.0")]
public class RoR2ModKoreanPatch : BaseUnityPlugin
{
	public void Awake()
	{
		CopyKoFilesToMods();
	}

	private void CopyKoFilesToMods()
	{
		string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "language");
		if (!Directory.Exists(text))
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)("language 폴더를 찾을 수 없습니다: " + text));
			return;
		}
		string fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), ".."));
		foreach (KeyValuePair<string, (string, string, string)> item in new Dictionary<string, (string, string, string)>
		{
			{
				"TeamMoonstorm-Starstorm2",
				("Starstorm2", "languages/ko", "*.json")
			},
			{
				"Risky_Sleeps-ClassicItemsReturns/ClassicItemsReturns",
				("RiskyClassicItems", "language/ko", "*.json")
			},
			{
				"William758-ZetAspects/ZetAspects",
				("ZetAspects", "lang", "*.zetlang")
			},
			{
				"EnforcerGang-Enforcer",
				("Enforcer", "Language/ko", "*.txt")
			},
			{
				"EnforcerGang-Rocket/EnforcerGang-Rocket",
				("Rocket", "language/ko", "*.txt")
			},
			{
				"EnforcerGang-Pilot/EnforcerGang-Pilot",
				("Pilot", "language/ko", "*.txt")
			},
			{
				"EnforcerGang-SniperClassic/SniperClassic",
				("SniperClassic", "language/ko", "*.txt")
			},
			{
				"EnforcerGang-Direseeker/EnforcerGang-Direseeker",
				("Direseeker", "language/ko", "*.txt")
			},
			{
				"EnforcerGang-HAND_OVERCLOCKED/HAND_Overclocked",
				("HANDOVERCLOCKED", "language/ko", "*.txt")
			},
			{
				"Moffein-TeammateRevival/KosmosisDire-TeammateRevival/Localization",
				("TeammateRevival", "Languages/ko", "*.json")
			},
			{
				"Wolfo-WLoopWeather/LoopWeather",
				("WLoopWeather", "Languages/ko", "*.json")
			}
		})
		{
			string text2 = Path.Combine(fullPath, item.Key);
			if (!Directory.Exists(text2))
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("모드 폴더를 찾을 수 없습니다: " + item.Key));
				continue;
			}
			string text3 = Path.Combine(text, item.Value.Item1);
			if (!Directory.Exists(text3))
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("내 패치 KO 폴더가 없습니다: " + text3));
				continue;
			}
			string text4 = Path.Combine(text2, item.Value.Item2);
			Directory.CreateDirectory(text4);
			string[] files = Directory.GetFiles(text3, item.Value.Item3);
			foreach (string text5 in files)
			{
				string text6 = Path.Combine(text4, Path.GetFileName(text5));
				if (File.Exists(text6))
				{
					string text7 = File.ReadAllText(text5);
					string text8 = File.ReadAllText(text6);
					if (text7 == text8)
					{
						((BaseUnityPlugin)this).Logger.LogInfo((object)("[" + item.Key + "] 동일 파일, 복사하지 않음: " + Path.GetFileName(text5)));
						continue;
					}
				}
				File.Copy(text5, text6, overwrite: true);
				((BaseUnityPlugin)this).Logger.LogInfo((object)("[" + item.Key + "] 복사/덮어쓰기 완료: " + Path.GetFileName(text5)));
			}
		}
		((BaseUnityPlugin)this).Logger.LogInfo((object)"모드별 파일 복사 완료");
	}
}