Commits vergleichen

..

3 Commits

Autor SHA1 Nachricht Datum
9fad1a3a11 Fix
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-03-09 21:45:32 +01:00
7cadd95254 Fix 2024-03-09 21:45:09 +01:00
9ead83ac83 New Packets
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
2024-03-09 21:27:48 +01:00
11 geänderte Dateien mit 183 neuen und 23 gelöschten Zeilen

Datei anzeigen

@ -74,15 +74,15 @@ repositories {
} }
dependencies { dependencies {
compileOnly 'org.projectlombok:lombok:1.18.32' compileOnly 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.32' testCompileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.32' annotationProcessor 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32' testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2' testImplementation 'org.hamcrest:hamcrest:2.2'
compileOnly 'org.xerial:sqlite-jdbc:3.46.0.0' compileOnly 'org.xerial:sqlite-jdbc:3.36.0'
} }
task buildResources { task buildResources {

Datei anzeigen

@ -0,0 +1,35 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.network.packets.api;
import de.steamwar.network.packets.NetworkPacket;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Getter
public class BauStatusRequestPacket extends NetworkPacket {
private static final long serialVersionUID = 1442956004669738962L;
private int playerId;
}

Datei anzeigen

@ -0,0 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.network.packets.api;
import de.steamwar.network.packets.NetworkPacket;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class EventReloadPacket extends NetworkPacket {
private static final long serialVersionUID = 1814658967167959572L;
}

Datei anzeigen

@ -0,0 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.network.packets.client;
import de.steamwar.network.packets.NetworkPacket;
public class AnvilInventoryCallbackPacket extends NetworkPacket {
private static final long serialVersionUID = 9000793526796115661L;
private int player;
private String text;
}

Datei anzeigen

@ -0,0 +1,40 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.network.packets.server;
import de.steamwar.network.packets.NetworkPacket;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Getter
public class AnvilInventoryPacket extends NetworkPacket {
private static final long serialVersionUID = -2283899431463763871L;
private String title;
private int player;
private String defaultText;
private String item;
}

Datei anzeigen

@ -0,0 +1,40 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.network.packets.server.api;
import de.steamwar.network.packets.NetworkPacket;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Getter
public class BauStatusResponsePacket extends NetworkPacket {
private static final long serialVersionUID = 4338519342870271560L;
private int player;
private boolean serverStatus;
private List<Integer> onlinePlayers;
}

Datei anzeigen

@ -87,7 +87,6 @@ public class Event {
private final SchematicType schemType; private final SchematicType schemType;
@Field @Field
private final boolean publicSchemsOnly; private final boolean publicSchemsOnly;
@Deprecated
@Field @Field
private final boolean spectateSystem; private final boolean spectateSystem;

Datei anzeigen

@ -84,12 +84,8 @@ public class EventFight implements Comparable<EventFight> {
private final int teamRed; private final int teamRed;
@Getter @Getter
@Field @Field
@Deprecated
private final int kampfleiter; private final int kampfleiter;
@Getter @Getter
@Field
private final int spectatePort;
@Getter
@Field(def = "0") @Field(def = "0")
private int ergebnis; private int ergebnis;
@Field(nullable = true) @Field(nullable = true)
@ -107,7 +103,7 @@ public class EventFight implements Comparable<EventFight> {
} }
public boolean hasFinished() { public boolean hasFinished() {
return fight != 0 || ergebnis != 0; return fight != 0;
} }
public void reschedule() { public void reschedule() {

Datei anzeigen

@ -31,7 +31,7 @@ import java.util.stream.Collectors;
public class Referee { public class Referee {
private static final Table<Referee> table = new Table<>(Referee.class); private static final Table<Referee> table = new Table<>(Referee.class);
private static final SelectStatement<Referee> byEvent = table.selectFields("eventID"); private static final SelectStatement<Referee> byEvent = table.select("eventID");
public static Set<Integer> get(int eventID) { public static Set<Integer> get(int eventID) {
return byEvent.listSelect(eventID).stream().map(referee -> referee.userID).collect(Collectors.toSet()); return byEvent.listSelect(eventID).stream().map(referee -> referee.userID).collect(Collectors.toSet());

Datei anzeigen

@ -38,7 +38,7 @@ public class SWException {
private static final String SERVER_NAME = new File(CWD).getName(); private static final String SERVER_NAME = new File(CWD).getName();
private static final Table<SWException> table = new Table<>(SWException.class, "Exception"); private static final Table<SWException> table = new Table<>(SWException.class, "Exception");
private static final Statement insert = table.insertFields(true, "server", "message", "stacktrace"); private static final Statement insert = table.insertFields("server", "message", "stacktrace");
@Field(keys = {Table.PRIMARY}, autoincrement = true) @Field(keys = {Table.PRIMARY}, autoincrement = true)
private final int id; private final int id;
@ -52,17 +52,10 @@ public class SWException {
private final String stacktrace; private final String stacktrace;
public static void log(String message, String stacktrace){ public static void log(String message, String stacktrace){
insert.update(SERVER_NAME, generateMessage(message), stacktrace);
}
public static int logGetId(String message, String stacktrace) {
return insert.insertGetKey(SERVER_NAME, generateMessage(message), stacktrace);
}
private static String generateMessage(String message) {
StringBuilder msgBuilder = new StringBuilder(message); StringBuilder msgBuilder = new StringBuilder(message);
SQLWrapper.impl.additionalExceptionMetadata(msgBuilder); SQLWrapper.impl.additionalExceptionMetadata(msgBuilder);
msgBuilder.append("\nCWD: ").append(CWD); msgBuilder.append("\nCWD: ").append(CWD);
return msgBuilder.toString();
insert.update(SERVER_NAME, msgBuilder.toString(), stacktrace);
} }
} }

Datei anzeigen

@ -42,7 +42,6 @@ public enum UserPerm {
RESTRICTED_MODS, RESTRICTED_MODS,
COLOR_CHAT, COLOR_CHAT,
TEAM, TEAM,
TICKET_LOG,
BUILD, BUILD,
CHECK, CHECK,
MODERATION, MODERATION,