From 0cfc58838b26ae982e6c23dc297118d6d8e79de3 Mon Sep 17 00:00:00 2001 From: GrafDimenzio Date: Sun, 10 Jan 2021 14:31:55 +0100 Subject: [PATCH] fixed double StartRound bug --- WaitAndChill/EventHandlers.cs | 8 +++++++- WaitAndChill/PluginClass.cs | 2 +- WaitAndChill/WaitAndChill.csproj | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/WaitAndChill/EventHandlers.cs b/WaitAndChill/EventHandlers.cs index e9cdf72..e0675a6 100644 --- a/WaitAndChill/EventHandlers.cs +++ b/WaitAndChill/EventHandlers.cs @@ -3,6 +3,7 @@ using Synapse.Api; using System.Collections.Generic; using UnityEngine; +using Mirror; namespace WaitAndChill { @@ -14,7 +15,12 @@ private void OnWaiting() { GameObject.Find("StartRound").transform.localScale = Vector3.zero; Timing.RunCoroutine(WaitingForPlayers()); - Server.Get.Host.ClassManager.RpcRoundStarted(); + + + var component = Server.Get.Host.ClassManager; + NetworkWriter writer = NetworkWriterPool.GetWriter(); + component.SendRPCInternal(typeof(global::CharacterClassManager), "RpcRoundStarted", writer, 0); + NetworkWriterPool.Recycle(writer); } private IEnumerator WaitingForPlayers() diff --git a/WaitAndChill/PluginClass.cs b/WaitAndChill/PluginClass.cs index bd902b1..34e953c 100644 --- a/WaitAndChill/PluginClass.cs +++ b/WaitAndChill/PluginClass.cs @@ -10,7 +10,7 @@ namespace WaitAndChill SynapseMajor = 2, SynapseMinor = 4, SynapsePatch = 2, - Version = "v.1.0.3" + Version = "v.1.0.4" )] public class PluginClass : AbstractPlugin { diff --git a/WaitAndChill/WaitAndChill.csproj b/WaitAndChill/WaitAndChill.csproj index a77bbc3..7218ec3 100644 --- a/WaitAndChill/WaitAndChill.csproj +++ b/WaitAndChill/WaitAndChill.csproj @@ -44,8 +44,8 @@ ..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll - - ..\packages\SynapseSL.2.4.2\lib\net472\Mirror.dll + + ..\..\..\Synapse\Refs\Mirror_publicized.dll ..\packages\SynapseSL.2.4.2\lib\net472\Synapse.dll