Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v6' into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
CaaMoe committed Jun 20, 2024
2 parents b3144b3 + 17009b1 commit a0ec9c8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class BukkitInjector : Injector {
modified = true
} else if (signatureValidatorClass != null && anyPair.second.javaClass.name.contains("SignatureValidator")) {
// 替换SignatureValidator
anyPair.second = Proxy.newProxyInstance(
Thread.currentThread().contextClassLoader,
arrayOf(signatureValidatorClass),
SignatureValidatorInvocationHandler(anyPair.second)
)
// anyPair.second = Proxy.newProxyInstance(
// Thread.currentThread().contextClassLoader,
// arrayOf(signatureValidatorClass),
// SignatureValidatorInvocationHandler(anyPair.second)
// )
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package moe.caa.multilogin.core.auth.service.floodgate;

import lombok.SneakyThrows;
import moe.caa.multilogin.api.internal.auth.AuthResult;
import moe.caa.multilogin.api.internal.logger.Logger;
import moe.caa.multilogin.api.internal.logger.LoggerProvider;
import moe.caa.multilogin.api.internal.util.reflect.ReflectUtil;
import moe.caa.multilogin.api.profile.GameProfile;
import moe.caa.multilogin.api.internal.util.ValueUtil;
import moe.caa.multilogin.core.auth.LoginAuthResult;
Expand All @@ -16,34 +12,51 @@
import org.geysermc.event.subscribe.Subscriber;
import org.geysermc.event.subscribe.impl.SubscriberImpl;
import org.geysermc.floodgate.api.FloodgateApi;
import org.geysermc.event.PostOrder;
import org.geysermc.event.subscribe.Subscriber;
import org.geysermc.event.subscribe.impl.SubscriberImpl;
import org.geysermc.floodgate.api.FloodgateApi;
import org.geysermc.floodgate.api.InstanceHolder;
import org.geysermc.floodgate.api.event.FloodgateEventBus;
import org.geysermc.floodgate.api.event.skin.SkinApplyEvent;
import org.geysermc.floodgate.api.event.skin.SkinApplyEvent;
import org.geysermc.floodgate.api.handshake.HandshakeData;
import org.geysermc.floodgate.api.handshake.HandshakeHandler;
import org.geysermc.floodgate.util.BedrockData;
import org.geysermc.floodgate.util.LinkedPlayer;

import java.lang.reflect.Field;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.UUID;
import java.util.function.Consumer;

public class FloodgateAuthenticationService implements HandshakeHandler {
private final MultiCore multiCore;

public FloodgateAuthenticationService(MultiCore multiCore) {
this.multiCore = multiCore;
}


FloodgateApi.getInstance().getEventBus().subscribe(SkinApplyEvent.class, event -> {
if(!multiCore.getPluginConfig().isFloodgateSupport()) return;
@Subscribe(postOrder = PostOrder.FIRST)
public void onSkinApply(SkinApplyEvent event){
if(!multiCore.getPluginConfig().isFloodgateSupport()) return;

// always apply bedrock skin.
event.setCancelled(false);
}

// always apply bedrock skin.
event.setCancelled(false);
}, PostOrder.FIRST);
@Subscribe(ignoreCancelled = true, postOrder = PostOrder.FIRST)
public void onSkinApplyIgnoreCancelled(SkinApplyEvent event){
onSkinApply(event);
}

public void register() {
InstanceHolder.getHandshakeHandlers().addHandshakeHandler(this);
FloodgateApi.getInstance().getEventBus().register(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public class MultiServerLogin extends ServerLoginPacket {

@Override
public boolean handle(MinecraftSessionHandler handler) {
if (getPlayerKey() != null) {
setPlayerKey((IdentifiedKey) Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class[]{IdentifiedKey.class}, new IdentifiedKeyInvocationHandler(getPlayerKey())));
}
// if (getPlayerKey() != null) {
// setPlayerKey((IdentifiedKey) Proxy.newProxyInstance(
// Thread.currentThread().getContextClassLoader(),
// new Class[]{IdentifiedKey.class}, new IdentifiedKeyInvocationHandler(getPlayerKey())));
// }

return super.handle(handler);
}
Expand Down

0 comments on commit a0ec9c8

Please sign in to comment.