SteamWar/BungeeCore
Archiviert
13
2

Update stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-10 22:04:23 +01:00
Ursprung 54753ce1f8
Commit b6e1e80b00
2 geänderte Dateien mit 46 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -30,5 +30,19 @@ public class FightEndsHandler implements SpigotHandler {
public void handle(ByteArrayDataInput in, ServerInfo info) { public void handle(ByteArrayDataInput in, ServerInfo info) {
FightEndsPacket fightEndsPacket = new FightEndsPacket(in); FightEndsPacket fightEndsPacket = new FightEndsPacket(in);
double playerRatio = Math.min(fightEndsPacket.getBluePlayers().size(), fightEndsPacket.getRedPlayers().size()) / (double )Math.max(fightEndsPacket.getBluePlayers().size(), fightEndsPacket.getRedPlayers().size());
if (playerRatio >= 0.4) {
return;
}
double blueResult;
if (fightEndsPacket.getWin() == 0) {
blueResult = 0.5;
} else if (fightEndsPacket.getWin() == 1) {
blueResult = 1;
} else {
blueResult = 0;
}
} }
} }

Datei anzeigen

@ -0,0 +1,32 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.sql;
public class SchemNode {
private SchemNode() {}
private static final Statement getSchemOwner = new Statement("SELECT NodeOwner FROM SchematicNode WHERE NodeId = ?");
public static int getSchematicOwner(int schemId) {
return getSchemOwner.select(rs -> {
return rs.getInt("NodeOwner");
}, schemId);
}
}