This commit is contained in:
vis2k 2022-09-25 11:59:44 +07:00
parent f24acb6372
commit c97bf5a06a
5 changed files with 14 additions and 20 deletions

View File

@ -68,11 +68,9 @@ protected override ServerResponse ProcessRequest(ServerRequest request, IPEndPoi
throw;
}
}
#endregion
#region Client
/// <summary>
/// Create a message that will be broadcasted on the network to discover servers
/// </summary>
@ -108,7 +106,6 @@ protected override void ProcessResponse(ServerResponse response, IPEndPoint endp
OnServerFound.Invoke(response);
}
#endregion
}
}

View File

@ -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().

View File

@ -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<TransportError, string> OnErrorEvent;
/// <summary>Registered spawnable prefabs by assetId.</summary>

View File

@ -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<NetworkConnectionToClient> OnConnectedEvent;
public static Action<NetworkConnectionToClient> OnDisconnectedEvent;
public static Action<NetworkConnectionToClient> OnConnectedEvent;
public static Action<NetworkConnectionToClient> OnDisconnectedEvent;
public static Action<NetworkConnectionToClient, TransportError, string> 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);
}

View File

@ -16,7 +16,7 @@ public abstract class MirrorTest
public List<GameObject> instantiated;
// we usually need the memory transport
public GameObject holder;
public GameObject holder;
public MemoryTransport transport;
public virtual void SetUp()