AdminRefreshDatabases() private method

private AdminRefreshDatabases ( ) : UnityEditor.MaintDatabaseRecord[]
return UnityEditor.MaintDatabaseRecord[]
示例#1
0
        public static bool Testing_SetupDatabase(string host, int port, string adminUser, string adminPwd, string user, string pwd, string projectName)
        {
            AssetServer.AdminSetCredentials(host, port, adminUser, adminPwd);
            MaintDatabaseRecord[] recordArray = AssetServer.AdminRefreshDatabases();
            if (recordArray == null)
            {
                return(false);
            }
            foreach (MaintDatabaseRecord record in recordArray)
            {
                if (record.name == projectName)
                {
                    AssetServer.AdminDeleteDB(projectName);
                }
            }
            if (AssetServer.AdminCreateDB(projectName) == 0)
            {
                return(false);
            }
            string databaseName = AssetServer.GetDatabaseName(host, adminUser, adminPwd, port.ToString(), projectName);

            if (!AssetServer.AdminSetUserEnabled(databaseName, user, user, string.Empty, 1))
            {
                return(false);
            }
            Testing_SetActiveDatabase(host, port, projectName, databaseName, user, pwd);
            return(true);
        }
示例#2
0
        public static bool Testing_SetupDatabase(string host, int port, string adminUser, string adminPwd, string user, string pwd, string projectName)
        {
            AssetServer.AdminSetCredentials(host, port, adminUser, adminPwd);
            MaintDatabaseRecord[] array = AssetServer.AdminRefreshDatabases();
            if (array == null)
            {
                return(false);
            }
            MaintDatabaseRecord[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                MaintDatabaseRecord maintDatabaseRecord = array2[i];
                if (maintDatabaseRecord.name == projectName)
                {
                    AssetServer.AdminDeleteDB(projectName);
                }
            }
            if (AssetServer.AdminCreateDB(projectName) == 0)
            {
                return(false);
            }
            string databaseName = AssetServer.GetDatabaseName(host, adminUser, adminPwd, port.ToString(), projectName);

            if (!AssetServer.AdminSetUserEnabled(databaseName, user, user, string.Empty, 1))
            {
                return(false);
            }
            ASEditorBackend.Testing_SetActiveDatabase(host, port, projectName, databaseName, user, pwd);
            return(true);
        }
        private void DoShowProjects()
        {
            int    result        = 0x29ed;
            string serverAddress = this.serverAddress;

            if (serverAddress.IndexOf(":") > 0)
            {
                int.TryParse(serverAddress.Substring(serverAddress.IndexOf(":") + 1), out result);
                serverAddress = serverAddress.Substring(0, serverAddress.IndexOf(":"));
            }
            AssetServer.AdminSetCredentials(serverAddress, result, this.userName, this.password);
            MaintDatabaseRecord[] recordArray = AssetServer.AdminRefreshDatabases();
            if (recordArray != null)
            {
                this.projectsList = new string[recordArray.Length];
                for (int i = 0; i < recordArray.Length; i++)
                {
                    this.projectsList[i] = recordArray[i].name;
                }
                this.projectsLv.totalRows = recordArray.Length;
                this.GetDefaultPListConfig();
                this.plc["Maint Server"]      = serverAddress;
                this.plc["Maint UserName"]    = this.userName;
                this.plc["Maint port number"] = this.port;
                this.plc.Save();
                ASEditorBackend.SetPassword(serverAddress, this.userName, this.password);
                ASEditorBackend.AddUser(this.serverAddress, this.userName);
            }
            else
            {
                this.projectsLv.totalRows = 0;
            }
        }
示例#4
0
        private void DoShowProjects()
        {
            int    num  = 10733;
            string text = this.serverAddress;

            if (text.IndexOf(":") > 0)
            {
                int.TryParse(text.Substring(text.IndexOf(":") + 1), out num);
                text = text.Substring(0, text.IndexOf(":"));
            }
            AssetServer.AdminSetCredentials(text, num, this.userName, this.password);
            MaintDatabaseRecord[] array = AssetServer.AdminRefreshDatabases();
            if (array != null)
            {
                this.projectsList = new string[array.Length];
                for (int i = 0; i < array.Length; i++)
                {
                    this.projectsList[i] = array[i].name;
                }
                this.projectsLv.totalRows = array.Length;
                this.GetDefaultPListConfig();
                this.plc["Maint Server"]      = text;
                this.plc["Maint UserName"]    = this.userName;
                this.plc["Maint port number"] = this.port;
                this.plc.Save();
                ASEditorBackend.SetPassword(text, this.userName, this.password);
                ASEditorBackend.AddUser(this.serverAddress, this.userName);
            }
            else
            {
                this.projectsLv.totalRows = 0;
            }
        }
示例#5
0
 public static string[] Testing_GetAllDatabaseNames()
 {
     MaintDatabaseRecord[] recordArray = AssetServer.AdminRefreshDatabases();
     string[] strArray = new string[recordArray.Length];
     for (int i = 0; i < recordArray.Length; i++)
     {
         strArray[i] = recordArray[i].name;
     }
     return(strArray);
 }
示例#6
0
 public static string[] Testing_GetAllDatabaseNames()
 {
     MaintDatabaseRecord[] array = AssetServer.AdminRefreshDatabases();
     string[] array2             = new string[array.Length];
     for (int i = 0; i < array.Length; i++)
     {
         array2[i] = array[i].name;
     }
     return(array2);
 }
 public static string[] Testing_GetAllDatabaseNames()
 {
     MaintDatabaseRecord[] maintDatabaseRecordArray = AssetServer.AdminRefreshDatabases();
     string[] strArray = new string[maintDatabaseRecordArray.Length];
     for (int index = 0; index < maintDatabaseRecordArray.Length; ++index)
     {
         strArray[index] = maintDatabaseRecordArray[index].name;
     }
     return(strArray);
 }
示例#8
0
 private void DoRefreshDatabases()
 {
     MaintDatabaseRecord[] maintDatabaseRecordArray = AssetServer.AdminRefreshDatabases();
     if (maintDatabaseRecordArray != null)
     {
         this.databases   = maintDatabaseRecordArray;
         this.isConnected = true;
     }
     else
     {
         this.databases     = new MaintDatabaseRecord[0];
         this.lv2.totalRows = 0;
     }
     this.lv.row        = -1;
     this.lv.totalRows  = this.databases.Length;
     this.lv2.totalRows = 0;
     this.users         = new MaintUserRecord[0];
 }