Skip to content

Commit

Permalink
版本更新
Browse files Browse the repository at this point in the history
  • Loading branch information
CaaMoe committed Dec 16, 2021
1 parent 9c64ac2 commit 25905fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import net.kyori.adventure.text.Component;

public interface Disconnectable {
void disconnect(Component reason);

static Disconnectable generateDisconnectable(Object obj){
static Disconnectable generateDisconnectable(Object obj) {
if (obj.getClass().getName().endsWith("InitialInboundConnection")) {
return InitialInboundConnectionProxy.of(obj);
}
return LoginInboundConnectionProxy.of(obj);
}

void disconnect(Component reason);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ private InitialInboundConnectionProxy(InitialInboundConnection connection) {
this.connection = connection;
}

public static Disconnectable of(Object obj) {
return new InitialInboundConnectionProxy((InitialInboundConnection) obj);
}

@Override
public void disconnect(Component reason) {
connection.disconnect(reason);
}

public static Disconnectable of(Object obj){
return new InitialInboundConnectionProxy((InitialInboundConnection) obj);
}

@Override
public String toString() {
return "InitialInboundConnectionProxy{" + "connection=" + connection +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ private LoginInboundConnectionProxy(LoginInboundConnection connection) {
this.connection = connection;
}

public static Disconnectable of(Object obj) {
return new LoginInboundConnectionProxy((LoginInboundConnection) obj);
}

@Override
public void disconnect(Component reason) {
connection.disconnect(reason);
}

public static Disconnectable of(Object obj){
return new LoginInboundConnectionProxy((LoginInboundConnection) obj);
}

@Override
public String toString() {
return "LoginInboundConnectionProxy{" + "connection=" + connection +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fun.ksnb.multilogin.velocity.impl;

import com.velocitypowered.api.util.GameProfile;
import com.velocitypowered.proxy.connection.client.InitialInboundConnection;
import com.velocitypowered.proxy.connection.client.LoginSessionHandler;
import fun.ksnb.multilogin.velocity.auth.Disconnectable;
import fun.ksnb.multilogin.velocity.main.MultiLoginVelocityPluginBootstrap;
Expand Down

0 comments on commit 25905fb

Please sign in to comment.