Fixed a couple errors on MySQL

This commit is contained in:
Rsl1122 2019-08-15 13:21:22 +03:00
parent 95f27a0a99
commit d2c70186ec
6 changed files with 12 additions and 11 deletions

View File

@ -178,7 +178,7 @@ public class KillQueries {
AND + KillsTable.DATE + ">=?" + AND + KillsTable.DATE + ">=?" +
AND + KillsTable.DATE + "<=?" + AND + KillsTable.DATE + "<=?" +
GROUP_BY + KillsTable.VICTIM_UUID; GROUP_BY + KillsTable.VICTIM_UUID;
String sql = SELECT + "AVG(CAST(kills AS FLOAT)/CAST(deaths AS FLOAT)) as kdr" + String sql = SELECT + "AVG(CAST(kills AS double)/CAST(deaths AS double)) as kdr" +
FROM + '(' + selectKillCounts + ") q1" + FROM + '(' + selectKillCounts + ") q1" +
INNER_JOIN + '(' + selectDeathCounts + ") q2 on q1." + KillsTable.KILLER_UUID + "=q2." + KillsTable.VICTIM_UUID + INNER_JOIN + '(' + selectDeathCounts + ") q2 on q1." + KillsTable.KILLER_UUID + "=q2." + KillsTable.VICTIM_UUID +
WHERE + "deaths!=0"; WHERE + "deaths!=0";
@ -251,7 +251,7 @@ public class KillQueries {
AND + KillsTable.DATE + "<=?" + AND + KillsTable.DATE + "<=?" +
GROUP_BY + KillsTable.WEAPON; GROUP_BY + KillsTable.WEAPON;
String sql = SELECT + KillsTable.WEAPON + String sql = SELECT + KillsTable.WEAPON +
FROM + '(' + innerSQL + ')' + FROM + '(' + innerSQL + ") q1" +
ORDER_BY + "kills DESC LIMIT ?"; ORDER_BY + "kills DESC LIMIT ?";
return new QueryStatement<List<String>>(sql, limit) { return new QueryStatement<List<String>>(sql, limit) {
@ -280,7 +280,7 @@ public class KillQueries {
AND + KillsTable.DATE + "<=?" + AND + KillsTable.DATE + "<=?" +
GROUP_BY + KillsTable.WEAPON; GROUP_BY + KillsTable.WEAPON;
String sql = SELECT + KillsTable.WEAPON + String sql = SELECT + KillsTable.WEAPON +
FROM + '(' + innerSQL + ')' + FROM + '(' + innerSQL + ") q1" +
ORDER_BY + "kills DESC LIMIT ?"; ORDER_BY + "kills DESC LIMIT ?";
return new QueryStatement<List<String>>(sql, limit) { return new QueryStatement<List<String>>(sql, limit) {

View File

@ -193,7 +193,7 @@ public class WorldTimesQueries {
@Override @Override
public GMTimes processResults(ResultSet set) throws SQLException { public GMTimes processResults(ResultSet set) throws SQLException {
return extractGMTimes(set, GMTimes.getGMKeyArray()); return set.next() ? extractGMTimes(set, GMTimes.getGMKeyArray()) : new GMTimes();
} }
}; };
} }

View File

@ -113,7 +113,7 @@ public class PvPPvEJSONParser implements TabJSONParser<Map<String, Object>> {
Map<String, Object> insights = new HashMap<>(); Map<String, Object> insights = new HashMap<>();
List<String> top3Weapons = db.query(KillQueries.topWeaponsOfPlayer(monthAgo, now, serverUUID, 3)); List<String> top3Weapons = db.query(KillQueries.topWeaponsOfServer(monthAgo, now, serverUUID, 3));
insights.put("weapon_1st", getWeapon(top3Weapons, 0).orElse("-")); insights.put("weapon_1st", getWeapon(top3Weapons, 0).orElse("-"));
insights.put("weapon_2nd", getWeapon(top3Weapons, 1).orElse("-")); insights.put("weapon_2nd", getWeapon(top3Weapons, 1).orElse("-"));
insights.put("weapon_3rd", getWeapon(top3Weapons, 2).orElse("-")); insights.put("weapon_3rd", getWeapon(top3Weapons, 2).orElse("-"));

View File

@ -117,6 +117,12 @@ Display_options:
Show_player_IPs: true Show_player_IPs: true
Graphs: Graphs:
Show_gaps_in_data: false Show_gaps_in_data: false
TPS:
High_threshold: 18
Medium_threshold: 10
Disk_space:
High_threshold: 500
Medium_threshold: 100
Command_colors: Command_colors:
Main: '&2' Main: '&2'
Secondary: '&7' Secondary: '&7'

View File

@ -79,7 +79,7 @@
'.card,.bg-white,.modal-content,.page-loader,.nav-tabs .nav-link:hover,.nav-tabs,hr {background-color:#44475a;border-color:#6272a4!important;}' + '.card,.bg-white,.modal-content,.page-loader,.nav-tabs .nav-link:hover,.nav-tabs,hr {background-color:#44475a;border-color:#6272a4!important;}' +
'.bg-white.collapse-inner {border:1px solid;}' + '.bg-white.collapse-inner {border:1px solid;}' +
'.card-header {background-color:#44475a;border-color:#6272a4;}' + '.card-header {background-color:#44475a;border-color:#6272a4;}' +
'#content,.col-black,.text-gray-800,.collapse-item,.modal-title,.modal-body,.page-loader,.close,.fc-title,.fc-time {color:#eee8d5 !important;}' + '#content,.col-black,.text-gray-800,.collapse-item,.modal-title,.modal-body,.page-loader,.close,.fc-title,.fc-time,pre {color:#eee8d5 !important;}' +
'.collapse-item:hover,.nav-link.active {background-color: #606270 !important;}' + '.collapse-item:hover,.nav-link.active {background-color: #606270 !important;}' +
'.nav-tabs .nav-link.active {background-color: #44475a !important;border-color:#6272a4 #6272a4 #44475a !important;}' + '.nav-tabs .nav-link.active {background-color: #44475a !important;border-color:#6272a4 #6272a4 #44475a !important;}' +
'.fc-today {background:#646e8c !important}' + '.fc-today {background:#646e8c !important}' +

View File

@ -114,11 +114,6 @@ public class ConfigSettingKeyTest {
settings.remove(PluginSettings.SERVER_NAME); settings.remove(PluginSettings.SERVER_NAME);
settings.remove(PluginSettings.BUNGEE_COPY_CONFIG); settings.remove(PluginSettings.BUNGEE_COPY_CONFIG);
settings.remove(DatabaseSettings.TYPE); settings.remove(DatabaseSettings.TYPE);
settings.remove(DisplaySettings.GRAPH_TPS_THRESHOLD_MED);
settings.remove(DisplaySettings.GRAPH_TPS_THRESHOLD_HIGH);
settings.remove(DisplaySettings.GRAPH_DISK_THRESHOLD_MED);
settings.remove(DisplaySettings.GRAPH_DISK_THRESHOLD_HIGH);
settings.remove(DisplaySettings.GRAPH_DISK_THRESHOLD_HIGH);
settings.remove(DisplaySettings.WORLD_ALIASES); settings.remove(DisplaySettings.WORLD_ALIASES);
settings.remove(TimeSettings.ANALYSIS_REFRESH_PERIOD); settings.remove(TimeSettings.ANALYSIS_REFRESH_PERIOD);
return settings; return settings;