Decompiled source of RainbowGuns v0.0.9

RainbowGuns.dll

Decompiled 8 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using Agents;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using GTFO.API;
using GTFO.API.Utilities;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using Player;
using SNetwork;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RainbowGuns")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RainbowGuns")]
[assembly: AssemblyTitle("RainbowGuns")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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 RainbowGuns
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("RainbowGuns", "RainbowGuns", "0.0.9")]
	public class Plugin : BasePlugin
	{
		public struct RainbowNetInfo
		{
			public int Name;

			public int R;

			public int G;

			public int B;

			public int A;

			public static string NetworkIdentity => "RainbowNetInfo";

			public RainbowNetInfo(int name, int r, int g, int b, int a)
			{
				this = default(RainbowNetInfo);
				Name = name;
				R = r;
				G = g;
				B = b;
				A = a;
				Debug.Log(Object.op_Implicit($"RainbowGuns - sent a rainbow love package over intternet {name} {r} {g} {b} {a}"));
			}
		}

		public struct RainbowInfo
		{
			public int Name;

			public int R;

			public int G;

			public int B;

			public int A;

			public RainbowInfo(int name, int r, int g, int b, int a)
			{
				this = default(RainbowInfo);
				Name = name;
				R = r;
				G = g;
				B = b;
				A = a;
			}

			public RainbowInfo(RainbowNetInfo network)
			{
				this = default(RainbowInfo);
				Name = network.Name;
				R = network.R;
				G = network.G;
				B = network.B;
				A = network.A;
			}
		}

		public class RainbowGuns : MonoBehaviour
		{
			public static void Send()
			{
				CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(RainbowSend()), (Action)null);
			}

			public static void Begin()
			{
				ledger.Clear();
				CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(RainbowWatcher()), (Action)null);
			}

			public static void OnFileChanged(LiveEditEventArgs e)
			{
				//IL_0204: Unknown result type (might be due to invalid IL or missing references)
				//IL_025b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0265: Expected O, but got Unknown
				//IL_032c: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
				Debug.Log(Object.op_Implicit("RainbowGuns - configuration changed, reloading.."));
				config.Reload();
				Dictionary<int, string> obj = new Dictionary<int, string>
				{
					[1] = _cfgFront.Value,
					[2] = _cfgMag.Value,
					[3] = _cfgReceiver.Value,
					[4] = _cfgSight.Value,
					[5] = _cfgStock.Value,
					[6] = _cfgGrip.Value,
					[7] = _cfgHandle.Value,
					[8] = _cfgNeck.Value,
					[9] = _cfgPommel.Value,
					[10] = _cfgHead.Value,
					[11] = _cfgIron.Value,
					[12] = _cfgRetA.Value,
					[13] = _cfgRetB.Value,
					[14] = _cfgRetC.Value
				};
				Dictionary<int, Color> dictionary = new Dictionary<int, Color>();
				foreach (KeyValuePair<int, string> item in obj)
				{
					string[] array = item.Value.Split(",");
					float num = 0f;
					float num2 = 0f;
					float num3 = 0f;
					float num4 = 0f;
					int.TryParse(array[0], out var result);
					int.TryParse(array[1], out var result2);
					int.TryParse(array[2], out var result3);
					int.TryParse(array[3], out var result4);
					if (result > 0)
					{
						num = (float)result / 255f;
					}
					if (result2 > 0)
					{
						num2 = (float)result2 / 255f;
					}
					if (result3 > 0)
					{
						num3 = (float)result3 / 255f;
					}
					if (result4 > 0)
					{
						num4 = (float)result4 / 255f;
					}
					int[] value = new int[4] { result, result2, result3, result4 };
					raakaList[item.Key] = value;
					dictionary[item.Key] = new Color(num, num2, num3, num4);
				}
				for (int i = 1; i < 5; i++)
				{
					for (int j = 1; j < 15; j++)
					{
						rbTextures[i][j].Add(new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height));
						rbTextures[i][j].RemoveAt(0);
					}
				}
				for (int k = 0; k < ((Texture)Texture2D.redTexture).height; k++)
				{
					for (int l = 0; l < ((Texture)Texture2D.redTexture).width; l++)
					{
						for (int m = 1; m < 5; m++)
						{
							for (int n = 1; n < 15; n++)
							{
								rbTextures[m][n].Last().SetPixel(l, k, dictionary[n]);
							}
						}
					}
				}
				for (int num5 = 1; num5 < 5; num5++)
				{
					for (int num6 = 1; num6 < 15; num6++)
					{
						colorList[num5][num6] = dictionary[num6];
						rbTextures[num5][num6].Last().Apply();
					}
				}
				SendNow = true;
				int key = PlayerManager.GetLocalPlayerAgent().PlayerSlotIndex + 1;
				for (int num7 = 0; num7 < 5; num7++)
				{
					pyssyt[key][num7] = true;
				}
				PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent();
				InventorySlot wieldedSlot = localPlayerAgent.Inventory.WieldedSlot;
				localPlayerAgent.Sync.WantsToWieldSlot((InventorySlot)1, false);
				localPlayerAgent.Sync.WantsToWieldSlot((InventorySlot)2, false);
				localPlayerAgent.Sync.WantsToWieldSlot((InventorySlot)3, false);
				localPlayerAgent.Sync.WantsToWieldSlot((InventorySlot)10, false);
				localPlayerAgent.Sync.WantsToWieldSlot(wieldedSlot, false);
				Enumerator<PlayerAgent> enumerator2 = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				while (enumerator2.MoveNext())
				{
					PlayerAgent current2 = enumerator2.Current;
					key = current2.PlayerSlotIndex + 1;
					for (int num8 = 1; num8 < 5; num8++)
					{
						pyssyt[key][num8] = true;
					}
					if (SNet.IsMaster && ((Agent)current2).m_replicator.OwningPlayer.IsBot)
					{
						current2.Sync.WantsToWieldSlot((InventorySlot)1, false);
						current2.Sync.WantsToWieldSlot((InventorySlot)2, false);
						current2.Sync.WantsToWieldSlot((InventorySlot)3, false);
						current2.Sync.WantsToWieldSlot((InventorySlot)10, false);
					}
				}
			}

			public static IEnumerator RainbowSend()
			{
				int secs = 0;
				while (true)
				{
					if (secs > 299 || SendNow)
					{
						SendNow = false;
						secs = 0;
						for (int i = 1; i < 12; i++)
						{
							NetworkAPI.InvokeEvent<RainbowNetInfo>("RainbowNetInfo", new RainbowNetInfo(i, raakaList[i][0], raakaList[i][1], raakaList[i][2], raakaList[i][3]), (SNet_ChannelType)2);
						}
					}
					secs++;
					yield return (object)new WaitForSeconds(1f);
				}
			}

			public static void ReceiveRainbowNetInfo(ulong sender, RainbowNetInfo netInfo)
			{
				//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e3: Expected O, but got Unknown
				//IL_0228: Unknown result type (might be due to invalid IL or missing references)
				Debug.Log(Object.op_Implicit("received data from sender " + sender + ": name:" + netInfo.Name + " r:" + netInfo.R + " g:" + netInfo.G + " b:" + netInfo.B + " a:" + netInfo.A));
				Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				Color val = default(Color);
				while (enumerator.MoveNext())
				{
					PlayerAgent current = enumerator.Current;
					if (current.Sync.Replicator.OwningPlayer.Lookup != sender)
					{
						continue;
					}
					Debug.Log(Object.op_Implicit($"RainbowGuns - player {current.PlayerName} is sender {current.Sync.Replicator.OwningPlayer.Lookup} in slot {current.PlayerSlotIndex}"));
					int key = current.PlayerSlotIndex + 1;
					float num = (float)netInfo.R / 255f;
					float num2 = (float)netInfo.G / 255f;
					float num3 = (float)netInfo.B / 255f;
					float num4 = (float)netInfo.A / 255f;
					((Color)(ref val))..ctor(num, num2, num3, num4);
					colorList[key][netInfo.Name] = val;
					rbTextures[key][netInfo.Name].Add(new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height));
					rbTextures[key][netInfo.Name].RemoveAt(0);
					for (int i = 0; i < ((Texture)Texture2D.redTexture).height; i++)
					{
						for (int j = 0; j < ((Texture)Texture2D.redTexture).width; j++)
						{
							rbTextures[key][netInfo.Name].Last().SetPixel(j, i, val);
						}
					}
					rbTextures[key][netInfo.Name].Last().Apply();
					for (int k = 1; k < 5; k++)
					{
						pyssyt[key][k] = true;
					}
				}
			}

			public static IEnumerator RainbowWatcher()
			{
				Debug.Log(Object.op_Implicit("RainbowGuns - thirdperson sentry coroutine running.."));
				yield return (object)new WaitForSeconds(0.4f);
				PlayerManager.GetLocalPlayerAgent().Sync.WantsToWieldSlot((InventorySlot)1, false);
				PlayerManager.GetLocalPlayerAgent().Sync.WantsToWieldSlot((InventorySlot)2, false);
				PlayerManager.GetLocalPlayerAgent().Sync.WantsToWieldSlot((InventorySlot)3, false);
				PlayerManager.GetLocalPlayerAgent().Sync.WantsToWieldSlot((InventorySlot)10, false);
				Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				while (enumerator.MoveNext())
				{
					PlayerAgent current = enumerator.Current;
					if (SNet.IsMaster && ((Agent)current).m_replicator.OwningPlayer.IsBot)
					{
						current.Sync.WantsToWieldSlot((InventorySlot)1, false);
						current.Sync.WantsToWieldSlot((InventorySlot)2, false);
						current.Sync.WantsToWieldSlot((InventorySlot)3, false);
						current.Sync.WantsToWieldSlot((InventorySlot)10, false);
					}
				}
				BackpackItem val = default(BackpackItem);
				while (true)
				{
					bool flag = false;
					enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
					while (enumerator.MoveNext())
					{
						PlayerAgent current2 = enumerator.Current;
						_ = current2.PlayerSlotIndex;
						PlayerBackpackManager.GetBackpack(((Agent)current2).m_replicator.m_owningPlayer).TryGetBackpackItem((InventorySlot)3, ref val);
						if (val != null)
						{
							if ((int)val.Status == 0 && ledger.Contains(current2.PlayerName))
							{
								ledger.Remove(current2.PlayerName);
							}
							if ((int)val.Status == 1 && !ledger.Contains(current2.PlayerName))
							{
								ledger.Add(current2.PlayerName);
								flag = true;
							}
						}
					}
					if (flag)
					{
						Debug.Log(Object.op_Implicit("RainbowGuns - hikst! (finding deployed sentryguns to re-texture)"));
						foreach (SentryGunInstance item in Object.FindObjectsOfType<SentryGunInstance>())
						{
							PlayerAgent owner = ((Item)item).Owner;
							int key = owner.PlayerSlotIndex + 1;
							foreach (Transform componentsInChild in ((Component)item).GetComponentsInChildren<Transform>())
							{
								string[] array = new string[13]
								{
									"Front", "Mag", "Receiver", "Sight", "Stock", "Grip", "Handle", "Neck", "Pommel", "Head",
									"Anim", "Turret", "Target"
								};
								for (int i = 0; i < array.Length; i++)
								{
									string text = array[i];
									if (!((Object)componentsInChild).name.Contains(text, StringComparison.OrdinalIgnoreCase))
									{
										continue;
									}
									bool flag2 = false;
									Texture2D val2 = new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height);
									_ = Color.black;
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "glass", RegexOptions.IgnoreCase).Success)
									{
										flag2 = true;
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "holo", RegexOptions.IgnoreCase).Success)
									{
										flag2 = true;
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "align", RegexOptions.IgnoreCase).Success)
									{
										flag2 = true;
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "_sight$", RegexOptions.IgnoreCase).Success)
									{
										flag2 = true;
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "_picture", RegexOptions.IgnoreCase).Success)
									{
										flag2 = true;
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^front", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][1].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "mag", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][2].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^receiver", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "anim", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^turret", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^sight", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "light", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "target", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^stock", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][5].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^grip", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][6].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "handle", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][7].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^neck", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][8].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^pommel", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][9].Last();
									}
									if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^head", RegexOptions.IgnoreCase).Success)
									{
										val2 = rbTextures[owner.PlayerSlotIndex + 1][10].Last();
									}
									string text2 = text;
									int key2 = i + 1;
									if (text == "Anim")
									{
										key2 = 3;
									}
									if (text == "Turret")
									{
										key2 = 3;
									}
									if (text == "Target")
									{
										key2 = 6;
									}
									_ = "slot" + (((Item)item).Owner.PlayerSlotIndex + 1) + text2;
									Color val3 = colorList[key][key2];
									if (val3.r + val3.g + val3.b + val3.a == 0f)
									{
										Debug.Log(Object.op_Implicit("RainbowGuns - " + ((Object)componentsInChild).name + " not getting textures due to 0,0,0,0"));
										flag2 = true;
									}
									if (flag2)
									{
										continue;
									}
									foreach (MeshRenderer component in ((Component)componentsInChild).gameObject.GetComponents<MeshRenderer>())
									{
										((Renderer)component).material.SetTexture("_MainTex", (Texture)(object)val2);
										((Renderer)component).material.color = val3;
										foreach (Material item2 in (Il2CppArrayBase<Material>)(object)((Renderer)component).materials)
										{
											item2.SetTexture("_MainTex", (Texture)(object)val2);
											item2.color = val3;
										}
									}
								}
							}
						}
					}
					yield return (object)new WaitForSeconds(1f);
				}
			}

			public static void ColorMe(ItemEquippable __instance)
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Invalid comparison between Unknown and I4
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Invalid comparison between Unknown and I4
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Invalid comparison between Unknown and I4
				//IL_0045: Invalid comparison between Unknown and I4
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_016b: Expected O, but got Unknown
				//IL_016b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Unknown result type (might be due to invalid IL or missing references)
				//IL_0657: Unknown result type (might be due to invalid IL or missing references)
				//IL_065c: Unknown result type (might be due to invalid IL or missing references)
				//IL_065e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0665: Unknown result type (might be due to invalid IL or missing references)
				//IL_066d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0675: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0840: Unknown result type (might be due to invalid IL or missing references)
				//IL_084e: Unknown result type (might be due to invalid IL or missing references)
				//IL_085d: Unknown result type (might be due to invalid IL or missing references)
				//IL_086c: Unknown result type (might be due to invalid IL or missing references)
				//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0743: Unknown result type (might be due to invalid IL or missing references)
				//IL_0751: Unknown result type (might be due to invalid IL or missing references)
				//IL_0760: Unknown result type (might be due to invalid IL or missing references)
				//IL_076f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0735: Unknown result type (might be due to invalid IL or missing references)
				//IL_0990: Unknown result type (might be due to invalid IL or missing references)
				//IL_099e: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_07df: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0815: Unknown result type (might be due to invalid IL or missing references)
				//IL_09f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a37: Unknown result type (might be due to invalid IL or missing references)
				Debug.Log(Object.op_Implicit("RainbowGuns - weapon " + ((Object)((Component)__instance).gameObject).name + " gets a proud paint-job!"));
				InventorySlot slot = ((Item)__instance).pItemData.slot;
				int key = 0;
				if ((int)slot == 10)
				{
					key = 1;
				}
				if ((int)slot == 1)
				{
					key = 2;
				}
				if ((int)slot == 2)
				{
					key = 3;
				}
				if ((int)slot == 3)
				{
					key = 4;
				}
				pyssyt[((Item)__instance).Owner.PlayerSlotIndex + 1][key] = false;
				PlayerAgent owner = ((Item)__instance).Owner;
				int key2 = owner.PlayerSlotIndex + 1;
				foreach (Transform componentsInChild in ((Component)__instance).GetComponentsInChildren<Transform>())
				{
					string[] array = new string[14]
					{
						"Front", "Mag", "Receiver", "Sight", "Stock", "Grip", "Handle", "Neck", "Pommel", "Head",
						"Anim", "Turret", "Target", "Holo"
					};
					for (int i = 0; i < array.Length; i++)
					{
						string text = array[i];
						if (!((Object)componentsInChild).name.Contains(text, StringComparison.OrdinalIgnoreCase))
						{
							continue;
						}
						foreach (MeshRenderer component in ((Component)componentsInChild).GetComponents<MeshRenderer>())
						{
							bool flag = false;
							Texture2D val = new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height);
							Color black = Color.black;
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "align", RegexOptions.IgnoreCase).Success)
							{
								flag = true;
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "_sight", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][11].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^front", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][1].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "mag", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][2].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^receiver", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "anim", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^turret", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][3].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^sight", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "light", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "target", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][4].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^stock", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][5].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^grip", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][6].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "handle", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][7].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^neck", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][8].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^pommel", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][9].Last();
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "^head", RegexOptions.IgnoreCase).Success)
							{
								val = rbTextures[owner.PlayerSlotIndex + 1][10].Last();
							}
							int num = i + 1;
							if (text == "Anim")
							{
								num = 3;
							}
							if (text == "Turret")
							{
								num = 3;
							}
							if (text == "Target")
							{
								num = 6;
							}
							if (text == "holo")
							{
								num = 11;
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "iron", RegexOptions.IgnoreCase).Success)
							{
								num = 11;
							}
							if (Regex.Match(((Object)((Renderer)component).material).name.ToLower(), "pistol_sight", RegexOptions.IgnoreCase).Success)
							{
								num = 11;
							}
							if (Regex.Match(((Object)((Renderer)component).material).name.ToLower(), "emissive", RegexOptions.IgnoreCase).Success)
							{
								num = 11;
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "glass", RegexOptions.IgnoreCase).Success)
							{
								num = 12;
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "holo", RegexOptions.IgnoreCase).Success)
							{
								num = 12;
							}
							if (Regex.Match(((Object)componentsInChild).name.ToLower(), "_picture", RegexOptions.IgnoreCase).Success)
							{
								num = 12;
							}
							black = colorList[key2][num];
							float num2 = black.r + black.g + black.b + black.a;
							if (num2 == 0f)
							{
								Debug.Log(Object.op_Implicit("RainbowGuns - part " + ((Object)componentsInChild).name + " not getting textures due to 0,0,0,0"));
								flag = true;
							}
							if (flag)
							{
								continue;
							}
							if (num > 11)
							{
								Dictionary<int, Color> dictionary = colorList[owner.PlayerSlotIndex + 1];
								num2 = dictionary[12].r + dictionary[12].g + dictionary[12].b + dictionary[12].a;
								if (num2 > 0f)
								{
									((Renderer)component).material.SetColor("_ReticuleColorA", colorList[owner.PlayerSlotIndex + 1][12]);
								}
								num2 = dictionary[13].r + dictionary[13].g + dictionary[13].b + dictionary[13].a;
								if (num2 > 0f)
								{
									((Renderer)component).material.SetColor("_ReticuleColorB", colorList[owner.PlayerSlotIndex + 1][13]);
								}
								num2 = dictionary[14].r + dictionary[14].g + dictionary[14].b + dictionary[14].a;
								if (num2 > 0f)
								{
									((Renderer)component).material.SetColor("_ReticuleColorC", colorList[owner.PlayerSlotIndex + 1][14]);
								}
							}
							if (num == 11)
							{
								Dictionary<int, Color> dictionary2 = colorList[owner.PlayerSlotIndex + 1];
								num2 = dictionary2[11].r + dictionary2[11].g + dictionary2[11].b + dictionary2[11].a;
								Debug.Log(Object.op_Implicit($"RainbowGuns - iron colors {colorList[owner.PlayerSlotIndex + 1][11]}"));
								if (num2 > 0f)
								{
									((Renderer)component).material.SetColor("_EmissiveColor", colorList[owner.PlayerSlotIndex + 1][11]);
								}
								if (num2 > 0f)
								{
									((Renderer)component).material.SetTexture("_MainTex", (Texture)(object)Texture2D.grayTexture);
								}
								if (num2 > 0f)
								{
									((Renderer)component).material.SetTexture("_BumpMap", (Texture)(object)Texture2D.grayTexture);
								}
								if (num2 > 0f)
								{
									((Renderer)component).material.SetTexture("_MetallicGlossMap", (Texture)(object)Texture2D.grayTexture);
								}
								if (num2 > 0f)
								{
									((Renderer)component).material.SetTexture("_EmissiveMap", (Texture)(object)Texture2D.grayTexture);
								}
							}
							if (num >= 11)
							{
								continue;
							}
							Dictionary<int, Color> dictionary3 = colorList[owner.PlayerSlotIndex + 1];
							num2 = dictionary3[num].r + dictionary3[num].g + dictionary3[num].b + dictionary3[num].a;
							if (num2 > 0f)
							{
								((Renderer)component).material.SetTexture("_MainTex", (Texture)(object)val);
							}
							if (num2 > 0f)
							{
								((Renderer)component).material.color = black;
							}
							foreach (Material item in (Il2CppArrayBase<Material>)(object)((Renderer)component).materials)
							{
								if (num2 > 0f)
								{
									item.SetTexture("_MainTex", (Texture)(object)val);
								}
								if (num2 > 0f)
								{
									item.color = black;
								}
							}
						}
					}
				}
			}
		}

		[HarmonyPatch]
		private class RainbowPatch1
		{
			[HarmonyPatch(typeof(ItemEquippable), "OnWield")]
			[HarmonyPrefix]
			private static bool Prefix(ItemEquippable __instance)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Invalid comparison between Unknown and I4
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Invalid comparison between Unknown and I4
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				//IL_0021: Invalid comparison between Unknown and I4
				InventorySlot slot = ((Item)__instance).pItemData.slot;
				int num = 0;
				if ((int)slot == 10)
				{
					num = 1;
				}
				if ((int)slot == 1)
				{
					num = 2;
				}
				if ((int)slot == 2)
				{
					num = 3;
				}
				if ((int)slot == 3)
				{
					num = 4;
				}
				if (num > 0 && !pyssyt[((Item)__instance).Owner.PlayerSlotIndex + 1][num])
				{
					return true;
				}
				if (num == 0)
				{
					return true;
				}
				RainbowGuns.ColorMe(__instance);
				return true;
			}
		}

		public static Dictionary<int, Dictionary<int, bool>> pyssyt = new Dictionary<int, Dictionary<int, bool>>
		{
			[1] = new Dictionary<int, bool>
			{
				[1] = true,
				[2] = true,
				[3] = true,
				[4] = true
			},
			[2] = new Dictionary<int, bool>
			{
				[1] = true,
				[2] = true,
				[3] = true,
				[4] = true
			},
			[3] = new Dictionary<int, bool>
			{
				[1] = true,
				[2] = true,
				[3] = true,
				[4] = true
			},
			[4] = new Dictionary<int, bool>
			{
				[1] = true,
				[2] = true,
				[3] = true,
				[4] = true
			}
		};

		public static bool SendNow = true;

		public static string CONFIG_PATH = Path.Combine(Paths.ConfigPath, "RainbowGuns.cfg");

		public static string PLUGIN_PATH = Paths.PluginPath;

		public static ConfigFile config = new ConfigFile(CONFIG_PATH, true);

		public static ConfigEntry<string> _cfgFront;

		public static ConfigEntry<string> _cfgMag;

		public static ConfigEntry<string> _cfgReceiver;

		public static ConfigEntry<string> _cfgSight;

		public static ConfigEntry<string> _cfgStock;

		public static ConfigEntry<string> _cfgGrip;

		public static ConfigEntry<string> _cfgHandle;

		public static ConfigEntry<string> _cfgNeck;

		public static ConfigEntry<string> _cfgPommel;

		public static ConfigEntry<string> _cfgHead;

		public static ConfigEntry<string> _cfgIron;

		public static ConfigEntry<string> _cfgRetA;

		public static ConfigEntry<string> _cfgRetB;

		public static ConfigEntry<string> _cfgRetC;

		public static Dictionary<int, Dictionary<int, List<Texture2D>>> rbTextures = new Dictionary<int, Dictionary<int, List<Texture2D>>>
		{
			[1] = new Dictionary<int, List<Texture2D>>
			{
				[1] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[2] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[3] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[4] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[5] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[6] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[7] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[8] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[9] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[10] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[11] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[12] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[13] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[14] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				}
			},
			[2] = new Dictionary<int, List<Texture2D>>
			{
				[1] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[2] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[3] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[4] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[5] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[6] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[7] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[8] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[9] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[10] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[11] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[12] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[13] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[14] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				}
			},
			[3] = new Dictionary<int, List<Texture2D>>
			{
				[1] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[2] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[3] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[4] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[5] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[6] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[7] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[8] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[9] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[10] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[11] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[12] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[13] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[14] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				}
			},
			[4] = new Dictionary<int, List<Texture2D>>
			{
				[1] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[2] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[3] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[4] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[5] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[6] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[7] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[8] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[9] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[10] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[11] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[12] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[13] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				},
				[14] = new List<Texture2D>
				{
					new Texture2D(((Texture)Texture2D.redTexture).width, ((Texture)Texture2D.redTexture).height)
				}
			}
		};

		private static int[] tempraw = new int[4];

		public static Dictionary<int, int[]> raakaList = new Dictionary<int, int[]> { [1] = tempraw };

		public static Dictionary<int, Dictionary<int, Color>> colorList = new Dictionary<int, Dictionary<int, Color>>
		{
			[1] = new Dictionary<int, Color> { [1] = Color.black },
			[2] = new Dictionary<int, Color> { [1] = Color.black },
			[3] = new Dictionary<int, Color> { [1] = Color.black },
			[4] = new Dictionary<int, Color> { [1] = Color.black }
		};

		public static List<string> ledger = new List<string>();

		public override void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_0089: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00bc: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_00ef: Expected O, but got Unknown
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_0122: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Expected O, but got Unknown
			//IL_0155: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0188: Expected O, but got Unknown
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			//IL_01bb: Expected O, but got Unknown
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Expected O, but got Unknown
			//IL_01ee: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Expected O, but got Unknown
			//IL_0221: Expected O, but got Unknown
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Expected O, but got Unknown
			//IL_0254: Expected O, but got Unknown
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Expected O, but got Unknown
			//IL_0287: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Expected O, but got Unknown
			//IL_02ba: Expected O, but got Unknown
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Expected O, but got Unknown
			//IL_02ed: Expected O, but got Unknown
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Expected O, but got Unknown
			//IL_0320: Expected O, but got Unknown
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Expected O, but got Unknown
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("RainbowGuns").PatchAll();
			Debug.Log(Object.op_Implicit("RainbowGuns - i bring you love"));
			LG_Factory.OnFactoryBuildStart += Action.op_Implicit((Action)RainbowGuns.Send);
			EventAPI.OnExpeditionStarted += RainbowGuns.Begin;
			NetworkAPI.RegisterEvent<RainbowNetInfo>(RainbowNetInfo.NetworkIdentity, (Action<ulong, RainbowNetInfo>)RainbowGuns.ReceiveRainbowNetInfo);
			_cfgFront = config.Bind<string>(new ConfigDefinition("General", "Front"), "0, 0, 0, 0", new ConfigDescription("Front color (unity Color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgMag = config.Bind<string>(new ConfigDefinition("General", "Mag"), "0, 0, 0, 0", new ConfigDescription("Mag color (unity Color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgReceiver = config.Bind<string>(new ConfigDefinition("General", "Receiver"), "0, 0, 0, 0", new ConfigDescription("Receiver color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgSight = config.Bind<string>(new ConfigDefinition("General", "Sight"), "0, 0, 0, 0", new ConfigDescription("Sight color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgStock = config.Bind<string>(new ConfigDefinition("General", "Stock"), "0, 0, 0, 0", new ConfigDescription("Stock color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgGrip = config.Bind<string>(new ConfigDefinition("General", "Grip"), "0, 0, 0, 0", new ConfigDescription("Grip color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgHandle = config.Bind<string>(new ConfigDefinition("General", "Handle"), "0, 0, 0, 0", new ConfigDescription("Melee Handle color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgNeck = config.Bind<string>(new ConfigDefinition("General", "Neck"), "0, 0, 0, 0", new ConfigDescription("Melee Neck color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgPommel = config.Bind<string>(new ConfigDefinition("General", "Pommel"), "0, 0, 0, 0", new ConfigDescription("Melee Pommel color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgHead = config.Bind<string>(new ConfigDefinition("General", "Head"), "0, 0, 0, 0", new ConfigDescription("Melee Head color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgIron = config.Bind<string>(new ConfigDefinition("General", "Iron"), "0, 0, 0, 0", new ConfigDescription("Iron Sights color (unity color r,g,b,a values 0-255 no decimals, WEIRD SHADER STUFF GOING ON, DIFF GUNS SHOW DIFF COLORS!)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgRetA = config.Bind<string>(new ConfigDefinition("General", "RetA"), "0, 0, 0, 0", new ConfigDescription("ADS sights Reticule A color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgRetB = config.Bind<string>(new ConfigDefinition("General", "RetB"), "0, 0, 0, 0", new ConfigDescription("ADS sights Reticule B color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			_cfgRetC = config.Bind<string>(new ConfigDefinition("General", "RetC"), "0, 0, 0, 0", new ConfigDescription("ADS sights Reticule C color (unity color r,g,b,a values 0-255 no decimals, default value is same as do not recolor)", (AcceptableValueBase)null, Array.Empty<object>()));
			LiveEditListener obj = LiveEdit.CreateListener(Paths.ConfigPath, "RainbowGuns.cfg", false);
			obj.FileChangedEventCooldown = 0.75f;
			obj.FileChanged += new LiveEditEventHandler(RainbowGuns.OnFileChanged);
			Dictionary<int, string> obj2 = new Dictionary<int, string>
			{
				[1] = _cfgFront.Value,
				[2] = _cfgMag.Value,
				[3] = _cfgReceiver.Value,
				[4] = _cfgSight.Value,
				[5] = _cfgStock.Value,
				[6] = _cfgGrip.Value,
				[7] = _cfgHandle.Value,
				[8] = _cfgNeck.Value,
				[9] = _cfgPommel.Value,
				[10] = _cfgHead.Value,
				[11] = _cfgIron.Value,
				[12] = _cfgRetA.Value,
				[13] = _cfgRetB.Value,
				[14] = _cfgRetC.Value
			};
			Dictionary<int, Color> dictionary = new Dictionary<int, Color>();
			foreach (KeyValuePair<int, string> item in obj2)
			{
				string[] array = item.Value.Split(",");
				float num = 0f;
				float num2 = 0f;
				float num3 = 0f;
				float num4 = 0f;
				int.TryParse(array[0], out var result);
				int.TryParse(array[1], out var result2);
				int.TryParse(array[2], out var result3);
				int.TryParse(array[3], out var result4);
				if (result > 0)
				{
					num = (float)result / 255f;
				}
				if (result2 > 0)
				{
					num2 = (float)result2 / 255f;
				}
				if (result3 > 0)
				{
					num3 = (float)result3 / 255f;
				}
				if (result4 > 0)
				{
					num4 = (float)result4 / 255f;
				}
				int[] value = new int[4] { result, result2, result3, result4 };
				raakaList[item.Key] = value;
				dictionary[item.Key] = new Color(num, num2, num3, num4);
			}
			for (int i = 0; i < ((Texture)Texture2D.redTexture).height; i++)
			{
				for (int j = 0; j < ((Texture)Texture2D.redTexture).width; j++)
				{
					for (int k = 1; k < 5; k++)
					{
						for (int l = 1; l < 15; l++)
						{
							rbTextures[k][l].Last().SetPixel(j, i, dictionary[l]);
						}
					}
				}
			}
			for (int m = 1; m < 5; m++)
			{
				for (int n = 1; n < 15; n++)
				{
					colorList[m][n] = dictionary[n];
					rbTextures[m][n].Last().Apply();
				}
			}
		}
	}
	[GeneratedCode("VersionInfoGenerator", "2.0.0+git50a4b1a-master")]
	[CompilerGenerated]
	internal static class VersionInfo
	{
		public const string RootNamespace = "RainbowGuns";

		public const string Version = "1.0.0";

		public const string VersionPrerelease = null;

		public const string VersionMetadata = null;

		public const string SemVer = "1.0.0";

		public const string GitRevShort = null;

		public const string GitRevLong = null;

		public const string GitBranch = null;

		public const string GitTag = null;

		public const bool GitIsDirty = false;
	}
}