Add duration field to FightEndsPacket #52

Zusammengeführt
Lixfel hat 2 Commits von DurationFieldInFightEndsPacket nach master 2023-05-11 09:08:01 +02:00 zusammengeführt
4 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
Nur Änderungen aus Commit 9df7ed39a4 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -32,6 +32,10 @@ import java.util.List;
@AllArgsConstructor
public class Event {
static {
SchematicType.Normal.name(); // Ensure SchematicType is loaded.
}
private static final Table<Event> table = new Table<>(Event.class);
private static final SelectStatement<Event> byCurrent = new SelectStatement<>(table, "SELECT * FROM Event WHERE Start < now() AND End > now()");

Datei anzeigen

@ -26,7 +26,7 @@ import lombok.AllArgsConstructor;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Timestamp;
import java.sql.Timestamp;
import java.time.Instant;
@AllArgsConstructor

Datei anzeigen

@ -20,9 +20,7 @@
package de.steamwar.sql;
import de.steamwar.sql.internal.*;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import java.sql.Timestamp;
import java.time.Instant;
@ -32,6 +30,7 @@ import java.util.function.Predicate;
public class SchematicNode {
static {
SchematicType.Normal.name(); // Ensure SchematicType is loaded.
new SqlTypeMapper<>(SchematicNode.class, null, (rs, identifier) -> { throw new SecurityException("SchematicNode cannot be used as type (recursive select)"); }, (st, index, value) -> st.setInt(index, value.nodeId));
}

Datei anzeigen

@ -32,7 +32,12 @@ public final class SqlTypeMapper<T> {
private static final Map<Class<?>, SqlTypeMapper<?>> mappers = new IdentityHashMap<>();
public static <T> SqlTypeMapper<T> getMapper(Class<?> clazz) {
return (SqlTypeMapper<T>) mappers.get(clazz);
SqlTypeMapper<T> result = (SqlTypeMapper<T>) mappers.get(clazz);
if(result == null)
throw new SecurityException("Unregistered mapper requested: " + clazz.getName());
return result;
}
public static <T extends Enum<T>> void ordinalEnumMapper(Class<T> type) {