cleanup
This commit is contained in:
parent
004ab1e220
commit
9daf6158f7
5 changed files with 8 additions and 33 deletions
|
@ -3,7 +3,6 @@
|
|||
"package": "eu.e99.svc.client.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"PlayerEntityMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
|
@ -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 = "<init>", 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());
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue