This is not C, stop doing return codes especially without doing an enum.
Databases can store other things besides strings. If you do not like changes from this commit feel free to revert it. Just giving some last insight on this branch.
This commit is contained in:
parent
35be16e6a7
commit
6468ed7562
6 changed files with 235 additions and 163 deletions
|
|
@ -143,13 +143,15 @@ namespace TShockAPI
|
|||
{
|
||||
try
|
||||
{
|
||||
var hostport = Config.MySqlHost.Split(':');
|
||||
DB = new MySqlConnection();
|
||||
DB.ConnectionString =
|
||||
"Server='" + Config.MySqlHost +
|
||||
"';Port='" + Config.MySqlPort +
|
||||
"';Database='" + Config.MySqlDbName +
|
||||
"';Uid='" + Config.MySqlUsername +
|
||||
"';Pwd='" + Config.MySqlPassword + "';";
|
||||
DB.ConnectionString = String.Format("Server='{0}'; Port='{1}'; Database='{2}'; Uid='{3}'; Pwd='{4}';",
|
||||
hostport[0],
|
||||
hostport.Length > 1 ? hostport[1] : "3306",
|
||||
Config.MySqlDbName,
|
||||
Config.MySqlUsername,
|
||||
Config.MySqlPassword
|
||||
);
|
||||
DB.Open();
|
||||
}
|
||||
catch (MySqlException ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue