Decompiled source of Better Lobby List v1.0.0

GDWeave/mods/TenTeypek.BetterLobbyList/TenTeypek.BetterLobbyList.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using GDWeave;
using GDWeave.Godot;
using GDWeave.Godot.Variants;
using GDWeave.Modding;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("TenTeypek.BetterLobbyList")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0+ddcf10a0b669676ac17636796bf0280ce934c265")]
[assembly: AssemblyProduct("TenTeypek.BetterLobbyList")]
[assembly: AssemblyTitle("TenTeypek.BetterLobbyList")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace TenTeypek.BetterLobbyList;

public class MainMenuScript : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private MultiTokenWaiter <lobbySortWaiter>5__2;

		private MultiTokenWaiter <ifLobbySearchSortWaiter>5__3;

		private MultiTokenWaiter <matchLobbySearchSortWaiter>5__4;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap4;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 16u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_040e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Expected O, but got Unknown
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Expected O, but got Unknown
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Expected O, but got Unknown
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Expected O, but got Unknown
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Expected O, but got Unknown
			//IL_0544: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Expected O, but got Unknown
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Expected O, but got Unknown
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a2: Expected O, but got Unknown
			//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cf: Expected O, but got Unknown
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Expected O, but got Unknown
			//IL_0619: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Expected O, but got Unknown
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Expected O, but got Unknown
			//IL_066f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0679: Expected O, but got Unknown
			//IL_046b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Expected O, but got Unknown
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Expected O, but got Unknown
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Expected O, but got Unknown
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<lobbySortWaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[10]
					{
						(Token t) => (int)t.Type == 51,
						(Token t) => (int)t.Type == 89,
						(Token t) => (int)t.Type == 62,
						delegate(Token t)
						{
							IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val13 != null && val13.Name == "LOBBY_SORT";
						},
						(Token t) => (int)t.Type == 78,
						delegate(Token t)
						{
							IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val12 != null && val12.Name == "PLAYER_HIGH";
						},
						(Token t) => (int)t.Type == 82,
						delegate(Token t)
						{
							IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val11 != null && val11.Name == "PLAYER_LOW";
						},
						(Token t) => (int)t.Type == 82,
						delegate(Token t)
						{
							IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val10 != null && val10.Name == "RANDOM";
						}
					}, false, true);
					<ifLobbySearchSortWaiter>5__3 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						(Token t) => (int)t.Type == 38,
						delegate(Token t)
						{
							IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val9 != null && val9.Name == "lobby_search_sort";
						},
						(Token t) => (int)t.Type == 11,
						delegate(Token t)
						{
							ConstantToken val7 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							if (val7 != null)
							{
								Variant value2 = val7.Value;
								IntVariant val8 = (IntVariant)(object)((value2 is IntVariant) ? value2 : null);
								if (val8 != null)
								{
									return val8.Value == 2;
								}
							}
							return false;
						}
					}, false, false);
					<matchLobbySearchSortWaiter>5__4 = new MultiTokenWaiter(new Func<Token, bool>[9]
					{
						delegate(Token t)
						{
							IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val6 != null && val6.Name == "LOBBY_SORT";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val5 != null && val5.Name == "RANDOM";
						},
						(Token t) => (int)t.Type == 86,
						delegate(Token t)
						{
							IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val4 != null && val4.Name == "search_button";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "text";
						},
						(Token t) => (int)t.Type == 23,
						delegate(Token t)
						{
							ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							if (val != null)
							{
								Variant value = val.Value;
								StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
								if (val2 != null)
								{
									return val2.Value == "Random";
								}
							}
							return false;
						}
					}, false, false);
					<>7__wrap4 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("PING");
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					break;
				case 4:
					<>1__state = -3;
					break;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("LOBBY_SORT");
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("PING");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("search_button");
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("text");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("Closest"));
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					break;
				case 17:
					<>1__state = -3;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap4).MoveNext())
				{
					Token current = <>7__wrap4.Current;
					if (<lobbySortWaiter>5__2.Check(current))
					{
						<>2__current = current;
						<>1__state = 1;
						return true;
					}
					if (<ifLobbySearchSortWaiter>5__3.Check(current))
					{
						<>2__current = (Token)new ConstantToken((Variant)new IntVariant(3L, false));
						<>1__state = 4;
						return true;
					}
					if (<matchLobbySearchSortWaiter>5__4.Check(current))
					{
						<>2__current = current;
						<>1__state = 5;
						return true;
					}
					<>2__current = current;
					<>1__state = 17;
					return true;
				}
				<>m__Finally1();
				<>7__wrap4 = null;
				return false;
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap4 != null)
			{
				((global::System.IDisposable)<>7__wrap4).Dispose();
			}
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Menus/Main Menu/main_menu.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter lobbySortWaiter = new MultiTokenWaiter(new Func<Token, bool>[10]
		{
			(Token t) => (int)t.Type == 51,
			(Token t) => (int)t.Type == 89,
			(Token t) => (int)t.Type == 62,
			delegate(Token t)
			{
				IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val13 != null && val13.Name == "LOBBY_SORT";
			},
			(Token t) => (int)t.Type == 78,
			delegate(Token t)
			{
				IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val12 != null && val12.Name == "PLAYER_HIGH";
			},
			(Token t) => (int)t.Type == 82,
			delegate(Token t)
			{
				IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val11 != null && val11.Name == "PLAYER_LOW";
			},
			(Token t) => (int)t.Type == 82,
			delegate(Token t)
			{
				IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val10 != null && val10.Name == "RANDOM";
			}
		}, false, true);
		MultiTokenWaiter ifLobbySearchSortWaiter = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			(Token t) => (int)t.Type == 38,
			delegate(Token t)
			{
				IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val9 != null && val9.Name == "lobby_search_sort";
			},
			(Token t) => (int)t.Type == 11,
			delegate(Token t)
			{
				ConstantToken val7 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val7 != null)
				{
					Variant value2 = val7.Value;
					IntVariant val8 = (IntVariant)(object)((value2 is IntVariant) ? value2 : null);
					if (val8 != null)
					{
						return val8.Value == 2;
					}
				}
				return false;
			}
		}, false, false);
		MultiTokenWaiter matchLobbySearchSortWaiter = new MultiTokenWaiter(new Func<Token, bool>[9]
		{
			delegate(Token t)
			{
				IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val6 != null && val6.Name == "LOBBY_SORT";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val5 != null && val5.Name == "RANDOM";
			},
			(Token t) => (int)t.Type == 86,
			delegate(Token t)
			{
				IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val4 != null && val4.Name == "search_button";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "text";
			},
			(Token t) => (int)t.Type == 23,
			delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val != null)
				{
					Variant value = val.Value;
					StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
					if (val2 != null)
					{
						return val2.Value == "Random";
					}
				}
				return false;
			}
		}, false, false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				if (lobbySortWaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("PING");
				}
				else if (ifLobbySearchSortWaiter.Check(current))
				{
					yield return (Token)new ConstantToken((Variant)new IntVariant(3L, false));
				}
				else if (matchLobbySearchSortWaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)89, (uint?)2u);
					yield return (Token)new IdentifierToken("LOBBY_SORT");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("PING");
					yield return new Token((TokenType)86, (uint?)null);
					yield return (Token)new IdentifierToken("search_button");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("text");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("Closest"));
					yield return new Token((TokenType)89, (uint?)null);
				}
				else
				{
					yield return current;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class Mod : IMod, global::System.IDisposable
{
	public Mod(IModInterface modInterface)
	{
		modInterface.Logger.Information("Hello, world!");
		modInterface.RegisterScriptMod((IScriptMod)(object)new MainMenuScript());
		modInterface.RegisterScriptMod((IScriptMod)(object)new ServerButtonScript());
		modInterface.RegisterScriptMod((IScriptMod)(object)new SteamNetworkScript());
	}

	public void Dispose()
	{
	}
}
public class ServerButtonScript : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private MultiTokenWaiter <updateLobbyNameWaiter>5__2;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap2;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 15u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Expected O, but got Unknown
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Expected O, but got Unknown
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Expected O, but got Unknown
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Expected O, but got Unknown
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Expected O, but got Unknown
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Expected O, but got Unknown
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Expected O, but got Unknown
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<updateLobbyNameWaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[10]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "_update_lobby_name";
						},
						(Token t) => (int)t.Type == 38,
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "label_toggle";
						},
						(Token t) => (int)t.Type == 13,
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "custom_name";
						},
						(Token t) => (int)t.Type == 8,
						(Token t) => t is ConstantToken,
						(Token t) => (int)t.Type == 86,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)15, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("OptionsMenu");
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("chat_filter");
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)3u);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("new_name");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("custom_name");
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = new Token((TokenType)40, (uint?)null);
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)3u);
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					break;
				case 16:
					<>1__state = -3;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
				{
					Token current = <>7__wrap2.Current;
					if (<updateLobbyNameWaiter>5__2.Check(current))
					{
						<>2__current = current;
						<>1__state = 1;
						return true;
					}
					<>2__current = current;
					<>1__state = 16;
					return true;
				}
				<>m__Finally1();
				<>7__wrap2 = null;
				return false;
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap2 != null)
			{
				((global::System.IDisposable)<>7__wrap2).Dispose();
			}
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Menus/Main Menu/ServerButton/server_button.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter updateLobbyNameWaiter = new MultiTokenWaiter(new Func<Token, bool>[10]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "_update_lobby_name";
			},
			(Token t) => (int)t.Type == 38,
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "label_toggle";
			},
			(Token t) => (int)t.Type == 13,
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "custom_name";
			},
			(Token t) => (int)t.Type == 8,
			(Token t) => t is ConstantToken,
			(Token t) => (int)t.Type == 86,
			(Token t) => (int)t.Type == 89
		}, false, true);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				if (updateLobbyNameWaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)38, (uint?)null);
					yield return new Token((TokenType)15, (uint?)null);
					yield return (Token)new IdentifierToken("OptionsMenu");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("chat_filter");
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)89, (uint?)3u);
					yield return (Token)new IdentifierToken("new_name");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new IdentifierToken("custom_name");
					yield return new Token((TokenType)89, (uint?)2u);
					yield return new Token((TokenType)40, (uint?)null);
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)89, (uint?)3u);
				}
				else
				{
					yield return current;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class SteamNetworkScript : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__1 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private MultiTokenWaiter <extendsWaiter>5__2;

		private MultiTokenWaiter <lobbyDistanceWaiter>5__3;

		private TokenConsumer <consumer>5__4;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap4;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Modify>d__1(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 6u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Expected O, but got Unknown
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<extendsWaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						(Token t) => (int)t.Type == 51,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<lobbyDistanceWaiter>5__3 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "_find_all_webfishing_lobbies";
						},
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "addRequestLobbyListDistanceFilter";
						},
						(Token t) => (int)t.Type == 80
					}, false, true);
					<consumer>5__4 = new TokenConsumer((Func<Token, bool>)((Token t) => (int)t.Type == 81));
					<>7__wrap4 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("distance");
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					break;
				case 5:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("distance");
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<consumer>5__4.SetReady();
					break;
				case 7:
					<>1__state = -3;
					break;
				}
				while (((global::System.Collections.IEnumerator)<>7__wrap4).MoveNext())
				{
					Token current = <>7__wrap4.Current;
					if (!<consumer>5__4.Check(current))
					{
						if (<consumer>5__4.Ready)
						{
							<consumer>5__4.Reset();
						}
						if (<extendsWaiter>5__2.Check(current))
						{
							<>2__current = current;
							<>1__state = 1;
							return true;
						}
						if (<lobbyDistanceWaiter>5__3.Check(current))
						{
							<>2__current = current;
							<>1__state = 5;
							return true;
						}
						<>2__current = current;
						<>1__state = 7;
						return true;
					}
				}
				<>m__Finally1();
				<>7__wrap4 = null;
				return false;
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap4 != null)
			{
				((global::System.IDisposable)<>7__wrap4).Dispose();
			}
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<Modify>d__1 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__1(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Singletons/SteamNetwork.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__1))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter extendsWaiter = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			(Token t) => (int)t.Type == 51,
			(Token t) => (int)t.Type == 89
		}, false, true);
		MultiTokenWaiter lobbyDistanceWaiter = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "_find_all_webfishing_lobbies";
			},
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "addRequestLobbyListDistanceFilter";
			},
			(Token t) => (int)t.Type == 80
		}, false, true);
		TokenConsumer consumer = new TokenConsumer((Func<Token, bool>)((Token t) => (int)t.Type == 81));
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				if (!consumer.Check(current))
				{
					if (consumer.Ready)
					{
						consumer.Reset();
					}
					if (extendsWaiter.Check(current))
					{
						yield return current;
						yield return new Token((TokenType)59, (uint?)null);
						yield return (Token)new IdentifierToken("distance");
						yield return new Token((TokenType)89, (uint?)null);
					}
					else if (lobbyDistanceWaiter.Check(current))
					{
						yield return current;
						yield return (Token)new IdentifierToken("distance");
						consumer.SetReady();
					}
					else
					{
						yield return current;
					}
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}