Attempt to fix duplicate players on Players table

This commit is contained in:
Rsl1122 2019-09-21 10:34:38 +03:00
parent 74bc647ff1
commit 146c990eb6
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ public class NetworkTablePlayersQuery implements Query<List<TablePlayer>> {
GROUP_BY + GeoInfoTable.USER_UUID;
String selectLatestGeolocations = SELECT +
"g1." + GeoInfoTable.GEOLOCATION + ',' +
"g1." + GeoInfoTable.USER_UUID +
DISTINCT + "g1." + GeoInfoTable.USER_UUID +
FROM + "(" + selectGeolocations + ") AS g1" +
INNER_JOIN + "(" + selectLatestGeolocationDate + ") AS g2 ON g1.uuid = g2.uuid" +
WHERE + GeoInfoTable.LAST_USED + "=last_used_g";
@ -84,7 +84,7 @@ public class NetworkTablePlayersQuery implements Query<List<TablePlayer>> {
WHERE + UserInfoTable.BANNED + "=?";
String selectBaseUsers = SELECT +
"u." + UsersTable.USER_UUID + ',' +
DISTINCT + "u." + UsersTable.USER_UUID + ',' +
"u." + UsersTable.USER_NAME + ',' +
"u." + UsersTable.REGISTERED + ',' +
"ban." + UserInfoTable.USER_UUID + " as banned," +

View File

@ -69,7 +69,7 @@ public class ServerTablePlayersQuery implements Query<List<TablePlayer>> {
GROUP_BY + GeoInfoTable.USER_UUID;
String selectLatestGeolocations = SELECT +
"g1." + GeoInfoTable.GEOLOCATION + ',' +
"g1." + GeoInfoTable.USER_UUID +
DISTINCT + "g1." + GeoInfoTable.USER_UUID +
FROM + "(" + selectGeolocations + ") AS g1" +
INNER_JOIN + "(" + selectLatestGeolocationDate + ") AS g2 ON g1.uuid = g2.uuid" +
WHERE + GeoInfoTable.LAST_USED + "=last_used_g";
@ -83,7 +83,7 @@ public class ServerTablePlayersQuery implements Query<List<TablePlayer>> {
GROUP_BY + "s." + SessionsTable.USER_UUID;
String selectBaseUsers = SELECT +
"u." + UsersTable.USER_UUID + ',' +
DISTINCT + "u." + UsersTable.USER_UUID + ',' +
"u." + UsersTable.USER_NAME + ',' +
"u." + UsersTable.REGISTERED + ',' +
UserInfoTable.BANNED + ',' +