void Agora_OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // Find user and remove it from list
        var tileIndex = _userTiles.FindIndex((video) => video.GetComponent <VideoHandler>().Uid == uid);
        var tile      = _userTiles[tileIndex];

        _userTiles.Remove(tile);
        _users.Remove(uid);
        DestroyImmediate(tile);

        var numChildren = scrollBar.gameObject.transform.childCount;

        if (numChildren > tileIndex)
        {
            for (int i = tileIndex; i < numChildren; i++)
            {
                var rect = _userTiles[i].GetComponent <RectTransform>();
                rect.anchoredPosition = new Vector3(0, -i * (rect.rect.height + 20), 0);
            }
        }

        // Change background uid if needed
        if (_backgroundVideoUid == uid)
        {
            SwapBackgroundVideo(0);
        }
    }
Ejemplo n.º 2
0
 public static void UserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
 {
     main_thread_sync_context_.Post(
         new SendOrPostCallback((object state) => {
         the_form.UserOfflineHandlerUI((uint)state);
     }), uid);
 }
Ejemplo n.º 3
0
 // When remote user is offline, this delegate will be called. Typically
 // delete the GameObject for this user
 private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     // remove video stream
     Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
     // this is called in main thread
     clientObserver.removeObserver(uid);
 }
    void EngineOnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        string userOfflineMessage = string.Format("onUserOffline callback uid {0} {1}", uid, reason);

        Debug.Log(userOfflineMessage);

        RemoveSpeaker(uid);
    }
Ejemplo n.º 5
0
    private void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            Destroy(go);
        }
    }
    // when remote user leaves the channel
    void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
    {
        print("remote user offline - uid: " + uid + " - reason: " + reason);

        currentUsers--;
        print("userCount: " + currentUsers);

        Destroy(GameObject.Find(uid.ToString()));
    }
Ejemplo n.º 7
0
 // When remote user is offline, this delegate will be called. Delete user video object
 private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
     if (activeLabel)
     {
         activeLabel.SetActive(false);
     }
     clearRemoteVideo();
 }
Ejemplo n.º 8
0
    protected override void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        base.OnUserOffline(uid, reason);
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            Object.Destroy(go);
        }
    }
Ejemplo n.º 9
0
 protected override void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     base.OnUserOffline(uid, reason);
     if (RemoteUID == uid)
     {
         host2.SetEnable(false);
         hostCount--;
         RemoteUID = 0;
     }
 }
Ejemplo n.º 10
0
    private void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        GameObject go = getGameObjectWithUserID(uid);

        if (!ReferenceEquals(go, null))
        {
            Animate vs = go.GetComponent <Animate> ();
            vs.isOnLine          = false;
            UsersDictionary [go] = 0;
        }
    }
 // When remote user is offline, this delegate will be called. Typically
 // delete the GameObject for this user
 protected virtual void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     // remove video stream
     Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
     if (UserVideoDict.ContainsKey(uid))
     {
         var surface = UserVideoDict[uid];
         surface.SetEnable(false);
         UserVideoDict.Remove(uid);
         GameObject.Destroy(surface.gameObject);
     }
 }
    void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        Debug.Log("user has left the channel");

        //remove the game object from scene
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            Destroy(go);
        }
    }
Ejemplo n.º 13
0
    void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
    {
        Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);

        GameObject go = GameObject.Find(uid.ToString());

        if (go != null)
        {
            Destroy(go);
            usersInChannel--;
        }
    }
Ejemplo n.º 14
0
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
        // this is called in main thread
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            Object.Destroy(go);
        }
    }
Ejemplo n.º 15
0
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid);
        // this is called in main thread
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            //Destroy (go);
            Destroy(LoginInfo.Instance().mylogindata.forDel);
        }
    }
Ejemplo n.º 16
0
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        Debug.Log("onUserOffline");
        GameObject go;

        go = GameObject.Find("other");
        VideoSurface o = go.GetComponent <VideoSurface>();

        if (!ReferenceEquals(o, null))
        {
            Destroy(o);
        }
    }
Ejemplo n.º 17
0
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    protected override void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
        // this is called in main thread
        GameObject go = GameObject.Find(uid.ToString());

        if (!ReferenceEquals(go, null))
        {
            UnityEngine.Object.Destroy(go);
        }
        OnDisable();
    }
Ejemplo n.º 18
0
    // Remote User Leaves the Channel.
    private void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
    {
        if (!photonView.isMine)
        {
            return;
        }

        if (playerVideoList.Count <= 1)
        {
            PlayerChatIsEmpty();
        }

        RemoveUserVideoSurface(uid);
    }
