forked from SteamWar/SteamWar
Hotfix CheckCommand
Remove uneeded stuff in SQLWrapper
This commit is contained in:
@@ -22,7 +22,6 @@ package de.steamwar.sql;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import de.steamwar.velocitycore.VelocityCore;
|
||||
import de.steamwar.velocitycore.commands.CheckCommand;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -38,15 +37,6 @@ public class SQLWrapperImpl implements SQLWrapper<String> {
|
||||
return new GameModeConfig<>(file, GameModeConfig.ToString, GameModeConfig.ToString, GameModeConfig.ToInternalName, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processSchematicType(GameModeConfig<?, String> gameModeConfig) {
|
||||
SchematicType type = gameModeConfig.Schematic.Type;
|
||||
if (type.checkType() != null) {
|
||||
CheckCommand.setCheckQuestions(type.checkType(), gameModeConfig.CheckQuestions);
|
||||
CheckCommand.addFightType(type.checkType(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void additionalExceptionMetadata(StringBuilder builder) {
|
||||
builder.append("\nServers: ");
|
||||
|
||||
@@ -48,20 +48,9 @@ import java.util.logging.Level;
|
||||
|
||||
@Linked
|
||||
public class CheckCommand extends SWCommand {
|
||||
private static final Map<SchematicType, SchematicType> fightTypes = new HashMap<>();
|
||||
private static final Map<SchematicType, List<String>> checkQuestions = new HashMap<>();
|
||||
|
||||
private static final Map<UUID, CheckSession> currentCheckers = new HashMap<>();
|
||||
private static final Map<Integer, CheckSession> currentSchems = new HashMap<>();
|
||||
|
||||
public static void setCheckQuestions(SchematicType checkType, List<String> checkQuestions) {
|
||||
CheckCommand.checkQuestions.put(checkType, checkQuestions);
|
||||
}
|
||||
|
||||
public static void addFightType(SchematicType checkType, SchematicType fightType) {
|
||||
fightTypes.put(checkType, fightType);
|
||||
}
|
||||
|
||||
public static boolean isChecking(Player player){
|
||||
return currentCheckers.containsKey(player.getUniqueId());
|
||||
}
|
||||
@@ -248,9 +237,9 @@ public class CheckCommand extends SWCommand {
|
||||
this.checker = checker;
|
||||
this.schematic = schematic;
|
||||
this.startTime = Timestamp.from(Instant.now());
|
||||
this.checkList = checkQuestions.get(schematic.getSchemtype()).listIterator();
|
||||
this.checkList = GameModeConfig.getBySchematicType(schematic.getSchemtype()).CheckQuestions.listIterator();
|
||||
|
||||
GameModeConfig<String, String> mode = ArenaMode.getBySchemType(fightTypes.get(schematic.getSchemtype()));
|
||||
GameModeConfig<String, String> mode = GameModeConfig.getBySchematicType(schematic.getSchemtype());
|
||||
new ServerStarter().test(mode, mode.getRandomMap(), checker.getPlayer()).check(schematic.getId()).callback(subserver -> {
|
||||
currentCheckers.put(checker.user().getUUID(), this);
|
||||
currentSchems.put(schematic.getId(), this);
|
||||
@@ -304,7 +293,7 @@ public class CheckCommand extends SWCommand {
|
||||
}
|
||||
|
||||
private void accept(){
|
||||
concludeCheckSession("freigegeben", fightTypes.get(schematic.getSchemtype()), () -> {
|
||||
concludeCheckSession("freigegeben", GameModeConfig.getBySchematicType(schematic.getSchemtype()).Schematic.Type, () -> {
|
||||
Chatter owner = Chatter.of(SteamwarUser.byId(schematic.getOwner()).getUUID());
|
||||
owner.withPlayerOrOffline(
|
||||
player -> owner.system("CHECK_ACCEPTED", schematic.getSchemtype().name(), schematic.getName()),
|
||||
|
||||
Reference in New Issue
Block a user