Fixed a lot of database stuff.
This commit is contained in:
parent
9596950a54
commit
cbc6bd2751
3 changed files with 2 additions and 11 deletions
|
|
@ -1576,7 +1576,7 @@ namespace TShockAPI
|
||||||
args.Player.SendMessage("You can always use the /user command to manage players. Do not just delete the auth.lck file.");
|
args.Player.SendMessage("You can always use the /user command to manage players. Do not just delete the auth.lck file.");
|
||||||
args.Player.SendMessage("Thankyou for using TShock! http://tshock.co/ & http://github.com/TShock/TShock");
|
args.Player.SendMessage("Thankyou for using TShock! http://tshock.co/ & http://github.com/TShock/TShock");
|
||||||
FileTools.CreateFile(Path.Combine(TShock.SavePath, "auth.lck"));
|
FileTools.CreateFile(Path.Combine(TShock.SavePath, "auth.lck"));
|
||||||
System.IO.File.Delete(Path.Combine(TShock.SavePath + "authcode.txt"));
|
File.Delete(Path.Combine(TShock.SavePath + "authcode.txt"));
|
||||||
TShock.AuthToken = 0;
|
TShock.AuthToken = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace TShockAPI.DB
|
||||||
else if (TShock.Config.StorageType.ToLower() == "mysql")
|
else if (TShock.Config.StorageType.ToLower() == "mysql")
|
||||||
com.CommandText = "INSERT IGNORE INTO GroupList SET GroupName=@groupname, Commands=@commands, OrderBy=@order;";
|
com.CommandText = "INSERT IGNORE INTO GroupList SET GroupName=@groupname, Commands=@commands, OrderBy=@order;";
|
||||||
com.AddParameter("@groupname", "default");
|
com.AddParameter("@groupname", "default");
|
||||||
com.AddParameter("@commands", "canwater,canlava,warp");
|
com.AddParameter("@commands", "canwater,canlava,warp,canbuild");
|
||||||
com.AddParameter("@order", "4");
|
com.AddParameter("@order", "4");
|
||||||
com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
com.Parameters.Clear();
|
com.Parameters.Clear();
|
||||||
|
|
|
||||||
|
|
@ -44,15 +44,6 @@ namespace TShockAPI.DB
|
||||||
"CREATE TABLE IF NOT EXISTS Users (Username VARCHAR(255) UNIQUE, Password VARCHAR(255), UserGroup VARCHAR(255), IP VARCHAR(255));";
|
"CREATE TABLE IF NOT EXISTS Users (Username VARCHAR(255) UNIQUE, Password VARCHAR(255), UserGroup VARCHAR(255), IP VARCHAR(255));";
|
||||||
|
|
||||||
com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
|
|
||||||
if (TShock.Config.StorageType.ToLower() == "sqlite")
|
|
||||||
com.CommandText = "INSERT OR IGNORE INTO Users (UserGroup, IP) VALUES (@group, @ip);";
|
|
||||||
else if (TShock.Config.StorageType.ToLower() == "mysql")
|
|
||||||
com.CommandText = "INSERT IGNORE INTO Users (UserGroup, IP) VALUES (@group, @ip);";
|
|
||||||
|
|
||||||
com.AddParameter("@ip", "127.0.0.1");
|
|
||||||
com.AddParameter("@group", "superadmin");
|
|
||||||
com.ExecuteNonQuery();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue