mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-21 21:43:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6152f559c | ||
|
|
9893fc9e45 | ||
|
|
16135fa897 | ||
|
|
0eb6ac0cbe | ||
|
|
3579ecb89e | ||
|
|
ff7a80addf | ||
|
|
ef6baeacce |
No files matched your search
@@ -1,13 +1,17 @@
|
||||
name: CI
|
||||
|
||||
on: [ "push", "pull_request" ]
|
||||
on: ["push", "pull_request"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- uses: actions/cache@v2
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.nuget/packages
|
||||
@@ -16,10 +20,6 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nuget-
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<GamePlatform Condition="'$(GamePlatform)' == ''">Steam</GamePlatform>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2022.6.21</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2022.6.21</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Steam'">2022.8.23</GameVersion>
|
||||
<GameVersion Condition="'$(GamePlatform)' == 'Itch'">2022.8.23</GameVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2022.6.21, )",
|
||||
"resolved": "2022.6.21",
|
||||
"contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ=="
|
||||
"requested": "[2022.8.23, )",
|
||||
"resolved": "2022.8.23",
|
||||
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2022.6.21, )",
|
||||
"resolved": "2022.6.21",
|
||||
"contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ=="
|
||||
"requested": "[2022.8.23, )",
|
||||
"resolved": "2022.8.23",
|
||||
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using Reactor.Extensions;
|
||||
using UnityEngine;
|
||||
@@ -54,9 +55,15 @@ namespace Reactor.Patches
|
||||
Watcher.Dispose();
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(FileIO), nameof(FileIO.WriteAllText))]
|
||||
[HarmonyPatch]
|
||||
private static class WritePatch
|
||||
{
|
||||
public static MethodBase TargetMethod()
|
||||
{
|
||||
var type = Type.GetType("FileIO, Assembly-CSharp", false) ?? Type.GetType("Innersloth.IO.FileIO, Assembly-CSharp", true);
|
||||
return AccessTools.Method(type, "WriteAllText");
|
||||
}
|
||||
|
||||
public static bool Prefix(string path, string contents)
|
||||
{
|
||||
// Among Us' region loading code unfortunately contains a call
|
||||
@@ -67,8 +74,7 @@ namespace Reactor.Patches
|
||||
// file again, stop AU from actually writing it.
|
||||
if (ServerManager.Instance && path == ServerManager.Instance.serverInfoFileJson)
|
||||
{
|
||||
var currentContents = FileIO.ReadAllText(path);
|
||||
var continueWrite = currentContents != contents;
|
||||
var continueWrite = !File.Exists(path) || File.ReadAllText(path) != contents;
|
||||
Logger<ReactorPlugin>.Debug($"Continue serverInfoFile write? {continueWrite}");
|
||||
// If we will write, ignore the next change action from the observer.
|
||||
PluginSingleton<ReactorPlugin>.Instance.RegionInfoWatcher.IgnoreNext = continueWrite;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using MonoMod.Utils;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
@@ -18,18 +16,28 @@ namespace Reactor.Patches
|
||||
internal static class WaitForEpicAuth
|
||||
{
|
||||
private static readonly PropertyInfo? _localUserIdProperty = typeof(EpicManager).GetProperty("localUserId", BindingFlags.Static | BindingFlags.Public);
|
||||
private static readonly Func<object>? _localUserId = _localUserIdProperty == null ? null : _localUserIdProperty.GetMethod.CreateDelegate<Func<object>>();
|
||||
private static bool _loginFinished;
|
||||
|
||||
private static bool Prefix(SplashManager __instance)
|
||||
{
|
||||
if (__instance.startedSceneLoad) return true;
|
||||
|
||||
if (_localUserId != null && _localUserId() == null)
|
||||
if (_localUserIdProperty != null && !_loginFinished)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// EpicManager calls SaveManager.LoadPlayerPrefs(true) both on successful and unsuccessful EOS login
|
||||
[HarmonyPatch(typeof(SaveManager), nameof(SaveManager.LoadPlayerPrefs))]
|
||||
private static class LoadPlayerPrefsPatch
|
||||
{
|
||||
private static void Postfix(bool overrideLoad)
|
||||
{
|
||||
if (overrideLoad) _loginFinished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
||||
<VersionPrefix>1.2.7</VersionPrefix>
|
||||
<VersionPrefix>1.2.8</VersionPrefix>
|
||||
<VersionSuffix>dev</VersionSuffix>
|
||||
<Description>Core mod and API for Among Us</Description>
|
||||
<Authors>NuclearPowered</Authors>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
".NETStandard,Version=v2.1": {
|
||||
"AmongUs.GameLibs.Steam": {
|
||||
"type": "Direct",
|
||||
"requested": "[2022.6.21, )",
|
||||
"resolved": "2022.6.21",
|
||||
"contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ=="
|
||||
"requested": "[2022.8.23, )",
|
||||
"resolved": "2022.8.23",
|
||||
"contentHash": "baY5JO6dbdOAZ0VTtGX0xre6/BlDdreJDAH8boCKZt3JTAcn+eeH+l8mUZRC9eCJOODUik2C0TTAt5AqBmYtZg=="
|
||||
},
|
||||
"BepInEx.AutoPlugin": {
|
||||
"type": "Direct",
|
||||
|
||||
Reference in new issue
Block a user