Exemplo n.º 1
0
        //导入完成后,把锚点数据附加到 物体上
        private void ImportComplete(SerializationCompletionReason status, WorldAnchorTransferBatch wat)
        {
            MYDialog.Instance.Write(status.ToString() + wat.GetAllIds().Length);
            if (status == SerializationCompletionReason.Succeeded && wat.GetAllIds().Length > 0)
            {
                MYDialog.Instance.Write("\r\n导入完成!");
                string first = wat.GetAllIds()[0];
                Debug.Log("锚点名字: " + first);
                WorldAnchor existingAnchor = objectToImportAnchor.GetComponent <WorldAnchor>();
                if (existingAnchor != null)
                {
                    //删除旧的锚点数据
                    DestroyImmediate(existingAnchor);
                }
                //绑定新的锚点数据
                Debug.Log(objectToImportAnchor.transform.position);
                WorldAnchor anchor = wat.LockObject(first, objectToImportAnchor);
                //AnchorStore.Save(first, anchor);
                MYDialog.Instance.Write("新锚点建立完成!\r\n待此文字位置与发送锚点的hololens看到的位置相同时\r\n锚点同步过程完成");

                IsImportAnchor = true;
                OperationBean op = new OperationBean();
                op.op = OperationBean.OpId.AnchorImported;
                SpectatorViewManager._instance.operationQueue.Enqueue(op);
            }
            else
            {
                Debug.Log("锚点导入失败!");
                OperationBean op = new OperationBean();
                op.op = OperationBean.OpId.AnchorImportFailed;
                SpectatorViewManager._instance.operationQueue.Enqueue(op);
            }
        }
Exemplo n.º 2
0
 private void NetWork_onRoomCache(string rid, Dictionary <string, string[]> roomCache)
 {
     if (rid != null && rid.Equals(this.roomId))
     {
         OperationBean op = new OperationBean();
         op.op    = OperationBean.OpId.OnRoomCache;
         op.param = roomCache;
         operationQueue.Enqueue(op);
     }
 }
Exemplo n.º 3
0
 private void NetWork_onUserLeave(string rid, string uid)
 {
     if (rid != null && rid.Equals(this.roomId))
     {
         OperationBean op = new OperationBean();
         op.op    = OperationBean.OpId.UserLeave;
         op.param = uid;
         operationQueue.Enqueue(op);
     }
 }
Exemplo n.º 4
0
        private void NetWork_onDisconnect(string rid)
        {
            if (rid != null && rid.Equals(this.roomId))
            {
                OperationBean op = new OperationBean();
                op.op = OperationBean.OpId.NetDisconn;

                operationQueue.Enqueue(op);
            }
        }
Exemplo n.º 5
0
        private void NetWork_onJoinRoom(string rid, bool result, bool isCreator, Dictionary <string, string[]> roomCache,
                                        string[] uids)
        {
            if (rid == null || !rid.Equals(this.roomId))
            {
                return;
            }
            if (result)
            {
                SetStates(VirtualManState.InRoom);
                if (isCreator)
                {
                    this.isControler = true;
                    //GameObject.Find("WorldRoot/SelectIpad").SetActive(true);
                }
                this.isCreator = isCreator;
                if (roomCache.ContainsKey(RoomCacheKey.RoomCacheKeyAnchor))
                {
                    // nothing todo
                }
                else if (isCreator)
                {
                    // nothing todo
                }
                if (!NetHelper.Instance.IsInSpectatorViewRoom && this.clientType != ClientType.SpectatorViewPc &&
                    this.clientType != ClientType.IOS)
                {
                    if (MrShareData._instance.FloorLocated)
                    {
                        SetStates(VirtualManState.FloorLoacted);
                    }
                    else
                    {
                        MrShareData._instance.needLocated = true;
                        SetStates(VirtualManState.FloorLocating);
                    }
                }
                OperationBean op = new OperationBean();
                op.op    = OperationBean.OpId.SelfJoinRoom;
                op.param = roomCache;
                operationQueue.Enqueue(op);


                if (uids != null)
                {
                    foreach (string uid in uids)
                    {
                        op       = new OperationBean();
                        op.op    = OperationBean.OpId.UserEnter;
                        op.param = uid;
                        operationQueue.Enqueue(op);
                    }
                }
            }
        }
