private void MsgInfo(RemoteDebugClientInfo client, string info)
        {
            // Debug.Log("MsgInfo:" + info);
            var temp     = info.Split('|');
            var os       = temp[1];
            var platform = (RuntimePlatform)int.Parse(temp[2]);

            client.name = temp[0];
            switch (platform)
            {
            case RuntimePlatform.OSXEditor:
            case RuntimePlatform.WindowsEditor:
                client.assetIcon = EditorGUIUtility.FindTexture("BuildSettings.Standalone");
                break;

            case RuntimePlatform.Android:
                client.assetIcon = EditorGUIUtility.FindTexture("BuildSettings.Android");
                break;

            case RuntimePlatform.IPhonePlayer:
                client.assetIcon = EditorGUIUtility.FindTexture("BuildSettings.iPhone");
                break;
            }

            m_IsClientDirty = true;
        }
        private void OnClientConnect(RemoteDebugClientInfo client)
        {
            Debug.Log("DebugServer:OnClientConnect--" + client);

            m_ClientDic[client.Index] = client;
            m_IsClientDirty           = true;
        }
        private void MsgPatchUploadEnd(RemoteDebugClientInfo client, string content)
        {
            var temp     = content.Split('|');
            var fileName = temp[0];
            var flag     = temp[1] == "0";

            RemoteDebugWindow.Instance.UploadFileSuccess(flag, fileName);
        }
        private void MsgPatchUpload(RemoteDebugClientInfo client, string content)
        {
            var temp     = content.Split('|');
            var fileName = temp[0];
            var fileSize = long.Parse(temp[1]);
            var speed    = int.Parse(temp[2]);

            RemoteDebugWindow.Instance.FileUploading(fileName, fileSize, speed);
        }
示例#5
0
 private void SelectedClient(RemoteDebugClientInfo info)
 {
     if (selectedClient != null)
     {
         selectedClient.itemSelected = false;
     }
     selectedClient = info;
     if (selectedClient != null)
     {
         selectedClient.itemSelected = true;
     }
     m_TabPanels[(int)m_SelectedTab].OnEnable();
 }
示例#6
0
        private void InitClientTable()
        {
            if (m_ClientTree != null)
            {
                return;
            }
            var column = RemoteDebugClientInfo.totalColumn;

            m_ClientTree = EditorTable.CreateTable(column);
            for (int i = 0; i < column; i++)
            {
                m_ClientTree.SetColumnHeader(i, RemoteDebugClientInfo.GetColumnHeader(i));
            }
            m_ClientTree.OnDoubleClickedItem = OnDoubleClickedItem;
            m_Panel.SetLeftTopPanel(m_ClientTree, false);
        }
        private void MsgPathFileList(RemoteDebugClientInfo client, string content)
        {
            var temp = content.Split('|');
            var type = int.Parse(temp[0]);
            var name = temp[1];
            var size = long.Parse(temp[2]);
            var time = temp[3];

            client.remotePatchFileList.Add(new PatchFileInfo()
            {
                type      = type,
                name      = name,
                size      = size,
                datetime  = time,
                assetIcon = type == 1 ? RemoteDebugStyles.iconFolder : RemoteDebugStyles.iconFile
            });
            m_IsPatchFileListDirty = true;
        }
        private void MsgSubObjects(RemoteDebugClientInfo client, string content)
        {
            var temp         = content.Split('|');
            var path         = temp[0];
            var name         = temp[1];
            var active       = bool.Parse(temp[2]);
            var parentActive = bool.Parse(temp[3]);

            //Debug.Log("MsgSubObjects:" + path + "," + name);
            if (!client.objectDic.ContainsKey(path))
            {
                var parent = new HierarchyItemInfo(path, path);
                parent.assetIcon       = IconStyles.iconGameObject;
                client.objectDic[path] = parent;
            }
            var child = new HierarchyItemInfo(name, path + "/" + name);

            child.itemDisabled           = !parentActive;
            child.assetIcon              = IconStyles.iconGameObject;
            client.objectDic[child.path] = child;
            client.objectDic[path].children.Add(child);
        }
        private void MsgRootObjects(RemoteDebugClientInfo client, string info)
        {
            //Debug.Log("MsgRootObjects:" + info);
            var temp   = info.Split('|');
            var root   = temp[0];
            var name   = temp[1];
            var active = bool.Parse(temp[2]);

            if (!client.objectDic.ContainsKey(root))
            {
                var objInfo = new HierarchyItemInfo(root, root);
                objInfo.assetIcon      = EditorGUIUtility.FindTexture("BuildSettings.Editor.Small");
                client.objectDic[root] = objInfo;
                client.objectList.Add(objInfo);
            }
            var chdInfo = new HierarchyItemInfo(name, name);

            chdInfo.itemDisabled   = !active;
            chdInfo.assetIcon      = IconStyles.iconGameObject;
            client.objectDic[name] = chdInfo;
            client.objectDic[root].children.Add(chdInfo);
            m_IsClientObjectsDirty = true;
        }
 private void MsgPatchCurrentFolder(RemoteDebugClientInfo client, string content)
 {
     client.remoteCurrentFolder = content;
     client.remotePatchFileList.Clear();
     m_IsPatchFileListDirty = true;
 }
        private void HandleMsg(RemoteDebugClientInfo client, string msg)
        {
            //Debug.Log("HandleMsg:" + msg);
            var temp = msg.Split('#');

            if (temp.Length < 2)
            {
                Debug.LogError("Error msg:" + msg);
                return;
            }
            var msgIndex = 0;

            if (!int.TryParse(temp[0], out msgIndex))
            {
                Debug.LogError("Error msg:" + msg);
                return;
            }
            var msgType    = (RemoteDebugMsg)msgIndex;
            var msgContent = temp[1];

            switch (msgType)
            {
            case RemoteDebugMsg.Heartbeat:
                break;

            case RemoteDebugMsg.Error:
                RemoteDebugWindow.Instance.ShowNotification(new GUIContent(msgContent));
                Debug.LogError("ERROR:" + msgContent);
                break;

            case RemoteDebugMsg.BaseInfo:
                MsgInfo(client, msgContent);
                break;

            case RemoteDebugMsg.Hierarchy_RootObjects:
                MsgRootObjects(client, msgContent);
                break;

            case RemoteDebugMsg.Hierarchy_SubObjects:
                MsgSubObjects(client, msgContent);
                break;

            case RemoteDebugMsg.Patch_RemoteFiles:
                MsgPathFileList(client, msgContent);
                break;

            case RemoteDebugMsg.Patch_RemoteCurrentFolder:
                MsgPatchCurrentFolder(client, msgContent);
                break;

            case RemoteDebugMsg.Patch_LocalUpload:
                MsgPatchUpload(client, msgContent);
                break;

            case RemoteDebugMsg.Patch_LocalUploadEnd:
                MsgPatchUploadEnd(client, msgContent);
                break;

            default:
                Debug.LogError("Unhandle msg:" + msgType);
                break;
            }
        }