From 78d511f65fb9a55aa0ea79450998a0492e8f3c13 Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 24 Apr 2024 11:46:34 +0800 Subject: [PATCH] NetworkReader/WriterPool: expose Count for testing --- Assets/Mirror/Core/NetworkReaderPool.cs | 3 +++ Assets/Mirror/Core/NetworkWriterPool.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Assets/Mirror/Core/NetworkReaderPool.cs b/Assets/Mirror/Core/NetworkReaderPool.cs index d50258a34..f44adb8ea 100644 --- a/Assets/Mirror/Core/NetworkReaderPool.cs +++ b/Assets/Mirror/Core/NetworkReaderPool.cs @@ -17,6 +17,9 @@ public static class NetworkReaderPool 1000 ); + // expose count for testing + public static int Count => Pool.Count; + /// Get the next reader in the pool. If pool is empty, creates a new Reader public static NetworkReaderPooled Get(byte[] bytes) { diff --git a/Assets/Mirror/Core/NetworkWriterPool.cs b/Assets/Mirror/Core/NetworkWriterPool.cs index 5eefa2a47..23f60269f 100644 --- a/Assets/Mirror/Core/NetworkWriterPool.cs +++ b/Assets/Mirror/Core/NetworkWriterPool.cs @@ -18,6 +18,9 @@ public static class NetworkWriterPool 1000 ); + // expose count for testing + public static int Count => Pool.Count; + /// Get a writer from the pool. Creates new one if pool is empty. public static NetworkWriterPooled Get() {