Exemplo n.º 6
0
 //锚点数据导出完成时调用
 private void ExportComplete(SerializationCompletionReason status)
 {
     if (status == SerializationCompletionReason.Succeeded && exportingAnchorBytes.Count > minTrustworthySerializedAnchorDataSize)
     {
         AnchorData = exportingAnchorBytes.ToArray();
         exportingAnchorBytes.Clear();
         IsExportAnchor = true;
         OperationBean op = new OperationBean();
         op.op = OperationBean.OpId.AnchorExported;
         SpectatorViewManager._instance.operationQueue.Enqueue(op);
         MYDialog.Instance.Write("锚点准备好了");
     }
     else
     {
         //如果序列化失败或者数据小于最下限制,重新创建
         Debug.Log("锚点导出失败,低于限制!再次尝试...");
         //再次导出
         ExportAnchorData(gameObject, exportAnchorName);
     }
 }
Exemplo n.º 7
0
        private void NetWork_onReceiveCmd(string rid, NetCmdIdClient cid, object cmd)
        {
            if (rid != null && rid.Equals(this.roomId))
            {
                switch (cid)
                {
                case NetCmdIdClient.None:
                    break;

                case NetCmdIdClient.AnchorUploaded:
                {
                    if (clientType != ClientType.SpectatorViewPc &&
                        clientType != ClientType.IOS)
                    {
                        AnchorUploaded clientCmd = (AnchorUploaded)cmd;


                        this.anchorName = clientCmd.anchor;
                        OperationBean oper = new OperationBean();
                        oper.op    = OperationBean.OpId.DownAnchor;
                        oper.param = anchorName;

                        operationQueue.Enqueue(oper);
                    }
                }
                break;

                case NetCmdIdClient.TakeControlPower:
                {
                    //TakeControlPower clientCmd = (TakeControlPower)cmd;
                }
                break;

                case NetCmdIdClient.SyncPos:
                {
                    SyncPos clientCmd = (SyncPos)cmd;
                    if (clientCmd.type == SyncType.VirtualMan)
                    {
                        if (PlayerUserList.ContainsKey(clientCmd.id))
                        {
                            SpectatorViewPlayer player;
                            PlayerUserList.TryGetValue(clientCmd.id, out player);
                            if (player)
                            {
                                player.OnRecvPosition(new Vector3(clientCmd.px, clientCmd.py, clientCmd.pz), clientCmd.time);
                            }
                        }
                    }
                }
                break;

                case NetCmdIdClient.SyncRotate:
                {
                    SyncRotate clientCmd = (SyncRotate)cmd;
                    if (clientCmd.type == SyncType.VirtualMan)
                    {
                        if (PlayerUserList.ContainsKey(clientCmd.id))
                        {
                            SpectatorViewPlayer player;
                            PlayerUserList.TryGetValue(clientCmd.id, out player);
                            if (player)
                            {
                                player.OnRecvRotation(new Vector3(clientCmd.rx, clientCmd.ry, clientCmd.rz), clientCmd.time);
                            }
                        }
                    }
                }
                break;

                case NetCmdIdClient.SyncAnim:
                {
                    SyncAnim clientCmd = (SyncAnim)cmd;
                    if (clientCmd.type == SyncType.SpectatorView)
                    {
                    }
                }
                break;

                case NetCmdIdClient.OtherCmd:
                {
                    OtherCmd      clientCmd = (OtherCmd)cmd;
                    OperationBean op        = new OperationBean();
                    op.op    = OperationBean.OpId.OtherCmd;
                    op.param = clientCmd;
                    operationQueue.Enqueue(op);
                }
                break;

                case NetCmdIdClient.FloorLocated:
                {
                    FloorLocated clientCmd = (FloorLocated)cmd;
                    _lerpStageWithFloor = clientCmd.y;

                    Vector3 v = new Vector3(clientCmd.x, clientCmd.y, clientCmd.z);

                    //TODO---->>>> GeMesCar测试数据
                    //ipad
                    if (clientType == ClientType.IOS)
                    {
                        OperationBean op = new OperationBean();
                        op.op    = OperationBean.OpId.ios_AdjustFloorLocate;
                        op.param = v;
                        operationQueue.Enqueue(op);
                    }
                    else
                    {
                        OperationBean op = new OperationBean();
                        op.op    = OperationBean.OpId.hololens_AdjustFloorLocate;
                        op.param = v;
                        operationQueue.Enqueue(op);
                    }
                    Debug.Log("收到creater定位地面的消息-->>>>>    " + v.ToString());
                }
                break;

                case NetCmdIdClient.MarkerGenerated:
                {
                    OperationBean op = new OperationBean();
                    op.op    = OperationBean.OpId.MarkerGenerated;
                    op.param = cmd;
                    operationQueue.Enqueue(op);
                }
                break;

                case NetCmdIdClient.MarkerDetected:
                {
                    OperationBean op = new OperationBean();
                    op.op    = OperationBean.OpId.MarkerDetected;
                    op.param = cmd;
                    operationQueue.Enqueue(op);
                }
                break;

                case NetCmdIdClient.SyncWorldRoot:
                {
                    Debug.Log("SpectatorViewManager#NetWork_onReceiveCmd#SyncWorldRoot");

                    OperationBean op = new OperationBean();
                    op.op    = OperationBean.OpId.SyncWorldRoot;
                    op.param = cmd;
                    operationQueue.Enqueue(op);
                }
                break;
                }
            }
        }
Exemplo n.º 8
0
        private void NetWork_onJoinRoom(string rid, bool result, bool isCreator, Dictionary <string, string[]> roomCache, string[] uids)
        {
            if (rid == null || !rid.Equals(this.roomId))
            {
                return;
            }
            if (result)
            {
                SetStates(SpectatorViewState.InRoom);

                this.isCreator = isCreator;

                if (isCreator)
                {
                    // locate floor
                    // export anchor after that
                    MrShareData._instance.needLocated = true;
                    WaittingForExportAnchor           = true;
                    SetStates(SpectatorViewState.LocatingFloor);
                }
                else
                {
                    if (roomCache != null)
                    {
                        if (roomCache.ContainsKey(RoomCacheKey.RoomCacheKeyAnchor) &&
                            clientType != ClientType.SpectatorViewPc &&
                            clientType != ClientType.IOS)
                        {
                            // do download anchor
                            SetStates(SpectatorViewState.AnchorDownloading);
                            string[] values;
                            roomCache.TryGetValue(RoomCacheKey.RoomCacheKeyAnchor, out values);
                            if (values.Length > 0)
                            {
                                this.anchorName = values[0];
                                OperationBean oper = new OperationBean();
                                oper.op    = OperationBean.OpId.DownAnchor;
                                oper.param = anchorName;

                                operationQueue.Enqueue(oper);
                            }
                        }

                        if (roomCache.ContainsKey(RoomCacheKey.RoomCacheKeyFloorY) &&
                            (clientType == ClientType.SpectatorViewPc ||
                             clientType == ClientType.IOS) || (clientType == ClientType.Hololens && !isCreator))
                        {
                            string[] values;
                            roomCache.TryGetValue(RoomCacheKey.RoomCacheKeyFloorY, out values);
                            if (values != null && values.Length > 0)
                            {
                                string sFloorY = values[0];
                                if (sFloorY != null)
                                {
                                    string[] strArr = sFloorY.Split(':');
                                    if (strArr.Length == 3)
                                    {
                                        _lerpStageWithFloor = float.Parse(strArr[1]);


                                        if (clientType == ClientType.IOS)
                                        {
                                            Vector3 v = new Vector3(float.Parse(strArr[0]), float.Parse(strArr[1]), float.Parse(strArr[2]));

                                            OperationBean opa = new OperationBean();
                                            opa.op    = OperationBean.OpId.ios_AdjustFloorLocate;
                                            opa.param = v;
                                            operationQueue.Enqueue(opa);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (roomCache != null && roomCache.ContainsKey(RoomCacheKey.RoomCacheKeyWaitingMarkerDetect))
                {
                    string[] values;
                    roomCache.TryGetValue(RoomCacheKey.RoomCacheKeyWaitingMarkerDetect, out values);
                    if (values.Length > 0)
                    {
                        string isWaitting = values[0];
                        if (isWaitting != null && isWaitting.Equals("true"))
                        {
                            isWaittingMarkerDetect = true;
                        }
                        else
                        {
                            isWaittingMarkerDetect = false;
                        }
                    }
                }
                OperationBean op = new OperationBean();
                op.op    = OperationBean.OpId.SelfJoinRoom;
                op.param = roomCache;

                operationQueue.Enqueue(op);

                if (uids != null)
                {
                    foreach (string uid in uids)
                    {
                        op       = new OperationBean();
                        op.op    = OperationBean.OpId.UserEnter;
                        op.param = uid;
                        operationQueue.Enqueue(op);
                    }
                }
            }
        }
Exemplo n.º 9
0
        void Update()
        {
            while (operationQueue.Count() > 0)
            {
                OperationBean op = operationQueue.Dequeue();
                switch (op.op)
                {
                case OperationBean.OpId.UserEnter:
                    PlayerUserIdList.Add((string)op.param);
                    AddSpectatorViewPlayer((string)op.param, false, false);
                    break;

                case OperationBean.OpId.UserLeave:
                    if (PlayerUserIdList.Contains((string)op.param))
                    {
                        PlayerUserIdList.Remove((string)op.param);
                    }
                    RemoveSpectatorViewPlayer((string)op.param);
                    if (PlayerUserIdList.Count == 0)
                    {
                        // Disconnect();
                    }
                    break;

                case OperationBean.OpId.SelfJoinRoom:
                    AddSpectatorViewPlayer(this.mineUid, true, this.isCreator);
                    SyncInterface.Instance.OnSelfJoinnedRoom(this.roomId, this.isCreator, (Dictionary <string, string[]>)op.param);

                    if (OnConnect != null)
                    {
                        OnConnect.Invoke(this.isCreator, this.isWaittingMarkerDetect);
                    }

                    break;

                case OperationBean.OpId.NetDisconn:
                    if (MrShareData._instance.needLocated)
                    {
                        MrShareData._instance.needLocated = false;
                        MrShareData._instance.FloorTarget.SetActive(false);
                        WaittingForExportAnchor = false;
                    }

                    ClearUserList();
                    PlayerUserIdList.Clear();
                    SetStates(SpectatorViewState.Init);
                    SyncInterface.Instance.OnSelfLeftRoom(roomId);

                    break;

                case OperationBean.OpId.DownAnchor:
                    SetStates(SpectatorViewState.AnchorDownloading);
                    StartCoroutine(DownLoadAnchor());
                    break;

                case OperationBean.OpId.AnchorExported:
                    if (state == SpectatorViewState.AnchorUploading)
                    {
                        StartCoroutine(UploadAnchor());
                    }
                    else
                    {
                        Debug.Log("SV#OperationBean.OpId.AnchorExported#Wrong State. Current State:" + state.ToString());
                    }

                    break;

                case OperationBean.OpId.AnchorImported:
                    if (state == SpectatorViewState.AnchorDownloading)
                    {
                        //停止映射
                        SpatialMappingManager.Instance.StopObserver();
                        MYDialog.Instance.Write("导入锚点完成,设置FloorY为 : " + _lerpStageWithFloor /*,false*/);
                        MrShareData._instance.FloorY = _lerpStageWithFloor;
                        SetStates(SpectatorViewState.AnchorPrepared);
                    }
                    else
                    {
                        Debug.Log("SV#OperationBean.OpId.AnchorImported#Wrong State. Current State:" + state.ToString());
                    }
                    break;

                case OperationBean.OpId.FloorLocated:
                    if (state == SpectatorViewState.LocatingFloor)
                    {
                        SetStates(SpectatorViewState.AnchorUploading);
                        string anchorName = "Anchor" + Guid.NewGuid().ToString();
                        ExportAnchor(anchorName);
                        MYDialog.Instance.Write("你已成功导出锚点  ");
                    }
                    else
                    {
                        Debug.Log("SV#OperationBean.OpId.FloorLocated#Wrong State. Current State:" + state.ToString());
                    }
                    break;

                case OperationBean.OpId.OtherCmd:
                    OtherCmd cmd = (OtherCmd)op.param;
                    SyncInterface.Instance.OnSyncOtherCmd(cmd.id, cmd.cmd);
                    break;

                case OperationBean.OpId.AnchorImportFailed:
                    if (state == SpectatorViewState.AnchorDownloading)
                    {
                        SetStates(SpectatorViewState.ImportAnchorFailed);
                    }
                    else
                    {
                        Debug.Log("SV#OperationBean.OpId.AnchorImportFailed#Wrong State. Current State:" + state.ToString());
                    }
                    break;

                case OperationBean.OpId.MarkerGenerated:
                {
                    MarkerGenerated cmdObj = (MarkerGenerated)op.param;
                    if (OnMarkerGenerated != null)
                    {
                        OnMarkerGenerated(cmdObj.senderid);
                    }
                }
                break;

                case OperationBean.OpId.MarkerDetected:
                {
                    MarkerDetected cmdObj = (MarkerDetected)op.param;
                    if (OnMarkerDetected != null)
                    {
                        OnMarkerDetected(cmdObj.senderid, cmdObj.markerid);
                    }
                }
                break;

                case OperationBean.OpId.SyncWorldRoot:
                {
                    Debug.Log("SpectatorViewManager#Update#SyncWorldRoot");
                    SyncWorldRoot cmdObj = (SyncWorldRoot)op.param;
                    if (OnSyncWorldRoot != null)
                    {
                        OnSyncWorldRoot(cmdObj.senderid, cmdObj.markerid, cmdObj.posx, cmdObj.posy, cmdObj.posz, cmdObj.angley);
                    }
                }
                break;

                case OperationBean.OpId.ios_AdjustFloorLocate:
                {
                    MrShareData._instance.FloorY = _lerpStageWithFloor;

                    Vector3 v = (Vector3)op.param;

                    MrShareData._instance.FloorTarget.transform.localPosition = v;
                    MrShareData._instance.RelativeTransform = MrShareData._instance.FloorTarget.transform;
                    SyncInterface.Instance.OnFloorLocated();
                    MYDialog.Instance.Write("定位地面完成,隐藏log" /*, false*/);
                }
                break;

                case OperationBean.OpId.hololens_AdjustFloorLocate:
                    Vector3 vv = (Vector3)op.param;
                    MrShareData._instance.CreatorLocatePos = vv;
                    break;

                case OperationBean.OpId.OnRoomCache:
                    SyncInterface.Instance.OnRoomCache(roomId, (Dictionary <string, string[]>)op.param);
                    break;
                }
            }
        }
Exemplo n.º 10
0
        void Update()
        {
            if (Input.GetKey(KeyCode.B))
            {
                if (ShowLog._instance != null)
                {
                    ShowLog._instance.ShowHide();
                }
            }

            while (operationQueue.Count() > 0)
            {
                OperationBean op = operationQueue.Dequeue();
                switch (op.op)
                {
                case OperationBean.OpId.UserEnter:
                    PlayerUserIdList.Add((string)op.param);
                    ClientType clientType = UserIdUtil.GetClientTypeByUid((string)op.param);
                    #region  发送Creator的语言版本,每个客户端应自主选择
                    //if (GameLanguageController._instance.GameLanguageType == LanguageType.Chinese)
                    //{
                    //    SyncInterface.Instance.SyncOtherCmd("CmdSetLanguageCn", new string[0]);
                    //}
                    //else
                    //{
                    //    SyncInterface.Instance.SyncOtherCmd("CmdSetLanguageEn", new string[0]);
                    //}
                    //SyncInterface.Instance.SyncOtherCmd("CmdCloseLanguagePanel", new string[0]);
                    #endregion
                    if (clientType == ClientType.IOS)
                    {
                        //TODO-->>  IOS端登陆成功
                        //TODO-->>  隐藏hololens提示UI
                    }
                    if (clientType == ClientType.Hololens)
                    {
                        AddVirtualManPlayer((string)op.param, false, false);
                    }
                    break;

                case OperationBean.OpId.UserLeave:
                    if (PlayerUserIdList.Contains((string)op.param))
                    {
                        PlayerUserIdList.Remove((string)op.param);
                    }
                    RemoveVirtualManPlayer((string)op.param);
                    if (PlayerUserIdList.Count == 0)
                    {
                        Disconnect();
                    }
                    break;

                case OperationBean.OpId.SelfJoinRoom:
                    if (this.clientType != ClientType.SpectatorViewPc && this.clientType != ClientType.IOS)
                    {
                        AddVirtualManPlayer(this.mineUid, true, this.isControler);

                        SyncInterface.Instance.OnSelfJoinnedRoom(roomId, this.isCreator,
                                                                 (Dictionary <string, string[]>)op.param);
                    }

                    //OpenSyncWorldRootCanvas();
                    break;

                case OperationBean.OpId.NetDisconn:
                    if (MrShareData._instance.needLocated)
                    {
                        MrShareData._instance.needLocated = false;
                        MrShareData._instance.FloorTarget.SetActive(false);
                    }

                    ClearUserList();
                    PlayerUserIdList.Clear();
                    SetStates(VirtualManState.Init);
                    SyncInterface.Instance.OnSelfLeftRoom(roomId);

                    break;

                case OperationBean.OpId.FloorLocated:
                    if (state == VirtualManState.FloorLocating)
                    {
                        SetStates(VirtualManState.FloorLoacted);
                    }
                    else
                    {
                        Debug.Log("VM#OperationBean.OpId.FloorLocated#Wrong State. Current State:" +
                                  state.ToString());
                    }
                    break;

                case OperationBean.OpId.OtherCmd:
                    OtherCmd cmd = (OtherCmd)op.param;
                    SyncInterface.Instance.OnSyncOtherCmd(cmd.id, cmd.cmd);
                    break;

                case OperationBean.OpId.OnRoomCache:
                    SyncInterface.Instance.OnRoomCache(roomId, (Dictionary <string, string[]>)op.param);
                    break;
                }
            }
        }
Exemplo n.º 11
0
        public void TestPosRot()
        {
            Debug.Log("TestPosRot");
            string uid = "testposrotuserid_" + (int)ClientType.Hololens;

            if (posRotLooping)
            {
                posRotLooping = false;


                OperationBean op = new OperationBean();
                op.op    = OperationBean.OpId.UserLeave;
                op.param = uid;
                operationQueue.Enqueue(op);
            }
            else
            {
                posRotLooping = true;
                OperationBean op = new OperationBean();
                op.op    = OperationBean.OpId.UserEnter;
                op.param = uid;
                operationQueue.Enqueue(op);


                new Task(async() =>
                {
                    while (posRotLooping)
                    {
                        VirtualManPlayer player;
                        PlayerUserList.TryGetValue(uid, out player);
                        if (player)
                        {
                            if (testx > 5)
                            {
                                moveLeft = true;
                                player.onRecvAnimation((int)VirtualManPlayer.ManAni.walk, TimeHelper.GetTimestamp());
                                player.onRecvAnimation((int)VirtualManPlayer.ManAni.sit, TimeHelper.GetTimestamp());
                                NetHelper.Instance.SyncAnimation(SyncType.VirtualMan, this.mineUid,
                                                                 (int)VirtualManPlayer.ManAni.walk);
                                NetHelper.Instance.SyncAnimation(SyncType.VirtualMan, this.mineUid,
                                                                 (int)VirtualManPlayer.ManAni.sit);
                            }
                            if (testx < -5)
                            {
                                moveLeft = false;
                                player.onRecvAnimation((int)VirtualManPlayer.ManAni.sitstand,
                                                       TimeHelper.GetTimestamp());
                                player.onRecvAnimation((int)VirtualManPlayer.ManAni.greet, TimeHelper.GetTimestamp());
                                NetHelper.Instance.SyncAnimation(SyncType.VirtualMan, this.mineUid,
                                                                 (int)VirtualManPlayer.ManAni.sitstand);
                                NetHelper.Instance.SyncAnimation(SyncType.VirtualMan, this.mineUid,
                                                                 (int)VirtualManPlayer.ManAni.sitstand);
                            }


                            if (moveLeft)
                            {
                                testx -= 0.1f;
                            }
                            else
                            {
                                testx += 0.1f;
                            }

                            player.OnRecvPosition(new Vector3(testx, 0, 0), TimeHelper.GetTimestamp());
                            player.OnRecvRotation(new Vector3(-1, 0, 0), TimeHelper.GetTimestamp());
                            NetHelper.Instance.SyncPosition(SyncType.VirtualMan, mineUid, new Vector3(testx, 0, 0));
                            NetHelper.Instance.SyncRotation(SyncType.VirtualMan, mineUid, new Vector3(1, 0, 0));
                        }
                        await Task.Delay(40);
                    }
                }).Start();
            }
        }
Exemplo n.º 12
0
        private void NetWork_onReceiveCmd(string rid, NetCmdIdClient cid, object cmd)
        {
            if (rid != null && rid.Equals(this.roomId))
            {
                switch (cid)
                {
                case NetCmdIdClient.None:
                    break;

                case NetCmdIdClient.AnchorUploaded:
                {
                    //AnchorUploaded clientCmd = (AnchorUploaded)cmd;
                }
                break;

                case NetCmdIdClient.TakeControlPower:
                {
                    //TakeControlPower clientCmd = (TakeControlPower)cmd;
                    isControler = false;
                }
                break;

                case NetCmdIdClient.SyncPos:
                {
                    SyncPos clientCmd = (SyncPos)cmd;
                    if (clientCmd.type == SyncType.VirtualMan)
                    {
                        if (PlayerUserList.ContainsKey(clientCmd.id))
                        {
                            VirtualManPlayer player;
                            PlayerUserList.TryGetValue(clientCmd.id, out player);
                            if (player)
                            {
                                player.OnRecvPosition(new Vector3(clientCmd.px, clientCmd.py, clientCmd.pz),
                                                      clientCmd.time);
                            }
                        }
                    }
                }
                break;

                case NetCmdIdClient.SyncRotate:
                {
                    SyncRotate clientCmd = (SyncRotate)cmd;
                    if (clientCmd.type == SyncType.VirtualMan)
                    {
                        if (PlayerUserList.ContainsKey(clientCmd.id))
                        {
                            VirtualManPlayer player;
                            PlayerUserList.TryGetValue(clientCmd.id, out player);
                            if (player)
                            {
                                player.OnRecvRotation(new Vector3(clientCmd.rx, clientCmd.ry, clientCmd.rz),
                                                      clientCmd.time);
                            }
                        }
                    }
                }
                break;

                case NetCmdIdClient.SyncAnim:
                {
                    SyncAnim clientCmd = (SyncAnim)cmd;
                    if (clientCmd.type == SyncType.VirtualMan)
                    {
                        if (PlayerUserList.ContainsKey(clientCmd.id))
                        {
                            VirtualManPlayer player;
                            PlayerUserList.TryGetValue(clientCmd.id, out player);
                            if (player)
                            {
                                player.onRecvAnimation(clientCmd.amimid, clientCmd.time);
                            }
                        }
                    }
                }
                break;

                case NetCmdIdClient.OtherCmd:
                {
                    OtherCmd      clientCmd = (OtherCmd)cmd;
                    OperationBean op        = new OperationBean();
                    op.op    = OperationBean.OpId.OtherCmd;
                    op.param = clientCmd;
                    operationQueue.Enqueue(op);
                }
                break;
                }
            }
        }