Decompiled source of LLBModdingLib v0.9.3
plugins/LLBModdingLib/LLBModdingLib.dll
Decompiled 2 months 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.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.9.3.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 LLBML { public static class StateApi { public static GameMode CurrentGameMode => JOMBNFKIHIC.GIGAKBJGFDI.PNJOKAICMNN; } [BepInPlugin("fr.glomzubuk.plugins.llb.llbml", "LLBModdingLib", "0.9.3")] [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.9.3"; } 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; } } internal 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}")] internal 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(); } [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); } } } namespace LLBML.Networking { public static class EnvelopeApi { public delegate void OnReceiveEnvelopeHandler(LocalPeer sender, EnvelopeEventArgs e); private static ManualLogSource Logger = LLBMLPlugin.Log; public static event OnReceiveEnvelopeHandler OnReceiveCustomEnvelope; internal static void OnReceiveCustomEnvelopeCall(LocalPeer sender, EnvelopeEventArgs e) { if (EnvelopeApi.OnReceiveCustomEnvelope != null) { EnvelopeApi.OnReceiveCustomEnvelope(sender, e); } } internal static byte[] WriteBytesEnvelope(Envelope envelope, SpecialCode specialCode = SpecialCode.SUPER_DUPER_SECRET_CODE_THAT_IS_THE_CHOOSEN_ONE_AS_DESTINY_WANTED_IT_TO_BE_THAT_WAS_DESCRIBED_IN_SACRED_DISCORD_PRIVATE_MESSAGES, bool socketHeader = false, byte byte0 = 0) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) ushort num = (ushort)envelope.message.msg; if (MessageApi.customMessages.ContainsKey(num) || MessageApi.internalMessageCodes.Contains(num)) { using (MemoryStream memoryStream = new MemoryStream()) { using BinaryWriter binaryWriter = new BinaryWriter(memoryStream); if (socketHeader) { binaryWriter.Write(byte0); binaryWriter.Write(envelope.packetNr); } binaryWriter.Write(envelope.sender); binaryWriter.Write(envelope.receiver); binaryWriter.Write((byte)specialCode); binaryWriter.Write((ushort)envelope.message.msg); binaryWriter.Write(envelope.message.playerNr); binaryWriter.Write(envelope.message.index); if (MessageApi.customMessages[num].messageActions.customWriter != null) { MessageApi.customMessages[num].messageActions.customWriter(binaryWriter, envelope.message.ob, envelope.message.obSize); } else if (envelope.message.ob is byte[] array) { binaryWriter.Write(array.Length); binaryWriter.Write(array); } else { binaryWriter.Write(-1); if (envelope.message.ob != null) { Logger.LogWarning((object)"Got message with an invalid payload, either provide a custom writer or pass a byte[] as the message object"); } } return memoryStream.ToArray(); } } return null; } internal static Envelope? ReceiveEnvelope(byte[] bytes, bool socketHeader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) Envelope val = default(Envelope); SpecialCode specialCode = SpecialCode.SUPER_DUPER_SECRET_CODE_THAT_IS_THE_CHOOSEN_ONE_AS_DESTINY_WANTED_IT_TO_BE_THAT_WAS_DESCRIBED_IN_SACRED_DISCORD_PRIVATE_MESSAGES; using (MemoryStream input = new MemoryStream(bytes)) { using BinaryReader binaryReader = new BinaryReader(input); if (socketHeader) { binaryReader.ReadByte(); val.packetNr = binaryReader.ReadInt32(); } val.sender = binaryReader.ReadString(); val.receiver = binaryReader.ReadString(); specialCode = (SpecialCode)binaryReader.ReadByte(); if (!MessageApi.internalMessageCodes.Contains((int)specialCode)) { return null; } ushort num = binaryReader.ReadUInt16(); if (!MessageApi.customMessages.ContainsKey(num)) { return null; } val.message.msg = (Msg)num; val.message.playerNr = binaryReader.ReadInt32(); val.message.index = binaryReader.ReadInt32(); if (MessageApi.customMessages[num].messageActions.customReader != null && specialCode == SpecialCode.SUPER_DUPER_SECRET_CODE_THAT_IS_THE_CHOOSEN_ONE_AS_DESTINY_WANTED_IT_TO_BE_THAT_WAS_DESCRIBED_IN_SACRED_DISCORD_PRIVATE_MESSAGES) { MessageApi.customMessages[num].messageActions.customReader(binaryReader, val.message); } else { val.message.obSize = binaryReader.ReadInt32(); if (val.message.obSize != -1) { val.message.ob = binaryReader.ReadBytes(val.message.obSize); } else { val.message.ob = null; } } } _ = 204; return val; } } public class EnvelopeEventArgs : EventArgs { public Envelope Envelope { get; private set; } public EnvelopeEventArgs(Envelope envelope) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Envelope = envelope; } } public enum TransactionState { Sending, Receiving, Done } public enum TransactionCode : byte { Start, Fragment, Ack } public class Transaction : IEnumerable, IByteable { private static ManualLogSource Logger = LLBMLPlugin.Log; internal const uint TransactionOverhead = 7u; internal const uint MaxFragmentSize = 1048569u; internal static Dictionary<string, Transaction> transactionCache = new Dictionary<string, Transaction>(); internal static ushort transactionCount = 0; private readonly ushort index; private readonly int channel; private readonly CSteamID sender; private readonly CSteamID receiver; private readonly uint fragmentSize; private byte[][] fragments; private uint currentFragment; internal Dictionary<TransactionCode, Action<CSteamID, byte[]>> TCodeMapping = new Dictionary<TransactionCode, Action<CSteamID, byte[]>> { [TransactionCode.Start] = ReceiveStart, [TransactionCode.Fragment] = ReceiveFragment, [TransactionCode.Ack] = ReceiveAck }; public string id { get; private set; } public Transaction(ushort index, CSteamID sender, CSteamID receiver, byte[] data, int channel = 0, uint fragmentSize = 1048569u, TransactionState state = TransactionState.Sending) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) id = GetID(sender, receiver, index); this.index = index; this.channel = channel; this.sender = sender; this.receiver = receiver; this.fragmentSize = fragmentSize; uint num = (uint)System.Math.Ceiling((decimal)data.Length / (decimal)fragmentSize); fragments = new byte[num][]; Logger.LogDebug((object)$"Creating transaction from payload with size {data.Length} and with {num} fragments."); for (uint num2 = 0u; num2 < num; num2++) { Logger.LogDebug((object)$"Splitting fragment number {num2}"); byte[] array = new byte[fragmentSize]; uint num3 = num2 * fragmentSize; long length = ((data.Length - num3 - fragmentSize >= 0) ? fragmentSize : (data.Length - num3)); Array.Copy(data, num2 * fragmentSize, array, 0L, length); fragments[num2] = array; } currentFragment = 0u; } public Transaction(ushort index, CSteamID sender, CSteamID receiver, uint nbFragments, int channel, uint fragmentSize) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) id = GetID(sender, receiver, index); this.index = index; this.channel = channel; this.sender = sender; this.receiver = receiver; this.fragmentSize = fragmentSize; fragments = new byte[nbFragments][]; currentFragment = 0u; } public static Transaction Create(Envelope envelope) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) CSteamID val = NetworkApi.PeerIDToCSteamID(envelope.sender); CSteamID val2 = NetworkApi.PeerIDToCSteamID(envelope.receiver); Transaction transaction = new Transaction(transactionCount++, val, val2, ((Envelope)(ref envelope)).ToBytes(false, (byte)0)); transactionCache.Add(transaction.id, transaction); return transaction; } public static Transaction Create(CSteamID destination, byte[] data, int channel = 0) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) CSteamID val = NetworkApi.PeerIDToCSteamID(((Peer)P2P.localPeer).peerId); Transaction transaction = new Transaction(transactionCount++, val, destination, data, channel); transactionCache.Add(transaction.id, transaction); return transaction; } public static string GetID(CSteamID sender, CSteamID receiver, int index) { //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) return $"{sender}_{receiver}_{index:00000}"; } internal void Start() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) byte[] array = new byte[1]; array.Add(ToBytes()); Logger.LogDebug((object)("Transaction " + id + " start!")); NetworkApi.SendP2PPacket(receiver, array, EP2PSend.k_EP2PSendUnreliable, 2, transactionSupport: false); } internal static void ReceiveStart(CSteamID sender, byte[] data) { Transaction transaction = FromBytes(data); transactionCache.Add(transaction.id, transaction); Logger.LogDebug((object)("Received transaction start for transaction " + transaction.id + ", start!")); transaction.SendAck(-1); } internal void SendNextFragment() { if (currentFragment <= fragments.Length) { SendFragment(currentFragment); currentFragment++; } } internal void SendFragment(uint fragmentId) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) byte[] array = new byte[1] { 1 }; byte[] fragment = GetFragment(fragmentId); using (MemoryStream memoryStream = new MemoryStream()) { using BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(index); binaryWriter.Write(fragmentId); binaryWriter.Write(fragment.Length); binaryWriter.Write(fragment); array.Add(memoryStream.ToArray()); } Logger.LogDebug((object)$"Sending fragment {fragmentId} for transaction {id}."); NetworkApi.SendP2PPacket(receiver, array, EP2PSend.k_EP2PSendReliable, 2, transactionSupport: false); } internal static void ReceiveFragment(CSteamID sender, byte[] data) { //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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) using MemoryStream input = new MemoryStream(data); using BinaryReader binaryReader = new BinaryReader(input); binaryReader.ReadUInt16(); uint num = binaryReader.ReadUInt32(); int count = binaryReader.ReadInt32(); byte[] fragment = binaryReader.ReadBytes(count); CSteamID val = NetworkApi.PeerIDToCSteamID(((Peer)P2P.localPeer).peerId); string iD = GetID(sender, val, data[0]); Transaction transaction = transactionCache[iD]; Logger.LogDebug((object)$"Received fragment {num} for transaction {iD}."); transaction.AddFragment(num, fragment); transaction.SendAck((int)num); if (transaction.GetMissingFragments().Count == 0) { transaction.End(); } } internal void SendAck(int fragmentId) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) byte[] array = new byte[1] { 2 }; array.Add(ToBytes()); using (MemoryStream memoryStream = new MemoryStream()) { using BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(index); binaryWriter.Write(fragmentId); array.Add(memoryStream.ToArray()); } Logger.LogDebug((object)$"Sending Ack {fragmentId} for transaction {id}."); NetworkApi.SendP2PPacket(receiver, array, EP2PSend.k_EP2PSendUnreliable, 2, transactionSupport: false); } internal static void ReceiveAck(CSteamID sender, byte[] data) { //IL_0026: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) using MemoryStream input = new MemoryStream(data); using BinaryReader binaryReader = new BinaryReader(input); binaryReader.ReadUInt16(); int num = binaryReader.ReadInt32(); CSteamID val = NetworkApi.PeerIDToCSteamID(((Peer)P2P.localPeer).peerId); string iD = GetID(sender, val, data[0]); Transaction transaction = transactionCache[iD]; Logger.LogDebug((object)$"Received Ack {num} for transaction {transaction.id}."); Logger.LogDebug((object)"Sending next fragment..."); if (num == -1) { transaction.currentFragment = 0u; transaction.SendNextFragment(); } else { transaction.SendNextFragment(); } } internal void End() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) byte[] array = fragments.SelectMany((byte[] byteArr) => byteArr).ToArray(); Dictionary<Channel, Action<byte[], uint, CSteamID>> channelMapping = Networking_Patches.NetSteamPatch.channelMapping; Channel key = (Channel)channel; if (channelMapping.ContainsKey(key)) { channelMapping[key](array, (uint)array.Length, sender); } } public void AddFragment(uint fragmentId, byte[] fragment) { if (fragment.Length > fragmentSize) { throw new InvalidOperationException($"Received a fragment too big for transaction {id}. Fragment was {fragment.Length} byte long, expected {fragmentSize} max"); } if (fragmentId == currentFragment) { fragments[currentFragment] = fragment; currentFragment++; return; } throw new NotImplementedException(); } public List<int> GetMissingFragments() { return (from index in fragments.Select((byte[] fragment, int index) => (fragment != null) ? (-1) : index) where index != -1 select index).ToList(); } public byte[] GetFragment(uint fragmentId) { return fragments[fragmentId]; } public IEnumerator GetEnumerator() { return fragments.SelectMany((byte[] fragment) => fragment).GetEnumerator(); } public byte[] ToBytes() { //IL_0035: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) using MemoryStream memoryStream = new MemoryStream(); using BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(index); binaryWriter.Write((uint)fragments.Length); binaryWriter.Write(fragmentSize); CSteamID val = sender; binaryWriter.Write(((object)(CSteamID)(ref val)).ToString()); val = receiver; binaryWriter.Write(((object)(CSteamID)(ref val)).ToString()); binaryWriter.Write(channel); return memoryStream.ToArray(); } public static Transaction FromBytes(byte[] data) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) using MemoryStream input = new MemoryStream(data); using BinaryReader binaryReader = new BinaryReader(input); ushort num = binaryReader.ReadUInt16(); uint nbFragments = binaryReader.ReadUInt32(); uint num2 = binaryReader.ReadUInt32(); CSteamID val = NetworkApi.PeerIDToCSteamID(binaryReader.ReadString()); CSteamID val2 = NetworkApi.PeerIDToCSteamID(binaryReader.ReadString()); int num3 = binaryReader.ReadInt32(); return new Transaction(num, val, val2, nbFragments, num3, num2); } } public static class Networking_Patches { public static class MessageBufferSizePatch { [HarmonyPatch(typeof(P2P), "get_messageBufferSize")] [HarmonyPostfix] public static int get_messageBufferSize_Postfix(int __result) { return 32768; } } public static class NetSteamPatch { public static Dictionary<Channel, Action<byte[], uint, CSteamID>> channelMapping = new Dictionary<Channel, Action<byte[], uint, CSteamID>> { [Channel.ModPackets] = ReceiveModPacket, [Channel.Transaction] = ReceiveTransaction }; [HarmonyPatch(typeof(NetSteam), "DoUpdate")] [HarmonyPrefix] public static bool DoUpdate_Prefix(NetSteam __instance) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) uint num = default(uint); uint arg = default(uint); CSteamID val = default(CSteamID); foreach (KeyValuePair<Channel, Action<byte[], uint, CSteamID>> item in channelMapping) { while (BEPOKFLHPBM.IAGFGJEKDNF(ref num, (int)item.Key)) { byte[] array = new byte[num]; if (BEPOKFLHPBM.FOPENCDPLGO(array, num, ref arg, ref val, (int)item.Key)) { item.Value(array, arg, val); continue; } Logger.LogError((object)$"ReadP2PPacket(Byte array from {val}) failed!"); Logger.LogError((object)$"Tried to read {num} bytes on channel {item.Key}."); } } return true; } public static void ReceiveModPacket(byte[] data, uint bytesRead, CSteamID sender) { byte[] array = data.Take(4).ToArray(); string key = StringUtils.PrettyPrintBytes(array); if (NetworkApi.modPacketCallbacks.ContainsKey(key)) { Action<Peer, byte[]> action = NetworkApi.modPacketCallbacks[key]; try { action(Peer.Get(((object)(CSteamID)(ref sender)).ToString()), data.Skip(4).ToArray()); return; } catch (Exception ex) { LLBMLPlugin.Log.LogError((object)("netID:" + array.ToString() + " returned error during PlayerLobbyState unpacking: " + ex)); return; } } Logger.LogWarning((object)$"Unknown PluginID: Couldn't find a plugin with \"{StringUtils.PrettyPrintBytes(array)}\" as netID. It had {bytesRead - 4} bytes of data."); } public static void ReceiveTransaction(byte[] data, uint bytesRead, CSteamID sender) { StringUtils.PrettyPrintBytes(data.Take(4).ToArray()); } } public static class ReceiveEnvelopePatch { [HarmonyPatch(typeof(LocalPeer), "OnReceiveMessage")] [HarmonyPrefix] public static bool OnReceiveMessage_Prefix(Envelope envelope, LocalPeer __instance) { //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_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) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) Message message = envelope.message; ushort num = (ushort)message.msg; if (num <= 255) { if (MessageApi.vanillaMessageCodes.Contains((byte)num)) { if (MessageApi.vanillaSubscriptions.ContainsKey((byte)num)) { Logger.LogDebug((object)("Received vanilla message with custom subscriptions. Number: " + num + ". Sender: " + envelope.sender)); foreach (CustomMessage item in MessageApi.vanillaSubscriptions[(byte)num]) { item.messageActions.onReceiveCode(message); } } return true; } Logger.LogWarning((object)("Received non-vanilla message in vanilla range. Number: " + num + ". Sender: " + envelope.sender)); EnvelopeApi.OnReceiveCustomEnvelopeCall(__instance, new EnvelopeEventArgs(envelope)); return false; } if (MessageApi.customMessages.ContainsKey(num) || MessageApi.internalMessageCodes.Contains(num)) { Logger.LogDebug((object)("Received custom message. Number: " + num + ". Sender: " + envelope.sender)); MessageApi.customMessages[num].messageActions.onReceiveCode(envelope.message); return false; } EnvelopeApi.OnReceiveCustomEnvelopeCall(__instance, new EnvelopeEventArgs(envelope)); Logger.LogWarning((object)("Received unregistered custom message. Number: " + num + ". Sender: " + envelope.sender)); return false; } } public static class CustomEnvelopeEncodingPatch { [HarmonyPatch(typeof(Envelope), "ToBytes")] [HarmonyPrefix] public static bool ToBytes_Prefix(bool socketHeader, byte byte0, Envelope __instance, ref byte[] __result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) byte[] array = EnvelopeApi.WriteBytesEnvelope(__instance, SpecialCode.SUPER_DUPER_SECRET_CODE_THAT_IS_THE_CHOOSEN_ONE_AS_DESTINY_WANTED_IT_TO_BE_THAT_WAS_DESCRIBED_IN_SACRED_DISCORD_PRIVATE_MESSAGES, socketHeader, byte0); if (array != null) { __result = new byte[array.Length]; array.CopyTo(__result, 0); return false; } return true; } [HarmonyPatch(typeof(Envelope), "FromBytes")] [HarmonyPrefix] public static bool FromBytes_Prefix(byte[] bytes, bool socketHeader, ref Envelope __result) { //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) try { Envelope? val = EnvelopeApi.ReceiveEnvelope(bytes, socketHeader); if (val.HasValue) { __result = val.Value; return false; } return true; } catch (Exception ex) { Logger.LogError((object)("Caught exception while reading Envelope: " + ex.Message + "\n" + ex.StackTrace)); } Logger.LogDebug((object)"Sending byte form envelope to vanilla."); return true; } } private static ManualLogSource Logger = LLBMLPlugin.Log; } internal enum SpecialCode { GREETINGS = 200, SUPER_DUPER_SECRET_CODE_THAT_IS_THE_CHOOSEN_ONE_AS_DESTINY_WANTED_IT_TO_BE_THAT_WAS_DESCRIBED_IN_SACRED_DISCORD_PRIVATE_MESSAGES = 204 } public enum Channel { Vanilla, ModPackets, Transaction } public static class NetworkApi { private static ManualLogSource Logger = LLBMLPlugin.Log; internal const int newMessageBufferSize = 32768; internal const int maxSteamworksReliablePacket = 1048576; public const int netIDSize = 4; internal static Dictionary<string, Action<Peer, byte[]>> modPacketCallbacks = new Dictionary<string, Action<Peer, byte[]>>(); public static bool IsOnline => JOMBNFKIHIC.DGGHBHPEGNK(); public static OnlineMode OnlineMode => JOMBNFKIHIC.OIACPNLFAKK(); [Obsolete("Deprecated, please use Player.LocalPlayerNumber instead.")] public static int LocalPlayerNumber => ((Peer)(P2P.localPeer?)).playerNr ?? 0; public static KIIIINKJKNI GetCurrentPlatform() { return CGLLJHHAJAK.GIGAKBJGFDI; } public static OperatingSystem GetOperatingSystem() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return CGLLJHHAJAK.EFECBCOGFHC; } public static byte[] GetNetworkIdentifier(string source) { MD5CryptoServiceProvider mD5CryptoServiceProvider = new MD5CryptoServiceProvider(); mD5CryptoServiceProvider.ComputeHash(Encoding.ASCII.GetBytes(source)); byte[] hash = mD5CryptoServiceProvider.Hash; LLBMLPlugin.Log.LogDebug((object)$"Hash for {source} = {hash}, length: {hash.Length}"); byte[] array = BinaryUtils.XORFold(hash, 2); LLBMLPlugin.Log.LogDebug((object)$"UID for {source} = {StringUtils.PrettyPrintBytes(array)}, length: {array.Length}"); return array; } public static void SendMessageToPlayer(int playerNr, Message message) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) SendMessageToPeer(Player.GetPlayer(playerNr).peer.peerId, message); } public static void SendMessageToPeer(string peerId, Message message) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Envelope envelope = default(Envelope); envelope.sender = ((Peer)P2P.localPeer).peerId; envelope.receiver = peerId; envelope.message = message; envelope.packetNr = -1; SendEnvelope(envelope); } public static void SendEnvelope(Envelope envelope) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) P2P.localPeer.networkImplementation.Send(envelope); } public static void SendBytes(string receiver, byte[] data, bool toVanilla = true) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (data.Length > 32768) { Logger.LogError((object)$"Couldn't send byte array to {receiver} : buffer overflow ({data.Length})"); return; } CSteamID steamIDRemote = PeerIDToCSteamID(receiver); EP2PSend eP2PSend = EP2PSend.k_EP2PSendUnreliable; if (data.Length > 1024) { eP2PSend = EP2PSend.k_EP2PSendReliable; } SendP2PPacket(steamIDRemote, data, eP2PSend, (!toVanilla) ? 1 : 0); } public static string PlayerNrToPeerID(int playerNr) { return Player.GetPlayer(playerNr).peer.peerId; } public static CSteamID PeerIDToCSteamID(string peerId) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) CSteamID result = KKMGLMJABKH.KJANLAGMBAM(peerId); if (!((CSteamID)(ref result)).OIAPLNLLNNL() || !((CSteamID)(ref result)).BNAMNCNLOGD()) { Logger.LogError((object)$"Peer '{peerId} invalid ({((CSteamID)(ref result)).AECOKNACKLO()})"); throw new ArgumentException($"Peer '{peerId} invalid ({((CSteamID)(ref result)).AECOKNACKLO()})"); } return result; } public static void SendP2PPacket(Player player, byte[] data, EP2PSend.Enum eP2PSendType = EP2PSend.Enum.k_EP2PSendUnreliable, int nChannel = 0, bool transactionSupport = true) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) SendP2PPacket(PeerIDToCSteamID(PlayerNrToPeerID(player.nr)), data, eP2PSendType, nChannel); } public static void SendP2PPacket(CSteamID steamIDRemote, byte[] data, EP2PSend.Enum eP2PSendType = EP2PSend.Enum.k_EP2PSendUnreliable, int nChannel = 0, bool transactionSupport = true) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) if ((long)data.Length > 1048569L) { if (transactionSupport) { Logger.LogDebug((object)$"Creating transaction for packet because it's size exeeded max length by {(long)data.Length - 1048569L}"); Transaction.Create(steamIDRemote, data, nChannel).Start(); } else { Logger.LogWarning((object)$"Packet exeeded max size by {(long)data.Length - 1048569L}, but transaction support was turned off. Aborting send."); } } else if (!BEPOKFLHPBM.BEMEPOKJHGF(steamIDRemote, data, (uint)data.Length, (HKNEJCDBFGF)(EP2PSend)eP2PSendType, nChannel)) { Logger.LogError((object)$"SendP2PPacket(Byte array to {steamIDRemote}) failed!"); P2P.Disconnect((DisconnectReason)11); } } public static void SendModPacket(PluginInfo pluginInfo, Player player, byte[] data) { byte[] data2 = CollectionExtensions.AddRangeToArray<byte>(GetNetworkIdentifier(pluginInfo.Metadata.GUID), data); SendP2PPacket(player, data2, EP2PSend.k_EP2PSendReliable, 1); } public static void RegisterModPacketCallback(PluginInfo pluginInfo, Action<Peer, byte[]> onReceivePacket) { string key = StringUtils.PrettyPrintBytes(GetNetworkIdentifier(pluginInfo.Metadata.GUID)); if (modPacketCallbacks.ContainsKey(key)) { LLBMLPlugin.Log.LogWarning((object)(pluginInfo.Metadata.Name + " has already registered a callback.")); } else { modPacketCallbacks.Add(key, onReceivePacket); } } internal static void Patch(Harmony harmonyPatcher) { harmonyPatcher.PatchAll(typeof(Networking_Patches.ReceiveEnvelopePatch)); harmonyPatcher.PatchAll(typeof(Networking_Patches.CustomEnvelopeEncodingPatch)); harmonyPatcher.PatchAll(typeof(Networking_Patches.MessageBufferSizePatch)); harmonyPatcher.PatchAll(typeof(Networking_Patches.NetSteamPatch)); } } public class EP2PSend : EnumWrapper<HKNEJCDBFGF> { public enum Enum { k_EP2PSendUnreliable, k_EP2PSendUnreliableNoDelay, k_EP2PSendReliable, k_EP2PSendReliableWithBuffering } public enum Enum_Mapping { k_EP2PSendUnreliable, k_EP2PSendUnreliableNoDelay, k_EP2PSendReliable, k_EP2PSendReliableWithBuffering } public static readonly EP2PSend k_EP2PSendUnreliable = Enum.k_EP2PSendUnreliable; public static readonly EP2PSend k_EP2PSendUnreliableNoDelay = Enum.k_EP2PSendUnreliableNoDelay; public static readonly EP2PSend k_EP2PSendReliable = Enum.k_EP2PSendReliable; public static readonly EP2PSend k_EP2PSendReliableWithBuffering = Enum.k_EP2PSendReliableWithBuffering; private EP2PSend(int id) : base(id) { } private EP2PSend(HKNEJCDBFGF 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 HKNEJCDBFGF(EP2PSend ew) { return (HKNEJCDBFGF)ew.id; } public static implicit operator EP2PSend(HKNEJCDBFGF val) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return new EP2PSend(val); } public static implicit operator EP2PSend(int id) { return new EP2PSend(id); } public static implicit operator EP2PSend(Enum val) { return new EP2PSend((int)val); } public static implicit operator Enum(EP2PSend ew) { return (Enum)ew.id; } } } 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.Settings { public class GameSettings { private readonly JOMBNFKIHIC _gameSettings; public static OnlineMode OnlineMode { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return JOMBNFKIHIC.OIACPNLFAKK(); } set { //IL_0000: Unknown result type (might be due to invalid IL or missing references) JOMBNFKIHIC.IELBAOAAHOE(value); } } public static bool IsOnline => JOMBNFKIHIC.DGGHBHPEGNK(); public static GameSettings current { get { return JOMBNFKIHIC.GIGAKBJGFDI; } set { JOMBNFKIHIC.GIGAKBJGFDI = value; } } public PowerupSelection PowerupSelection { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.ABIHCBMELMF(); } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _gameSettings.CBLMNOPPMKP(value); } } public bool BallTagging { get { return _gameSettings.FILHOMMPHJK(); } set { _gameSettings.AHOLKPAFMBE(value); } } public int MinSpeed { get { return _gameSettings.OEJNIMMDLEA(); } set { _gameSettings.JJHLJMDPAPL(value); } } public bool UsePoints { get { return _gameSettings.JFNLOKKDCEB(); } set { _gameSettings.HEEBCJHJFBA(value); } } public bool SinglePowerup => _gameSettings.COANGJDDNBN(); public Stage stage { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.OOEPDFABFIP; } 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) _gameSettings.OOEPDFABFIP = value; } } public StageRandom stageRandom { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.OCPOONFEMCA; } 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) _gameSettings.OCPOONFEMCA = value; } } public int stocks { get { return _gameSettings.MLEKMMGIFMF; } set { _gameSettings.MLEKMMGIFMF = value; } } public int points { get { return _gameSettings.HGHFBMLJGEM; } set { _gameSettings.HGHFBMLJGEM = value; } } public bool pointInfinite { get { return _gameSettings.LDEAKMILLHE; } set { _gameSettings.LDEAKMILLHE = value; } } public bool mUsePoints { get { return _gameSettings.FONKOHIGBLE; } set { _gameSettings.FONKOHIGBLE = value; } } public int time { get { return _gameSettings.GKJAGGKNFCO; } set { _gameSettings.GKJAGGKNFCO = value; } } public bool timeInfinite { get { return _gameSettings.BLADHBMDPPK; } set { _gameSettings.BLADHBMDPPK = value; } } public bool mBallTagging { get { return _gameSettings.NAKDBIFCJDI; } set { _gameSettings.NAKDBIFCJDI = value; } } public int mMinSpeed { get { return _gameSettings.HMOBHEIJCLM; } set { _gameSettings.HMOBHEIJCLM = value; } } public int energy { get { return _gameSettings.IKGAIFLLLAG; } set { _gameSettings.IKGAIFLLLAG = value; } } public HpFactor useHP { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.BKKMIBGLAEC; } 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) _gameSettings.BKKMIBGLAEC = value; } } public PowerupSelection havePowerups { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.JJLDLMPOEEI; } 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) _gameSettings.JJLDLMPOEEI = value; } } public BallType ballType { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _gameSettings.HKOFJKJDPGL; } 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) _gameSettings.HKOFJKJDPGL = value; } } public GameSettings(JOMBNFKIHIC gs) { _gameSettings = 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 JOMBNFKIHIC || obj is GameSettings) { return object.Equals((object?)(JOMBNFKIHIC)obj, (JOMBNFKIHIC)this); } return false; } public override int GetHashCode() { return ((object)_gameSettings).GetHashCode(); } public override string ToString() { return ((object)_gameSettings).ToString(); } public static implicit operator JOMBNFKIHIC(GameSettings gs) { return gs._gameSettings; } public static implicit operator GameSettings(JOMBNFKIHIC gs) { return new GameSettings(gs); } } } 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.GameEvents { public delegate void OnLobbyEnteredHandler(object source, LobbyEventArgs e); public delegate void OnLobbyReadyHandler(object source, LobbyReadyArgs e); public delegate void OnUserCharacterPickHandler(PlayersCharacterButton source, OnUserCharacterPickArgs e); public delegate void OnUserSkinClickHandler(PlayersSelection source, OnUserSkinClickArgs e); public delegate void OnPlayerJoinHandler(Player source, OnPlayerJoinArgs e); public delegate void OnUnlinkFromPlayerHandler(Peer source, OnUnlinkFromPlayerArgs e); public delegate void OnDecisionsHandler(HDLIJDBFGKN source, OnDecisionsArgs e); public delegate void OnStageSelectOpenHandler(HDLIJDBFGKN source, OnStageSelectOpenArgs e); public static class LobbyEvents { public static event OnLobbyEnteredHandler OnLobbyEntered; public static event OnLobbyReadyHandler OnLobbyReady; public static event OnUserCharacterPickHandler OnUserCharacterPick; public static event OnUserSkinClickHandler OnUserSkinClick; public static event OnPlayerJoinHandler OnPlayerJoin; public static event OnUnlinkFromPlayerHandler OnUnlinkFromPlayer; public static event OnDecisionsHandler OnDecisions; public static event OnStageSelectOpenHandler OnStageSelectOpen; internal static void Patch(Harmony harmonyInstance) { harmonyInstance.PatchAll(typeof(LobbyEvents_Patches)); OnUserCharacterPick += delegate(PlayersCharacterButton o, OnUserCharacterPickArgs a) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) LLBMLPlugin.Log.LogDebug((object)$"Event OnUserCharacterPick triggered. Player nr: {a.playerNr}. Char: {a.character}"); }; OnUserSkinClick += delegate(PlayersSelection o, OnUserSkinClickArgs a) { LLBMLPlugin.Log.LogDebug((object)$"Event OnUserSkinClick triggered. clicker nr: {a.clickerNr}. ToSkin nr: {a.toSkinNr}"); }; OnLobbyEntered += delegate(object o, LobbyEventArgs a) { LLBMLPlugin.Log.LogDebug((object)$"Event OnLobbyEntered triggered. Online? {a.isOnline}. Lobby ID: {a.lobby_id}. Lobby Host: {a.host_id}"); }; OnLobbyReady += delegate(object o, LobbyReadyArgs a) { LLBMLPlugin.Log.LogDebug((object)$"Event OnLobbyReady triggered. Online? {a.isOnline}. Lobby ID: {a.lobby_id}. Lobby Host: {a.host_id}"); }; OnPlayerJoin += delegate(Player o, OnPlayerJoinArgs a) { LLBMLPlugin.Log.LogDebug((object)string.Format("Event OnPlayerJoin triggered. Player nr: {0}. It's a {1} player.", a.playerNr, a.isLocal ? "local" : "remote")); }; OnUnlinkFromPlayer += delegate(Peer o, OnUnlinkFromPlayerArgs a) { LLBMLPlugin.Log.LogDebug((object)$"Event OnUnlinkFromPlayer triggered. Player nr: {a.playerNr}."); }; OnDecisions += delegate(HDLIJDBFGKN o, OnDecisionsArgs a) { LLBMLPlugin.Log.LogDebug((object)$"Event OnDecisions triggered. Is player host?: {a.sent}."); }; OnStageSelectOpen += delegate(HDLIJDBFGKN o, OnStageSelectOpenArgs a) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) LLBMLPlugin.Log.LogDebug((object)$"Event OnStageSelectOpen triggered. Can go back? {a.canGoBack}. Spec? {a.localSpectator}. ScreenType: {a.screenType}"); }; } internal static void OnLobbyEnteredCall(object source, LobbyEventArgs e) { if (LobbyEvents.OnLobbyEntered != null) { LobbyEvents.OnLobbyEntered(source, e); } } internal static void OnLobbyReadyCall(object source, LobbyReadyArgs e) { if (LobbyEvents.OnLobbyReady != null) { LobbyEvents.OnLobbyReady(source, e); } } internal static void OnUserCharacterPickCall(PlayersCharacterButton source, OnUserCharacterPickArgs e) { if (LobbyEvents.OnUserCharacterPick != null) { LobbyEvents.OnUserCharacterPick(source, e); } } internal static void OnUserSkinClickCall(PlayersSelection source, OnUserSkinClickArgs e) { if (LobbyEvents.OnUserSkinClick != null) { LobbyEvents.OnUserSkinClick(source, e); } } internal static void OnPlayerJoinCall(Player source, OnPlayerJoinArgs e) { if (LobbyEvents.OnPlayerJoin != null) { LobbyEvents.OnPlayerJoin(source, e); } } internal static void OnUnlinkFromPlayerCall(Peer source, OnUnlinkFromPlayerArgs e) { if (LobbyEvents.OnUnlinkFromPlayer != null) { LobbyEvents.OnUnlinkFromPlayer(source, e); } } internal static void OnDecisionsCall(HDLIJDBFGKN source, OnDecisionsArgs e) { if (LobbyEvents.OnDecisions != null) { LobbyEvents.OnDecisions(source, e); } } internal static void OnStageSelectOpenCall(HDLIJDBFGKN source, OnStageSelectOpenArgs e) { if (LobbyEvents.OnStageSelectOpen != null) { LobbyEvents.OnStageSelectOpen(source, e); } } } public class LobbyEventArgs : EventArgs { public bool isOnline { get; private set; } public string lobby_id { get; private set; } public string host_id { get; private set; } public LobbyEventArgs(bool isOnline, string lobby_id, string host_id) { this.isOnline = isOnline; this.lobby_id = lobby_id; this.host_id = host_id; } } public class LobbyReadyArgs : EventArgs { public bool isOnline { get; private set; } public string lobby_id { get; private set; } public string host_id { get; private set; } public LobbyReadyArgs(bool isOnline, string lobby_id, string host_id) { this.isOnline = isOnline; this.lobby_id = lobby_id; this.host_id = host_id; } } public class OnUserCharacterPickArgs : EventArgs { public int playerNr { get; private set; } public Character character { get; private set; } public OnUserCharacterPickArgs(int playerNr, Character character) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) this.playerNr = playerNr; this.character = character; } } public class OnUserSkinClickArgs : EventArgs { public int clickerNr { get; private set; } public int toSkinNr { get; private set; } public OnUserSkinClickArgs(int clickerNr, int toSkinNr) { this.clickerNr = clickerNr; this.toSkinNr = toSkinNr; } } public class OnPlayerJoinArgs : EventArgs { public int playerNr { get; private set; } public bool isLocal { get; private set; } public OnPlayerJoinArgs(int playerNr, bool isLocal) { this.playerNr = playerNr; this.isLocal = isLocal; } } public class OnUnlinkFromPlayerArgs : EventArgs { public int playerNr { get; private set; } public OnUnlinkFromPlayerArgs(int playerNr) { this.playerNr = playerNr; } } public class OnDecisionsArgs : EventArgs { public bool sent { get; private set; } public int[] decisions { get; private set; } public OnDecisionsArgs(bool sent, int[] decisions) { this.sent = sent; this.decisions = decisions; } } public class OnStageSelectOpenArgs : EventArgs { public bool canGoBack { get; private set; } public bool localSpectator { get; private set; } public ScreenType screenType { get; private set; } public OnStageSelectOpenArgs(bool canGoBack, bool localSpectator, ScreenType screenType) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) this.canGoBack = canGoBack; this.localSpectator = localSpectator; this.screenType = screenType; } } internal static class LobbyEvents_Patches { private static CSteamID lobby_CSteamID; [HarmonyPatch(typeof(HDLIJDBFGKN), "OAACLLGMFLH", new Type[] { })] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> StartGameHost_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator iL) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, iL); PatchUtils.LogInstructions(val.Instructions(), 252, 264); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[8] { new CodeMatch((OpCode?)OpCodes.Blt, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Call, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_M1, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_M1, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_0, (object)null, (string)null), new C
plugins/LLBModdingLib/System.Runtime.Serialization.dll
Decompiled 2 months 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) { } } }