Merge pull request 'chore(VelocityCore): reennable replays for serverteam' (#417) from wip/VelocityCore-reenable-replays-for-serverteam into main

Reviewed-on: SteamWar/SteamWar#417
Reviewed-by: Chaoscaot <max@chaoscaot.de>
This commit is contained in:
2026-06-07 00:06:07 +02:00
@@ -42,13 +42,6 @@ public class ReplayCommand extends SWCommand {
super("replay"); super("replay");
} }
@Register
public void genericCommand(PlayerChatter sender) {
sender.system("REPLAY_UNAVAILABLE");
return;
}
/*
@Register @Register
public void genericCommand(PlayerChatter sender, int replayId, @StaticValue(value = {"", "-a"}, allowISE = true) @OptionalValue("") boolean isAdmin, @OptionalValue("") String optionalMap) { public void genericCommand(PlayerChatter sender, int replayId, @StaticValue(value = {"", "-a"}, allowISE = true) @OptionalValue("") boolean isAdmin, @OptionalValue("") String optionalMap) {
Fight fight = Fight.getById(replayId); Fight fight = Fight.getById(replayId);
@@ -64,6 +57,9 @@ public class ReplayCommand extends SWCommand {
@Register @Register
public void genericCommand(PlayerChatter sender, @OptionalValue("") String optionalMap) { public void genericCommand(PlayerChatter sender, @OptionalValue("") String optionalMap) {
if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return; if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return;
if (!sender.user().hasPerm(UserPerm.TEAM)) return;
new SWStreamInv<>(sender, new Message("REPLAY_TITLE"), (click, fight) -> { new SWStreamInv<>(sender, new Message("REPLAY_TITLE"), (click, fight) -> {
startReplay(sender, click.isShiftClick(), optionalMap, fight); startReplay(sender, click.isShiftClick(), optionalMap, fight);
@@ -72,6 +68,7 @@ public class ReplayCommand extends SWCommand {
private void startReplay(PlayerChatter sender, boolean isAdmin, String optionalMap, Fight fight) { private void startReplay(PlayerChatter sender, boolean isAdmin, String optionalMap, Fight fight) {
if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return; if (PunishmentCommand.isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer)) return;
if (!sender.user().hasPerm(UserPerm.TEAM)) return;
GameModeConfig<String, String> mode = ArenaMode.getBySchemType(fight.getSchemType()); GameModeConfig<String, String> mode = ArenaMode.getBySchemType(fight.getSchemType());
ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(sender.getPlayer()); ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(sender.getPlayer());
@@ -116,5 +113,5 @@ public class ReplayCommand extends SWCommand {
private Message parseLeader(SteamwarUser leader, int players, boolean winner) { private Message parseLeader(SteamwarUser leader, int players, boolean winner) {
return new Message("REPLAY_" + (players > 1 ? "" : "SOLO_") + (winner ? "WINNER" : "LOSER"), leader.getUserName(), players - 1); return new Message("REPLAY_" + (players > 1 ? "" : "SOLO_") + (winner ? "WINNER" : "LOSER"), leader.getUserName(), players - 1);
} }
*/
} }