Dieser Commit ist enthalten in:
Ursprung
6c60cc3ce6
Commit
3e064f7e4c
@ -36,7 +36,7 @@ import java.util.*;
|
|||||||
import static java.time.temporal.ChronoUnit.SECONDS;
|
import static java.time.temporal.ChronoUnit.SECONDS;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class EventFight implements Comparable<EventFight> {
|
public class EventFight {
|
||||||
|
|
||||||
private static final Table<EventFight> table = new Table<>(EventFight.class);
|
private static final Table<EventFight> table = new Table<>(EventFight.class);
|
||||||
private static final SelectStatement<EventFight> byId = table.select(Table.PRIMARY);
|
private static final SelectStatement<EventFight> byId = table.select(Table.PRIMARY);
|
||||||
|
@ -106,6 +106,10 @@ public class SteamwarUser {
|
|||||||
return loadPunishments(byDiscord.select(discordId));
|
return loadPunishments(byDiscord.select(discordId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<SteamwarUser> getAll() {
|
||||||
|
return getAll.listSelect();
|
||||||
|
}
|
||||||
|
|
||||||
public static SteamwarUser getOrCreate(UUID uuid, String name, Consumer<UUID> newPlayer, BiConsumer<String, String> nameUpdate) {
|
public static SteamwarUser getOrCreate(UUID uuid, String name, Consumer<UUID> newPlayer, BiConsumer<String, String> nameUpdate) {
|
||||||
SteamwarUser user = get(uuid);
|
SteamwarUser user = get(uuid);
|
||||||
|
|
||||||
@ -278,33 +282,4 @@ public class SteamwarUser {
|
|||||||
usersByDiscord.put(discordId, this);
|
usersByDiscord.put(discordId, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SteamwarUser get(int id) {
|
|
||||||
SteamwarUser user = usersById.get(id);
|
|
||||||
if(user != null)
|
|
||||||
return user;
|
|
||||||
return byID.select(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SteamwarUser get(Long discordId) {
|
|
||||||
if(usersByDiscord.containsKey(discordId))
|
|
||||||
return usersByDiscord.get(discordId);
|
|
||||||
return byDiscord.select(discordId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<SteamwarUser> getAll() {
|
|
||||||
return getAll.listSelect();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void createOrUpdateUsername(UUID uuid, String userName) {
|
|
||||||
insert.update(uuid, userName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<SteamwarUser> getServerTeam() {
|
|
||||||
return getServerTeam.listSelect();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<SteamwarUser> getTeam(int teamId) {
|
|
||||||
return byTeam.listSelect(teamId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -76,9 +76,9 @@ public class Team {
|
|||||||
|
|
||||||
public static Team get(int id) {
|
public static Team get(int id) {
|
||||||
if(id == -1)
|
if(id == -1)
|
||||||
return new Team(-1, "?", "?", "8");
|
return new Team(-1, "?", "?", "8", "", 25565, false);
|
||||||
if(id == 0)
|
if(id == 0)
|
||||||
return pub;
|
return new Team(0, "PUB", "Public", "8", "", 25565, false);
|
||||||
return byId.select(id);
|
return byId.select(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren