diff --git a/client-fabric/resources/svc.mixins.json b/client-fabric/resources/svc.mixins.json index 82dbe62..7b7c489 100644 --- a/client-fabric/resources/svc.mixins.json +++ b/client-fabric/resources/svc.mixins.json @@ -3,7 +3,6 @@ "package": "eu.e99.svc.client.fabric.mixin", "compatibilityLevel": "JAVA_21", "mixins": [ - "PlayerEntityMixin" ], "injectors": { "defaultRequire": 1 diff --git a/client-fabric/src/eu/e99/svc/client/fabric/mixin/PlayerEntityMixin.java b/client-fabric/src/eu/e99/svc/client/fabric/mixin/PlayerEntityMixin.java deleted file mode 100644 index fcd2ef7..0000000 --- a/client-fabric/src/eu/e99/svc/client/fabric/mixin/PlayerEntityMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -package eu.e99.svc.client.fabric.mixin; - -import com.mojang.authlib.GameProfile; -import dev.onvoid.webrtc.RTCPeerConnection; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(PlayerEntity.class) -public class PlayerEntityMixin { - - @Shadow @Final private GameProfile gameProfile; - - @Inject(method = "", at = @At("RETURN")) - private void svc$init(World world, BlockPos pos, float yaw, GameProfile gameProfile, CallbackInfo ci) { - System.out.printf("Added %s.%n", gameProfile.getName()); - } - - @Inject(method = "remove", at = @At("HEAD")) - private void svc$remove(Entity.RemovalReason reason, CallbackInfo ci) { - System.out.printf("Removed %s.%n", this.gameProfile.getName()); - } -} diff --git a/server/build.gradle b/server/build.gradle index 6085679..d3b079f 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -16,3 +16,8 @@ sourceSets { main.java.srcDirs = ['src'] main.resources.srcDirs = ['resources'] } + +tasks.register('run', JavaExec) { + mainClass = 'eu.e99.svc.server.Main' + classpath = sourceSets.main.runtimeClasspath +} diff --git a/server/src/eu/e99/svc/server/Main.java b/server/src/eu/e99/svc/server/Main.java index 8fac3f9..9c3b74f 100644 --- a/server/src/eu/e99/svc/server/Main.java +++ b/server/src/eu/e99/svc/server/Main.java @@ -19,6 +19,7 @@ public class Main { try (ServerSocket socket = socketFactory.createServerSocket()) { socket.bind(new InetSocketAddress("0.0.0.0", 6969)); + System.out.printf("Server listening.%n"); Server server = new Server(socket); server.start(); diff --git a/server/src/eu/e99/svc/server/Server.java b/server/src/eu/e99/svc/server/Server.java index 308212c..5b83efd 100644 --- a/server/src/eu/e99/svc/server/Server.java +++ b/server/src/eu/e99/svc/server/Server.java @@ -55,7 +55,7 @@ public class Server { } private void handleConnection(Socket client) throws IOException { - System.out.printf("Accepted client %s.%n", client.getInetAddress()); + System.out.printf("Handling client %s.%n", client.getInetAddress()); Connection conn = new Connection(client); PlayerProfile profile = this.handleHandshake(conn); @@ -109,7 +109,7 @@ public class Server { if (clientHello.version < SimplerVoiceChat.PROTOCOL_VERSION) { System.out.printf("Refusing to accept client, outdated client.%n"); - conn.disconnect("Outdated client. Please update the mode."); + conn.disconnect("Outdated client. Please update the mod."); return null; }