mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-26 22:10:26 +00:00
[Refactoring] Removed now unused protobuff code from the buld scripts and project (#167)
Some checks failed
Build / Build-Server-Jar (push) Has been cancelled
Some checks failed
Build / Build-Server-Jar (push) Has been cancelled
* [Refactoring] Remove all protobuff related code from the gradle script and project * [Refactoring] Removed now unused exlipse and intellij plugins * [Dependencies] Updated lombok version (1.18.24->1.18.34)
This commit is contained in:
parent
3932bdead9
commit
95b26b5ba4
64
build.gradle
64
build.gradle
@ -12,9 +12,6 @@ buildscript {
|
||||
repositories {
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
@ -26,15 +23,6 @@ plugins {
|
||||
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
|
||||
// Apply the protobuf auto generator
|
||||
id 'com.google.protobuf' version "0.8.18"
|
||||
|
||||
// Eclipse Support
|
||||
id 'eclipse'
|
||||
|
||||
// IntelliJ Support
|
||||
id 'idea'
|
||||
|
||||
// Maven
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
@ -85,7 +73,6 @@ dependencies {
|
||||
implementation group: 'io.netty', name: 'netty-transport-native-kqueue', version: '4.1.79.Final'
|
||||
|
||||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
|
||||
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.18.2'
|
||||
|
||||
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
|
||||
|
||||
@ -114,12 +101,10 @@ dependencies {
|
||||
implementation group: 'io.javalin', name: 'javalin', version: '4.6.4'
|
||||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.3'
|
||||
|
||||
protobuf files('proto/')
|
||||
|
||||
compileOnly 'org.projectlombok:lombok:1.18.24'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.24'
|
||||
testCompileOnly 'org.projectlombok:lombok:1.18.24'
|
||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.34'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.34'
|
||||
testCompileOnly 'org.projectlombok:lombok:1.18.34'
|
||||
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
@ -132,7 +117,6 @@ application {
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude("*.proto")
|
||||
zip64 = true
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
mergeServiceFiles()
|
||||
@ -146,8 +130,6 @@ shadowJar {
|
||||
}
|
||||
|
||||
jar {
|
||||
exclude '*.proto'
|
||||
|
||||
manifest {
|
||||
attributes 'Main-Class': 'emu.grasscutter.Grasscutter'
|
||||
}
|
||||
@ -232,48 +214,14 @@ publishing {
|
||||
}
|
||||
}
|
||||
|
||||
clean {
|
||||
delete protobuf.generatedFilesBaseDir
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc {
|
||||
// The artifact spec for the Protobuf Compiler
|
||||
artifact = 'com.google.protobuf:protoc:3.18.1'
|
||||
}
|
||||
// generatedFilesBaseDir = "$projectDir/src/main/java/emu/grasscutter/net/proto/"
|
||||
generatedFilesBaseDir = "$projectDir/src/generated/"
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
proto {
|
||||
// In addition to the default 'src/main/proto'
|
||||
srcDir 'src/generated'
|
||||
}
|
||||
java {
|
||||
srcDir 'src/java'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
// proto files and generated Java files are automatically added as
|
||||
// source dirs.
|
||||
// If you have additional sources, add them here:
|
||||
sourceDirs += file("/proto/");
|
||||
}
|
||||
}
|
||||
|
||||
eclipse {
|
||||
classpath {
|
||||
file.whenMerged { cp ->
|
||||
cp.entries.add( new org.gradle.plugins.ide.eclipse.model.SourceFolder('src/generated/main/java', null) )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
if(!version.endsWith('-dev')) {
|
||||
sign publishing.publications.mavenJava
|
||||
@ -306,8 +254,4 @@ public final class BuildConfig {
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
dependsOn "generateProto"
|
||||
}
|
||||
|
||||
task generateActivityConditions(type: GenerateActivityConditions)
|
||||
|
@ -11,8 +11,6 @@ import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.Loggers;
|
||||
import emu.grasscutter.game.props.ElementReactionType;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.binout.AbilityData;
|
||||
import emu.grasscutter.data.binout.AbilityMixinData;
|
||||
@ -414,11 +412,11 @@ public final class AbilityManager extends BasePlayerManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMixinCostStamina(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleMixinCostStamina(AbilityInvokeEntry invoke) {
|
||||
|
||||
}
|
||||
|
||||
private void handleGenerateElemBall(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleGenerateElemBall(AbilityInvokeEntry invoke) {
|
||||
|
||||
}
|
||||
|
||||
@ -432,7 +430,7 @@ public final class AbilityManager extends BasePlayerManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void handleGlobalFloatValue(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleGlobalFloatValue(AbilityInvokeEntry invoke) {
|
||||
var entity = this.player.getScene().getEntityById(invoke.getEntityId());
|
||||
if(entity == null) return;
|
||||
|
||||
@ -465,11 +463,11 @@ public final class AbilityManager extends BasePlayerManager {
|
||||
|
||||
}
|
||||
|
||||
private void handleModifierDurabilityChange(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleModifierDurabilityChange(AbilityInvokeEntry invoke) {
|
||||
|
||||
}
|
||||
|
||||
private void handleAddNewAbility(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleAddNewAbility(AbilityInvokeEntry invoke) {
|
||||
var entity = this.player.getScene().getEntityById(invoke.getEntityId());
|
||||
|
||||
if(entity == null) {
|
||||
@ -496,7 +494,7 @@ public final class AbilityManager extends BasePlayerManager {
|
||||
* Invoked when an entity triggered an elemental reaction.
|
||||
* @param invoke Holds information of elemental reaction, attacker and target.
|
||||
*/
|
||||
private void handleTriggerElementReaction(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
private void handleTriggerElementReaction(AbilityInvokeEntry invoke) {
|
||||
if (getPlayer().getScene() == null) return;
|
||||
|
||||
AbilityMetaTriggerElementReaction data = AbilityMetaTriggerElementReaction.parseBy(invoke.getAbilityData(), player.getSession().getVersion());
|
||||
|
@ -1,12 +1,8 @@
|
||||
package emu.grasscutter.game.ability.actions;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
|
||||
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
|
||||
import emu.grasscutter.game.ability.Ability;
|
||||
import emu.grasscutter.game.ability.AbilityModifierController;
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
|
||||
@AbilityAction(AbilityModifierAction.Type.ApplyModifier)
|
||||
|
@ -1,7 +1,5 @@
|
||||
package emu.grasscutter.game.ability.mixins;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import emu.grasscutter.data.binout.AbilityMixinData;
|
||||
import emu.grasscutter.game.ability.Ability;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package emu.grasscutter.game.managers.energy;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.DataLoader;
|
||||
import emu.grasscutter.data.GameData;
|
||||
@ -121,7 +120,7 @@ public class EnergyManager extends BasePlayerManager {
|
||||
};
|
||||
}
|
||||
|
||||
public void handleGenerateElemBall(AbilityInvokeEntry invoke) throws InvalidProtocolBufferException {
|
||||
public void handleGenerateElemBall(AbilityInvokeEntry invoke) {
|
||||
// ToDo:
|
||||
// This is also called when a weapon like Favonius Warbow etc. creates energy through its passive.
|
||||
// We are not handling this correctly at the moment.
|
||||
|
@ -3,7 +3,6 @@ package emu.grasscutter.net.packet;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.utils.Crypto;
|
||||
import lombok.val;
|
||||
@ -76,15 +75,6 @@ public class BasePacket {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setData(GeneratedMessageV3 proto) {
|
||||
this.data = proto.toByteArray();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void setData(GeneratedMessageV3.Builder proto) {
|
||||
this.data = proto.build().toByteArray();
|
||||
}
|
||||
|
||||
public BasePacket buildHeader(int clientSequence) {
|
||||
if (this.getHeader() != null && clientSequence == 0) {
|
||||
return this;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package emu.grasscutter.net.packet;
|
||||
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import org.anime_game_servers.core.base.Version;
|
||||
import org.anime_game_servers.multi_proto.core.interfaces.ProtoModel;
|
||||
@ -36,14 +35,4 @@ public abstract class BaseTypedPacket<Packet extends ProtoModel> extends BasePac
|
||||
public void setData(byte[] data) {
|
||||
throw new UnsupportedOperationException("Not supported, why are you doing this.");
|
||||
}
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setData(GeneratedMessageV3 proto) {
|
||||
setData((byte[])null);
|
||||
}
|
||||
|
||||
@Override @Deprecated
|
||||
public void setData(GeneratedMessageV3.Builder proto) {
|
||||
setData((byte[])null);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package emu.grasscutter.server.http.dispatch;
|
||||
|
||||
import com.google.protobuf.ByteString;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.Grasscutter.ServerRunMode;
|
||||
import emu.grasscutter.server.event.dispatch.QueryAllRegionsEvent;
|
||||
|
Loading…
Reference in New Issue
Block a user