Decompiled source of LLBModdingLib v0.10.4
plugins/LLBModdingLib/LLBModdingLib.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using B83.Image; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DDSLoader; using GameplayEntities; using HarmonyLib; using LLBML.GameEvents; using LLBML.Math; using LLBML.Messages; using LLBML.Networking; using LLBML.Players; using LLBML.States; using LLBML.UI; using LLBML.Utils; using LLGUI; using LLHandlers; using LLScreen; using Multiplayer; using Steamworks; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyTitle("LLBModdingLib (fr.glomzubuk.plugins.llb.llbml)")] [assembly: AssemblyProduct("LLBModdingLib")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.10.4.0")] [module: UnverifiableCode] namespace DDSLoader { public static class DDSUnityExtensions { public static TextureFormat GetTextureFormat(this DDSImage image) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (image.HasFourCC) { FourCC pixelFormatFourCC = image.GetPixelFormatFourCC(); if (pixelFormatFourCC == "DXT1") { return (TextureFormat)10; } if (pixelFormatFourCC == "DXT5") { return (TextureFormat)12; } throw new UnityException("Unsupported PixelFormat! " + pixelFormatFourCC.ToString()); } throw new UnityException("Unsupported Format!"); } } public class DDSImage { public struct DDSHeader { public uint magicWord; public uint size; public HeaderFlags Flags; public uint Height; public uint Width; public uint PitchOrLinearSize; public uint Depth; public uint MipMapCount; public uint Reserved1; public uint Reserved2; public uint Reserved3; public uint Reserved4; public uint Reserved5; public uint Reserved6; public uint Reserved7; public uint Reserved8; public uint Reserved9; public uint Reserved10; public uint Reserved11; public DDSPixelFormat PixelFormat; public uint dwCaps; public uint dwCaps2; public uint dwCaps3; public uint dwCaps4; public uint dwReserved2; public bool IsValid => magicWord == 542327876; public bool SizeCheck() { return size == 124; } } public struct DDSPixelFormat { public uint size; public PixelFormatFlags dwFlags; public uint FourCC; public uint dwRGBBitCount; public uint dwRBitMask; public uint dwGBitMask; public uint dwBBitMask; public uint dwABitMask; public bool SizeCheck() { return size == 32; } } [Flags] public enum HeaderFlags { CAPS = 1, HEIGHT = 2, WIDTH = 4, PITCH = 8, PIXELFORMAT = 0x1000, MIPMAPCOUNT = 0x20000, LINEARSIZE = 0x80000, DEPTH = 0x800000, TEXTURE = 0x1007 } [Flags] public enum PixelFormatFlags { ALPHAPIXELS = 1, ALPHA = 2, FOURCC = 4, RGB = 0x40, YUV = 0x200, LUMINANCE = 0x20000 } private static readonly int HeaderSize = 128; private DDSHeader _header; private byte[] rawData; public DDSHeader Header => _header; public HeaderFlags headerFlags => Header.Flags; public bool IsValid { get { if (Header.IsValid) { return Header.SizeCheck(); } return false; } } public bool HasHeight => CheckFlag(HeaderFlags.HEIGHT); public int Height => (int)Header.Height; public bool HasWidth => CheckFlag(HeaderFlags.WIDTH); public int Width => (int)Header.Width; public bool HasDepth => CheckFlag(HeaderFlags.DEPTH); public int Depth => (int)Header.Depth; public int MipMapCount => (int)Header.MipMapCount; public bool HasFourCC => Header.PixelFormat.dwFlags == PixelFormatFlags.FOURCC; public bool IsUncompressedRGB => Header.PixelFormat.dwFlags == PixelFormatFlags.RGB; private bool CheckFlag(HeaderFlags flag) { return (Header.Flags & flag) == flag; } public DDSImage(byte[] rawData) { this.rawData = rawData; _header = ByteArrayToStructure<DDSHeader>(rawData); } public FourCC GetPixelFormatFourCC() { return new FourCC(Header.PixelFormat.FourCC); } public byte[] GetTextureData() { byte[] array = new byte[rawData.Length - HeaderSize]; GetRGBData(array); return array; } public void GetRGBData(byte[] rgbData) { Buffer.BlockCopy(rawData, HeaderSize, rgbData, 0, rgbData.Length); } private static T ByteArrayToStructure<T>(byte[] bytes) where T : struct { GCHandle gCHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); try { return (T)Marshal.PtrToStructure(gCHandle.AddrOfPinnedObject(), typeof(T)); } finally { gCHandle.Free(); } } } public struct FourCC { private readonly uint valueDWord; private readonly string valueString; public FourCC(uint value) { valueDWord = value; valueString = new string(new char[4] { (char)(value & 0xFFu), (char)((value & 0xFF00) >> 8), (char)((value & 0xFF0000) >> 16), (char)((value & 0xFF000000u) >> 24) }); } public FourCC(string value) { if (value == null) { throw new Exception(); } if (value.Length > 4) { throw new Exception(); } if (value.Any((char c) => ' ' > c || c > '~')) { throw new Exception(); } valueString = value.PadRight(4); valueDWord = valueString[0] + ((uint)valueString[1] << 8) + ((uint)valueString[2] << 16) + ((uint)valueString[3] << 24); } public override string ToString() { if (!valueString.All((char c) => ' ' <= c && c <= '~')) { uint num = valueDWord; return num.ToString("X8"); } return valueString; } public override int GetHashCode() { uint num = valueDWord; return num.GetHashCode(); } public override bool Equals(object obj) { if (obj is FourCC) { return (FourCC)obj == this; } return base.Equals(obj); } public static implicit operator FourCC(uint value) { return new FourCC(value); } public static implicit operator FourCC(string value) { return new FourCC(value); } public static explicit operator uint(FourCC value) { return value.valueDWord; } public static explicit operator string(FourCC value) { return value.valueString; } public static bool operator ==(FourCC value1, FourCC value2) { return value1.valueDWord == value2.valueDWord; } public static bool operator !=(FourCC value1, FourCC value2) { return !(value1 == value2); } } } namespace B83.Image { public enum EPNGChunkType : uint { IHDR = 1229472850u, sRBG = 1934772034u, gAMA = 1732332865u, cHRM = 1665684045u, pHYs = 1883789683u, IDAT = 1229209940u, IEND = 1229278788u } public class PNGFile { public static ulong m_Signature = 9894494448401390090uL; public ulong Signature; public List<PNGChunk> chunks; public int FindChunk(EPNGChunkType aType, int aStartIndex = 0) { if (chunks == null) { return -1; } for (int i = aStartIndex; i < chunks.Count; i++) { if (chunks[i].type == aType) { return i; } } return -1; } } public class PNGChunk { public uint length; public EPNGChunkType type; public byte[] data; public uint crc; public uint CalcCRC() { return PNGTools.UpdateCRC(PNGTools.UpdateCRC(uint.MaxValue, (uint)type), data) ^ 0xFFFFFFFFu; } } public class PNGTools { private static uint[] crc_table; static PNGTools() { crc_table = new uint[256]; for (int i = 0; i < 256; i++) { uint num = (uint)i; for (int j = 0; j < 8; j++) { num = (((num & 1) == 0) ? (num >> 1) : (0xEDB88320u ^ (num >> 1))); } crc_table[i] = num; } } public static uint UpdateCRC(uint crc, byte aData) { return crc_table[(crc ^ aData) & 0xFF] ^ (crc >> 8); } public static uint UpdateCRC(uint crc, uint aData) { crc = crc_table[(crc ^ ((aData >> 24) & 0xFF)) & 0xFF] ^ (crc >> 8); crc = crc_table[(crc ^ ((aData >> 16) & 0xFF)) & 0xFF] ^ (crc >> 8); crc = crc_table[(crc ^ ((aData >> 8) & 0xFF)) & 0xFF] ^ (crc >> 8); crc = crc_table[(crc ^ (aData & 0xFF)) & 0xFF] ^ (crc >> 8); return crc; } public static uint UpdateCRC(uint crc, byte[] buf) { for (int i = 0; i < buf.Length; i++) { crc = crc_table[(crc ^ buf[i]) & 0xFF] ^ (crc >> 8); } return crc; } public static uint CalculateCRC(byte[] aBuf) { return UpdateCRC(uint.MaxValue, aBuf) ^ 0xFFFFFFFFu; } public static List<PNGChunk> ReadChunks(BinaryReader aReader) { List<PNGChunk> list = new List<PNGChunk>(); while (aReader.BaseStream.Position < aReader.BaseStream.Length - 4) { PNGChunk pNGChunk = new PNGChunk(); pNGChunk.length = aReader.ReadUInt32BE(); if (aReader.BaseStream.Position >= aReader.BaseStream.Length - 4 - pNGChunk.length) { break; } list.Add(pNGChunk); pNGChunk.type = (EPNGChunkType)aReader.ReadUInt32BE(); pNGChunk.data = aReader.ReadBytes((int)pNGChunk.length); pNGChunk.crc = aReader.ReadUInt32BE(); uint num = pNGChunk.CalcCRC(); if ((pNGChunk.crc ^ num) != 0) { Debug.Log((object)("Chunk CRC wrong. Got 0x" + pNGChunk.crc.ToString("X8") + " expected 0x" + num.ToString("X8"))); } if (pNGChunk.type == EPNGChunkType.IEND) { break; } } return list; } public static PNGFile ReadPNGFile(BinaryReader aReader) { if (aReader == null || aReader.BaseStream.Position >= aReader.BaseStream.Length - 8) { return null; } return new PNGFile { Signature = aReader.ReadUInt64BE(), chunks = ReadChunks(aReader) }; } public static void WritePNGFile(PNGFile aFile, BinaryWriter aWriter) { aWriter.WriteUInt64BE(PNGFile.m_Signature); foreach (PNGChunk chunk in aFile.chunks) { aWriter.WriteUInt32BE((uint)chunk.data.Length); aWriter.WriteUInt32BE((uint)chunk.type); aWriter.Write(chunk.data); aWriter.WriteUInt32BE(chunk.crc); } } public static void SetPPM(PNGFile aFile, uint aXPPM, uint aYPPM) { int num = aFile.FindChunk(EPNGChunkType.pHYs); PNGChunk pNGChunk; if (num > 0) { pNGChunk = aFile.chunks[num]; if (pNGChunk.data == null || pNGChunk.data.Length < 9) { throw new Exception("PNG: pHYs chunk data size is too small. It should be at least 9 bytes"); } } else { pNGChunk = new PNGChunk(); pNGChunk.type = EPNGChunkType.pHYs; pNGChunk.length = 9u; pNGChunk.data = new byte[9]; aFile.chunks.Insert(1, pNGChunk); } byte[] data = pNGChunk.data; data[0] = (byte)((aXPPM >> 24) & 0xFFu); data[1] = (byte)((aXPPM >> 16) & 0xFFu); data[2] = (byte)((aXPPM >> 8) & 0xFFu); data[3] = (byte)(aXPPM & 0xFFu); data[4] = (byte)((aYPPM >> 24) & 0xFFu); data[5] = (byte)((aYPPM >> 16) & 0xFFu); data[6] = (byte)((aYPPM >> 8) & 0xFFu); data[7] = (byte)(aYPPM & 0xFFu); data[8] = 1; pNGChunk.crc = pNGChunk.CalcCRC(); } public static byte[] ChangePPM(byte[] aPNGData, uint aXPPM, uint aYPPM) { PNGFile aFile; using (MemoryStream input = new MemoryStream(aPNGData)) { using BinaryReader aReader = new BinaryReader(input); aFile = ReadPNGFile(aReader); } SetPPM(aFile, aXPPM, aYPPM); using MemoryStream memoryStream = new MemoryStream(); using BinaryWriter aWriter = new BinaryWriter(memoryStream); WritePNGFile(aFile, aWriter); return memoryStream.ToArray(); } public static byte[] ChangePPI(byte[] aPNGData, float aXPPI, float aYPPI) { return ChangePPM(aPNGData, (uint)(aXPPI * 39.3701f), (uint)(aYPPI * 39.3701f)); } } public static class BinaryReaderWriterExt { public static uint ReadUInt32BE(this BinaryReader aReader) { return (uint)((aReader.ReadByte() << 24) | (aReader.ReadByte() << 16) | (aReader.ReadByte() << 8) | aReader.ReadByte()); } public static ulong ReadUInt64BE(this BinaryReader aReader) { return ((ulong)aReader.ReadUInt32BE() << 32) | aReader.ReadUInt32BE(); } public static void WriteUInt32BE(this BinaryWriter aWriter, uint aValue) { aWriter.Write((byte)((aValue >> 24) & 0xFFu)); aWriter.Write((byte)((aValue >> 16) & 0xFFu)); aWriter.Write((byte)((aValue >> 8) & 0xFFu)); aWriter.Write((byte)(aValue & 0xFFu)); } public static void WriteUInt64BE(this BinaryWriter aWriter, ulong aValue) { aWriter.WriteUInt32BE((uint)(aValue >> 32)); aWriter.WriteUInt32BE((uint)aValue); } } } namespace TarUtils { public class TarUtils { public static void ExtractTarGz(string filename, string outputDir) { using FileStream stream = File.OpenRead(filename); ExtractTarGz(stream, outputDir); } public static void ExtractTarGz(Stream stream, string outputDir) { using GZipStream gZipStream = new GZipStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); byte[] buffer = new byte[4096]; int num; do { num = gZipStream.Read(buffer, 0, 4096); memoryStream.Write(buffer, 0, num); } while (num == 4096); memoryStream.Seek(0L, SeekOrigin.Begin); ExtractTar(memoryStream, outputDir); } public static void ExtractTar(string filename, string outputDir) { using FileStream stream = File.OpenRead(filename); ExtractTar(stream, outputDir); } public static void ExtractTar(Stream stream, string outputDir) { byte[] array = new byte[100]; while (true) { stream.Read(array, 0, 100); string text = Encoding.ASCII.GetString(array).Trim(new char[1]); if (string.IsNullOrEmpty(text)) { break; } stream.Seek(24L, SeekOrigin.Current); stream.Read(array, 0, 12); long num = Convert.ToInt64(Encoding.UTF8.GetString(array, 0, 12).Trim(new char[1]).Trim(), 8); stream.Seek(376L, SeekOrigin.Current); string path = Path.Combine(outputDir, text); if (!Directory.Exists(Path.GetDirectoryName(path))) { Directory.CreateDirectory(Path.GetDirectoryName(path)); } if (!text.EndsWith("/")) { using FileStream fileStream = File.Open(path, FileMode.OpenOrCreate, FileAccess.Write); byte[] array2 = new byte[num]; stream.Read(array2, 0, array2.Length); fileStream.Write(array2, 0, array2.Length); } long position = stream.Position; long num2 = 512 - position % 512; if (num2 == 512) { num2 = 0L; } stream.Seek(num2, SeekOrigin.Current); } } } } namespace TinyJson { public static class JSONParser { [ThreadStatic] private static Stack<List<string>> splitArrayPool; [ThreadStatic] private static StringBuilder stringBuilder; [ThreadStatic] private static Dictionary<Type, Dictionary<string, FieldInfo>> fieldInfoCache; [ThreadStatic] private static Dictionary<Type, Dictionary<string, PropertyInfo>> propertyInfoCache; public static T FromJson<T>(this string json) { if (propertyInfoCache == null) { propertyInfoCache = new Dictionary<Type, Dictionary<string, PropertyInfo>>(); } if (fieldInfoCache == null) { fieldInfoCache = new Dictionary<Type, Dictionary<string, FieldInfo>>(); } if (stringBuilder == null) { stringBuilder = new StringBuilder(); } if (splitArrayPool == null) { splitArrayPool = new Stack<List<string>>(); } stringBuilder.Length = 0; for (int i = 0; i < json.Length; i++) { char c = json[i]; if (c == '"') { i = AppendUntilStringEnd(appendEscapeCharacter: true, i, json); } else if (!char.IsWhiteSpace(c)) { stringBuilder.Append(c); } } return (T)ParseValue(typeof(T), stringBuilder.ToString()); } private static int AppendUntilStringEnd(bool appendEscapeCharacter, int startIdx, string json) { stringBuilder.Append(json[startIdx]); for (int i = startIdx + 1; i < json.Length; i++) { if (json[i] == '\\') { if (appendEscapeCharacter) { stringBuilder.Append(json[i]); } stringBuilder.Append(json[i + 1]); i++; } else { if (json[i] == '"') { stringBuilder.Append(json[i]); return i; } stringBuilder.Append(json[i]); } } return json.Length - 1; } private static List<string> Split(string json) { List<string> list = ((splitArrayPool.Count > 0) ? splitArrayPool.Pop() : new List<string>()); list.Clear(); if (json.Length == 2) { return list; } int num = 0; stringBuilder.Length = 0; for (int i = 1; i < json.Length - 1; i++) { switch (json[i]) { case '[': case '{': num++; break; case ']': case '}': num--; break; case '"': i = AppendUntilStringEnd(appendEscapeCharacter: true, i, json); continue; case ',': case ':': if (num == 0) { list.Add(stringBuilder.ToString()); stringBuilder.Length = 0; continue; } break; } stringBuilder.Append(json[i]); } list.Add(stringBuilder.ToString()); return list; } internal static object ParseValue(Type type, string json) { if ((object)type == typeof(string)) { if (json.Length <= 2) { return string.Empty; } StringBuilder stringBuilder = new StringBuilder(json.Length); for (int i = 1; i < json.Length - 1; i++) { if (json[i] == '\\' && i + 1 < json.Length - 1) { int num = "\"\\nrtbf/".IndexOf(json[i + 1]); if (num >= 0) { stringBuilder.Append("\"\\\n\r\t\b\f/"[num]); i++; continue; } if (json[i + 1] == 'u' && i + 5 < json.Length - 1) { uint result = 0u; if (uint.TryParse(json.Substring(i + 2, 4), NumberStyles.AllowHexSpecifier, null, out result)) { stringBuilder.Append((char)result); i += 5; continue; } } } stringBuilder.Append(json[i]); } return stringBuilder.ToString(); } if (type.IsPrimitive) { return Convert.ChangeType(json, type, CultureInfo.InvariantCulture); } if ((object)type == typeof(decimal)) { decimal.TryParse(json, NumberStyles.Float, CultureInfo.InvariantCulture, out var result2); return result2; } if ((object)type == typeof(DateTime)) { DateTime.TryParse(json.Replace("\"", ""), CultureInfo.InvariantCulture, DateTimeStyles.None, out var result3); return result3; } if (json == "null") { return null; } if (type.IsEnum) { if (json[0] == '"') { json = json.Substring(1, json.Length - 2); } try { return Enum.Parse(type, json, ignoreCase: false); } catch { return 0; } } if (type.IsArray) { Type elementType = type.GetElementType(); if (json[0] != '[' || json[json.Length - 1] != ']') { return null; } List<string> list = Split(json); Array array = Array.CreateInstance(elementType, list.Count); for (int j = 0; j < list.Count; j++) { array.SetValue(ParseValue(elementType, list[j]), j); } splitArrayPool.Push(list); return array; } if (type.IsGenericType && (object)type.GetGenericTypeDefinition() == typeof(List<>)) { Type type2 = type.GetGenericArguments()[0]; if (json[0] != '[' || json[json.Length - 1] != ']') { return null; } List<string> list2 = Split(json); IList list3 = (IList)type.GetConstructor(new Type[1] { typeof(int) }).Invoke(new object[1] { list2.Count }); for (int k = 0; k < list2.Count; k++) { list3.Add(ParseValue(type2, list2[k])); } splitArrayPool.Push(list2); return list3; } if (TomlTypeConverter.CanConvert(type)) { if (json.Length <= 2) { return null; } return TomlTypeConverter.ConvertToValue(json.Substring(1, json.Length - 2), type); } if (type.IsGenericType && (object)type.GetGenericTypeDefinition() == typeof(Dictionary<, >)) { Type[] genericArguments = type.GetGenericArguments(); Type type3 = genericArguments[0]; Type type4 = genericArguments[1]; if ((object)type3 != typeof(string)) { return null; } if (json[0] != '{' || json[json.Length - 1] != '}') { return null; } List<string> list4 = Split(json); if (list4.Count % 2 != 0) { return null; } IDictionary dictionary = (IDictionary)type.GetConstructor(new Type[1] { typeof(int) }).Invoke(new object[1] { list4.Count / 2 }); for (int l = 0; l < list4.Count; l += 2) { if (list4[l].Length > 2) { string key = list4[l].Substring(1, list4[l].Length - 2); object value = ParseValue(type4, list4[l + 1]); dictionary[key] = value; } } return dictionary; } if ((object)type == typeof(object)) { return ParseAnonymousValue(json); } if (json[0] == '{' && json[json.Length - 1] == '}') { return ParseObject(type, json); } return null; } private static object ParseAnonymousValue(string json) { if (json.Length == 0) { return null; } if (json[0] == '{' && json[json.Length - 1] == '}') { List<string> list = Split(json); if (list.Count % 2 != 0) { return null; } Dictionary<string, object> dictionary = new Dictionary<string, object>(list.Count / 2); for (int i = 0; i < list.Count; i += 2) { dictionary[list[i].Substring(1, list[i].Length - 2)] = ParseAnonymousValue(list[i + 1]); } return dictionary; } if (json[0] == '[' && json[json.Length - 1] == ']') { List<string> list2 = Split(json); List<object> list3 = new List<object>(list2.Count); for (int j = 0; j < list2.Count; j++) { list3.Add(ParseAnonymousValue(list2[j])); } return list3; } if (json[0] == '"' && json[json.Length - 1] == '"') { return json.Substring(1, json.Length - 2).Replace("\\", string.Empty); } if (char.IsDigit(json[0]) || json[0] == '-') { if (json.Contains(".")) { double.TryParse(json, NumberStyles.Float, CultureInfo.InvariantCulture, out var result); return result; } int.TryParse(json, out var result2); return result2; } if (json == "true") { return true; } if (json == "false") { return false; } return null; } private static Dictionary<string, T> CreateMemberNameDictionary<T>(T[] members) where T : MemberInfo { Dictionary<string, T> dictionary = new Dictionary<string, T>(StringComparer.OrdinalIgnoreCase); foreach (T val in members) { if (val.IsDefined(typeof(IgnoreDataMemberAttribute), inherit: true)) { continue; } string name = val.Name; if (val.IsDefined(typeof(DataMemberAttribute), inherit: true)) { DataMemberAttribute dataMemberAttribute = (DataMemberAttribute)Attribute.GetCustomAttribute(val, typeof(DataMemberAttribute), inherit: true); if (!string.IsNullOrEmpty(dataMemberAttribute.Name)) { name = dataMemberAttribute.Name; } } dictionary.Add(name, val); } return dictionary; } private static object ParseObject(Type type, string json) { object uninitializedObject = FormatterServices.GetUninitializedObject(type); List<string> list = Split(json); if (list.Count % 2 != 0) { return uninitializedObject; } if (!fieldInfoCache.TryGetValue(type, out var value)) { value = CreateMemberNameDictionary(type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy)); fieldInfoCache.Add(type, value); } if (!propertyInfoCache.TryGetValue(type, out var value2)) { value2 = CreateMemberNameDictionary(type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy)); propertyInfoCache.Add(type, value2); } for (int i = 0; i < list.Count; i += 2) { if (list[i].Length > 2) { string key = list[i].Substring(1, list[i].Length - 2); string json2 = list[i + 1]; PropertyInfo value4; if (value.TryGetValue(key, out var value3)) { value3.SetValue(uninitializedObject, ParseValue(value3.FieldType, json2)); } else if (value2.TryGetValue(key, out value4)) { value4.SetValue(uninitializedObject, ParseValue(value4.PropertyType, json2), null); } } } return uninitializedObject; } } public static class JSONWriter { public static string ToJson(this object item) { StringBuilder stringBuilder = new StringBuilder(); AppendValue(stringBuilder, item); return stringBuilder.ToString(); } private static void AppendValue(StringBuilder stringBuilder, object item) { if (item == null) { stringBuilder.Append("null"); return; } Type type = item.GetType(); if ((object)type == typeof(string) || (object)type == typeof(char)) { stringBuilder.Append('"'); string text = item.ToString(); for (int i = 0; i < text.Length; i++) { if (text[i] < ' ' || text[i] == '"' || text[i] == '\\') { stringBuilder.Append('\\'); int num = "\"\\\n\r\t\b\f".IndexOf(text[i]); if (num >= 0) { stringBuilder.Append("\"\\nrtbf"[num]); } else { stringBuilder.AppendFormat("u{0:X4}", (uint)text[i]); } } else { stringBuilder.Append(text[i]); } } stringBuilder.Append('"'); return; } if ((object)type == typeof(byte) || (object)type == typeof(sbyte)) { stringBuilder.Append(item.ToString()); return; } if ((object)type == typeof(short) || (object)type == typeof(ushort)) { stringBuilder.Append(item.ToString()); return; } if ((object)type == typeof(int) || (object)type == typeof(uint)) { stringBuilder.Append(item.ToString()); return; } if ((object)type == typeof(long) || (object)type == typeof(ulong)) { stringBuilder.Append(item.ToString()); return; } if ((object)type == typeof(float)) { stringBuilder.Append(((float)item).ToString(CultureInfo.InvariantCulture)); return; } if ((object)type == typeof(double)) { stringBuilder.Append(((double)item).ToString(CultureInfo.InvariantCulture)); return; } if ((object)type == typeof(decimal)) { stringBuilder.Append(((decimal)item).ToString(CultureInfo.InvariantCulture)); return; } if ((object)type == typeof(bool)) { stringBuilder.Append(((bool)item) ? "true" : "false"); return; } if ((object)type == typeof(DateTime)) { stringBuilder.Append('"'); stringBuilder.Append(((DateTime)item).ToString(CultureInfo.InvariantCulture)); stringBuilder.Append('"'); return; } if (type.IsEnum) { stringBuilder.Append('"'); stringBuilder.Append(item.ToString()); stringBuilder.Append('"'); return; } if (item is IList) { stringBuilder.Append('['); bool flag = true; IList list = item as IList; for (int j = 0; j < list.Count; j++) { if (flag) { flag = false; } else { stringBuilder.Append(','); } AppendValue(stringBuilder, list[j]); } stringBuilder.Append(']'); return; } if (type.IsGenericType && (object)type.GetGenericTypeDefinition() == typeof(Dictionary<, >)) { if ((object)type.GetGenericArguments()[0] != typeof(string)) { stringBuilder.Append("{}"); return; } stringBuilder.Append('{'); IDictionary dictionary = item as IDictionary; bool flag2 = true; foreach (object key in dictionary.Keys) { if (flag2) { flag2 = false; } else { stringBuilder.Append(','); } stringBuilder.Append('"'); stringBuilder.Append((string)key); stringBuilder.Append("\":"); AppendValue(stringBuilder, dictionary[key]); } stringBuilder.Append('}'); return; } if (TomlTypeConverter.CanConvert(type)) { stringBuilder.Append('"'); stringBuilder.Append(TomlTypeConverter.ConvertToString(item, type)); stringBuilder.Append('"'); return; } stringBuilder.Append('{'); bool flag3 = true; FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy); for (int k = 0; k < fields.Length; k++) { if (fields[k].IsDefined(typeof(IgnoreDataMemberAttribute), inherit: true)) { continue; } object value = fields[k].GetValue(item); if (value != null) { if (flag3) { flag3 = false; } else { stringBuilder.Append(','); } stringBuilder.Append('"'); stringBuilder.Append(GetMemberName(fields[k])); stringBuilder.Append("\":"); AppendValue(stringBuilder, value); } } PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy); for (int l = 0; l < properties.Length; l++) { if (!properties[l].CanRead || properties[l].IsDefined(typeof(IgnoreDataMemberAttribute), inherit: true)) { continue; } object value2 = properties[l].GetValue(item, null); if (value2 != null) { if (flag3) { flag3 = false; } else { stringBuilder.Append(','); } stringBuilder.Append('"'); stringBuilder.Append(GetMemberName(properties[l])); stringBuilder.Append("\":"); AppendValue(stringBuilder, value2); } } stringBuilder.Append('}'); } private static string GetMemberName(MemberInfo member) { if (member.IsDefined(typeof(DataMemberAttribute), inherit: true)) { DataMemberAttribute dataMemberAttribute = (DataMemberAttribute)Attribute.GetCustomAttribute(member, typeof(DataMemberAttribute), inherit: true); if (!string.IsNullOrEmpty(dataMemberAttribute.Name)) { return dataMemberAttribute.Name; } } return member.Name; } } } namespace LLBML { public static class StateApi { public static GameMode CurrentGameMode => JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN; } [BepInPlugin("fr.glomzubuk.plugins.llb.llbml", "LLBModdingLib", "0.10.4")] [BepInProcess("LLBlaze.exe")] public class LLBMLPlugin : BaseUnityPlugin { internal static LLBMLPlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static ConfigFile Conf { get; private set; } internal static bool StartReached { get; private set; } private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0052: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Hello, world!"); ConfigTypeConverters.AddConfigConverters(); ModdingFolder.InitConfig(((BaseUnityPlugin)this).Config); Harmony val = new Harmony("fr.glomzubuk.plugins.llb.llbml"); MessageApi.Patch(val); NetworkApi.Patch(val); LLBML.GameEvents.GameEvents.PatchAll(val); PlayerLobbyState.Patch(val); } private void Start() { ModDependenciesUtils.RegisterToModMenu(((BaseUnityPlugin)this).Info, new List<string> { "The modding folder is the place where mods that use it will store user information.Things like sounds, skins or special configuration should get gathered there.", "For it to be applied properly, you should restart your game after changing it." }); StartReached = true; BepInRef.RefCheck(); } private void OnGUI() { LoadingScreen.OnGUI(); } } public static class PluginInfos { public const string PLUGIN_NAME = "LLBModdingLib"; public const string PLUGIN_ID = "fr.glomzubuk.plugins.llb.llbml"; public const string PLUGIN_VERSION = "0.10.4"; } public static class BallApi { public static bool NoBallsActivelyInMatch() { if ((Object)(object)BallHandler.instance == (Object)null) { return true; } return BallHandler.instance.NoBallsActivelyInMatch(); } public static bool BallsActivelyInMatch() { if ((Object)(object)BallHandler.instance == (Object)null) { return false; } BallEntity[] balls = BallHandler.instance.balls; for (int i = 0; i < balls.Length; i++) { if (((Entity)balls[i]).IsActivelyInMatch()) { return true; } } return false; } public static BallEntity GetBall(int ballIndex = 0) { if ((Object)(object)BallHandler.instance == (Object)null) { return null; } return BallHandler.instance.GetBall(0); } } public static class LoadingScreen { private static Dictionary<string, LoadingInfo> loadingInfos = new Dictionary<string, LoadingInfo>(); public static bool AnyModLoading => loadingInfos.Count > 0; public static void SetLoading(PluginInfo plugin, bool loading, string message = null, bool showScreen = true) { if (loading) { if (!loadingInfos.ContainsKey(plugin.Metadata.GUID)) { string message2 = ((message == null) ? (plugin.Metadata.Name + " is loading external resources") : message); loadingInfos.Add(plugin.Metadata.GUID, new LoadingInfo(message2, showScreen)); } } else if (loadingInfos.ContainsKey(plugin.Metadata.GUID)) { loadingInfos.Remove(plugin.Metadata.GUID); } UpdateState(); } public static void UpdateState() { if (AnyModLoading) { if (!UIScreen.loadingScreenActive) { UIScreen.SetLoadingScreen(true, false, false, (Stage)0); } } else if (UIScreen.loadingScreenActive && GameStates.GetCurrent() != GameState.NONE) { UIScreen.SetLoadingScreen(false, false, false, (Stage)0); } } internal static void OnGUI() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (!UIScreen.loadingScreenActive || !AnyModLoading) { return; } Color contentColor = GUI.contentColor; int fontSize = GUI.skin.label.fontSize; TextAnchor alignment = GUI.skin.label.alignment; GUI.contentColor = Color.white; GUI.skin.label.fontSize = 50; new GUIStyle(GUI.skin.label); GUI.skin.label.alignment = (TextAnchor)4; Resolution resolutionFromConfig = UIScreen.GetResolutionFromConfig(); float num = ((Resolution)(ref resolutionFromConfig)).height / loadingInfos.Count; foreach (LoadingInfo value in loadingInfos.Values) { GUI.Label(new Rect(0f, num - 25f, (float)Screen.width, 50f), value.message); num -= 50f; } GUI.skin.label.alignment = (TextAnchor)3; GUI.contentColor = contentColor; GUI.skin.label.fontSize = fontSize; GUI.skin.label.alignment = alignment; } } public struct LoadingInfo { public string message; public bool showScreen; public LoadingInfo(string _message, bool _showScreen) { message = _message; showScreen = _showScreen; } } public static class ScreenApi { public static ScreenBase[] CurrentScreens => UIScreen.currentScreens; public static bool IsGameResult() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 ScreenBase obj = CurrentScreens[0]; if (obj == null) { return false; } return (int)obj.screenType == 21; } public static PostScreen GetPostScreen() { if (IsGameResult()) { ScreenBase obj = CurrentScreens[0]; return (PostScreen)(object)((obj is PostScreen) ? obj : null); } return null; } } public class CharacterApi { public static Character[] invalidCharacters = (Character[])(object)new Character[3] { (Character)12, (Character)100, (Character)101 }; public static Character[] unplayableCharacters = (Character[])(object)new Character[1] { (Character)102 }; public static IEnumerable<Character> GetAllCharacters() { return GenericUtils.GetEnumValues<Character>(); } public static IEnumerable<Character> GetValidCharacters() { return GetAllCharacters().Except(invalidCharacters); } public static IEnumerable<Character> GetPlayableCharacters() { return GetValidCharacters().Except(unplayableCharacters); } public static Character GetCharacterByName(string characterName) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 12; i++) { Character result = (Character)i; if (((object)(Character)(ref result)).ToString() == characterName.ToUpper()) { return result; } } return (Character)101; } public static Character TheWitcherGetCharacterByName(string characterName) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0044: Unknown result type (might be due to invalid IL or missing references) foreach (Character enumValue in GenericUtils.GetEnumValues<Character>()) { Character current = enumValue; if (((object)(Character)(ref current)).ToString() == characterName) { return current; } } return (Character)101; } } public static class ProgressApi { public static int GetCurrency() { return BDCINPKBMBL.currency; } public static int GetXp() { return BDCINPKBMBL.xp; } public static bool DidCharacterCompleteArcade(Character pChar) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.HGHKKPCAKOM(pChar); } public static bool DidAllCharactersCompleteArcade() { return EPCDKLCABNC.JIAKEINJLMN(); } public static void CharacterCompleteArcadeSet(Character pChar) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) EPCDKLCABNC.NHANFBFHNDJ(pChar); } public static bool IsAvaliableForUnlocking(AudioTrack track) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.ENLLEDKHNAH(track); } public static bool IsAvaliableForUnlocking(Character pChar, CharacterVariant pCharVar) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.ENLLEDKHNAH(pChar, pCharVar); } public static bool AllOutfitsAboveModelAlt2AreUnlocked(Character pChar) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.NHMBIMHGDNH(pChar); } public static bool IsUnlocked(AudioTrack track) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(track); } public static bool IsUnlocked(Character pChar, CharacterVariant pCharVar, int peerPlayerNr = -1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(pChar, pCharVar, peerPlayerNr); } public static bool IsUnlocked(Character pChar, int peerPlayerNr = -1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(pChar, peerPlayerNr); } public static bool IsUnlocked(GameMode pGameMode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(pGameMode); } public static bool IsUnlocked(Stage pStage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(pStage); } public static bool IsUnlocked(UnlockableMode pMode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.KFFJOEAJLEH(pMode); } public static bool IsDefaultUnlocked(Character pChar) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if (pChar - 6 <= 2 || (int)pChar == 10) { return false; } return true; } public static bool IsDefaultUnlocked(Stage pStage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected I4, but got Unknown switch (pStage - 3) { case 0: case 1: case 3: case 5: case 8: case 9: return true; default: return false; } } public static string GetSkinName(Character character, CharacterVariant characterVariant) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown return EPCDKLCABNC.CPNGJKMEOOM(character, (int)characterVariant); } public static string GetStageName(Stage stage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return EPCDKLCABNC.IHODJKJJMLE(stage); } } public static class InputApi { } public static class GraphicUtils { private static readonly Texture2D backgroundTexture = Texture2D.whiteTexture; private static readonly GUIStyle textureStyle = new GUIStyle { normal = new GUIStyleState { background = backgroundTexture } }; public static void DrawRect(Rect position, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) DrawRectWithContent(position, color, null); } public static void DrawRectWithContent(Rect position, Color color, GUIContent content) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color backgroundColor = GUI.backgroundColor; GUI.backgroundColor = color; GUI.Box(position, content ?? GUIContent.none, textureStyle); GUI.backgroundColor = backgroundColor; } } public static class Tuple { public static Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2) { return new Tuple<T1, T2>(item1, item2); } } [DebuggerDisplay("Item1={Item1};Item2={Item2}")] public class Tuple<T1, T2> : IFormattable { private static readonly IEqualityComparer<T1> Item1Comparer = EqualityComparer<T1>.Default; private static readonly IEqualityComparer<T2> Item2Comparer = EqualityComparer<T2>.Default; public T1 Item1 { get; private set; } public T2 Item2 { get; private set; } public Tuple(T1 item1, T2 item2) { Item1 = item1; Item2 = item2; } public override int GetHashCode() { int num = 0; if (Item1 != null) { num = Item1Comparer.GetHashCode(Item1); } if (Item2 != null) { num = (num << 3) ^ Item2Comparer.GetHashCode(Item2); } return num; } public override bool Equals(object obj) { if (!(obj is Tuple<T1, T2> tuple)) { return false; } if (Item1Comparer.Equals(Item1, tuple.Item1)) { return Item2Comparer.Equals(Item2, tuple.Item2); } return false; } public override string ToString() { return ToString(null, CultureInfo.CurrentCulture); } public string ToString(string format, IFormatProvider formatProvider) { return string.Format(formatProvider, format ?? "{0},{1}", new object[2] { Item1, Item2 }); } } internal static class ConfigTypeConverters { public static void AddConfigConverters() { AddColorConverters(); AddVectorConverters(); AddLLBMathConverters(); } [MethodImpl(MethodImplOptions.NoInlining)] private static void AddColorConverters() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_0050: Expected O, but got Unknown TypeConverter val = new TypeConverter { ConvertToString = (object obj, Type type) => ColorUtility.ToHtmlStringRGBA((Color)obj), ConvertToObject = delegate(string str, Type type) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) Color val2 = default(Color); if (!ColorUtility.TryParseHtmlString("#" + str.Trim('#', ' '), ref val2)) { throw new FormatException("Invalid color string, expected hex #RRGGBBAA"); } return val2; } }; TomlTypeConverter.AddConverter(typeof(Color), val); } [MethodImpl(MethodImplOptions.NoInlining)] private static void AddVectorConverters() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_0050: Expected O, but got Unknown TypeConverter val = new TypeConverter { ConvertToString = (object obj, Type type) => JsonUtility.ToJson(obj), ConvertToObject = (string str, Type type) => JsonUtility.FromJson(str, type) }; TomlTypeConverter.AddConverter(typeof(Vector2), val); TomlTypeConverter.AddConverter(typeof(Vector3), val); TomlTypeConverter.AddConverter(typeof(Vector4), val); TomlTypeConverter.AddConverter(typeof(Quaternion), val); } [MethodImpl(MethodImplOptions.NoInlining)] private static void AddLLBMathConverters() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_0050: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown TypeConverter val = new TypeConverter { ConvertToString = (object obj, Type type) => ((Floatf)obj).ToMachineString(), ConvertToObject = (string str, Type type) => Floatf.FromMachineString(str) }; TypeConverter val2 = new TypeConverter { ConvertToString = (object obj, Type type) => ((Vector2f)obj).ToMachineString(), ConvertToObject = (string str, Type type) => Vector2f.FromMachineString(str) }; TypeConverter val3 = new TypeConverter { ConvertToString = (object obj, Type type) => JsonUtility.ToJson((object)(Vector2)(Vector2i)obj), ConvertToObject = (string str, Type type) => (Vector2i)JsonUtility.FromJson<Vector2Int>(str) }; TomlTypeConverter.AddConverter(typeof(Floatf), val); TomlTypeConverter.AddConverter(typeof(Vector2f), val2); TomlTypeConverter.AddConverter(typeof(Vector2i), val3); } } } namespace LLBML.External { public class Murmur3 { public static ulong READ_SIZE = 16uL; private static ulong C1 = 9782798678568883157uL; private static ulong C2 = 5545529020109919103uL; private ulong length; private uint seed; private ulong h1; private ulong h2; public byte[] Hash { get { h1 ^= length; h2 ^= length; h1 += h2; h2 += h1; h1 = MixFinal(h1); h2 = MixFinal(h2); h1 += h2; h2 += h1; byte[] array = new byte[READ_SIZE]; Array.Copy(BitConverter.GetBytes(h1), 0, array, 0, 8); Array.Copy(BitConverter.GetBytes(h2), 0, array, 8, 8); return array; } } private void MixBody(ulong k1, ulong k2) { h1 ^= MixKey1(k1); h1 = h1.RotateLeft(27); h1 += h2; h1 = h1 * 5 + 1390208809; h2 ^= MixKey2(k2); h2 = h2.RotateLeft(31); h2 += h1; h2 = h2 * 5 + 944331445; } private static ulong MixKey1(ulong k1) { k1 *= C1; k1 = k1.RotateLeft(31); k1 *= C2; return k1; } private static ulong MixKey2(ulong k2) { k2 *= C2; k2 = k2.RotateLeft(33); k2 *= C1; return k2; } private static ulong MixFinal(ulong k) { k ^= k >> 33; k *= 18397679294719823053uL; k ^= k >> 33; k *= 14181476777654086739uL; k ^= k >> 33; return k; } public byte[] ComputeHash(byte[] bb) { ProcessBytes(bb); return Hash; } private void ProcessBytes(byte[] bb) { h1 = seed; length = 0uL; int num = 0; ulong num2 = (ulong)bb.Length; while (num2 >= READ_SIZE) { ulong uInt = bb.GetUInt64(num); num += 8; ulong uInt2 = bb.GetUInt64(num); num += 8; length += READ_SIZE; num2 -= READ_SIZE; MixBody(uInt, uInt2); } if (num2 != 0) { ProcessBytesRemaining(bb, num2, num); } } private void ProcessBytesRemaining(byte[] bb, ulong remaining, int pos) { ulong num = 0uL; ulong num2 = 0uL; length += remaining; ulong num3 = remaining - 1; if (num3 <= 14) { switch (num3) { case 14uL: num2 ^= (ulong)bb[pos + 14] << 48; goto case 13uL; case 13uL: num2 ^= (ulong)bb[pos + 13] << 40; goto case 12uL; case 12uL: num2 ^= (ulong)bb[pos + 12] << 32; goto case 11uL; case 11uL: num2 ^= (ulong)bb[pos + 11] << 24; goto case 10uL; case 10uL: num2 ^= (ulong)bb[pos + 10] << 16; goto case 9uL; case 9uL: num2 ^= (ulong)bb[pos + 9] << 8; goto case 8uL; case 8uL: num2 ^= bb[pos + 8]; goto case 7uL; case 7uL: num ^= bb.GetUInt64(pos); goto IL_0128; case 6uL: num ^= (ulong)bb[pos + 6] << 48; goto case 5uL; case 5uL: num ^= (ulong)bb[pos + 5] << 40; goto case 4uL; case 4uL: num ^= (ulong)bb[pos + 4] << 32; goto case 3uL; case 3uL: num ^= (ulong)bb[pos + 3] << 24; goto case 2uL; case 2uL: num ^= (ulong)bb[pos + 2] << 16; goto case 1uL; case 1uL: num ^= (ulong)bb[pos + 1] << 8; goto case 0uL; case 0uL: { num ^= bb[pos]; goto IL_0128; } IL_0128: h1 ^= MixKey1(num); h2 ^= MixKey2(num2); return; } } throw new Exception("Something went wrong with remaining bytes calculation."); } } public static class IntHelpers { public static ulong RotateLeft(this ulong original, int bits) { return (original << bits) | (original >> 64 - bits); } public static ulong RotateRight(this ulong original, int bits) { return (original >> bits) | (original << 64 - bits); } public unsafe static ulong GetUInt64(this byte[] bb, int pos) { fixed (byte* ptr = &bb[pos]) { return *(ulong*)ptr; } } } } namespace LLBML.Graphic { public static class Draw { public enum Alignment : byte { INSIDE, OUTSIDE } private static Material _lineMaterial; private static Material lineMaterial { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if ((Object)(object)_lineMaterial == (Object)null) { _lineMaterial = new Material(Shader.Find("Hidden/Internal-Colored")); ((Object)_lineMaterial).hideFlags = (HideFlags)61; _lineMaterial.SetInt("_SrcBlend", 5); _lineMaterial.SetInt("_DstBlend", 0); _lineMaterial.SetInt("_Cull", 0); _lineMaterial.SetInt("_ZWrite", 0); _lineMaterial.SetInt("_ZTest", 8); } return _lineMaterial; } } public static void Cube(Vector2f center, Vector2f size, Color color, float thicc = 4f, Alignment align = Alignment.INSIDE) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0275: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) lineMaterial.SetPass(0); thicc *= 0.01f; Camera gameplayCam = GameCamera.gameplayCam; GL.PushMatrix(); GL.Begin(7); GL.Color(color); GL.LoadProjectionMatrix(gameplayCam.projectionMatrix); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((float)(center.x - size.x * HHBCPNCDNDH.GMEDDLALMGA), (float)(center.y - size.y * HHBCPNCDNDH.GMEDDLALMGA)); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((float)(center.x - size.x * HHBCPNCDNDH.GMEDDLALMGA), (float)(center.y + size.y * HHBCPNCDNDH.GMEDDLALMGA)); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor((float)(center.x + size.x * HHBCPNCDNDH.GMEDDLALMGA), (float)(center.y + size.y * HHBCPNCDNDH.GMEDDLALMGA)); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor((float)(center.x + size.x * HHBCPNCDNDH.GMEDDLALMGA), (float)(center.y - size.y * HHBCPNCDNDH.GMEDDLALMGA)); Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(thicc, 0f, 0f); Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(0f, thicc * (float)(int)align, 0f); Vector3 val7 = default(Vector3); ((Vector3)(ref val7))..ctor(thicc, thicc, 0f); Vector3 val8 = default(Vector3); ((Vector3)(ref val8))..ctor(thicc, 0f - thicc, 0f); GL.Vertex(val - val6); GL.Vertex(val2 + val6); if (align == Alignment.INSIDE) { GL.Vertex(val2 + val5); GL.Vertex(val + val5); } else { GL.Vertex(val2 - val8); GL.Vertex(val - val7); } GL.Vertex(val2); GL.Vertex(val3); if (align == Alignment.INSIDE) { GL.Vertex3(val3.x, val3.y - thicc, val3.z); GL.Vertex3(val2.x, val2.y - thicc, val2.z); } else { GL.Vertex3(val3.x, val3.y + thicc, val3.z); GL.Vertex3(val2.x, val2.y + thicc, val2.z); } GL.Vertex(val3 + val6); GL.Vertex(val4 - val6); if (align == Alignment.INSIDE) { GL.Vertex(val4 - val5); GL.Vertex(val3 - val5); } else { GL.Vertex(val4 + val8); GL.Vertex(val3 + val7); } GL.Vertex(val4); GL.Vertex(val); if (align == Alignment.INSIDE) { GL.Vertex3(val.x, val.y + thicc, val.z); GL.Vertex3(val4.x, val4.y + thicc, val4.z); } else { GL.Vertex3(val.x, val.y - thicc, val.z); GL.Vertex3(val4.x, val4.y - thicc, val4.z); } GL.End(); GL.PopMatrix(); } public static void Polygon(Vector2f center, Floatf radius, Color color, int vertexNumber = 360, bool hollow = false, float thicness = 4f) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) lineMaterial.SetPass(0); thicness *= 0.01f; Camera gameplayCam = GameCamera.gameplayCam; float num = ((radius - thicness <= 0f) ? 0f : ((float)radius - thicness)); GL.PushMatrix(); if (hollow) { GL.Begin(4); } else { GL.Begin(7); } GL.Color(color); GL.LoadProjectionMatrix(gameplayCam.projectionMatrix); float num2 = (float)System.Math.PI * 2f / (float)vertexNumber; for (float num3 = 0f; num3 <= (float)vertexNumber; num3 += 1f) { float num4 = num2 * num3 - (float)System.Math.PI / 2f + num2 / 2f; float num5 = num2 * (num3 + 1f) - (float)System.Math.PI / 2f + num2 / 2f; if (hollow) { GL.Vertex3((float)center.x, (float)center.y, 0f); GL.Vertex3((float)(center.x + Mathf.Cos(num4) * radius), (float)(center.y + Mathf.Sin(num4) * radius), 0f); GL.Vertex3((float)(center.x + Mathf.Cos(num5) * radius), (float)(center.y + Mathf.Sin(num5) * radius), 0f); } else { GL.Vertex3((float)(center.x + Mathf.Cos(num4) * radius), (float)(center.y + Mathf.Sin(num4) * radius), 0f); GL.Vertex3((float)(center.x + Mathf.Cos(num5) * radius), (float)(center.y + Mathf.Sin(num5) * radius), 0f); GL.Vertex3((float)(center.x + Mathf.Cos(num5) * num), (float)(center.y + Mathf.Sin(num5) * num), 0f); GL.Vertex3((float)(center.x + Mathf.Cos(num4) * num), (float)(center.y + Mathf.Sin(num4) * num), 0f); } } GL.End(); GL.PopMatrix(); } } } namespace LLBML.Texture { public static class TextureUtils { private static ManualLogSource Logger = LLBMLPlugin.Log; public static Texture2D LoadPNG(FileInfo file) { if (!file.Exists) { Logger.LogWarning((object)("LoadPNG: Could not find " + file.FullName)); return null; } byte[] array; using (FileStream input = file.OpenRead()) { using BinaryReader aReader = new BinaryReader(input); PNGFile pNGFile = PNGTools.ReadPNGFile(aReader); for (int num = pNGFile.chunks.Count - 1; num >= 0; num--) { PNGChunk pNGChunk = pNGFile.chunks[num]; if (pNGChunk.type == EPNGChunkType.gAMA || pNGChunk.type == EPNGChunkType.pHYs || pNGChunk.type == EPNGChunkType.sRBG) { pNGFile.chunks.RemoveAt(num); } } using MemoryStream memoryStream = new MemoryStream(); PNGTools.WritePNGFile(pNGFile, new BinaryWriter(memoryStream)); array = memoryStream.ToArray(); } string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file.FullName); Texture2D obj = DefaultTexture(512, 512, (TextureFormat)4); ((Object)obj).name = fileNameWithoutExtension; ImageConversion.LoadImage(obj, array); return obj; } public static Texture2D LoadPNG(string filePath) { return LoadPNG(new FileInfo(filePath)); } public static Texture2D LoadDDS(FileInfo file) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) DDSImage dDSImage = new DDSImage(File.ReadAllBytes(file.FullName)); Texture2D obj = DefaultTexture(dDSImage.Width, dDSImage.Height, dDSImage.GetTextureFormat()); obj.LoadRawTextureData(dDSImage.GetTextureData()); obj.Apply(); return obj; } public static Texture2D LoadDDS(string filePath) { return LoadDDS(new FileInfo(filePath)); } public static Texture2D LoadTexture(FileInfo file) { string text = file.Extension.ToLower(); if (!(text == ".png")) { if (text == ".dds") { return LoadDDS(file); } throw new NotSupportedException("Unkown file extension: " + file.Extension); } return LoadPNG(file); } public static Texture2D LoadTexture(string filePath) { return LoadTexture(new FileInfo(filePath)); } public static Texture2D DefaultTexture(int width = 512, int height = 512, TextureFormat format = 4) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown return new Texture2D(width, height, format, true, false) { filterMode = (FilterMode)2, anisoLevel = 9, mipMapBias = -0.5f }; } } } namespace LLBML.UI { public class Dialogs { private static ScreenBase screenDialog; private static void CloseDialog() { UIScreen.Close(screenDialog, (ScreenTransition)0); screenDialog = null; } private static bool IsDialogOpen() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 if ((Object)(object)screenDialog != (Object)null) { return true; } ScreenBase[] currentScreens = ScreenApi.CurrentScreens; foreach (ScreenBase val in currentScreens) { if ((Object)(object)val != (Object)null && ((int)val.screenType == 26 || (int)val.screenType == 28 || (int)val.screenType == 27)) { return true; } } return false; } public static void OpenDialog(string title, string message, string buttonText = null, Action onClickButton = null) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown if (IsDialogOpen()) { LLBMLPlugin.Log.LogWarning((object)("Tried to open a dialog while one was already opened. Title:" + title)); return; } screenDialog = UIScreen.Open((ScreenType)26, 2); ScreenBase obj = screenDialog; ScreenDialog val = (ScreenDialog)(object)((obj is ScreenDialog) ? obj : null); val.SetText(title, message, -1, false); if (buttonText != null) { val.ShowButton(buttonText); } else { val.AutoClose(10f); } ((LLClickable)val.btOk).onClick = (ControlDelegate)delegate { if (onClickButton != null) { onClickButton(); } CloseDialog(); }; } public static void OpenConfirmationDialog(string title, string text, Action onClickOK = null, Action onClickCancel = null) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown if (IsDialogOpen()) { LLBMLPlugin.Log.LogWarning((object)("Tried to open a dialog while one was already opened. Title:" + title)); return; } screenDialog = UIScreen.Open((ScreenType)27, 2, (ScreenTransition)0, true); ScreenBase obj = screenDialog; ScreenBase obj2 = ((obj is ScreenDialogConfirmation) ? obj : null); ((ScreenDialogConfirmation)obj2).SetText(title, text, -1); ((LLClickable)((ScreenDialogConfirmation)obj2).btOk).onClick = (ControlDelegate)delegate { if (onClickOK != null) { onClickOK(); } CloseDialog(); }; ((LLClickable)((ScreenDialogConfirmation)obj2).btCancel).onClick = (ControlDelegate)delegate { if (onClickCancel != null) { onClickCancel(); } CloseDialog(); }; } } } namespace LLBML.States { public class GameStates { private readonly DNPFJHMAIBP _gameStates; public static GameStates Instance => DNPFJHMAIBP.AKGAOAEJ; public static List<Message> Messages => DNPFJHMAIBP.IGEBDAFJIDI; public GameStates(DNPFJHMAIBP gs) { _gameStates = gs; } public override bool Equals(object obj) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (obj is DNPFJHMAIBP || obj is GameStates) { return object.Equals((object?)(DNPFJHMAIBP)obj, (DNPFJHMAIBP)this); } return false; } public override int GetHashCode() { return ((object)_gameStates).GetHashCode(); } public override string ToString() { return ((object)_gameStates).ToString(); } public static implicit operator DNPFJHMAIBP(GameStates gs) { return gs._gameStates; } public static implicit operator GameStates(DNPFJHMAIBP gs) { return new GameStates(gs); } public static GameState GetCurrent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return DNPFJHMAIBP.HHMOGKIMBNM(); } public static void DirectProcess(Message message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) DNPFJHMAIBP.OLGPEGGAIIB(message); } public static void DirectProcess(Msg msg, int playerNr, int index) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) DirectProcess(new Message(msg, playerNr, index, (object)null, -1)); } public static void ClearMessages() { DNPFJHMAIBP.CJLNFAABMGM(); } public static bool ShouldIgnoreInputs() { return DNPFJHMAIBP.CNEEALIJJFE(); } public static bool IsInIntro() { return DNPFJHMAIBP.DEDHLLMANNE(); } public static bool IsSwitching() { return DNPFJHMAIBP.KHJPIEHGCHK(); } public static bool IsMenuState(GameState s, bool alsoOptions = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return DNPFJHMAIBP.LJCBCBAKKDF((JOFJHDJHJGI)s, alsoOptions); } public static void Send(Message message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) DNPFJHMAIBP.GKBNNFEAJGO(message); } public static void Send(Msg msgType, int playerNr, int index) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) DNPFJHMAIBP.GKBNNFEAJGO(msgType, playerNr, index); } public static void SendAfter(float delay, Message message) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) DNPFJHMAIBP.EPPPGGPNAPK(delay, message); } public static void Set(GameState newState, bool noLink = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) DNPFJHMAIBP.HOGJDNCMNFP((JOFJHDJHJGI)newState, noLink); } public static void UpdateToConfigAll() { DNPFJHMAIBP.CHILDIDHNBH(); } public static FHPLAFJAAIP GetCurrentGameStateObject() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) return DNPFJHMAIBP.AKGAOAEJ.EAPCPAJPEMA((JOFJHDJHJGI)GetCurrent()); } public static bool IsInLobby() { if (!IsInLocalLobby() && !IsInOnlineLobby()) { return IsInSingleLobby(); } return true; } public static bool IsInLocalLobby() { return GetCurrent() == GameState.LOBBY_LOCAL; } public static bool IsInOnlineLobby() { return GetCurrent() == GameState.LOBBY_ONLINE; } public static bool IsInSingleLobby() { GameState current = GetCurrent(); if (!(current == GameState.LOBBY_TRAINING) && !(current == GameState.LOBBY_STORY) && !(current == GameState.LOBBY_TUTORIAL)) { return current == GameState.LOBBY_CHALLENGE; } return true; } public static bool IsInGame() { GameState current = GetCurrent(); if (!(current == GameState.GAME)) { return current == GameState.GAME_PAUSE; } return true; } public static bool IsInMatch() { GetCurrent(); if ((Object)(object)World.instance != (Object)null && !UIScreen.loadingScreenActive) { return IsInGame(); } return false; } } public static class GameStatesLobbyUtils { private static ManualLogSource Logger = LLBMLPlugin.Log; public static HPNLMFHPHFD GetLobby() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (!GameStates.IsInLobby()) { throw new InvalidOperationException(ErrorMessage("GameStatesLobby", GameStates.GetCurrent().ToString())); } return (HPNLMFHPHFD)GameStates.GetCurrentGameStateObject(); } public static void UpdatePlayer(HPNLMFHPHFD gs_lobby, Player player, bool play_selection_anim = false) { gs_lobby.BDMIDGAHNLA((ALDOKEMAOMB)player, play_selection_anim); } public static void UpdatePlayer(Player player, bool play_selection_anim = false) { UpdatePlayer(GetLobby(), player, play_selection_anim); } public static HDLIJDBFGKN GetOnlineLobby() { if (!GameStates.IsInOnlineLobby()) { throw new InvalidOperationException(ErrorMessage("GameStatesLobbyOnline", GameStates.GetCurrent().ToString())); } return HDLIJDBFGKN.instance; } public static void MakeSureReadyIs(HDLIJDBFGKN gs_lobbyOnline, bool ready, bool resetTimer = false) { gs_lobbyOnline.IKPDLPDNHIJ(ready, resetTimer); } public static void MakeSureReadyIs(bool ready, bool resetTimer = false) { MakeSureReadyIs(GetOnlineLobby(), ready, resetTimer); } public static void SendPlayerState(HDLIJDBFGKN gs_lobbyOnline, Player player) { gs_lobbyOnline.OFGNNIBJOLH((ALDOKEMAOMB)player); } public static void SendPlayerState(Player player) { SendPlayerState(GetOnlineLobby(), player); } public static void RefreshPlayerState(Player player) { Logger.LogInfo((object)("Refreshing player " + player.nr)); if (GameStates.IsInLobby()) { UpdatePlayer(player); } else { Logger.LogWarning((object)("Tried to refresh state while not in a lobby.\n Current GameState: " + GameStates.GetCurrent()?.ToString() + " . Stacktrace: \n" + new StackTrace())); } } public static void RefreshLocalPlayerState() { RefreshPlayerState(Player.GetLocalPlayer()); } public static bool GetAutoreadyStatus() { if (GameStates.IsInLobby() && GameStates.IsInOnlineLobby()) { return GetOnlineLobby().BOEPIJPONCK; } return false; } public static IJDANPONMLL GetLocalLobby() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (!GameStates.IsInLocalLobby()) { throw new InvalidOperationException(ErrorMessage("GameStatesLobbyLocal", GameStates.GetCurrent().ToString())); } return (IJDANPONMLL)GameStates.GetCurrentGameStateObject(); } public static HFAEJNGHDDM GetSingleLobby() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (!GameStates.IsInSingleLobby()) { throw new InvalidOperationException(ErrorMessage("GameStatesLobbySingle", GameStates.GetCurrent().ToString())); } return (HFAEJNGHDDM)GameStates.GetCurrentGameStateObject(); } private static string ErrorMessage(string obName, string state) { return "Tried to fetch " + obName + " object while not in the right state. Current state: " + state; } } public class GameState : EnumWrapper<JOFJHDJHJGI> { public enum Enum { NONE, INTRO, MENU, QUIT, LOBBY_LOCAL, LOBBY_ONLINE, LOBBY_CHALLENGE, CHALLENGE_LADDER, CHALLENGE_LOST, STORY_GRID, STORY_COMIC, LOBBY_TRAINING, LOBBY_TUTORIAL, CREDITS, OPTIONS_GAME, OPTIONS_INPUT, OPTIONS_AUDIO, OPTIONS_VIDEO, GAME_INTRO, GAME, GAME_PAUSE, GAME_RESULT, UNLOCKS, LOBBY_STORY, UNKNOWN1, UNKNOWN2 } public enum Enum_Mapping { NONE, INTRO, MENU, QUIT, LOBBY_LOCAL, LOBBY_ONLINE, LOBBY_CHALLENGE, CHALLENGE_LADDER, CHALLENGE_LOST, STORY_GRID, STORY_COMIC, LOBBY_TRAINING, LOBBY_TUTORIAL, CREDITS, OPTIONS_GAME, OPTIONS_INPUT, OPTIONS_AUDIO, OPTIONS_VIDEO, GAME_INTRO, GAME, GAME_PAUSE, GAME_RESULT, UNLOCKS, LOBBY_STORY, UNKNOWN1, UNKNOWN2 } public static readonly GameState NONE = Enum.NONE; public static readonly GameState INTRO = Enum.INTRO; public static readonly GameState MENU = Enum.MENU; public static readonly GameState QUIT = Enum.QUIT; public static readonly GameState LOBBY_LOCAL = Enum.LOBBY_LOCAL; public static readonly GameState LOBBY_ONLINE = Enum.LOBBY_ONLINE; public static readonly GameState LOBBY_CHALLENGE = Enum.LOBBY_CHALLENGE; public static readonly GameState CHALLENGE_LADDER = Enum.CHALLENGE_LADDER; public static readonly GameState CHALLENGE_LOST = Enum.CHALLENGE_LOST; public static readonly GameState STORY_GRID = Enum.STORY_GRID; public static readonly GameState STORY_COMIC = Enum.STORY_COMIC; public static readonly GameState LOBBY_TRAINING = Enum.LOBBY_TRAINING; public static readonly GameState LOBBY_TUTORIAL = Enum.LOBBY_TUTORIAL; public static readonly GameState CREDITS = Enum.CREDITS; public static readonly GameState OPTIONS_GAME = Enum.OPTIONS_GAME; public static readonly GameState OPTIONS_INPUT = Enum.OPTIONS_INPUT; public static readonly GameState OPTIONS_AUDIO = Enum.OPTIONS_AUDIO; public static readonly GameState OPTIONS_VIDEO = Enum.OPTIONS_VIDEO; public static readonly GameState GAME_INTRO = Enum.GAME_INTRO; public static readonly GameState GAME = Enum.GAME; public static readonly GameState GAME_PAUSE = Enum.GAME_PAUSE; public static readonly GameState GAME_RESULT = Enum.GAME_RESULT; public static readonly GameState UNLOCKS = Enum.UNLOCKS; public static readonly GameState LOBBY_STORY = Enum.LOBBY_STORY; public static readonly GameState UNKNOWN1 = Enum.UNKNOWN1; public static readonly GameState UNKNOWN2 = Enum.UNKNOWN2; private GameState(int id) : base(id) { } private GameState(JOFJHDJHJGI gameState) : base((int)gameState) { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown public override string ToString() { return ((Enum)id).ToString(); } public static implicit operator JOFJHDJHJGI(GameState ew) { return (JOFJHDJHJGI)ew.id; } public static implicit operator GameState(JOFJHDJHJGI val) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return new GameState(val); } public static implicit operator GameState(int id) { return new GameState(id); } public static implicit operator GameState(Enum val) { return new GameState((int)val); } public static implicit operator Enum(GameState ew) { return (Enum)ew.id; } } public class PlayerLobbyState { internal struct PLSCustomPayload { public string name; public byte[] netID; public Func<PlayerLobbyState, byte[]> onSendPayload; public Action<PlayerLobbyState, byte[]> onReceivePayload; public PLSCustomPayload(byte[] netID, Func<PlayerLobbyState, byte[]> onSendPayload, Action<PlayerLobbyState, byte[]> onReceivePayload) { name = null; this.netID = netID; this.onSendPayload = onSendPayload; this.onReceivePayload = onReceivePayload; } public PLSCustomPayload(PluginInfo pi, Func<PlayerLobbyState, byte[]> onSendPayload, Action<PlayerLobbyState, byte[]> onReceivePayload) { name = pi.Metadata.Name; netID = NetworkApi.GetNetworkIdentifier(pi.Metadata.GUID); this.onSendPayload = onSendPayload; this.onReceivePayload = onReceivePayload; } } private readonly JMLEHJLKPAC _pls; internal static readonly byte[] nullNetID = new byte[4]; internal static readonly DateTime payloadLengthSwitchDate = new DateTime(2025, 6, 1, 8, 0, 0, DateTimeKind.Utc); internal static Dictionary<string, PLSCustomPayload> customPayloads = new Dictionary<string, PLSCustomPayload>(); public int playerNr { get { return _pls.BKEOPDPFFPM; } set { _pls.BKEOPDPFFPM = value; } } public Character character { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _pls.LALEEFJMMLH; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _pls.LALEEFJMMLH = value; } } public CharacterVariant variant { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _pls.AIINAIDBHJI; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _pls.AIINAIDBHJI = value; } } public Team team { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _pls.HEOKEMBMDIJ; } set { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) _pls.HEOKEMBMDIJ = value; } } public bool selected { get { return _pls.CHNGAKOIJFE; } set { _pls.CHNGAKOIJFE = value; } } public bool ready { get { return _pls.GFCMODHPPCN; } set { _pls.GFCMODHPPCN = value; } } public bool spectator { get { return _pls.HOKENEBPEGH; } set { _pls.HOKENEBPEGH = value; } } public PlayerLobbyState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _pls = new JMLEHJLKPAC(); } public PlayerLobbyState(JMLEHJLKPAC pls) { _pls = pls; } public PlayerLobbyState(Player player) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown _pls = new JMLEHJLKPAC((ALDOKEMAOMB)player); } public override bool Equals(object obj) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (obj is JMLEHJLKPAC || obj is PlayerLobbyState) { return object.Equals((object?)(JMLEHJLKPAC)obj, (JMLEHJLKPAC)this); } return false; } public override int GetHashCode() { return ((object)_pls).GetHashCode(); } public override string ToString() { return ((object)_pls).ToString(); } public static implicit operator JMLEHJLKPAC(PlayerLobbyState pls) { return pls._pls; } public static implicit operator PlayerLobbyState(JMLEHJLKPAC pls) { return new PlayerLobbyState(pls); } public void CopyTo(Player p) { _pls.LMIPEFAPKOJ((ALDOKEMAOMB)p); } public void WriteBytes(BinaryWriter writer) { _pls.JFFMEHKLMNG(writer); } public static PlayerLobbyState ReadBytes(BinaryReader reader) { return JMLEHJLKPAC.JFNLMPNOEMA(reader); } internal static void Patch(Harmony harmonyInstance) { harmonyInstance.PatchAll(typeof(PlayerLobbyState_Patches)); } public static void RegisterPayload(PluginInfo info, Func<PlayerLobbyState, byte[]> onSendPayload, Action<PlayerLobbyState, byte[]> onReceivePayload) { string key = StringUtils.PrettyPrintBytes(NetworkApi.GetNetworkIdentifier(info.Metadata.GUID)); if (customPayloads.ContainsKey(key)) { LLBMLPlugin.Log.LogWarning((object)(info.Metadata.Name + " has already registered a payload.")); } else { customPayloads.Add(key, new PLSCustomPayload(info, onSendPayload, onReceivePayload)); } } public static void UnregisterPayload(PluginInfo info) { string key = StringUtils.PrettyPrintBytes(NetworkApi.GetNetworkIdentifier(info.Metadata.GUID)); if (customPayloads.ContainsKey(key)) { customPayloads.Remove(key); return; } LLBMLPlugin.Log.LogWarning((object)(info.Metadata.Name + " doesn't have a registered payload.")); DebugUtils.PrintStacktrace(); } } public static class PlayerLobbyState_Patches { [HarmonyPatch(typeof(JMLEHJLKPAC), "JFFMEHKLMNG")] [HarmonyPrefix] public static bool WriteBytes_Prefix(BinaryWriter __0, JMLEHJLKPAC __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (PlayerLobbyState.customPayloads.Count <= 0) { return true; } PlayerLobbyState playerLobbyState = __instance; __0.Write((byte)playerLobbyState.playerNr); __0.Write((byte)playerLobbyState.character); __0.Write((byte)playerLobbyState.variant); __0.Write((byte)(int)playerLobbyState.team); __0.Write((byte)(playerLobbyState.selected ? 1u : 0u)); __0.Write((byte)(playerLobbyState.ready ? 1u : 0u)); __0.Write((byte)(playerLobbyState.spectator ? 1u : 0u)); foreach (KeyValuePair<string, PlayerLobbyState.PLSCustomPayload> customPayload in PlayerLobbyState.customPayloads) { byte[] array = null; try { LLBMLPlugin.Log.LogDebug((object)("Getting PLS payload for: " + customPayload.Value.name)); array = customPayload.Value.onSendPayload(playerLobbyState); } catch (Exception ex) { LLBMLPlugin.Log.LogError((object)((customPayload.Value.name ?? customPayload.Value.netID.ToString()) + " returned error during PlayerLobbyState packing: " + ex)); } if (array == null || array.Length == 0) { continue; } if (DateTime.UtcNow < PlayerLobbyState.payloadLengthSwitchDate) { if (array.Length > 255) { LLBMLPlugin.Log.LogError((object)$"Payload size for {customPayload.Value.name} is too big. {array.Length} bytes received for a maximum of {byte.MaxValue}."); ManualLogSource log = LLBMLPlugin.Log; DateTime payloadLengthSwitchDate = PlayerLobbyState.payloadLengthSwitchDate; log.LogInfo((object)$"This behaviour will change after {payloadLengthSwitchDate.ToLocalTime()}, and will be extended to {ushort.MaxValue}."); continue; } } else if (array.Length > 65535) { LLBMLPlugin.Log.LogError((object)$"Payload size for {customPayload.Value.name} is too big. {array.Length} bytes received for a maximum of {ushort.MaxValue}."); continue; } LLBMLPlugin.Log.LogDebug((object)$"Sending {array.Length} bytes payload for: {customPayload.Value.name}"); __0.Write(customPayload.Value.netID); if (DateTime.UtcNow < PlayerLobbyState.payloadLengthSwitchDate) { __0.Write((byte)array.Length); } else { __0.Write((ushort)array.Length); } __0.Write(array); } __0.Write(PlayerLobbyState.nullNetID); return false; } [HarmonyPatch(typeof(JMLEHJLKPAC), "JFNLMPNOEMA")] [HarmonyPrefix] public static bool ReadBytes_Prefix(ref JMLEHJLKPAC __result, BinaryReader __0) { if (PlayerLobbyState.customPayloads.Count <= 0) { return true; } __result = new PlayerLobbyState { playerNr = __0.ReadByte(), character = (Character)__0.ReadByte(), variant = (CharacterVariant)__0.ReadByte(), team = __0.ReadByte(), selected = (__0.ReadByte() != 0), ready = (__0.ReadByte() != 0), spectator = (__0.ReadByte() != 0) }; while (__0.BaseStream.Position < __0.BaseStream.Length) { LLBMLPlugin.Log.LogDebug((object)$"Current Stream position: {__0.BaseStream.Position}/{__0.BaseStream.Length}"); byte[] array = __0.ReadBytes(4); if (array.Aggregate(0, (int acc, byte val) => acc + val) == 0) { break; } int num = ((DateTime.UtcNow < PlayerLobbyState.payloadLengthSwitchDate) ? __0.ReadByte() : __0.ReadUInt16()); LLBMLPlugin.Log.LogDebug((object)$"Received {num} bytes payload for: {StringUtils.PrettyPrintBytes(array)}"); byte[] arg = __0.ReadBytes(num); string key = StringUtils.PrettyPrintBytes(array); if (PlayerLobbyState.customPayloads.ContainsKey(key)) { PlayerLobbyState.PLSCustomPayload pLSCustomPayload = PlayerLobbyState.customPayloads[key]; LLBMLPlugin.Log.LogDebug((object)("Which is " + pLSCustomPayload.name + ".")); try { pLSCustomPayload.onReceivePayload(__result, arg); } catch (Exception ex) { LLBMLPlugin.Log.LogError((object)((pLSCustomPayload.name ?? pLSCustomPayload.netID.ToString()) + " returned error during PlayerLobbyState unpacking: " + ex)); } } else { LLBMLPlugin.Log.LogWarning((object)$"Unknown PluginID: Couldn't find a plugin with \"{StringUtils.PrettyPrintBytes(array)}\" as netID. It had {num} bytes of data."); } } return false; } } public static class GameStatesGameUtils { private static ManualLogSource Logger = LLBMLPlugin.Log; public static int currentFrame => OGONAGCFDPK.JGKJICLOPFJ(); } } namespace LLBML.Messages { public class CustomMessage { public readonly PluginInfo pluginInfo; public readonly int messageCode; public readonly string messageName; public readonly MessageActions messageActions; public CustomMessage(PluginInfo pluginInfo, int messageCode, string messageName, Action<Message> onReceiveCode) { this.pluginInfo = pluginInfo; this.messageCode = messageCode; messageActions = new MessageActions(onReceiveCode); } public CustomMessage(PluginInfo pluginInfo, int messageCode, string messageName, MessageActions messageActions) { this.pluginInfo = pluginInfo; this.messageCode = messageCode; this.messageActions = messageActions; } } public class MessageActions { public readonly Action<Message> onReceiveCode; public readonly Action<BinaryWriter, object, int> customWriter; public readonly Action<BinaryReader, Message> customReader; public MessageActions(Action<Message> onReceiveCode, Action<BinaryWriter, object, int> customWriter = null, Action<BinaryReader, Message> customReader = null) { this.onReceiveCode = onReceiveCode; this.customWriter = customWriter; this.customReader = customReader; } } public static class MessageApi { public delegate void OnReceiveMessageHandler(object sender, Message e); private static ManualLogSource Logger = LLBMLPlugin.Log; internal static List<int> vanillaMessageCodes; internal static List<int> internalMessageCodes; internal static Dictionary<byte, List<CustomMessage>> vanillaSubscriptions = new Dictionary<byte, List<CustomMessage>>(); internal static Dictionary<ushort, CustomMessage> customMessages = new Dictionary<ushort, CustomMessage>(); internal static void Patch(Harmony harmonyPatcher) { vanillaMessageCodes = GenericUtils.GetEnumValues<Msg>().Cast<int>().ToList(); internalMessageCodes = GenericUtils.GetEnumValues<SpecialCode>().Cast<int>().ToList(); } public static CustomMessage RegisterCustomMessage(PluginInfo pluginInfo, ushort messageCode, string messageName, Action<Message> onReceiveMessageCallback) { return RegisterCustomMessage(pluginInfo, messageCode, messageName, new MessageActions(onReceiveMessageCallback)); } public static CustomMessage RegisterCustomMessage(PluginInfo pluginInfo, ushort messageCode, string messageName, MessageActions messageActions) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (messageCode <= 255) { ManualLogSource logger = Logger; Msg val = (Msg)messageCode; logger.LogWarning((object)("Message codes under 256 are reserved for the game (" + ((object)(Msg)(ref val)).ToString() + ").")); Logger.LogWarning((object)"Could not register code action."); return null; } if (customMessages.ContainsKey(messageCode)) { Logger.LogWarning((object)("Message code number" + messageCode + " is already taken by another mod (" + customMessages[messageCode].messageName + ").")); Logger.LogWarning((object)"Could not register code action."); return null; } CustomMessage customMessage = new CustomMessage(pluginInfo, messageCode, messageName, messageActions); customMessages.Add(messageCode, customMessage); ManualLogSource logger2 = Logger; string[] obj = new string[8] { "Registered message code number ", null, null, null, null, null, null, null }; int messageCode2 = customMessage.messageCode; obj[1] = messageCode2.ToString(); obj[2] = " for "; obj[3] = customMessage.pluginInfo.Metadata.Name; obj[4] = ". Reason: "; obj[5] = customMessage.messageName; obj[6] = ". Callback name: "; obj[7] = customMessage.messageActions.onReceiveCode.Method.Name; logger2.LogDebug((object)string.Concat(obj)); return customMessage; } public static bool UnregisterCustomMessage(PluginInfo pluginInfo, ushort messageCode) { if (customMessages.ContainsKey(messageCode)) { if (pluginInfo.Metadata.GUID == customMessages[messageCode].pluginInfo.Metadata.GUID) { customMessages.Remove(messageCode); Logger.LogDebug((object)("Removed code number " + messageCode)); return true; } Logger.LogWarning((object)"Tried to unregister a code with the wrong plugin info. Ignoring."); } else { Logger.LogWarning((object)("No message code number " + messageCode + " previously registered")); } return false; } public static CustomMessage SubscribeToVanillaMessage(PluginInfo pluginInfo, Msg messageCode, string messageName, Action<Message> onReceiveMessageCallback) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return SubscribeToVanillaMessage(pluginInfo, messageCode, messageName, new MessageActions(onReceiveMessageCallback)); } public static CustomMessage SubscribeToVanillaMessage(PluginInfo pluginInfo, Msg messageCode, string messageName, MessageActions messageActions) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!vanillaSubscriptions.ContainsKey((byte)messageCode)) { vanillaSubscriptions[(byte)messageCode] = new List<CustomMessage>(); } CustomMessage customMessage = new CustomMessage(pluginInfo, (byte)messageCode, messageName, messageActions); vanillaSubscriptions[(byte)messageCode].Add(customMessage); ManualLogSource logger = Logger; string[] obj = new string[8] { "Registered message code number ", null, null, null, null, null, null, null }; int messageCode2 = customMessage.messageCode; obj[1] = messageCode2.ToString(); obj[2] = " for "; obj[3] = customMessage.pluginInfo.Metadata.Name; obj[4] = ". Reason: "; obj[5] = customMessage.messageName; obj[6] = ". Callback name: "; obj[7] = customMessage.messageActions.onReceiveCode.Method.Name; logger.LogDebug((object)string.Concat(obj)); return customMessage; } public static bool UnsubscribeToVanillaMessage(PluginInfo pluginInfo, Msg messageCode, CustomMessage customMessage) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (vanillaSubscriptions.ContainsKey((byte)messageCode)) { int num = vanillaSubscriptions[(byte)messageCode].IndexOf(customMessage); if (num == -1) { Logger.LogWarning((object)("No custom message matching " + customMessage?.ToString() + " previously registered")); return false; } if (vanillaSubscriptions[(byte)messageCode][num].pluginInfo.Metadata.GUID == pluginInfo.Metadata.GUID) { customMessages.Remove((byte)messageCode); Logger.LogDebug((object)("Removed code number " + ((object)(Msg)(ref messageCode)).ToString())); return true; } Logger.LogWarning((object)"Tried to unregister a code with the wrong plugin info. Ignoring."); } else { Logger.LogWarning((object)("No message code number " + ((object)(Msg)(ref messageCode)).ToString() + " previously registered")); } return false; } } public class MessageEventArgs : EventArgs { public Message Message { get; private set; } public MessageEventArgs(Message message) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Message = message; } } } namespace LLBML.Players { public class Team : EnumWrapper<BGHNEHPFHGC> { public enum Enum { RED, BLUE, YELLOW, GREEN, NONE } public enum Enum_Mappings { RED, BLUE, YELLOW, GREEN, NONE } public static readonly Team RED = Enum.RED; public static readonly Team BLUE = Enum.BLUE; public static readonly Team YELLOW = Enum.YELLOW; public static readonly Team GREEN = Enum.GREEN; public static readonly Team NONE = Enum.NONE; private Team(int id) : base(id) { } private Team(BGHNEHPFHGC team) : base((int)team) { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected I4, but got Unknown public override string ToString() { return ((Enum)id).ToString(); } public static implicit operator BGHNEHPFHGC(Team ew) { return (BGHNEHPFHGC)ew.id; } public static implicit operator Team(int id) { return new Team(id); } public static implicit operator Enum(Team ew) { return (Enum)ew.id; } public static implicit operator Team(Enum val) { return new Team((int)val); } public static implicit operator Team(BGHNEHPFHGC val) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return new Team(val); } } public class Player { private readonly ALDOKEMAOMB _player; public Character Character { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _player.JPMBNEEFOJH(); } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _player.IJOLFCPOMJM(value); } } public CharacterVariant CharacterVariant { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return variant; } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) variant = value; } } public Character CharacterSelected { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _player.CMLGLEHDOCN(); } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _player.CGNNOILEBDK(value); } } public bool CharacterSelectedIsRandom => _player.DELMJMNAENA(); public
plugins/LLBModdingLib/System.Runtime.Serialization.dll
Decompiled 4 days agousing System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Configuration; using System.Diagnostics; using System.IO; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization.Formatters; using System.Security; using System.Security.Permissions; using System.Text; using System.Xml; using System.Xml.Schema; [assembly: CompilationRelaxations(8)] [assembly: CLSCompliant(true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("Mono development team")] [assembly: AssemblyCopyright("(c) Various Mono authors")] [assembly: AssemblyDefaultAlias("System.Runtime.Serialization.dll")] [assembly: AssemblyDescription("System.Runtime.Serialization.dll")] [assembly: AssemblyFileVersion("3.0.4506.648")] [assembly: AssemblyInformationalVersion("3.0.4506.648")] [assembly: AssemblyProduct("Mono Common Language Infrastructure")] [assembly: AssemblyTitle("System.Runtime.Serialization.dll")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SatelliteContractVersion("3.0.0.0")] [assembly: InternalsVisibleTo("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: ComCompatibleVersion(1, 0, 3300, 0)] [assembly: ComVisible(false)] [assembly: AllowPartiallyTrustedCallers] [assembly: SecurityCritical(SecurityCriticalScope.Explicit)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.0.0.0")] [module: UnverifiableCode] namespace System { [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoDocumentationNoteAttribute : MonoTODOAttribute { public MonoDocumentationNoteAttribute(string comment) { } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoExtensionAttribute : MonoTODOAttribute { public MonoExtensionAttribute(string comment) { } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoInternalNoteAttribute : MonoTODOAttribute { public MonoInternalNoteAttribute(string comment) { } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoLimitationAttribute : MonoTODOAttribute { public MonoLimitationAttribute(string comment) { } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoNotSupportedAttribute : MonoTODOAttribute { public MonoNotSupportedAttribute(string comment) { } } [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] internal class MonoTODOAttribute : Attribute { public string Comment { get { throw null; } } public MonoTODOAttribute() { } public MonoTODOAttribute(string comment) { } } } namespace System.Xml { public interface IFragmentCapableXmlDictionaryWriter { bool CanFragment { get; } void EndFragment(); void StartFragment(Stream stream, bool generateSelfContainedTextFragment); void WriteFragment(byte[] buffer, int offset, int count); } public interface IStreamProvider { Stream GetStream(); void ReleaseStream(Stream stream); } public interface IXmlBinaryReaderInitializer { void SetInput(byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quota, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose); void SetInput(Stream stream, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quota, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose); } public interface IXmlBinaryWriterInitializer { void SetOutput(Stream stream, IXmlDictionary dictionary, XmlBinaryWriterSession session, bool ownsStream); } public interface IXmlDictionary { bool TryLookup(int key, out XmlDictionaryString result); bool TryLookup(string value, out XmlDictionaryString result); bool TryLookup(XmlDictionaryString value, out XmlDictionaryString result); } public interface IXmlMtomReaderInitializer { void SetInput(byte[] buffer, int offset, int count, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose); void SetInput(Stream stream, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose); } public interface IXmlMtomWriterInitializer { void SetOutput(Stream stream, Encoding encoding, int maxSizeInBytes, string startInfo, string boundary, string startUri, bool writeMessageHeaders, bool ownsStream); } public interface IXmlTextReaderInitializer { void SetInput(byte[] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quota, OnXmlDictionaryReaderClose onClose); void SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quota, OnXmlDictionaryReaderClose onClose); } public interface IXmlTextWriterInitializer { void SetOutput(Stream stream, Encoding encoding, bool ownsStream); } public delegate void OnXmlDictionaryReaderClose(XmlDictionaryReader reader); public class UniqueId { public int CharArrayLength { [SecurityCritical] [SecurityTreatAsSafe] get { throw null; } } public bool IsGuid { get { throw null; } } public UniqueId() { } public UniqueId(byte[] id) { } [SecurityCritical] [SecurityTreatAsSafe] public UniqueId(byte[] id, int offset) { } [SecurityCritical] [SecurityTreatAsSafe] public UniqueId(char[] id, int offset, int count) { } public UniqueId(Guid id) { } [SecurityCritical] [SecurityTreatAsSafe] public UniqueId(string value) { } public override bool Equals(object obj) { throw null; } [MonoTODO("Determine semantics when IsGuid==true")] public override int GetHashCode() { throw null; } public static bool operator ==(UniqueId id1, UniqueId id2) { throw null; } public static bool operator !=(UniqueId id1, UniqueId id2) { throw null; } [SecurityCritical] [SecurityTreatAsSafe] public int ToCharArray(char[] array, int offset) { throw null; } [SecurityCritical] [SecurityTreatAsSafe] public override string ToString() { throw null; } [SecurityCritical] [SecurityTreatAsSafe] public bool TryGetGuid(byte[] buffer, int offset) { throw null; } public bool TryGetGuid(out Guid guid) { guid = default(Guid); throw null; } } public class XmlBinaryReaderSession : IXmlDictionary { public XmlDictionaryString Add(int id, string value) { throw null; } public void Clear() { } public bool TryLookup(int key, out XmlDictionaryString result) { result = null; throw null; } public bool TryLookup(string value, out XmlDictionaryString result) { result = null; throw null; } public bool TryLookup(XmlDictionaryString value, out XmlDictionaryString result) { result = null; throw null; } } public class XmlBinaryWriterSession { public void Reset() { } public virtual bool TryAdd(XmlDictionaryString value, out int key) { key = 0; throw null; } } public class XmlDictionary : IXmlDictionary { public static IXmlDictionary Empty { get { throw null; } } public XmlDictionary() { } public XmlDictionary(int capacity) { } public virtual XmlDictionaryString Add(string value) { throw null; } public virtual bool TryLookup(int key, out XmlDictionaryString result) { result = null; throw null; } public virtual bool TryLookup(string value, out XmlDictionaryString result) { result = null; throw null; } public virtual bool TryLookup(XmlDictionaryString value, out XmlDictionaryString result) { result = null; throw null; } } public abstract class XmlDictionaryReader : XmlReader { public virtual bool CanCanonicalize { get { throw null; } } public virtual XmlDictionaryReaderQuotas Quotas { get { throw null; } } public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session) { throw null; } public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, int offset, int count, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, int offset, int count, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateBinaryReader(byte[] buffer, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateBinaryReader(Stream stream, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateBinaryReader(Stream stream, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session) { throw null; } public static XmlDictionaryReader CreateBinaryReader(Stream stream, IXmlDictionary dictionary, XmlDictionaryReaderQuotas quotas, XmlBinaryReaderSession session, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateBinaryReader(Stream stream, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateDictionaryReader(XmlReader reader) { throw null; } public static XmlDictionaryReader CreateMtomReader(byte[] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateMtomReader(byte[] buffer, int offset, int count, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateMtomReader(byte[] buffer, int offset, int count, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateMtomReader(byte[] buffer, int offset, int count, Encoding[] encodings, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateMtomReader(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateMtomReader(Stream stream, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateMtomReader(Stream stream, Encoding[] encodings, string contentType, XmlDictionaryReaderQuotas quotas, int maxBufferSize, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateMtomReader(Stream stream, Encoding[] encodings, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateTextReader(byte[] buffer, int offset, int count, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateTextReader(byte[] buffer, int offset, int count, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateTextReader(byte[] buffer, XmlDictionaryReaderQuotas quotas) { throw null; } public static XmlDictionaryReader CreateTextReader(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose) { throw null; } public static XmlDictionaryReader CreateTextReader(Stream stream, XmlDictionaryReaderQuotas quotas) { throw null; } public virtual void EndCanonicalization() { } public virtual string GetAttribute(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual int IndexOfLocalName(string[] localNames, string namespaceUri) { throw null; } public virtual int IndexOfLocalName(XmlDictionaryString[] localNames, XmlDictionaryString namespaceUri) { throw null; } public virtual bool IsArray(out Type type) { type = null; throw null; } public virtual bool IsLocalName(string localName) { throw null; } public virtual bool IsLocalName(XmlDictionaryString localName) { throw null; } public virtual bool IsNamespaceUri(string namespaceUri) { throw null; } public virtual bool IsNamespaceUri(XmlDictionaryString namespaceUri) { throw null; } public virtual bool IsStartArray(out Type type) { type = null; throw null; } public virtual bool IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } protected bool IsTextNode(XmlNodeType nodeType) { throw null; } public virtual void MoveToStartElement() { } public virtual void MoveToStartElement(string name) { } public virtual void MoveToStartElement(string localName, string namespaceUri) { } public virtual void MoveToStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public virtual int ReadArray(string localName, string namespaceUri, bool[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, DateTime[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, decimal[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, double[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, Guid[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, short[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, int[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, long[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, float[] array, int offset, int length) { throw null; } public virtual int ReadArray(string localName, string namespaceUri, TimeSpan[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, double[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, short[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, int[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, long[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, float[] array, int offset, int length) { throw null; } public virtual int ReadArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int length) { throw null; } public virtual bool[] ReadBooleanArray(string localName, string namespaceUri) { throw null; } public virtual bool[] ReadBooleanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public override object ReadContentAs(Type type, IXmlNamespaceResolver nsResolver) { throw null; } public virtual byte[] ReadContentAsBase64() { throw null; } public virtual byte[] ReadContentAsBinHex() { throw null; } protected byte[] ReadContentAsBinHex(int maxByteArrayContentLength) { throw null; } [MonoTODO] public virtual int ReadContentAsChars(char[] chars, int offset, int count) { throw null; } public override decimal ReadContentAsDecimal() { throw null; } public override float ReadContentAsFloat() { throw null; } public virtual Guid ReadContentAsGuid() { throw null; } public virtual void ReadContentAsQualifiedName(out string localName, out string namespaceUri) { localName = null; namespaceUri = null; } public override string ReadContentAsString() { throw null; } [MonoTODO] protected string ReadContentAsString(int maxStringContentLength) { throw null; } [MonoTODO("there is exactly no information on the web")] public virtual string ReadContentAsString(string[] strings, out int index) { index = 0; throw null; } [MonoTODO("there is exactly no information on the web")] public virtual string ReadContentAsString(XmlDictionaryString[] strings, out int index) { index = 0; throw null; } public virtual TimeSpan ReadContentAsTimeSpan() { throw null; } public virtual UniqueId ReadContentAsUniqueId() { throw null; } public virtual DateTime[] ReadDateTimeArray(string localName, string namespaceUri) { throw null; } public virtual DateTime[] ReadDateTimeArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual decimal[] ReadDecimalArray(string localName, string namespaceUri) { throw null; } public virtual decimal[] ReadDecimalArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual double[] ReadDoubleArray(string localName, string namespaceUri) { throw null; } public virtual double[] ReadDoubleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual byte[] ReadElementContentAsBase64() { throw null; } public virtual byte[] ReadElementContentAsBinHex() { throw null; } public override bool ReadElementContentAsBoolean() { throw null; } public override DateTime ReadElementContentAsDateTime() { throw null; } public override decimal ReadElementContentAsDecimal() { throw null; } public override double ReadElementContentAsDouble() { throw null; } public override float ReadElementContentAsFloat() { throw null; } public virtual Guid ReadElementContentAsGuid() { throw null; } public override int ReadElementContentAsInt() { throw null; } public override long ReadElementContentAsLong() { throw null; } public override string ReadElementContentAsString() { throw null; } public virtual TimeSpan ReadElementContentAsTimeSpan() { throw null; } public virtual UniqueId ReadElementContentAsUniqueId() { throw null; } public virtual void ReadFullStartElement() { } public virtual void ReadFullStartElement(string name) { } public virtual void ReadFullStartElement(string localName, string namespaceUri) { } public virtual void ReadFullStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public virtual Guid[] ReadGuidArray(string localName, string namespaceUri) { throw null; } public virtual Guid[] ReadGuidArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual short[] ReadInt16Array(string localName, string namespaceUri) { throw null; } public virtual short[] ReadInt16Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual int[] ReadInt32Array(string localName, string namespaceUri) { throw null; } public virtual int[] ReadInt32Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual long[] ReadInt64Array(string localName, string namespaceUri) { throw null; } public virtual long[] ReadInt64Array(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual float[] ReadSingleArray(string localName, string namespaceUri) { throw null; } public virtual float[] ReadSingleArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual void ReadStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public override string ReadString() { throw null; } [MonoTODO] protected string ReadString(int maxStringContentLength) { throw null; } public virtual TimeSpan[] ReadTimeSpanArray(string localName, string namespaceUri) { throw null; } public virtual TimeSpan[] ReadTimeSpanArray(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { throw null; } public virtual int ReadValueAsBase64(byte[] bytes, int start, int length) { throw null; } public virtual void StartCanonicalization(Stream stream, bool includeComments, string[] inclusivePrefixes) { } public virtual bool TryGetArrayLength(out int count) { count = 0; throw null; } public virtual bool TryGetBase64ContentLength(out int count) { count = 0; throw null; } public virtual bool TryGetLocalNameAsDictionaryString(out XmlDictionaryString localName) { localName = null; throw null; } public virtual bool TryGetNamespaceUriAsDictionaryString(out XmlDictionaryString namespaceUri) { namespaceUri = null; throw null; } public virtual bool TryGetValueAsDictionaryString(out XmlDictionaryString value) { value = null; throw null; } } public sealed class XmlDictionaryReaderQuotas { public static XmlDictionaryReaderQuotas Max { get { throw null; } } public int MaxArrayLength { get { throw null; } set { } } public int MaxBytesPerRead { get { throw null; } set { } } public int MaxDepth { get { throw null; } set { } } public int MaxNameTableCharCount { get { throw null; } set { } } public int MaxStringContentLength { get { throw null; } set { } } public void CopyTo(XmlDictionaryReaderQuotas quota) { } } public class XmlDictionaryString { public IXmlDictionary Dictionary { get { throw null; } } public static XmlDictionaryString Empty { get { throw null; } } public int Key { get { throw null; } } public string Value { get { throw null; } } public XmlDictionaryString(IXmlDictionary dictionary, string value, int key) { } public override string ToString() { throw null; } } public abstract class XmlDictionaryWriter : XmlWriter { public virtual bool CanCanonicalize { get { throw null; } } public static XmlDictionaryWriter CreateBinaryWriter(Stream stream) { throw null; } public static XmlDictionaryWriter CreateBinaryWriter(Stream stream, IXmlDictionary dictionary) { throw null; } public static XmlDictionaryWriter CreateBinaryWriter(Stream stream, IXmlDictionary dictionary, XmlBinaryWriterSession session) { throw null; } public static XmlDictionaryWriter CreateBinaryWriter(Stream stream, IXmlDictionary dictionary, XmlBinaryWriterSession session, bool ownsStream) { throw null; } public static XmlDictionaryWriter CreateDictionaryWriter(XmlWriter writer) { throw null; } public static XmlDictionaryWriter CreateMtomWriter(Stream stream, Encoding encoding, int maxSizeInBytes, string startInfo) { throw null; } public static XmlDictionaryWriter CreateMtomWriter(Stream stream, Encoding encoding, int maxSizeInBytes, string startInfo, string boundary, string startUri, bool writeMessageHeaders, bool ownsStream) { throw null; } public static XmlDictionaryWriter CreateTextWriter(Stream stream) { throw null; } public static XmlDictionaryWriter CreateTextWriter(Stream stream, Encoding encoding) { throw null; } public static XmlDictionaryWriter CreateTextWriter(Stream stream, Encoding encoding, bool ownsStream) { throw null; } public virtual void EndCanonicalization() { } public virtual void StartCanonicalization(Stream stream, bool includeComments, string[] inclusivePrefixes) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, bool[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, DateTime[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, decimal[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, double[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, Guid[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, short[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, int[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, long[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, float[] array, int offset, int length) { } public virtual void WriteArray(string prefix, string localName, string namespaceUri, TimeSpan[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, bool[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, DateTime[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, decimal[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, double[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, Guid[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, short[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, int[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, long[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, float[] array, int offset, int length) { } public virtual void WriteArray(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, TimeSpan[] array, int offset, int length) { } public void WriteAttributeString(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, string value) { } public void WriteAttributeString(XmlDictionaryString localName, XmlDictionaryString namespaceUri, string value) { } public void WriteElementString(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri, string value) { } public void WriteElementString(XmlDictionaryString localName, XmlDictionaryString namespaceUri, string value) { } public virtual void WriteNode(XmlDictionaryReader reader, bool defattr) { } public override void WriteNode(XmlReader reader, bool defattr) { } public virtual void WriteQualifiedName(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public virtual void WriteStartAttribute(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public void WriteStartAttribute(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public virtual void WriteStartElement(string prefix, XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public void WriteStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri) { } public virtual void WriteString(XmlDictionaryString value) { } protected virtual void WriteTextNode(XmlDictionaryReader reader, bool isAttribute) { } public virtual void WriteValue(Guid guid) { } public virtual void WriteValue(TimeSpan duration) { } public virtual void WriteValue(IStreamProvider value) { } public virtual void WriteValue(UniqueId id) { } public virtual void WriteValue(XmlDictionaryString value) { } public virtual void WriteXmlAttribute(string localName, string value) { } public virtual void WriteXmlAttribute(XmlDictionaryString localName, XmlDictionaryString value) { } public virtual void WriteXmlnsAttribute(string prefix, string namespaceUri) { } public virtual void WriteXmlnsAttribute(string prefix, XmlDictionaryString namespaceUri) { } } } namespace System.Runtime.Serialization { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] public sealed class CollectionDataContractAttribute : Attribute { public bool IsReference { [CompilerGenerated] get { throw null; } [CompilerGenerated] set { } } public string ItemName { get { throw null; } set { } } public string KeyName { get { throw null; } set { } } public string Name { get { throw null; } set { } } public string Namespace { get { throw null; } set { } } public string ValueName { get { throw null; } set { } } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module, Inherited = false, AllowMultiple = true)] public sealed class ContractNamespaceAttribute : Attribute { public string ClrNamespace { get { throw null; } set { } } public string ContractNamespace { get { throw null; } } public ContractNamespaceAttribute(string ns) { } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, Inherited = false, AllowMultiple = false)] public sealed class DataContractAttribute : Attribute { public bool IsReference { [CompilerGenerated] get { throw null; } [CompilerGenerated] set { } } public string Name { get { throw null; } set { } } public string Namespace { get { throw null; } set { } } } public sealed class DataContractSerializer : XmlObjectSerializer { public IDataContractSurrogate DataContractSurrogate { get { throw null; } } public bool IgnoreExtensionDataObject { get { throw null; } } public ReadOnlyCollection<Type> KnownTypes { get { throw null; } } public int MaxItemsInObjectGraph { get { throw null; } } public bool PreserveObjectReferences { get { throw null; } } public DataContractSerializer(Type type) { } public DataContractSerializer(Type type, IEnumerable<Type> knownTypes) { } public DataContractSerializer(Type type, IEnumerable<Type> knownTypes, int maxObjectsInGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate) { } public DataContractSerializer(Type type, string rootName, string rootNamespace) { } public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable<Type> knownTypes) { } public DataContractSerializer(Type type, string rootName, string rootNamespace, IEnumerable<Type> knownTypes, int maxObjectsInGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate) { } public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace) { } public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable<Type> knownTypes) { } public DataContractSerializer(Type type, XmlDictionaryString rootName, XmlDictionaryString rootNamespace, IEnumerable<Type> knownTypes, int maxObjectsInGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate) { } public override bool IsStartObject(XmlDictionaryReader reader) { throw null; } public override bool IsStartObject(XmlReader reader) { throw null; } public override object ReadObject(XmlDictionaryReader reader, bool verifyObjectName) { throw null; } public override object ReadObject(XmlReader reader) { throw null; } public override object ReadObject(XmlReader reader, bool verifyObjectName) { throw null; } public override void WriteEndObject(XmlDictionaryWriter writer) { } public override void WriteEndObject(XmlWriter writer) { } public override void WriteObject(XmlWriter writer, object graph) { } [MonoTODO("use DataContractSurrogate")] public override void WriteObjectContent(XmlDictionaryWriter writer, object graph) { } public override void WriteObjectContent(XmlWriter writer, object graph) { } public override void WriteStartObject(XmlDictionaryWriter writer, object graph) { } public override void WriteStartObject(XmlWriter writer, object graph) { } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = false)] public sealed class DataMemberAttribute : Attribute { public bool EmitDefaultValue { get { throw null; } set { } } public bool IsRequired { get { throw null; } set { } } public string Name { get { throw null; } set { } } public int Order { get { throw null; } set { } } } [AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)] public sealed class EnumMemberAttribute : Attribute { public string Value { get { throw null; } set { } } } public class ExportOptions { public IDataContractSurrogate DataContractSurrogate { get { throw null; } set { } } [MonoTODO] public Collection<Type> KnownTypes { get { throw null; } } } public sealed class ExtensionDataObject { internal ExtensionDataObject() { } } public interface IDataContractSurrogate { object GetCustomDataToExport(MemberInfo memberInfo, Type dataContractType); object GetCustomDataToExport(Type clrType, Type dataContractType); Type GetDataContractType(Type type); object GetDeserializedObject(object obj, Type targetType); void GetKnownCustomDataTypes(Collection<Type> customDataTypes); object GetObjectToSerialize(object obj, Type targetType); Type GetReferencedTypeOnImport(string typeName, string typeNamespace, object customData); CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit); } public interface IExtensibleDataObject { ExtensionDataObject ExtensionData { get; set; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = false, AllowMultiple = false)] public sealed class IgnoreDataMemberAttribute : Attribute { } public class ImportOptions { public CodeDomProvider CodeProvider { get { throw null; } set { } } [MonoTODO] public IDataContractSurrogate DataContractSurrogate { get { throw null; } set { } } [MonoTODO] public bool EnableDataBinding { get { throw null; } set { } } public bool GenerateInternal { get { throw null; } set { } } public bool GenerateSerializable { get { throw null; } set { } } [MonoTODO] public bool ImportXmlType { get { throw null; } set { } } public IDictionary<string, string> Namespaces { get { throw null; } } [MonoTODO] public ICollection<Type> ReferencedCollectionTypes { get { throw null; } } [MonoTODO] public ICollection<Type> ReferencedTypes { get { throw null; } } } [Serializable] public class InvalidDataContractException : Exception { public InvalidDataContractException() { } protected InvalidDataContractException(SerializationInfo info, StreamingContext context) { } public InvalidDataContractException(string message) { } public InvalidDataContractException(string message, Exception innerException) { } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true, AllowMultiple = true)] public sealed class KnownTypeAttribute : Attribute { public string MethodName { get { throw null; } } public Type Type { get { throw null; } } public KnownTypeAttribute(string methodName) { } public KnownTypeAttribute(Type type) { } } public sealed class NetDataContractSerializer : XmlObjectSerializer, IFormatter { public FormatterAssemblyStyle AssemblyFormat { get { throw null; } set { } } public SerializationBinder Binder { get { throw null; } set { } } public StreamingContext Context { get { throw null; } set { } } public bool IgnoreExtensionDataObject { get { throw null; } } public int MaxItemsInObjectGraph { get { throw null; } } public ISurrogateSelector SurrogateSelector { get { throw null; } set { } } public NetDataContractSerializer() { } public NetDataContractSerializer(StreamingContext context) { } public NetDataContractSerializer(StreamingContext context, int maxItemsInObjectGraph, bool ignoreExtensibleDataObject, FormatterAssemblyStyle assemblyFormat, ISurrogateSelector surrogateSelector) { } public NetDataContractSerializer(string rootName, string rootNamespace) { } public NetDataContractSerializer(string rootName, string rootNamespace, StreamingContext context, int maxItemsInObjectGraph, bool ignoreExtensibleDataObject, FormatterAssemblyStyle assemblyFormat, ISurrogateSelector surrogateSelector) { } public NetDataContractSerializer(XmlDictionaryString rootName, XmlDictionaryString rootNamespace) { } public NetDataContractSerializer(XmlDictionaryString rootName, XmlDictionaryString rootNamespace, StreamingContext context, int maxItemsInObjectGraph, bool ignoreExtensibleDataObject, FormatterAssemblyStyle assemblyFormat, ISurrogateSelector surrogateSelector) { } public object Deserialize(Stream stream) { throw null; } [MonoTODO] public override bool IsStartObject(XmlDictionaryReader reader) { throw null; } public override object ReadObject(XmlDictionaryReader reader, bool readContentOnly) { throw null; } public void Serialize(Stream stream, object graph) { } public override void WriteEndObject(XmlDictionaryWriter writer) { } [MonoTODO("support arrays; support Serializable; support SharedType; use DataContractSurrogate")] public override void WriteObjectContent(XmlDictionaryWriter writer, object graph) { } public override void WriteStartObject(XmlDictionaryWriter writer, object graph) { } } public abstract class XmlObjectSerializer { public abstract bool IsStartObject(XmlDictionaryReader reader); public virtual bool IsStartObject(XmlReader reader) { throw null; } public virtual object ReadObject(Stream stream) { throw null; } public virtual object ReadObject(XmlDictionaryReader reader) { throw null; } [MonoTODO] public abstract object ReadObject(XmlDictionaryReader reader, bool readContentOnly); public virtual object ReadObject(XmlReader reader) { throw null; } public virtual object ReadObject(XmlReader reader, bool readContentOnly) { throw null; } public abstract void WriteEndObject(XmlDictionaryWriter writer); public virtual void WriteEndObject(XmlWriter writer) { } public virtual void WriteObject(Stream stream, object graph) { } public virtual void WriteObject(XmlDictionaryWriter writer, object graph) { } public virtual void WriteObject(XmlWriter writer, object graph) { } public abstract void WriteObjectContent(XmlDictionaryWriter writer, object graph); public virtual void WriteObjectContent(XmlWriter writer, object graph) { } public abstract void WriteStartObject(XmlDictionaryWriter writer, object graph); public virtual void WriteStartObject(XmlWriter writer, object graph) { } } public static class XmlSerializableServices { [MonoTODO] public static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName) { } public static XmlNode[] ReadNodes(XmlReader xmlReader) { throw null; } public static void WriteNodes(XmlWriter xmlWriter, XmlNode[] nodes) { } } public class XsdDataContractExporter { public ExportOptions Options { [CompilerGenerated] get { throw null; } [CompilerGenerated] set { } } public XmlSchemaSet Schemas { [CompilerGenerated] get { throw null; } } public XsdDataContractExporter() { } public XsdDataContractExporter(XmlSchemaSet schemas) { } public bool CanExport(ICollection<Assembly> assemblies) { throw null; } public bool CanExport(ICollection<Type> types) { throw null; } public bool CanExport(Type type) { throw null; } public void Export(ICollection<Assembly> assemblies) { } public void Export(ICollection<Type> types) { } public void Export(Type type) { } public XmlQualifiedName GetRootElementName(Type type) { throw null; } public XmlSchemaType GetSchemaType(Type type) { throw null; } public XmlQualifiedName GetSchemaTypeName(Type type) { throw null; } } [MonoTODO("support arrays")] public class XsdDataContractImporter { public CodeCompileUnit CodeCompileUnit { [CompilerGenerated] get { throw null; } } public ImportOptions Options { get { throw null; } set { } } public XsdDataContractImporter() { } public XsdDataContractImporter(CodeCompileUnit codeCompileUnit) { } public bool CanImport(XmlSchemaSet schemas) { throw null; } public bool CanImport(XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames) { throw null; } public bool CanImport(XmlSchemaSet schemas, XmlSchemaElement element) { throw null; } public bool CanImport(XmlSchemaSet schemas, XmlQualifiedName typeName) { throw null; } public CodeTypeReference GetCodeTypeReference(XmlQualifiedName typeName) { throw null; } [MonoTODO("use element argument and fill Nullable etc.")] public CodeTypeReference GetCodeTypeReference(XmlQualifiedName typeName, XmlSchemaElement element) { throw null; } public ICollection<CodeTypeReference> GetKnownTypeReferences(XmlQualifiedName typeName) { throw null; } public void Import(XmlSchemaSet schemas) { } public void Import(XmlSchemaSet schemas, ICollection<XmlQualifiedName> typeNames) { } public XmlQualifiedName Import(XmlSchemaSet schemas, XmlSchemaElement element) { throw null; } public void Import(XmlSchemaSet schemas, XmlQualifiedName typeName) { } } } namespace System.Runtime.Serialization.Configuration { public sealed class DataContractSerializerSection : ConfigurationSection { [ConfigurationProperty("declaredTypes", DefaultValue = null)] public DeclaredTypeElementCollection DeclaredTypes { get { throw null; } } protected override ConfigurationPropertyCollection Properties { get { throw null; } } } [MonoTODO] public sealed class DeclaredTypeElement : ConfigurationElement { [ConfigurationProperty(/*Could not decode attribute arguments.*/)] public TypeElementCollection KnownTypes { get { throw null; } } protected override ConfigurationPropertyCollection Properties { get { throw null; } } [ConfigurationProperty(/*Could not decode attribute arguments.*/)] public string Type { get { throw null; } set { } } public DeclaredTypeElement() { } public DeclaredTypeElement(string typeName) { } protected override void PostDeserialize() { } } [ConfigurationCollection(typeof(DeclaredTypeElement))] public sealed class DeclaredTypeElementCollection : ConfigurationElementCollection { public DeclaredTypeElement this[int index] { get { throw null; } set { } } public DeclaredTypeElement this[string typeName] { get { throw null; } set { } } public void Add(DeclaredTypeElement element) { } public void Clear() { } public bool Contains(string typeName) { throw null; } protected override ConfigurationElement CreateNewElement() { throw null; } protected override object GetElementKey(ConfigurationElement element) { throw null; } public int IndexOf(DeclaredTypeElement element) { throw null; } public void Remove(DeclaredTypeElement element) { } public void Remove(string typeName) { } public void RemoveAt(int index) { } } public sealed class ParameterElement : ConfigurationElement { [ConfigurationProperty("index", DefaultValue = 0)] [IntegerValidator(MinValue = 0)] public int Index { get { throw null; } set { } } [ConfigurationProperty(/*Could not decode attribute arguments.*/)] public ParameterElementCollection Parameters { get { throw null; } } protected override ConfigurationPropertyCollection Properties { get { throw null; } } [ConfigurationProperty("type", DefaultValue = "")] [StringValidator(MinLength = 0)] public string Type { get { throw null; } set { } } public ParameterElement() { } public ParameterElement(int index) { } public ParameterElement(string typeName) { } protected override void PostDeserialize() { } protected override void PreSerialize(XmlWriter writer) { } } [ConfigurationCollection(/*Could not decode attribute arguments.*/)] public sealed class ParameterElementCollection : ConfigurationElementCollection { public override ConfigurationElementCollectionType CollectionType { get { throw null; } } protected override string ElementName { get { throw null; } } public ParameterElement this[int index] { get { throw null; } set { } } public void Add(ParameterElement element) { } public void Clear() { } public bool Contains(string typeName) { throw null; } protected override ConfigurationElement CreateNewElement() { throw null; } protected override object GetElementKey(ConfigurationElement element) { throw null; } public int IndexOf(ParameterElement element) { throw null; } public void Remove(ParameterElement element) { } public void RemoveAt(int index) { } } public sealed class SerializationSectionGroup : ConfigurationSectionGroup { public DataContractSerializerSection DataContractSerializer { get { throw null; } } public static SerializationSectionGroup GetSectionGroup(Configuration config) { throw null; } } public sealed class TypeElement : ConfigurationElement { [ConfigurationProperty("index", DefaultValue = 0)] [IntegerValidator(MinValue = 0)] public int Index { get { throw null; } set { } } [ConfigurationProperty(/*Could not decode attribute arguments.*/)] public ParameterElementCollection Parameters { get { throw null; } } protected override ConfigurationPropertyCollection Properties { get { throw null; } } [ConfigurationProperty("type", DefaultValue = "")] [StringValidator(MinLength = 0)] public string Type { get { throw null; } set { } } public TypeElement() { } public TypeElement(string typeName) { } protected override void Reset(ConfigurationElement parentElement) { } } [ConfigurationCollection(/*Could not decode attribute arguments.*/)] public sealed class TypeElementCollection : ConfigurationElementCollection { public override ConfigurationElementCollectionType CollectionType { get { throw null; } } protected override string ElementName { get { throw null; } } public TypeElement this[int index] { get { throw null; } set { } } public void Add(TypeElement element) { } public void Clear() { } protected override ConfigurationElement CreateNewElement() { throw null; } protected override object GetElementKey(ConfigurationElement element) { throw null; } public int IndexOf(TypeElement element) { throw null; } public void Remove(TypeElement element) { } public void RemoveAt(int index) { } } }