Mergd master

This commit is contained in:
MrGadget 2024-01-21 17:16:55 -05:00
commit 3d6659d885
3 changed files with 14 additions and 1 deletions

View File

@ -930,6 +930,14 @@ public static void ReplaceHandler<T>(Action<NetworkConnectionToClient, T> handle
ushort msgType = NetworkMessageId<T>.Id;
handlers[msgType] = NetworkMessages.WrapHandler(handler, requireAuthentication, exceptionsDisconnect);
}
/// <summary>Replace a handler for message type T. Most should require authentication.</summary>
public static void ReplaceHandler<T>(Action<NetworkConnectionToClient, T, int> handler, bool requireAuthentication = true)
where T : struct, NetworkMessage
{
ushort msgType = NetworkMessageId<T>.Id;
handlers[msgType] = NetworkMessages.WrapHandler(handler, requireAuthentication, exceptionsDisconnect);
}
/// <summary>Unregister a handler for a message type T.</summary>
public static void UnregisterHandler<T>()

View File

@ -367,6 +367,7 @@ MonoBehaviour:
connectionQualityInterval: 3
timeInterpolationGui: 0
spawnAmount: 50000
spawnAmount: 10000
interleave: 2
spawnPrefab: {fileID: 449802645721213856, guid: 0ea79775d59804682a8cdd46b3811344,
type: 3}

View File

@ -5,9 +5,13 @@ namespace Mirror.Examples.NetworkRoom
[RequireComponent(typeof(Common.RandomColor))]
public class Reward : NetworkBehaviour
{
public bool available = true;
[Header("Components")]
public Common.RandomColor randomColor;
[Header("Diagnostics")]
[ReadOnly, SerializeField]
bool available = true;
protected override void OnValidate()
{
base.OnValidate();