Add schem deadline message to /event #359
@ -81,9 +81,12 @@ public class EventCommand extends BasicCommand {
|
||||
if(now.isBefore(e.getDeadline().toInstant())) {
|
||||
Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline());
|
||||
}
|
||||
SchematicType schematicType = SchematicType.get(e);
|
||||
if (schematicType != null && schematicType.deadline() != null && now.isBefore(schematicType.deadline().toInstant())) {
|
||||
Message.send("EVENT_COMING_SCHEM_DEADLINE", player, e.getDeadline());
|
||||
String checkType = e.getCheckType();
|
||||
if (checkType != null) {
|
||||
SchematicType schematicType = SchematicType.fromDB(checkType);
|
||||
if (schematicType != null && schematicType.deadline() != null && now.isBefore(schematicType.deadline().toInstant())) {
|
||||
Message.send("EVENT_COMING_SCHEM_DEADLINE", player, e.getDeadline());
|
||||
}
|
||||
}
|
||||
if(!teams.isEmpty()){
|
||||
StringBuilder tline = new StringBuilder();
|
||||
|
@ -41,6 +41,7 @@ public class Event {
|
||||
private final boolean publicSchemsOnly;
|
||||
private final boolean spectateSystem;
|
||||
private final Timestamp deadline;
|
||||
private final String checkType;
|
||||
|
||||
private static Event current = null;
|
||||
|
||||
@ -53,6 +54,7 @@ public class Event {
|
||||
this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly");
|
||||
this.spectateSystem = rs.getBoolean("SpectateSystem");
|
||||
this.deadline = rs.getTimestamp("Deadline");
|
||||
this.checkType = rs.getString("CheckType");
|
||||
|
||||
}
|
||||
|
||||
public static Event get(){
|
||||
@ -123,4 +125,7 @@ public class Event {
|
||||
public Timestamp getDeadline() {
|
||||
return deadline;
|
||||
}
|
||||
public String getCheckType() {
|
||||
return checkType;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ public class SchematicType {
|
||||
private static final Map<String, SchematicType> fromDB;
|
||||
private static final Map<SchematicType, SchematicType> fightType;
|
||||
private static final List<SchematicType> types;
|
||||
private static final Map<Integer, SchematicType> eventSchematicTypes;
|
||||
|
||||
static {
|
||||
File folder = new File(ProxyServer.getInstance().getPluginsFolder(), "FightSystem");
|
||||
@ -106,7 +105,6 @@ public class SchematicType {
|
||||
fromDB = Collections.unmodifiableMap(tmpFromDB);
|
||||
fightType = Collections.unmodifiableMap(tmpFightType);
|
||||
types = Collections.unmodifiableList(tmpTypes);
|
||||
eventSchematicTypes = Collections.unmodifiableMap(tmpEventType);
|
||||
}
|
||||
|
||||
private final String name;
|
||||
@ -177,10 +175,6 @@ public class SchematicType {
|
||||
return types;
|
||||
}
|
||||
|
||||
public static SchematicType get(Event event) {
|
||||
return eventSchematicTypes.get(event.getEventID());
|
||||
}
|
||||
|
||||
enum Type{
|
||||
NORMAL,
|
||||
CHECK_TYPE,
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Können wir das bitte in SchemType umändern? Weil so wie ich das sehe würde die Deadline nicht angezeigt werden (da null) für den Checktype, da die Deadline für den (Haupt-)SchemType gesetzt wird.