Migrated logging to slf4j
* style: Added load times logging to Gameserver
* refactor(logging): Migrated logging to slf4j
Fixed some warnings along the way
* refactor(logging): Removed slf4j bridge and JUL
* Minor changes to loggers refactor
Approved-by: Zoey76
The buffs use NOT_FRIEND as the affectObject, which was not affecting players when cast by NPCs due to player.isAutoAttackable(npc) returning false.
Fixes: Bless of Sword (6287), Jinia's Prayer (6288), Kegor's Courage (6289)
Until now, the `L2Character` constructor directly invoked the
`IdFactory` to generate an Object ID for each new instance. While this
approach simplified the creation process by deferring ID generation to
the constructor, it introduced a tight coupling between various instance
types and `IdFactory`. This coupling increased the complexity of
testing, as multiple components required mocking to isolate `IdFactory`
interactions.
This refactor decouples `IdFactory` by shifting Object ID generation
responsibility outside the constructor. Going forward, new entities
should receive their Object ID as a constructor parameter. This change
enhances testability by allowing instances to be created without
directly relying on `IdFactory`, simplifying mock requirements and
improving modularity.
Updated SLF4J from 2.0.12 to 2.0.16
Updated GSON from 2.10.1 to 2.11.0
Updated JDA from 5.0.0-beta.22 to 5.1.2
Updated L2J Server Commons from 2.6.7.1 to 2.6.8.0
Updated JUnit Jupiter from 5.10.2 to 5.11.3
Updated Mockito Core from 5.11.0 to 5.14.2
Removed deprecated Mockito Inline
Updated AssertJ from 3.25.3 to 3.26.3
Updated Dependency Check plugin from 9.1.0 to 10.0.4
Updated Maven Jar plugin from 3.3.0 to 3.4.2
Updated Maven Surefire plugin from 3.2.5 to 3.5.1
Fixed traps detection & defusing
* refactor: Made L2Object.isVisibleFor() slightly more generic
Changed signature to take L2Character as param instead of L2PcInstance
Moved L2TrapInstance.canBeSeen() logic to an override of isVisibleFor()
* fix(traps): Fixed trap detection skills not revealing traps
Caused by incorrect visibility check in AffectObject.INVISIBLE
Fixes: Detect Trap (470), Find Trap (623)
* fix(traps): Fixed trap defusing skills not removing traps
Caused by traps not being returned by TargetType.ENEMY and being set as invul on summon.
Fixed non defusable trap in Emerald Square, caused by it being set to invul instead of immortal, which prevents negative effects.
Fixes: Defuse Trap (471), Remove Trap (624)
Approved-by: Zoey76
Fixed POINT_BLANK scope calculating affectObject using target as the caster
Fixed debuffs with targetType SUMMON not being castable. Caused by the server seeing them as debuffs being cast on the summon, as opposed to from the summon.
Added a couple of unit tests for Skill
- Included target, it was being excluded.
- Added affect scope filtering.
- Added support for "target index" in a list of effected targets,
required for "Chain Heal" skill that decreases the power of the skill on
each effected target.
- Fixes#229
Reported by: FinalDestination, Hadriel
Thanks: Pablo Recchia, HorridoJoho, Kita
This was causing doors with emitters to appear closed when open and vice-versa.
Affected are all doors in Nornil's Garden and Hellbound's barrier to the Battered Lands
- Refactored `AcquireSkillList` packet to avoid wasting memory.
- Removed `L2Trainer` instance, it will be handled in Datapack.
- Removed custom `L2Npc` "no teach HTML" code, it will be handled in
Datapack.
- Removed custom `L2NpcInstance` "show skill list" code, it will be
handled in Datapack.
- Removed custom `L2NpcTemplate` "teach info", , it will be handled in
Datapack using retail-like categories.
- Minor refactor of `L2SkillLearn` to use `LinkedList`, it should reduce
the memory foot print.
- Removed custom `NpcData` "learn data", it should reduce the memory
foot print and start up time.
- Added PlayerMenuSelected event and onMenuSelected method.
- Added/fixed PlayerSkillLearned and onAcquireSkill, now
onLearnSkillRequested, using event system.
- Fixes to link bypass.
Renamed `IBaseEvent` to `BaseEvent`.
Removed `ON_` and `On` from all event types and events.
Converted all events DTOs to Java records.
Renamed all methods to `bind` instead of `add`.
Implemented Learn Skill Requested event.
Using Java records to represent events.
Removed `ON_` and `On` from event type and event object.
The `onLearnSkillRequested` method will receive the event object instead
of several parameters.
Methods to reference NPCs to the event will start with `bind` instead of
`add`.
A `setLearnSkillRequested(...)` method was avoided.
The rest of the changes to existing events will be done in a separated
commit.
Centralized code using OWNER configuration framework.
Added the ability to create the path to custom configs (prevents an
exception if the user didn't create it in advance).
Remove the -proc:full configuration from pom.xml. We target Java 21, but
the JDK21 does not support "full" (it is the default value, but it can
not be set on the command line). "full" is only supported on JDK22+.
https://inside.java/2023/10/23/quality-heads-up/
Followed the guide: https://jda.wiki/introduction/migration-v4-v5/
The idea is to reduce the vulnerabilities, but some of them are still
present in this version...
Known vulnerabilities in JDA:
CVE-2023-35116
CVE-2022-24329
CVE-2023-3635
Warning 1:
WARNING: A Java agent has been loaded dynamically
(\.m2\repository\net\bytebuddy\byte-buddy-agent\1.14.9\byte-buddy-agent-1.14.9.jar)
WARNING: If a serviceability tool is in use, please run with
-XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with
-Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a
future release
Warning 2:
Annotation processing is enabled because one or more processors were
found on the class path. A future release of javac may disable
annotation processing unless at least one processor is specified by name
(-processor), or a search path is specified (--processor-path,
--processor-module-path), or annotation processing is enabled explicitly
(-proc:only, -proc:full).
Use -Xlint:-options to suppress this message.
Use -proc:none to disable annotation processing.
Warning 3:
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot
loader classes because bootstrap classpath has been appended
Required by datapack and database update. Previously, boolean fields in
the database were of type enum ('true','false'). The datapack changes
this to type bool.
Changed _skill to protected.
Now L2AttackableAI won't implement Runnable anymore.
Externalized class FearTask to reduce the size of L2AttackableAI.
Removed method getActiveChar(), replaced it with a covariant version of
getActor() method, honoring OOP.
Renamed variables from me and npc to actor.
Using Java 10 local variable type inference where it's possible.
Other minor fixes.
SLF4J from 2.0.6 to 2.0.9
Log4J from 2.19.0 to 2.21.0
JDA from 4.3.0_330 to v4.4.0
L2j Commons from 2.6.6.1 to 2.6.6.4
JUnit from 5.9.2 to 5.10.0
Mockito from 5.0.0 to 5.6.0
Mockito Inline from 5.0.0 to 5.2.0
Maven Surefire from 3.0.0-M8 to 3.1.2
Maven Assembly from 3.4.2 to 3.6.0
Removed JDA's custom repository, version 4.x uses jitpack.io.
Fixed build final name.
Added Dependency Check Maven Plugin