4 Commits
Author SHA1 Message Date
js6pak 89a8adadf7 2021.12.15 2021-12-21 15:53:08 +01:00
js6pak 837ee142b3 2021.12.14 2021-12-15 19:45:27 +01:00
js6pak 2453bff8df Merge branch '2021.11.9' 2021-12-14 23:17:43 +01:00
js6pak f501dc1897 RandomExtensions 2021-12-14 22:40:12 +01:00
8 changed files with 39 additions and 14 deletions

No files matched your search

+2 -2
View File
@@ -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>
+3 -3
View File
@@ -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",
+3 -3
View File
@@ -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",
+2
View File
@@ -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)
+23
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
}
+2 -2
View File
@@ -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),
};
}
+3 -3
View File
@@ -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",