mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-20 21:35:55 +00:00
Compare commits
4
Commits
1.2.0-rc.1
..
1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89a8adadf7 | ||
|
|
837ee142b3 | ||
|
|
2453bff8df | ||
|
|
f501dc1897 |
No files matched your search
+2
-2
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GamePlatform Condition="'$(GamePlatform)' == ''">Steam</GamePlatform>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2021.11.9</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2021.11.9</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2021.12.15</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2021.12.15</GameVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2021.11.9, )",
|
||||
"resolved": "2021.11.9",
|
||||
"contentHash": "mqaIx7oPavuwMTRZDMmBrLOAWNG6s1tCOvpysnNPZT58b3epU+WMJKBruw9fUCf53t333d71xVUov6PRcwnSZQ=="
|
||||
"requested": "[2021.12.15, )",
|
||||
"resolved": "2021.12.15",
|
||||
"contentHash": "YXKxGYWvA5+cLvJXlzcsYOS55q1g/QKzLgy1QNGnyWgTYk91z1scufLb4aMb6lSfQhTPUpEB3ajyupwqtI8uOg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2021.11.9, )",
|
||||
"resolved": "2021.11.9",
|
||||
"contentHash": "mqaIx7oPavuwMTRZDMmBrLOAWNG6s1tCOvpysnNPZT58b3epU+WMJKBruw9fUCf53t333d71xVUov6PRcwnSZQ=="
|
||||
"requested": "[2021.12.15, )",
|
||||
"resolved": "2021.12.15",
|
||||
"contentHash": "YXKxGYWvA5+cLvJXlzcsYOS55q1g/QKzLgy1QNGnyWgTYk91z1scufLb4aMb6lSfQhTPUpEB3ajyupwqtI8uOg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnhollowerBaseLib.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reactor.Extensions;
|
||||
@@ -31,6 +32,7 @@ public class Dispatcher : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
[HideFromIl2Cpp]
|
||||
public void Enqueue(Action action)
|
||||
{
|
||||
lock (_queue)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Reactor.Extensions;
|
||||
|
||||
public static class RandomExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns random <typeparamref name="T"/> from <paramref name="input"/> using <paramref name="random"/>
|
||||
/// </summary>
|
||||
public static T? Random<T>(this IEnumerable<T> input, Random random)
|
||||
{
|
||||
var list = input as IList<T> ?? input.ToList();
|
||||
return list.Count == 0 ? default : list[random.Next(0, list.Count)];
|
||||
}
|
||||
|
||||
/// <summary>Returns a random double that is within a specified range.</summary>
|
||||
public static double NextDouble(this Random random, double minValue, double maxValue)
|
||||
{
|
||||
return random.NextDouble() * (maxValue - minValue) + minValue;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace Reactor.Patches
|
||||
if (serverManager.CurrentRegion.TryCast<DnsRegionInfo>() is not { } regionInfo || !regionInfo.Fqdn.EndsWith("among.us"))
|
||||
{
|
||||
var remoteEndPoint = new IPEndPoint(IPAddress.Parse(targetIp), targetPort - 3);
|
||||
__result = new UnityUdpClientConnection(remoteEndPoint);
|
||||
__result = new UnityUdpClientConnection(null, remoteEndPoint);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Reactor.Patches
|
||||
var servers = Dns.GetHostAddresses(__instance.Fqdn)
|
||||
.Distinct()
|
||||
.Where(ipAddress => ipAddress.AddressFamily == AddressFamily.InterNetwork)
|
||||
.Select(ipAddress => new ServerInfo($"{__instance.Name}-{i++}", ipAddress.ToString(), __instance.Port))
|
||||
.Select(ipAddress => new ServerInfo($"{__instance.Name}-{i++}", ipAddress.ToString(), __instance.Port, __instance.UseDtls))
|
||||
.ToArray();
|
||||
|
||||
__instance.cachedServers = servers;
|
||||
@@ -41,7 +41,7 @@ namespace Reactor.Patches
|
||||
Logger<ReactorPlugin>.Info($"Failed to populate {__instance.Name}: {e}");
|
||||
__instance.cachedServers = new[]
|
||||
{
|
||||
new ServerInfo(__instance.Name ?? string.Empty, __instance.DefaultIp, __instance.Port),
|
||||
new ServerInfo(__instance.Name ?? string.Empty, __instance.DefaultIp, __instance.Port, __instance.UseDtls),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2021.11.9, )",
|
||||
"resolved": "2021.11.9",
|
||||
"contentHash": "mqaIx7oPavuwMTRZDMmBrLOAWNG6s1tCOvpysnNPZT58b3epU+WMJKBruw9fUCf53t333d71xVUov6PRcwnSZQ=="
|
||||
"requested": "[2021.12.15, )",
|
||||
"resolved": "2021.12.15",
|
||||
"contentHash": "YXKxGYWvA5+cLvJXlzcsYOS55q1g/QKzLgy1QNGnyWgTYk91z1scufLb4aMb6lSfQhTPUpEB3ajyupwqtI8uOg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
Reference in new issue
Block a user