From c97bf5a06afd0e8f372af7b830c760371e78f31e Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 25 Sep 2022 11:59:44 +0700 Subject: [PATCH] syntax --- .../Components/Discovery/NetworkDiscovery.cs | 3 --- Assets/Mirror/Components/NetworkStatistics.cs | 16 ++++++++-------- Assets/Mirror/Core/NetworkClient.cs | 4 ++-- Assets/Mirror/Core/NetworkServer.cs | 9 +++------ Assets/Mirror/Tests/Common/MirrorTest.cs | 2 +- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Assets/Mirror/Components/Discovery/NetworkDiscovery.cs b/Assets/Mirror/Components/Discovery/NetworkDiscovery.cs index c24187021..cc9f1167b 100644 --- a/Assets/Mirror/Components/Discovery/NetworkDiscovery.cs +++ b/Assets/Mirror/Components/Discovery/NetworkDiscovery.cs @@ -68,11 +68,9 @@ protected override ServerResponse ProcessRequest(ServerRequest request, IPEndPoi throw; } } - #endregion #region Client - /// /// Create a message that will be broadcasted on the network to discover servers /// @@ -108,7 +106,6 @@ protected override void ProcessResponse(ServerResponse response, IPEndPoint endp OnServerFound.Invoke(response); } - #endregion } } diff --git a/Assets/Mirror/Components/NetworkStatistics.cs b/Assets/Mirror/Components/NetworkStatistics.cs index 8dfdbbe39..5d09fd0ef 100644 --- a/Assets/Mirror/Components/NetworkStatistics.cs +++ b/Assets/Mirror/Components/NetworkStatistics.cs @@ -21,16 +21,16 @@ public class NetworkStatistics : MonoBehaviour // CLIENT (public fields for other components to grab statistics) // long bytes to support >2GB - [HideInInspector] public int clientIntervalReceivedPackets; + [HideInInspector] public int clientIntervalReceivedPackets; [HideInInspector] public long clientIntervalReceivedBytes; - [HideInInspector] public int clientIntervalSentPackets; + [HideInInspector] public int clientIntervalSentPackets; [HideInInspector] public long clientIntervalSentBytes; // results from last interval // long bytes to support >2GB - [HideInInspector] public int clientReceivedPacketsPerSecond; + [HideInInspector] public int clientReceivedPacketsPerSecond; [HideInInspector] public long clientReceivedBytesPerSecond; - [HideInInspector] public int clientSentPacketsPerSecond; + [HideInInspector] public int clientSentPacketsPerSecond; [HideInInspector] public long clientSentBytesPerSecond; // --------------------------------------------------------------------- @@ -38,16 +38,16 @@ public class NetworkStatistics : MonoBehaviour // SERVER (public fields for other components to grab statistics) // capture interval // long bytes to support >2GB - [HideInInspector] public int serverIntervalReceivedPackets; + [HideInInspector] public int serverIntervalReceivedPackets; [HideInInspector] public long serverIntervalReceivedBytes; - [HideInInspector] public int serverIntervalSentPackets; + [HideInInspector] public int serverIntervalSentPackets; [HideInInspector] public long serverIntervalSentBytes; // results from last interval // long bytes to support >2GB - [HideInInspector] public int serverReceivedPacketsPerSecond; + [HideInInspector] public int serverReceivedPacketsPerSecond; [HideInInspector] public long serverReceivedBytesPerSecond; - [HideInInspector] public int serverSentPacketsPerSecond; + [HideInInspector] public int serverSentPacketsPerSecond; [HideInInspector] public long serverSentBytesPerSecond; // NetworkManager sets Transport.active in Awake(). diff --git a/Assets/Mirror/Core/NetworkClient.cs b/Assets/Mirror/Core/NetworkClient.cs index 4802f95dd..99afe845e 100644 --- a/Assets/Mirror/Core/NetworkClient.cs +++ b/Assets/Mirror/Core/NetworkClient.cs @@ -69,8 +69,8 @@ public static class NetworkClient // Connected/Disconnected messages over the network causing undefined // behaviour. // => public so that custom NetworkManagers can hook into it - public static Action OnConnectedEvent; - public static Action OnDisconnectedEvent; + public static Action OnConnectedEvent; + public static Action OnDisconnectedEvent; public static Action OnErrorEvent; /// Registered spawnable prefabs by assetId. diff --git a/Assets/Mirror/Core/NetworkServer.cs b/Assets/Mirror/Core/NetworkServer.cs index fbff76d61..1fe976967 100644 --- a/Assets/Mirror/Core/NetworkServer.cs +++ b/Assets/Mirror/Core/NetworkServer.cs @@ -50,8 +50,8 @@ public static class NetworkServer // Connected/Disconnected messages over the network causing undefined // behaviour. // => public so that custom NetworkManagers can hook into it - public static Action OnConnectedEvent; - public static Action OnDisconnectedEvent; + public static Action OnConnectedEvent; + public static Action OnDisconnectedEvent; public static Action OnErrorEvent; // initialization / shutdown /////////////////////////////////////////// @@ -900,10 +900,7 @@ internal static void ShowForConnection(NetworkIdentity identity, NetworkConnecti internal static void HideForConnection(NetworkIdentity identity, NetworkConnection conn) { - ObjectHideMessage msg = new ObjectHideMessage - { - netId = identity.netId - }; + ObjectHideMessage msg = new ObjectHideMessage {netId = identity.netId}; conn.Send(msg); } diff --git a/Assets/Mirror/Tests/Common/MirrorTest.cs b/Assets/Mirror/Tests/Common/MirrorTest.cs index d0b919387..b732ee89b 100644 --- a/Assets/Mirror/Tests/Common/MirrorTest.cs +++ b/Assets/Mirror/Tests/Common/MirrorTest.cs @@ -16,7 +16,7 @@ public abstract class MirrorTest public List instantiated; // we usually need the memory transport - public GameObject holder; + public GameObject holder; public MemoryTransport transport; public virtual void SetUp()