mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-17 03:10:39 -04:00
Fixed case-insensitive compatibility for mysql/sqlite
This commit is contained in:
parent
67d566bc4d
commit
6afb221bc8
@ -41,10 +41,19 @@ namespace MCGalaxy.Commands
|
||||
}
|
||||
|
||||
if (message.IndexOf("'") != -1) { Player.SendMessage(p, "Cannot parse request."); return; }
|
||||
|
||||
string syntax;
|
||||
string FoundRank = Group.findPlayer(message.ToLower());
|
||||
Database.AddParams("@Name", message);
|
||||
DataTable playerDb = Database.fillData("SELECT * FROM Players WHERE Name=@Name COLLATE NOCASE");
|
||||
if (Server.useMySQL)
|
||||
{
|
||||
syntax = "SELECT * FROM Players WHERE Name=@Name COLLATE utf8_general_ci";
|
||||
}
|
||||
else
|
||||
{
|
||||
syntax = "SELECT * FROM Players WHERE Name=@Name COLLATE NOCASE";
|
||||
}
|
||||
|
||||
DataTable playerDb = Database.fillData(syntax);
|
||||
if (playerDb.Rows.Count == 0) { Player.SendMessage(p, Group.Find(FoundRank).color + message + Server.DefaultColor + " has the rank of " + Group.Find(FoundRank).color + FoundRank); return; }
|
||||
string title = playerDb.Rows[0]["Title"].ToString();
|
||||
string color = c.Parse(playerDb.Rows[0]["color"].ToString().Trim());
|
||||
|
Loading…
x
Reference in New Issue
Block a user