private AdminSetCredentials ( string server, int port, string user, string password ) : void | ||
server | string | |
port | int | |
user | string | |
password | string | |
return | void |
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() { EditorPrefs.SetString("ASAdminServer", this.server); this.userSelected = false; this.isConnected = false; this.projectSelected = false; this.lv.row = -1; this.lv2.row = -1; this.lv.totalRows = 0; this.lv2.totalRows = 0; int result = 10733; string server; if (this.server.IndexOf(":") > 0) { int.TryParse(this.server.Substring(this.server.IndexOf(":") + 1), out result); server = this.server.Substring(0, this.server.IndexOf(":")); } else { server = this.server; } AssetServer.AdminSetCredentials(server, result, this.user, this.password); this.DoRefreshDatabases(); }
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; } }
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 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; } }