Skip to content

Commit

Permalink
it is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Acemany committed Oct 26, 2024
1 parent 525dd49 commit 7eb3485
Show file tree
Hide file tree
Showing 436 changed files with 3,968 additions and 3,958 deletions.
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:label="@string/app_name"
android:theme="@style/GdxTheme" android:fullBackupContent="@xml/backup_rules">
<activity
android:name="io.acemany.mindustryV4.AndroidLauncher"
android:name="mindustryV4.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="user"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout">
Expand Down
7 changes: 6 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ android {
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}else if(System.getenv("CI") == "true"){
storeFile = file("../../bekeystore.jks")
storePassword = System.getenv("keystore_password")
keyAlias = System.getenv("keystore_alias")
keyPassword = System.getenv("keystore_alias_password")
}else{
println("No keystore info property found!")
}
Expand Down Expand Up @@ -172,7 +177,7 @@ task run(type: Exec) {
}

def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'io.acemany.mindustryV4/io.acemany.mindustryV4.AndroidLauncher'
commandLine "$adb", 'shell', 'am', 'start', '-n', 'io.acemany.mindustryV4/mindustryV4.AndroidLauncher'
}

// sets up the Android Idea project, using the old Ant based build.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.acemany.mindustryV4;
package mindustryV4;

import android.Manifest;
import android.content.Context;
Expand All @@ -22,23 +22,23 @@
import com.google.android.gms.security.ProviderInstaller;
import io.anuke.kryonet.KryoClient;
import io.anuke.kryonet.KryoServer;
import io.acemany.mindustryV4.core.Platform;
import io.acemany.mindustryV4.game.Saves.SaveSlot;
import io.acemany.mindustryV4.io.SaveIO;
import io.acemany.mindustryV4.net.Net;
import io.acemany.mindustryV4.ui.dialogs.FileChooser;
import io.anuke.ucore.function.Consumer;
import io.anuke.ucore.scene.ui.layout.Unit;
import io.anuke.ucore.util.Bundles;
import io.anuke.ucore.util.Strings;
import mindustryV4.core.Platform;
import mindustryV4.game.Saves.SaveSlot;
import mindustryV4.io.SaveIO;
import mindustryV4.net.Net;
import mindustryV4.ui.dialogs.FileChooser;
import ucore.function.Consumer;
import ucore.scene.ui.layout.Unit;
import ucore.util.Bundles;
import ucore.util.Strings;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

import static io.acemany.mindustryV4.Vars.*;
import static mindustryV4.Vars.*;

public class AndroidLauncher extends PatchedAndroidApplication{
public static final int PERMISSION_REQUEST_CODE = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.acemany.mindustryV4;
package mindustryV4;

import com.badlogic.gdx.backends.android.AndroidApplication;
import java.util.concurrent.ExecutorService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor{
/** Maximum size of each event packet. */
public static final int maxPacketSize = 4096;
/** Name of the base package to put all the generated classes. */
private static final String packageName = "io.acemany.mindustryV4.gen";
private static final String packageName = "mindustryV4.gen";

/** Name of class that handles reading and invoking packets on the server. */
private static final String readServerName = "RemoteReadServer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void generateFor(List<MethodEntry> entries, String className, String pack
Constructor<TypeName> cons = TypeName.class.getDeclaredConstructor(String.class);
cons.setAccessible(true);

TypeName playerType = cons.newInstance("io.acemany.mindustryV4.entities.Player");
TypeName playerType = cons.newInstance("mindustryV4.entities.Player");
//add player parameter
readMethod.addParameter(playerType, "player");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
return;
}

if(!elem.getParameters().get(0).asType().toString().equals("io.acemany.mindustryV4.entities.Player")){
if(!elem.getParameters().get(0).asType().toString().equals("mindustryV4.entities.Player")){
Utils.messager.printMessage(Kind.ERROR, "Client invoke methods should have a first parameter of type Player.", elem);
return;
}
Expand All @@ -99,7 +99,7 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
if(!forwarded && methodEntry.local != Loc.none){
//add in local checks
if(methodEntry.local != Loc.both){
method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !io.acemany.mindustryV4.net.Net.active())");
method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !mindustryV4.net.Net.active())");
}

//concatenate parameters
Expand All @@ -108,7 +108,7 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
for(VariableElement var : elem.getParameters()){
//special case: calling local-only methods uses the local player
if(index == 0 && methodEntry.where == Loc.client){
results.append("io.acemany.mindustryV4.Vars.players[0]");
results.append("mindustryV4.Vars.players[0]");
}else{
results.append(var.getSimpleName());
}
Expand All @@ -129,7 +129,7 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
method.beginControlFlow("if(" + getCheckString(methodEntry.where) + ")");

//add statement to create packet from pool
method.addStatement("$1N packet = $2N.obtain($1N.class, $1N::new)", "io.acemany.mindustryV4.net.Packets.InvokePacket", "io.anuke.ucore.util.Pooling");
method.addStatement("$1N packet = $2N.obtain($1N.class, $1N::new)", "mindustryV4.net.Packets.InvokePacket", "ucore.util.Pooling");
//assign buffer
method.addStatement("packet.writeBuffer = TEMP_BUFFER");
//assign priority
Expand Down Expand Up @@ -161,7 +161,7 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
boolean writePlayerSkipCheck = methodEntry.where == Loc.both && i == 0;

if(writePlayerSkipCheck){ //write begin check
method.beginControlFlow("if(io.acemany.mindustryV4.net.Net.server())");
method.beginControlFlow("if(mindustryV4.net.Net.server())");
}

if(Utils.isPrimitive(typeName)){ //check if it's a primitive, and if so write it
Expand Down Expand Up @@ -207,8 +207,8 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
}

//send the actual packet
method.addStatement("io.acemany.mindustryV4.net.Net." + sendString + "packet, " +
(methodEntry.unreliable ? "io.acemany.mindustryV4.net.Net.SendMode.udp" : "io.acemany.mindustryV4.net.Net.SendMode.tcp") + ")");
method.addStatement("mindustryV4.net.Net." + sendString + "packet, " +
(methodEntry.unreliable ? "mindustryV4.net.Net.SendMode.udp" : "mindustryV4.net.Net.SendMode.tcp") + ")");


//end check for server/client
Expand All @@ -219,8 +219,8 @@ private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry metho
}

private String getCheckString(Loc loc){
return loc.isClient && loc.isServer ? "io.acemany.mindustryV4.net.Net.server() || io.acemany.mindustryV4.net.Net.client()" :
loc.isClient ? "io.acemany.mindustryV4.net.Net.client()" :
loc.isServer ? "io.acemany.mindustryV4.net.Net.server()" : "false";
return loc.isClient && loc.isServer ? "mindustryV4.net.Net.server() || mindustryV4.net.Net.client()" :
loc.isClient ? "mindustryV4.net.Net.client()" :
loc.isServer ? "mindustryV4.net.Net.server()" : "false";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{
/**Target class name.*/
private static final String className = "Serialization";
/** Name of the base package to put all the generated classes. */
private static final String packageName = "io.acemany.mindustryV4.gen";
private static final String packageName = "mindustryV4.gen";

private int round;

Expand Down Expand Up @@ -52,7 +52,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment

TypeSpec.Builder serializer = TypeSpec.anonymousClassBuilder("")
.addSuperinterface(ParameterizedTypeName.get(
ClassName.bestGuess("io.anuke.ucore.io.TypeSerializer"), type));
ClassName.bestGuess("ucore.io.TypeSerializer"), type));

MethodSpec.Builder writeMethod = MethodSpec.methodBuilder("write")
.returns(void.class)
Expand Down Expand Up @@ -83,8 +83,8 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
writeMethod.addStatement("stream.write" + capName + "(object." + name + ")");
readMethod.addStatement("object." + name + "= stream.read" + capName + "()");
}else{
writeMethod.addStatement("io.anuke.ucore.core.Settings.getSerializer(" + typeName+ ".class).write(stream, object." + name + ")");
readMethod.addStatement("object." + name + " = (" +typeName+")io.anuke.ucore.core.Settings.getSerializer(" + typeName+ ".class).read(stream)");
writeMethod.addStatement("ucore.core.Settings.getSerializer(" + typeName+ ".class).write(stream, object." + name + ")");
readMethod.addStatement("object." + name + " = (" +typeName+")ucore.core.Settings.getSerializer(" + typeName+ ".class).read(stream)");
}
}

Expand All @@ -93,7 +93,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
serializer.addMethod(writeMethod.build());
serializer.addMethod(readMethod.build());

method.addStatement("io.anuke.ucore.core.Settings.setSerializer($N, $L)", Utils.elementUtils.getBinaryName(elem).toString().replace('$', '.') + ".class", serializer.build());
method.addStatement("ucore.core.Settings.setSerializer($N, $L)", Utils.elementUtils.getBinaryName(elem).toString().replace('$', '.') + ".class", serializer.build());
}

classBuilder.addMethod(method.build());
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ allprojects {
appName = 'Mindustry V4'
gdxVersion = '1.9.9'
roboVMVersion = '2.3.0'
uCoreVersion = 'b29bd8c7855b797ce80aedc1af271e2c0aca1be8'
uCoreVersion = '4085d65de0cc6b971ac4d8c744b1b690d940270e'

getVersionString = {
String buildVersion = getBuildVersion()
Expand Down Expand Up @@ -129,7 +129,7 @@ project(":ios") {

props['app.id'] = 'io.acemany.mindustryV4'
props['app.version'] = '4.0'
props['app.mainclass'] = 'io.acemany.mindustryV4.IOSLauncher'
props['app.mainclass'] = 'mindustryV4.IOSLauncher'
props['app.executable'] = 'IOSLauncher'
props['app.name'] = 'Mindustry V4'
props['app.build'] = (!props.hasProperty("app.build") ? 40 : props['app.build'].toInteger() + 1)+""
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions core/src/io/acemany/mindustryV4/entities/traits/ShooterTrait.java

This file was deleted.

12 changes: 0 additions & 12 deletions core/src/io/acemany/mindustryV4/entities/traits/SpawnerTrait.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package io.acemany.mindustryV4;
package mindustryV4;

import io.acemany.mindustryV4.core.*;
import io.acemany.mindustryV4.game.EventType.GameLoadEvent;
import io.acemany.mindustryV4.io.BundleLoader;
import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.modules.ModuleCore;
import io.anuke.ucore.util.Log;
import mindustryV4.core.*;
import mindustryV4.game.EventType.GameLoadEvent;
import mindustryV4.io.BundleLoader;
import ucore.core.Events;
import ucore.core.Timers;
import ucore.modules.ModuleCore;
import ucore.util.Log;

import static io.acemany.mindustryV4.Vars.*;
import static mindustryV4.Vars.*;

public class Mindustry extends ModuleCore{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package io.acemany.mindustryV4;
package mindustryV4;

import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import io.acemany.mindustryV4.core.*;
import io.acemany.mindustryV4.entities.Player;
import io.acemany.mindustryV4.entities.TileEntity;
import io.acemany.mindustryV4.entities.bullet.Bullet;
import io.acemany.mindustryV4.entities.effect.Fire;
import io.acemany.mindustryV4.entities.effect.Puddle;
import io.acemany.mindustryV4.entities.traits.SyncTrait;
import io.acemany.mindustryV4.entities.units.BaseUnit;
import io.acemany.mindustryV4.game.Team;
import io.acemany.mindustryV4.game.Version;
import io.acemany.mindustryV4.gen.Serialization;
import io.acemany.mindustryV4.net.Net;
import io.acemany.mindustryV4.world.blocks.defense.ForceProjector.ShieldEntity;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.entities.impl.EffectEntity;
import io.anuke.ucore.entities.trait.DrawTrait;
import io.anuke.ucore.scene.ui.layout.Unit;
import io.anuke.ucore.util.Translator;
import mindustryV4.core.*;
import mindustryV4.entities.Player;
import mindustryV4.entities.TileEntity;
import mindustryV4.entities.bullet.Bullet;
import mindustryV4.entities.effect.Fire;
import mindustryV4.entities.effect.Puddle;
import mindustryV4.entities.traits.SyncTrait;
import mindustryV4.entities.units.BaseUnit;
import mindustryV4.game.Team;
import mindustryV4.game.Version;
import mindustryV4.gen.Serialization;
import mindustryV4.net.Net;
import mindustryV4.world.blocks.defense.ForceProjector.ShieldEntity;
import ucore.core.Settings;
import ucore.entities.Entities;
import ucore.entities.EntityGroup;
import ucore.entities.impl.EffectEntity;
import ucore.entities.trait.DrawTrait;
import ucore.scene.ui.layout.Unit;
import ucore.util.Translator;

import java.util.Arrays;
import java.util.Locale;
Expand Down
Loading

0 comments on commit 7eb3485

Please sign in to comment.