Esempio n. 1
0
            public void onRoomCreated(/* @OnRoomCreatedStatusCodes */ int statusCode,  /* @Nullable Room */
                                      AndroidJavaObject room)
            {
                if (room == null)
                {
                    mListener.OnRoomConnected(false);
                    return;
                }

                mParent.mRoom = room;
                mListener.OnRoomSetupProgress(mParent.GetPercentComplete());
            }
Esempio n. 2
0
            private void handleConnectedSetChanged(AndroidJavaObject room)
            {
                HashSet <string> oldConnectedSet = new HashSet <string>();

                foreach (Participant participant in mParent.GetConnectedParticipants())
                {
                    oldConnectedSet.Add(participant.ParticipantId);
                }

                mParent.mRoom = room;

                HashSet <string> connectedSet = new HashSet <string>();

                foreach (Participant participant in mParent.GetConnectedParticipants())
                {
                    connectedSet.Add(participant.ParticipantId);
                }

                // If the connected set hasn't actually changed, bail out.
                if (oldConnectedSet.Equals(connectedSet))
                {
                    OurUtils.Logger.w("Received connected set callback with unchanged connected set!");
                    return;
                }

                List <string> noLongerConnected = new List <string>();

                foreach (string id in oldConnectedSet)
                {
                    if (!connectedSet.Contains(id))
                    {
                        noLongerConnected.Add(id);
                    }
                }

                if (mParent.GetRoomStatus() == RoomStatus.Deleted)
                {
                    OurUtils.Logger.e("Participants disconnected during room setup, failing. " + "Participants were: " +
                                      string.Join(",", noLongerConnected.ToArray()));
                    mParent.mListener.OnRoomConnected(false);
                    mParent.CleanSession();
                    return;
                }

                mParent.mListener.OnRoomSetupProgress(mParent.GetPercentComplete());
            }