Ejemplo n.º 19
0
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("agora_:" + "onUserOffline: uid = " + uid);
        // this is called in main thread
        GameObject go = RecallController.GetInstanse.GetRemote;

        if (!ReferenceEquals(go, null))
        {
            Destroy(go);
        }
        //VideoTimer.timer = 0f;
        //VideoTimer.isStarted = false;
    }
Ejemplo n.º 20
0
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        GameObject go = getGameObjectWithUserID(uid);

        if (!ReferenceEquals(go, null))
        {
            UsersDictionary [go] = 0;

            VideoSurface vs = go.GetComponent <VideoSurface> ();
            vs.UserID = 0;
            vs.RemoveTexture();
            vs.enabled = false;
        }
    }
Ejemplo n.º 21
0
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid);
        // this is called in main thread
        GameObject go = GameObject.Find(uid.ToString());


        GameObject go1 = GameObject.Find("C_" + uid.ToString());


        GameObject go2 = GameObject.Find("C2_" + uid.ToString());

        GameObject go3 = GameObject.Find("C3_" + uid.ToString());


        GameObject go4 = GameObject.Find("C4_" + uid.ToString());


        if (!ReferenceEquals(go1, null))
        {
            Destroy(go);

            go1.GetComponent <Renderer>().enabled = false;
            go1.name = "Cylinder";
        }

        if (!ReferenceEquals(go2, null))
        {
            Debug.Log("Entra");
            Destroy(go);

            go2.name = "Cylinder2";
            go2.GetComponent <Renderer>().enabled = false;
        }
        if (!ReferenceEquals(go3, null))
        {
            Destroy(go);
            go3.name = "Cylinder3";
            go3.GetComponent <Renderer>().enabled = false;
        }
        if (!ReferenceEquals(go4, null))
        {
            Destroy(go);

            go4.name = "Cylinder4";
            go4.GetComponent <Renderer>().enabled = false;
        }
    }
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        if (ToastManager.instance)
        {
            ToastManager.instance.AddToast(ToastType.Info, "用户退出\n" + uid);
        }
        clientObserver.removeObserver(uid);
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
        // this is called in main thread

        /*    GameObject go = GameObject.Find(uid.ToString());
         *  if (!ReferenceEquals(go, null))
         *  {
         *      Object.Destroy(go);
         *  }*/
    }
    // When remote user is offline, this delegate will be called. Typically
    // delete the GameObject for this user
    protected virtual void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
    {
        // remove video stream
        Debug.Log("onUserOffline: uid = " + uid + " reason = " + reason);
        // this is called in main thread
        GameObject go = GameObject.Find(RemoteStreamTargetImage);

        if (go != null)
        {
            RawImage rawImage = go.GetComponent <RawImage>();
            if (rawImage == null)
            {
                return;
            }

            VideoSurface videoSurface = go.GetComponent <VideoSurface>();
            videoSurface.enabled = false;
        }
    }
        void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
        {
            logger.UpdateLog("User " + uid + " went offline, reason:" + reason);
            dispatch(() => { logger.UpdateLog("Dispatched log + OFFLINE reason = " + reason); });

            lock (RemoteUserConfigured)
            {
                if (RemoteUserObject.ContainsKey(uid))
                {
                    Destroy(RemoteUserObject[uid]);
                    RemoteUserObject.Remove(uid);
                }

                if (RemoteUserConfigured.Contains(uid))
                {
                    RemoteUserConfigured.Remove(uid);
                }
            }
        }
Ejemplo n.º 25
0
 // When remote user is offline, this delegate will be called. Typically
 // delete the GameObject for this user
 private void onUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     //Debug.Log ("agora_:" + "onUserOffline: uid = " + uid);
     TestHome.GetInstance.onLeaveButtonClicked();
     SceneManager.LoadScene(0);
 }
Ejemplo n.º 26
0
 void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
 {
     logger.UpdateLog(string.Format("OnUserOffLine uid: ${0}, reason: ${1}", uid, (int)reason));
     DestroyVideoView(uid);
 }
Ejemplo n.º 27
0
 //Handles the other player leaving
 private void OnUserLeave(uint uid, USER_OFFLINE_REASON reason)
 {
     playerTwo.Clear();
     playerTree.Clear();
 }
Ejemplo n.º 28
0
 void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
 {
     remoteView.SetEnable(false);
 }
Ejemplo n.º 29
0
 void UserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
 {
     logCallback("OnUserOfflineHandler uid = " + uid + "  ,reason = " + (int)reason);
 }
Ejemplo n.º 30
0
    // Remote User Leaves the Channel.
    private void OnUserOfflineHandler(uint uid, USER_OFFLINE_REASON reason)
    {
        Debug.Log("Remote user left: " + uid + " for reason: " + reason);

        RemoveUserVideoSurface(uid);
    }