geforkt von SteamWar/BungeeCore
Merge pull request 'Event deadline' (#188) from event-deadline into master
Reviewed-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Commit
2368953e23
@ -78,12 +78,16 @@ public class EventCommand extends BasicCommand {
|
||||
private void noCurrentEvent(ProxiedPlayer player){
|
||||
Message.send("EVENT_NO_CURRENT", player);
|
||||
List<Event> coming = Event.getComing();
|
||||
Instant now = Instant.now();
|
||||
if(!coming.isEmpty()){
|
||||
DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(Message.parse("EVENT_DATE_FORMAT", player));
|
||||
Message.send("EVENT_COMING", player);
|
||||
for(Event e : coming){
|
||||
Message.send("EVENT_COMING_EVENT", player, e.getStart().toLocalDateTime().format(dateFormat), e.getEnd().toLocalDateTime().format(dateFormat), e.getEventName());
|
||||
Set<Team> teams = TeamTeilnahme.getTeams(e.getEventID());
|
||||
if(now.isBefore(e.getDeadline().toInstant())) {
|
||||
Message.send("EVENT_COMING_DEADLINE", player, e.getDeadline());
|
||||
}
|
||||
if(!teams.isEmpty()){
|
||||
StringBuilder tline = new StringBuilder();
|
||||
for(Team t : teams){
|
||||
|
@ -509,7 +509,7 @@ public class TeamCommand extends BasicCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if(Instant.now().isAfter(event.getEnd().toInstant())){
|
||||
if(Instant.now().isAfter(event.getDeadline().toInstant())){
|
||||
Message.send("TEAM_EVENT_OVER", player);
|
||||
return;
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ public class Event {
|
||||
private final int maximumTeamMembers;
|
||||
private final boolean publicSchemsOnly;
|
||||
private final boolean spectateSystem;
|
||||
private final Timestamp deadline;
|
||||
|
||||
private static Event current = null;
|
||||
|
||||
@ -48,6 +49,7 @@ public class Event {
|
||||
this.maximumTeamMembers = rs.getInt("MaximumTeamMembers");
|
||||
this.publicSchemsOnly = rs.getBoolean("PublicSchemsOnly");
|
||||
this.spectateSystem = rs.getBoolean("SpectateSystem");
|
||||
this.deadline = rs.getTimestamp("Deadline");
|
||||
}
|
||||
|
||||
public static Event get(){
|
||||
@ -133,4 +135,7 @@ public class Event {
|
||||
public boolean spectateSystem(){
|
||||
return spectateSystem;
|
||||
}
|
||||
public Timestamp getDeadline() {
|
||||
return deadline;
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ EVENT_NO_FIGHT_TEAM=§cDas Team kämpft derzeit nicht
|
||||
EVENT_NO_CURRENT=§cDerzeit findet kein Event statt
|
||||
EVENT_COMING=§eKommende Events§8:
|
||||
EVENT_COMING_EVENT=§7{0}§8-§7{1}§8: §e{2}
|
||||
EVENT_COMING_DEADLINE=§7 Anmeldeschluss§8: §7{0}
|
||||
EVENT_COMING_TEAMS=§7 Mit§8:{0}
|
||||
EVENT_COMING_TEAM= §{0}{1}
|
||||
EVENT_CURRENT_EVENT=§e§l{0}
|
||||
@ -400,7 +401,7 @@ TEAM_EVENT_USAGE=§8/§7team event §8[§eEvent§8] - §7um daran teilzunehmen
|
||||
TEAM_EVENT_HEADER=§7Dein Team nimmt an folgenden Events teil§8:
|
||||
TEAM_EVENT_EVENT=§7{0}§8: §e{1}
|
||||
TEAM_EVENT_NO_EVENT=§cDieses Event gibt es nicht
|
||||
TEAM_EVENT_OVER=§cDieses Event ist bereits vorbei
|
||||
TEAM_EVENT_OVER=§cDie Anmeldephase für dieses Event ist bereits vorbei
|
||||
TEAM_EVENT_LEFT=§7Dein Team nimmt nicht mehr am Event teil
|
||||
TEAM_EVENT_JOINED=§7Dein Team nimmt nun am Event §e{0} §7 teil!
|
||||
TEAM_EVENT_HOW_TO_LEAVE=§7Um die Teilnahme abzusagen, wiederhole den Befehl
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren