Dieser Commit ist enthalten in:
Ursprung
54753ce1f8
Commit
b6e1e80b00
@ -30,5 +30,19 @@ public class FightEndsHandler implements SpigotHandler {
|
||||
public void handle(ByteArrayDataInput in, ServerInfo info) {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
32
src/de/steamwar/bungeecore/sql/SchemNode.java
Normale Datei
32
src/de/steamwar/bungeecore/sql/SchemNode.java
Normale Datei
@ -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);
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren