SteamWar/FightSystem
Archiviert
13
1

Fix replay server termination #319

Zusammengeführt
Lixfel hat 1 Commits von fixReplayEnd nach master 2021-12-27 19:09:24 +01:00 zusammengeführt
4 geänderte Dateien mit 8 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -43,13 +43,13 @@ public enum ArenaMode {
public static final Set<ArenaMode> Replay = Collections.unmodifiableSet(EnumSet.of(REPLAY)); public static final Set<ArenaMode> Replay = Collections.unmodifiableSet(EnumSet.of(REPLAY));
public static final Set<ArenaMode> AntiReplay = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(REPLAY))); public static final Set<ArenaMode> AntiReplay = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(REPLAY)));
public static final Set<ArenaMode> Replayable = Collections.unmodifiableSet(EnumSet.of(REPLAY, TEST));
public static final Set<ArenaMode> AntiTest = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK))); public static final Set<ArenaMode> AntiTest = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK)));
public static final Set<ArenaMode> AntiEvent = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(EVENT))); public static final Set<ArenaMode> AntiEvent = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(EVENT)));
public static final Set<ArenaMode> AntiPrepare = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(PREPARE))); public static final Set<ArenaMode> AntiPrepare = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(PREPARE)));
public static final Set<ArenaMode> VariableTeams = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(RANKED, EVENT, REPLAY))); public static final Set<ArenaMode> VariableTeams = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(RANKED, EVENT, REPLAY)));
public static final Set<ArenaMode> RankedEvent = Collections.unmodifiableSet(EnumSet.of(RANKED, EVENT, REPLAY)); public static final Set<ArenaMode> RankedEvent = Collections.unmodifiableSet(EnumSet.of(RANKED, EVENT, REPLAY));
public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED, REPLAY)); public static final Set<ArenaMode> Restartable = Collections.unmodifiableSet(EnumSet.of(NORMAL, RANKED, REPLAY));
public static final Set<ArenaMode> NotRestartable = Collections.unmodifiableSet(EnumSet.of(EVENT, REPLAY));
public static final Set<ArenaMode> SoloLeader = Collections.unmodifiableSet(EnumSet.of(TEST, CHECK, PREPARE)); public static final Set<ArenaMode> SoloLeader = Collections.unmodifiableSet(EnumSet.of(TEST, CHECK, PREPARE));
public static final Set<ArenaMode> NotOnBau = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK, PREPARE, REPLAY))); public static final Set<ArenaMode> NotOnBau = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK, PREPARE, REPLAY)));
public static final Set<ArenaMode> SeriousFight = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK, REPLAY))); public static final Set<ArenaMode> SeriousFight = Collections.unmodifiableSet(EnumSet.complementOf(EnumSet.of(TEST, CHECK, REPLAY)));

Datei anzeigen

@ -31,7 +31,7 @@ public class EventSpectateCountdown extends Countdown {
public EventSpectateCountdown() { public EventSpectateCountdown() {
super(Config.SpectatorDuration, new Message("SHUTDOWN_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false); super(Config.SpectatorDuration, new Message("SHUTDOWN_COUNTDOWN"), SWSound.BLOCK_NOTE_PLING, false);
new StateDependentCountdown(ArenaMode.Event, FightState.Spectate, this); new StateDependentCountdown(ArenaMode.NotRestartable.contains(Config.mode) && !Config.replayserver(), FightState.Spectate, this);
} }
@Override @Override

Datei anzeigen

@ -142,12 +142,7 @@ public class PacketProcessor {
else if(team == 0x02) else if(team == 0x02)
winner = Fight.getRedTeam(); winner = Fight.getRedTeam();
if(Config.replayserver() || ArenaMode.AntiReplay.contains(Config.mode)) { FightSystem.setSpectateState(winner, "Replay ends", message.getMsg(), message.getParams());
FightSystem.setSpectateState(winner, "Replay ends", message.getMsg(), message.getParams());
}else{
FightUI.printWin(winner, message.getMsg(), message.getParams());
new EventSpectateCountdown().enable();
}
}); });
} }

Datei anzeigen

@ -43,7 +43,11 @@ public class StateDependentCountdown extends StateDependent {
} }
public StateDependentCountdown(Winconditions wincondition, Set<FightState> states, Countdown countdown) { public StateDependentCountdown(Winconditions wincondition, Set<FightState> states, Countdown countdown) {
super(Config.ActiveWinconditions.contains(wincondition), states); this(Config.ActiveWinconditions.contains(wincondition), states, countdown);
}
public StateDependentCountdown(boolean active, Set<FightState> states, Countdown countdown) {
super(active, states);
this.countdown = countdown; this.countdown = countdown;
register(); register();
} }