SteamWar/BungeeCore
Archiviert
13
2

Add new rank system #303

Zusammengeführt
Lixfel hat 3 Commits von Ranked nach master 2022-03-10 11:45:39 +01:00 zusammengeführt
3 geänderte Dateien mit 0 neuen und 83 gelöschten Zeilen
Nur Änderungen aus Commit 750cf0ee97 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -116,7 +116,6 @@ public class BungeeCore extends Plugin {
new BugCommand();
new WhoisCommand();
new RegelnCommand();
new RankCommand();
new IgnoreCommand();
new UnIgnoreCommand();
new PollresultCommand();

Datei anzeigen

@ -1,68 +0,0 @@
/*
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.commands;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.sql.Elo;
import de.steamwar.bungeecore.sql.Season;
import de.steamwar.bungeecore.sql.SteamwarUser;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.List;
public class RankCommand extends BasicCommand {
public RankCommand() {
super("rank", null);
}
@Override
public void execute(CommandSender sender, String[] args) {
if(!(sender instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) sender;
Message.send("RANK_HEADER", player, Season.convertSeasonToString(Season.getSeason()));
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
for(ArenaMode mode : ArenaMode.getAllModes()){
if(!mode.isRanked())
continue;
int elo = Elo.getElo(user.getId(), mode.getSchemType());
int placement = Elo.getPlacement(elo, mode.getSchemType());
if(placement == -1)
Message.send("RANK_UNPLACED", player, mode.getChatName());
else
Message.send("RANK_PLACED", player, mode.getChatName(), placement, elo);
}
}
@Override
public Iterable<String> onTabComplete(CommandSender commandSender, String[] args) {
if(args.length > 1)
return new ArrayList<>();
List<String> result = ArenaMode.getAllRankedChatNames();
result.removeIf(name -> !name.startsWith(args[0]));
return result;
}
}

Datei anzeigen

@ -301,20 +301,6 @@ POLL_NO_ANSWER=§cDas ist keine Antwortmöglichkeit!
POLL_ANSWER_REFRESH=§aDeine Antwort wurde aktualisiert.
POLL_ANSWER_NEW=§aDeine Antwort wurde registriert.
#RankCommand
RANK_HEADER=§7§lPlatzierungen {0}
RANK_UNPLACED=§7{0}§8: §eunplatziert
RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8.
#RankedCommand
RANKED_NO_RANKED_MODE=§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten.
RANKED_QUEUE_JOINED=§aRanglistenspiel-Warteschlange betreten.
RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlange.
RANKED_QUEUE_LEFT=§cRanglistenspiel-Warteschlange verlassen.
RANKED_ENEMY_SPOTTED=§eGegner gefunden! Ranglistenspiel startet.
RANKED_BROADCAST=§7{0}§8-§7Ranglistenspiel§8: §e{1} vs {2}
RANKED_BROADCAST_HOVER=§aZuschauen
#RCommand
R_USAGE=§8/§7r §8[§eAntwort§8]
R_NOTHING=§cDu hast bisher mit niemandem geschrieben!