Bläddra i källkod

Update to Java 14

Fixed invalid use of ResultSet#first() instead of ResultSet#next(),
reported by cryops.
Fixed several typos.
Updated L2J Commons to 2.6.3.0.
Updated MMO Core to 2.6.2.0.
Updated TestNG to 7.3.0.
Updated Mockito to 3.5.2.
Zoey76 4 år sedan
förälder
incheckning
957dce2d15

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 .project
 .classpath
 .idea/
+*.iml
 target/
 logs/
 log/

+ 3 - 3
.settings/org.eclipse.jdt.core.prefs

@@ -1,11 +1,11 @@
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=14
+org.eclipse.jdt.core.compiler.compliance=14
 org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
 org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
 org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=14
 org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false

+ 4 - 4
README.md

@@ -27,13 +27,13 @@ Server and Datapack may not be not be bundled or packaged.
 Requeriments
 ---
 
-Windows or Linux system with Java JDK 11+, Maven 3.6+, MariaDB 10.4+.
+Windows or Linux system with Java JDK 14+ and MariaDB 10.4+.
 
 At least 4gb of RAM and 2 Cores.
 
-Open ports 2016 and 7777.
+Open ports 2106 and 7777.
 
-High Five part 5 NA client fully updated.
+High Five part 5 client fully updated.
 
 Links
 ---
