private void HandleNetworkReady() { if (NetworkManager.Singleton.IsHost) { OnConnectionFinished?.Invoke(ConnectStatus.Success); } OnNetworkReadied?.Invoke(); }
private void HandleConnectionFinished(ConnectStatus status) { if (status != ConnectStatus.Success) { DisconnectReason.SetDisconnectReason(status); } OnConnectionFinished?.Invoke(status); }
private void RegisterClientMessageHandlers() { NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("ServerToClientConnectResult", (senderClientId, reader) => { reader.ReadValueSafe(out ConnectStatus status); OnConnectionFinished?.Invoke(status); }); NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("ServerToClientSetDisconnectReason", (senderClientId, reader) => { reader.ReadValueSafe(out ConnectStatus status); OnDisconnectReasonReceived?.Invoke(status); }); }