Skip to content

Commit 6ca26c3

Browse files
authored
Merge pull request #1 from Johnanater/patch-1
Fix MySQL statement on QueryById
2 parents e02d0bd + aa66022 commit 6ca26c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DatabaseManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public PlayerData QueryById(CSteamID steamId, bool cached = true)
369369
MySqlCommand command = Connection.CreateCommand();
370370
command.Parameters.AddWithValue("@steamid", steamId);
371371
command.Parameters.AddWithValue("@instance", InstanceID);
372-
command.CommandText = "SELECT * FROM (SELECT a.SteamID, a.SteamName, a.CharName, a.IP, a.LastLoginGlobal, a.TotalPlayTime, a.LastServerID, b.ServerID, b.LastLoginLocal, b.CleanedBuildables, b.CleanedPlayerData, c.ServerName AS LastServerName FROM `" + Table + "` AS a LEFT JOIN `" + TableServer + "` AS b ON a.SteamID = b.SteamID LEFT JOIN `" + TableInstance + "` AS c ON a.LastServerID = c.ServerID WHERE (b.ServerID = @instance OR b.ServerID = a.LastServerID OR b.ServerID IS NULL) AND a.SteamID = @steamid ORDER BY b.LastLoginLocal ASC) AS g GROUP BY g.SteamID";
372+
command.CommandText = "SELECT * FROM (SELECT a.SteamID, a.SteamName, a.CharName, a.IP, a.LastLoginGlobal, a.TotalPlayTime, a.LastServerID, b.ServerID, b.LastLoginLocal, b.CleanedBuildables, b.CleanedPlayerData, c.ServerName AS LastServerName FROM `" + Table + "` AS a LEFT JOIN `" + TableServer + "` AS b ON a.SteamID = b.SteamID LEFT JOIN `" + TableInstance + "` AS c ON a.LastServerID = c.ServerID WHERE (b.ServerID = @instance OR b.ServerID = a.LastServerID OR b.ServerID IS NULL) AND a.SteamID = @steamid ORDER BY b.LastLoginLocal ASC) AS g";
373373
reader = command.ExecuteReader();
374374
if (reader.Read())
375375
{
@@ -803,4 +803,4 @@ public enum OptionType
803803
Buildables,
804804
PlayerFiles,
805805
}
806-
}
806+
}

0 commit comments

Comments
 (0)