@@ -42,7 +42,7 @@ Links
 
 - [Forums](http://www.l2jserver.com/forum/)
 
-- [Live Support](https://gitter.im/L2J/L2J_Server)
+- [Discord](https://discord.gg/jMnKZA)
 
 - [Trello](https://trello.com/b/qjLoH966)
 

+ 2 - 2
bitbucket-pipelines.yml

@@ -1,4 +1,4 @@
-image: maven:3.6.3-jdk-11-slim
+image: openjdk:14-alpine
 
 pipelines:
    branches:
@@ -7,7 +7,7 @@ pipelines:
             caches:
              - maven
             script:
-             - mvn install
+             - /bin/sh mvnw clean install
             artifacts:
              - target/*.zip
          - step:

+ 6 - 18
pom.xml

@@ -6,22 +6,20 @@
 	<version>2.6.2.0-SNAPSHOT</version>
 	<name>L2J Game Server</name>
 	<properties>
-		<maven.compiler.source>11</maven.compiler.source>
-		<maven.compiler.target>11</maven.compiler.target>
+		<maven.compiler.source>14</maven.compiler.source>
+		<maven.compiler.target>14</maven.compiler.target>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 		<slf4j.version>1.7.30</slf4j.version>
 		<log4j.version>2.13.3</log4j.version>
 		<InMemoryJavaCompiler.version>1.3.0</InMemoryJavaCompiler.version>
 		<gson.version>2.8.6</gson.version>
-		<weupnp.version>0.1.4</weupnp.version>
 		<owner.version>1.0.12</owner.version>
-		<l2j-server-mmocore.version>2.6.1.2</l2j-server-mmocore.version>
-		<l2j-server-commons.version>2.6.2.2</l2j-server-commons.version>
+		<l2j-server-commons.version>2.6.3.0</l2j-server-commons.version>
 		<l2j-server-geo-driver.version>2.6.1.0</l2j-server-geo-driver.version>
 		<!-- Test -->
-		<testng.version>7.1.0</testng.version>
-		<mockito-core.version>3.4.0</mockito-core.version>
+		<testng.version>7.3.0</testng.version>
+		<mockito-core.version>3.5.2</mockito-core.version>
 		<!-- Plugins -->
 		<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
 		<maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
@@ -52,7 +50,7 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-assembly-plugin</artifactId>
-				<version>${maven-assembly-plugin.version}</version><!--$NO-MVN-MAN-VER$-->
+				<version>${maven-assembly-plugin.version}</version><!-- $NO-MVN-MAN-VER$ -->
 				<executions>
 					<execution>
 						<phase>package</phase>
@@ -103,22 +101,12 @@
 			<artifactId>gson</artifactId>
 			<version>${gson.version}</version>
 		</dependency>
-		<dependency>
-			<groupId>org.bitlet</groupId>
-			<artifactId>weupnp</artifactId>
-			<version>${weupnp.version}</version>
-		</dependency>
 		<dependency>
 			<groupId>org.aeonbits.owner</groupId>
 			<artifactId>owner-java8</artifactId>
 			<version>${owner.version}</version>
 		</dependency>
 		<!-- L2J -->
-		<dependency>
-			<groupId>org.bitbucket.l2jserver</groupId>
-			<artifactId>l2j-server-mmocore</artifactId>
-			<version>${l2j-server-mmocore.version}</version>
-		</dependency>
 		<dependency>
 			<groupId>org.bitbucket.l2jserver</groupId>
 			<artifactId>l2j-server-commons</artifactId>

+ 1 - 1
src/main/java/com/l2jserver/gameserver/ai/CtrlIntention.java

@@ -39,5 +39,5 @@ public enum CtrlIntention {
 	/** PickUp and item, (got to item, pickup it, become idle */
 	AI_INTENTION_PICK_UP,
 	/** Move to target, then interact */
-	AI_INTENTION_INTERACT;
+	AI_INTENTION_INTERACT
 }

+ 1 - 1
src/main/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java

@@ -906,7 +906,7 @@ public class Olympiad extends ListenersContainer {
 			var ps = con.prepareStatement("SELECT olympiad_points FROM olympiad_nobles_eom WHERE charId = ?")) {
 			ps.setInt(1, objId);
 			try (var rs = ps.executeQuery()) {
-				if (rs.first()) {
+				if (rs.next()) {
 					result = rs.getInt(1);
 				}
 			}

+ 1 - 1
src/main/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -1408,7 +1408,7 @@ public class Quest extends AbstractScript implements IIdentifiable {
 			ps.setString(1, getName());
 			ps.setString(2, var);
 			try (var rs = ps.executeQuery()) {
-				if (rs.first()) {
+				if (rs.next()) {
 					result = rs.getString(1);
 				}
 			}

+ 1 - 1
src/main/java/com/l2jserver/gameserver/model/quest/QuestState.java

@@ -377,7 +377,7 @@ public final class QuestState {
 			ps.setInt(1, _player.getObjectId());
 			ps.setString(2, var);
 			try (var rs = ps.executeQuery()) {
-				if (rs.first()) {
+				if (rs.next()) {
 					result = rs.getString(1);
 				}
 			}

+ 4 - 4
src/main/java/com/l2jserver/gameserver/network/L2GamePacketHandler.java

@@ -26,9 +26,9 @@ import java.util.logging.Logger;
 import com.l2jserver.commons.util.Util;
 import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
 import com.l2jserver.gameserver.network.clientpackets.*;
-import com.l2jserver.mmocore.IClientFactory;
-import com.l2jserver.mmocore.IMMOExecutor;
-import com.l2jserver.mmocore.IPacketHandler;
+import com.l2jserver.mmocore.ClientFactory;
+import com.l2jserver.mmocore.MMOExecutor;
+import com.l2jserver.mmocore.PacketHandler;
 import com.l2jserver.mmocore.MMOConnection;
 import com.l2jserver.mmocore.ReceivablePacket;
 
@@ -42,7 +42,7 @@ import com.l2jserver.mmocore.ReceivablePacket;
  * Note: If for a given exception a packet needs to be handled on more then one state, then it should be added to all these states.
  * @author KenM
  */
-public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>, IClientFactory<L2GameClient>, IMMOExecutor<L2GameClient> {
+public final class L2GamePacketHandler implements PacketHandler<L2GameClient>, ClientFactory<L2GameClient>, MMOExecutor<L2GameClient> {
 	private static final Logger _log = Logger.getLogger(L2GamePacketHandler.class.getName());
 	
 	// implementation