forked from SteamWar/SteamWar
Refactor CommonCore
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
plugins {
|
||||||
|
id("java")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "de.steamwar"
|
||||||
|
version = ""
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.compileJava {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs("src/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("src/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
annotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
testCompileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
}
|
||||||
+12
-13
@@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 SteamWar.de-Serverteam
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.linkage;
|
package de.steamwar.linkage;
|
||||||
@@ -36,7 +36,6 @@ import javax.lang.model.element.VariableElement;
|
|||||||
import javax.lang.model.type.DeclaredType;
|
import javax.lang.model.type.DeclaredType;
|
||||||
import javax.lang.model.type.TypeMirror;
|
import javax.lang.model.type.TypeMirror;
|
||||||
import javax.tools.Diagnostic;
|
import javax.tools.Diagnostic;
|
||||||
import javax.tools.StandardLocation;
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
plugins {
|
||||||
|
id("java")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "de.steamwar"
|
||||||
|
version = ""
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.compileJava {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs("src/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("src/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
annotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
testCompileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
|
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||||
|
}
|
||||||
+2
-6
@@ -20,12 +20,8 @@
|
|||||||
package de.steamwar.network;
|
package de.steamwar.network;
|
||||||
|
|
||||||
import de.steamwar.network.packets.NetworkPacket;
|
import de.steamwar.network.packets.NetworkPacket;
|
||||||
import de.steamwar.network.packets.client.ExecuteCommandPacket;
|
import de.steamwar.network.packets.client.*;
|
||||||
import de.steamwar.network.packets.client.ImALobbyPacket;
|
import de.steamwar.network.packets.common.*;
|
||||||
import de.steamwar.network.packets.client.InventoryCallbackPacket;
|
|
||||||
import de.steamwar.network.packets.client.PrepareSchemPacket;
|
|
||||||
import de.steamwar.network.packets.common.FightEndsPacket;
|
|
||||||
import de.steamwar.network.packets.common.FightInfoPacket;
|
|
||||||
import de.steamwar.network.packets.server.*;
|
import de.steamwar.network.packets.server.*;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
plugins {
|
||||||
|
id("java")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "de.steamwar"
|
||||||
|
version = ""
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.compileJava {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs("src/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("src/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
}
|
||||||
|
resources {
|
||||||
|
srcDirs("testsrc/")
|
||||||
|
exclude("**/*.java", "**/*.kt")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
annotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
testCompileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
}
|
||||||
+14
-14
@@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.sql;
|
package de.steamwar.sql;
|
||||||
@@ -53,7 +53,7 @@ public class Mod {
|
|||||||
return new Mod(platform, name, ModType.UNKLASSIFIED);
|
return new Mod(platform, name, ModType.UNKLASSIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Mod> getAllModsFiltered(int page, int elementsPerPage, Mod.ModType filter) {
|
public static List<Mod> getAllModsFiltered(int page, int elementsPerPage, ModType filter) {
|
||||||
return Mod.getPageOfType.listSelect(filter, page * elementsPerPage, elementsPerPage);
|
return Mod.getPageOfType.listSelect(filter, page * elementsPerPage, elementsPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public class Mod {
|
|||||||
@Field(def = "0")
|
@Field(def = "0")
|
||||||
private ModType modType;
|
private ModType modType;
|
||||||
|
|
||||||
public void setModType(Mod.ModType modType) {
|
public void setModType(ModType modType) {
|
||||||
set.update(modType, platform, modName);
|
set.update(modType, platform, modName);
|
||||||
this.modType = modType;
|
this.modType = modType;
|
||||||
}
|
}
|
||||||
+13
-13
@@ -1,20 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* This file is a part of the SteamWar software.
|
* This file is a part of the SteamWar software.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 SteamWar.de-Serverteam
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.steamwar.sql;
|
package de.steamwar.sql;
|
||||||
@@ -60,7 +60,7 @@ public class Punishment {
|
|||||||
return getAllPunishments.listSelect(user);
|
return getAllPunishments.listSelect(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPunished(SteamwarUser user, Punishment.PunishmentType type, Consumer<Punishment> callback) {
|
public static boolean isPunished(SteamwarUser user, PunishmentType type, Consumer<Punishment> callback) {
|
||||||
Punishment punishment = Punishment.getPunishmentOfPlayer(user.getId(), type);
|
Punishment punishment = Punishment.getPunishmentOfPlayer(user.getId(), type);
|
||||||
if(punishment == null || !punishment.isCurrent()) {
|
if(punishment == null || !punishment.isCurrent()) {
|
||||||
return false;
|
return false;
|
||||||
+1
-1
@@ -34,7 +34,7 @@ public class Table<T> {
|
|||||||
private final Map<String, TableField<?>> fieldsByIdentifier = new HashMap<>();
|
private final Map<String, TableField<?>> fieldsByIdentifier = new HashMap<>();
|
||||||
final Constructor<T> constructor;
|
final Constructor<T> constructor;
|
||||||
|
|
||||||
private final Map<String, Table.TableField<?>[]> keys;
|
private final Map<String, TableField<?>[]> keys;
|
||||||
|
|
||||||
|
|
||||||
public Table(Class<T> clazz) {
|
public Table(Class<T> clazz) {
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("base")
|
id("base")
|
||||||
id("java")
|
id("java-library")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "de.steamwar"
|
group = "de.steamwar"
|
||||||
@@ -35,24 +35,6 @@ tasks.compileJava {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs("src/")
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs("src/")
|
|
||||||
exclude("**/*.java", "**/*.kt")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
test {
|
|
||||||
java {
|
|
||||||
srcDirs("testsrc/")
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs("testsrc/")
|
|
||||||
exclude("**/*.java", "**/*.kt")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -61,8 +43,9 @@ dependencies {
|
|||||||
testCompileOnly("org.projectlombok:lombok:1.18.32")
|
testCompileOnly("org.projectlombok:lombok:1.18.32")
|
||||||
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
|
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
|
||||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
|
||||||
|
|
||||||
compileOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
compileOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
||||||
|
|
||||||
|
api(project(":CommonCore:SQL"))
|
||||||
|
api(project(":CommonCore:Linkage"))
|
||||||
|
api(project(":CommonCore:Network"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package de.steamwar.lobby;
|
package de.steamwar.lobby;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
import de.steamwar.lobby.portal.FightserverPortal;
|
import de.steamwar.lobby.portal.FightserverPortal;
|
||||||
import de.steamwar.network.packets.common.FightInfoPacket;
|
import de.steamwar.network.packets.common.FightInfoPacket;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|||||||
@@ -110,12 +110,4 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
|
||||||
java {
|
|
||||||
srcDirs()
|
|
||||||
}
|
|
||||||
resources {
|
|
||||||
srcDirs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ rootProject.name = "SteamWar"
|
|||||||
include("CommandFramework")
|
include("CommandFramework")
|
||||||
|
|
||||||
include("CommonCore")
|
include("CommonCore")
|
||||||
|
include("CommonCore:SQL")
|
||||||
|
include("CommonCore:Linkage")
|
||||||
|
include("CommonCore:Network")
|
||||||
|
|
||||||
include("FightSystem")
|
include("FightSystem")
|
||||||
include("FightSystem:FightSystem_8")
|
include("FightSystem:FightSystem_8")
|
||||||
|
|||||||
Reference in New Issue
Block a user