private GetDatabaseName ( string server, string user, string password, string port, string projectName ) : string | ||
server | string | |
user | string | |
password | string | |
port | string | |
projectName | string | |
return | string |
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); }
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); }
private void DoConnect() { AssetServer.RemoveMaintErrorsFromConsole(); 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(":")); } this.port = result.ToString(); string str2 = AssetServer.GetDatabaseName(serverAddress, this.userName, this.password, this.port, this.projectName); this.GetDefaultPListConfig(); this.plc["Maint Server"] = serverAddress; this.plc["Maint UserName"] = this.userName; this.plc["Maint database name"] = str2; this.plc["Maint port number"] = this.port; this.plc["Maint project name"] = this.projectName; this.plc.Save(); if (ArrayUtility.Contains <string>(this.serversList, this.serverAddress)) { ArrayUtility.Remove <string>(ref this.serversList, this.serverAddress); } ArrayUtility.Insert <string>(ref this.serversList, 0, this.serverAddress); ASEditorBackend.AddUser(this.serverAddress, this.userName); ASEditorBackend.SetPassword(this.serverAddress, this.userName, this.password); InternalEditorUtility.SaveEditorSettingsList("ASServer", this.serversList, 20); if (str2 != string.Empty) { ASEditorBackend.InitializeMaintBinding(); this.parentWin.Reinit(); GUIUtility.ExitGUI(); } else { this.parentWin.NeedsSetup = true; this.parentWin.Repaint(); } }