private void OnConnected(SocketEndpoint endpoint)
        {
            if (participants.TryGetValue(endpoint, out var existingParticipant))
            {
                Debug.LogWarning("SpatialCoordinateSystemParticipant connected that already existed.");
                return;
            }

            DebugLog($"Creating new SpatialCoordinateSystemParticipant, IPAddress: {endpoint.Address}, DebugLogging: {debugLogging}");

            SpatialCoordinateSystemParticipant participant = new SpatialCoordinateSystemParticipant(endpoint, debugVisual, debugVisualScale);

            participants[endpoint]       = participant;
            participant.ShowDebugVisuals = showDebugVisuals;
            participant.SendSupportedLocalizersMessage(endpoint, localizers.Keys);

            if (ParticipantConnected == null)
            {
                DebugLog($"No ParticipantConnected event handlers exist");
            }
            else
            {
                DebugLog($"Invoking ParticipantConnected event");
                ParticipantConnected.Invoke(participant);
            }
        }
        private void OnConnected(SocketEndpoint endpoint)
        {
            if (participants.ContainsKey(endpoint))
            {
                Debug.LogWarning("SpatialCoordinateSystemParticipant connected that already existed");
                return;
            }

            DebugLog($"Creating new SpatialCoordinateSystemParticipant, IPAddress: {endpoint.Address}, DebugLogging: {debugLogging}");

            SpatialCoordinateSystemParticipant participant = new SpatialCoordinateSystemParticipant(endpoint, debugVisual, debugVisualScale);

            participants[endpoint]       = participant;
            participant.ShowDebugVisuals = showDebugVisuals;

            if (ParticipantConnected == null)
            {
                Debug.LogWarning("Participant created, but no connection listeners were found");
                return;
            }

            participant.SendSupportedLocalizersMessage(endpoint, localizers.Keys);

            DebugLog($"Invoking ParticipantConnected event");
            ParticipantConnected.Invoke(participant);
        }
Example #3
0
        private void OnConnected(INetworkConnection connection)
        {
            if (participants.TryGetValue(connection, out var existingParticipant))
            {
                Debug.LogWarning("SpatialCoordinateSystemParticipant connected that already existed.");
                return;
            }

            DebugLog($"Creating new SpatialCoordinateSystemParticipant, NetworkConnection: {connection.ToString()}, DebugLogging: {debugLogging}");

            SpatialCoordinateSystemParticipant participant = new SpatialCoordinateSystemParticipant(connection, debugVisual, debugVisualScale);

            participants[connection]     = participant;
            participant.ShowDebugVisuals = showDebugVisuals;
            participant.SendSupportedLocalizersMessage(connection, localizers.Keys);

            if (ParticipantConnected == null)
            {
                DebugLog($"No ParticipantConnected event handlers exist");
            }
            else
            {
                DebugLog($"Invoking ParticipantConnected event");
                ParticipantConnected.Invoke(participant);
            }
        }