From 483c2189c1fa9521aebd023d88d6feb90d062c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=B6ller?= Date: Mon, 3 Aug 2020 22:37:15 +0200 Subject: [PATCH] Update to GameVersion 10.0.1 and Synapse Version 1.1.1 --- Synapse/Api/Map.cs | 4 ++-- Synapse/Events/EventHandlers.cs | 2 +- .../Patches/EventPatches/MapPatches/DoorInteractPatch.cs | 2 +- .../Patches/EventPatches/MapPatches/GeneratorPatches.cs | 3 ++- .../Patches/EventPatches/PlayerPatches/PlayerSetClassPatch.cs | 3 ++- .../Patches/EventPatches/RoundPatches/TeamRespawnPatch.cs | 3 ++- Synapse/Synapse.cs | 2 +- Synapse/Synapse.csproj | 3 +++ 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Synapse/Api/Map.cs b/Synapse/Api/Map.cs index a335849..f6cc7e9 100644 --- a/Synapse/Api/Map.cs +++ b/Synapse/Api/Map.cs @@ -117,7 +117,7 @@ public static Vector3 GetDoorPos(string doorName) vector.x -= 1f; } - if (FallDamage.CheckUnsafePosition(vector)) break; + if (FallDamage.CheckUnsafePosition(vector, false)) break; if (b == 20) vector = Vector3.zero; } @@ -222,6 +222,6 @@ public static bool IsGroupAllowed(string group, string permission) /// /// /// - public static void TurnOffAllLights(float duration, bool onlyHeavy = false) => Generator079.Generators[0].RpcCustomOverchargeForOurBeautifulModCreators(duration, onlyHeavy); + public static void TurnOffAllLights(float duration, bool onlyHeavy = false) => Generator079.Generators[0].ServerOvercharge(duration, onlyHeavy); } } \ No newline at end of file diff --git a/Synapse/Events/EventHandlers.cs b/Synapse/Events/EventHandlers.cs index beb810c..613d1e2 100644 --- a/Synapse/Events/EventHandlers.cs +++ b/Synapse/Events/EventHandlers.cs @@ -40,7 +40,7 @@ private static void OnDoorInteract(DoorInteractEvent ev) if (gameitem.permissions == null || gameitem.permissions.Length == 0) continue; ev.Allow = gameitem.permissions.Any(p => - ev.Door.backwardsCompatPermissions.TryGetValue(p, out var flag) && + Door.backwardsCompatPermissions.TryGetValue(p, out var flag) && ev.Door.PermissionLevels.HasPermission(flag)); } } diff --git a/Synapse/Events/Patches/EventPatches/MapPatches/DoorInteractPatch.cs b/Synapse/Events/Patches/EventPatches/MapPatches/DoorInteractPatch.cs index 9cf892f..2291ab6 100644 --- a/Synapse/Events/Patches/EventPatches/MapPatches/DoorInteractPatch.cs +++ b/Synapse/Events/Patches/EventPatches/MapPatches/DoorInteractPatch.cs @@ -39,7 +39,7 @@ public static bool Prefix(PlayerInteract __instance, GameObject doorId) { var itemPerms = __instance._inv.GetItemByID(__instance._inv.curItem).permissions; allowTheAccess = itemPerms.Any(p => - door.backwardsCompatPermissions.TryGetValue(p, out var flag) && + Door.backwardsCompatPermissions.TryGetValue(p, out var flag) && door.PermissionLevels.HasPermission(flag)); } else allowTheAccess = false; diff --git a/Synapse/Events/Patches/EventPatches/MapPatches/GeneratorPatches.cs b/Synapse/Events/Patches/EventPatches/MapPatches/GeneratorPatches.cs index 9b10f71..08f8b01 100644 --- a/Synapse/Events/Patches/EventPatches/MapPatches/GeneratorPatches.cs +++ b/Synapse/Events/Patches/EventPatches/MapPatches/GeneratorPatches.cs @@ -5,6 +5,7 @@ namespace Synapse.Events.Patches { + /** [HarmonyPatch(typeof(Generator079), nameof(Generator079.Interact))] public static class GeneratorTabletPatches { @@ -56,7 +57,7 @@ public static bool Prefix(Generator079 __instance, GameObject person, string com return true; } } - } + }*/ [HarmonyPatch(typeof(Generator079), nameof(Generator079.OpenClose))] public static class GeneratorDoorPatches diff --git a/Synapse/Events/Patches/EventPatches/PlayerPatches/PlayerSetClassPatch.cs b/Synapse/Events/Patches/EventPatches/PlayerPatches/PlayerSetClassPatch.cs index 46d0744..5ca0a90 100644 --- a/Synapse/Events/Patches/EventPatches/PlayerPatches/PlayerSetClassPatch.cs +++ b/Synapse/Events/Patches/EventPatches/PlayerPatches/PlayerSetClassPatch.cs @@ -2,6 +2,7 @@ using System.Linq; using Harmony; using Mirror; +using NorthwoodLib.Pools; using Synapse.Api; using UnityEngine; @@ -24,7 +25,7 @@ public static bool Prefix(CharacterClassManager __instance, RoleType classid, Ga if (lite) return false; var inv = ply.GetPlayer().Inventory; - var list = ListPool.Rent(); + var list = ListPool.Shared.Rent(); if (escape && __instance.KeepItemsAfterEscaping) { diff --git a/Synapse/Events/Patches/EventPatches/RoundPatches/TeamRespawnPatch.cs b/Synapse/Events/Patches/EventPatches/RoundPatches/TeamRespawnPatch.cs index acd8a15..4103d62 100644 --- a/Synapse/Events/Patches/EventPatches/RoundPatches/TeamRespawnPatch.cs +++ b/Synapse/Events/Patches/EventPatches/RoundPatches/TeamRespawnPatch.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Harmony; +using NorthwoodLib.Pools; using Respawning; using Synapse.Api; using UnityEngine; @@ -42,7 +43,7 @@ public static bool Prefix(Respawning.RespawnManager __instance) list.RemoveAt(list.Count - 1); } list.ShuffleList(); - List list2 = ListPool.Rent(); + List list2 = ListPool.Shared.Rent(); var Playerlist = new List(); foreach (ReferenceHub hub in list) diff --git a/Synapse/Synapse.cs b/Synapse/Synapse.cs index 4c15c0b..7ad2059 100644 --- a/Synapse/Synapse.cs +++ b/Synapse/Synapse.cs @@ -18,7 +18,7 @@ public static class Synapse #region Version private const int MajorVersion = 1; private const int MinorVerion = 1; - private const int Patch = 0; + private const int Patch = 1; public static int VersionNumber => MajorVersion * 100 + MinorVerion * 10 + Patch; public static string Version => $"{MajorVersion}.{MinorVerion}.{Patch}"; diff --git a/Synapse/Synapse.csproj b/Synapse/Synapse.csproj index 05c75f1..223c1a2 100644 --- a/Synapse/Synapse.csproj +++ b/Synapse/Synapse.csproj @@ -49,6 +49,9 @@ ..\..\Synapse_Dependencies\Mirror.dll + + ..\..\Synapse_Dependencies\NorthwoodLib.dll + ..\SynapseModLoader\bin\Debug\SynapseModLoader.dll