mirror of
https://github.com/MoltenMods/Unify.git
synced 2026-10-19 17:56:57 +00:00
Merge branch 'dev'
This commit is contained in:
commit
25ccc7124c
4 files changed
+28
-3
No files matched your search
@@ -1,5 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using Hazel.Udp;
|
||||
using Reactor;
|
||||
using Array = System.Array;
|
||||
using String = System.String;
|
||||
|
||||
@@ -57,4 +61,21 @@ namespace Unify.Patches
|
||||
return customRegions.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(UdpConnection), nameof(UdpConnection.HandleSend))]
|
||||
public static class DisableModdedHandshakePatch
|
||||
{
|
||||
[HarmonyBefore(new string[] { "gg.reactor.api" })]
|
||||
public static void Prefix()
|
||||
{
|
||||
if (!UnifyPlugin.NormalHandshake.Contains(ServerManager.Instance.CurrentRegion.Name)) return;
|
||||
|
||||
PluginSingleton<ReactorPlugin>.Instance.ModdedHandshake.Value = false;
|
||||
}
|
||||
|
||||
public static void Postfix()
|
||||
{
|
||||
PluginSingleton<ReactorPlugin>.Instance.ModdedHandshake.Value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-2
@@ -11,21 +11,25 @@ namespace Unify
|
||||
[BepInPlugin(Id, Name, Version)]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
[ReactorPluginSide(PluginSide.ClientOnly)]
|
||||
public class UnifyPlugin : BasePlugin
|
||||
{
|
||||
public const string Id = "daemon.unify.reactor";
|
||||
private const string Name = "Unify";
|
||||
private const string Version = "2.0.1";
|
||||
private const string Version = "2.0.3";
|
||||
|
||||
public static readonly ConfigFile ConfigFile =
|
||||
new ConfigFile(Path.Combine(Paths.ConfigPath, $"{UnifyPlugin.Id}.cfg"), true);
|
||||
|
||||
public static readonly string[] NormalHandshake =
|
||||
new string[] {"North America", "Europe", "Asia", "skeld.net"};
|
||||
|
||||
public Harmony Harmony { get; } = new Harmony(Id);
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
RegionsPatch.Patch();
|
||||
|
||||
|
||||
Harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Version>2.0.1</Version>
|
||||
<Version>2.0.3</Version>
|
||||
<Mappings>NuclearPowered/Mappings:0.2.0</Mappings>
|
||||
|
||||
<Description>Region mod for Reactor</Description>
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user