mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-20 01:46:21 +00:00
Rework debugger (#79)
This commit is contained in:
1 parent
d82268b88a
commit
5db20ca9de
27 files changed
+1068
-180
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Il2CppInterop.Runtime;
|
||||
using InnerNet;
|
||||
|
||||
namespace Reactor.Debugger.Utilities;
|
||||
|
||||
internal static class Extensions
|
||||
{
|
||||
public static IEnumerator CoCreateLocalGame(this AmongUsClient client)
|
||||
{
|
||||
try
|
||||
{
|
||||
client.NetworkMode = NetworkModes.LocalGame;
|
||||
|
||||
InnerNetServer.Instance.StartAsServer();
|
||||
|
||||
client.SetEndpoint(Constants.LocalNetAddress, Constants.GamePlayPort, false);
|
||||
client.MainMenuScene = "MatchMaking";
|
||||
client.OnlineScene = "OnlineGame";
|
||||
}
|
||||
catch (Il2CppException e)
|
||||
{
|
||||
Error(e);
|
||||
DisconnectPopup.Instance.ShowCustom(e.Message[..e.Message.IndexOf("\n--- BEGIN IL2CPP STACK TRACE ---\n", StringComparison.Ordinal)]);
|
||||
MatchMaker.Instance.NotConnecting();
|
||||
yield break;
|
||||
}
|
||||
|
||||
client.Connect(MatchMakerModes.HostAndClient, null);
|
||||
|
||||
yield return client.WaitForConnectionOrFail();
|
||||
|
||||
DestroyableSingleton<MatchMaker>.Instance.NotConnecting();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user