Java 类net.minecraft.network.login.server.S00PacketDisconnect 实例源码

项目:NeptuneMod    文件:MixinNetHandlerHandshakeTCP_Bungee.java   
@Inject(method = "processHandshake", at = @At(value = "HEAD"), cancellable = true)
private void onProcessHandshake(C00Handshake packetIn, CallbackInfo ci) {
    if (packetIn.getRequestedState().equals(EnumConnectionState.LOGIN)) {
        final String[] split = packetIn.ip.split("\00");

        if (split.length >= 3) {
            packetIn.ip = split[0];
            ((IMixinNetworkManager_Bungee) this.networkManager).setRemoteAddress(new InetSocketAddress(split[1],
                            ((InetSocketAddress) this.networkManager.getRemoteAddress()).getPort()));
            ((IMixinNetworkManager_Bungee) this.networkManager).setSpoofedUUID(UUIDTypeAdapter.fromString(split[2]));

            if (split.length == 4) {
                ((IMixinNetworkManager_Bungee) this.networkManager).setSpoofedProfile(GSON.fromJson(split[3], Property[].class));
            }
        } else {
            final ChatComponentText chatcomponenttext =
                    new ChatComponentText("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!");
            this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
            this.networkManager.closeChannel(chatcomponenttext);
        }
    }
}
项目:DecompiledMinecraft    文件:NetHandlerLoginServer.java   
public void closeConnection(String reason)
{
    try
    {
        logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason);
        ChatComponentText chatcomponenttext = new ChatComponentText(reason);
        this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
        this.networkManager.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error((String)"Error whilst disconnecting player", (Throwable)exception);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerHandshakeTCP.java   
/**
 * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The
 * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention
 * must pass a versioncheck or receive a disconnect otherwise
 */
public void processHandshake(C00Handshake packetIn)
{
    switch (packetIn.getRequestedState())
    {
        case LOGIN:
            this.networkManager.setConnectionState(EnumConnectionState.LOGIN);

            if (packetIn.getProtocolVersion() > 47)
            {
                ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
                this.networkManager.closeChannel(chatcomponenttext);
            }
            else if (packetIn.getProtocolVersion() < 47)
            {
                ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1));
                this.networkManager.closeChannel(chatcomponenttext1);
            }
            else
            {
                this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager));
            }

            break;

        case STATUS:
            this.networkManager.setConnectionState(EnumConnectionState.STATUS);
            this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager));
            break;

        default:
            throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState());
    }
}
项目:DecompiledMinecraft    文件:NetHandlerLoginServer.java   
public void closeConnection(String reason)
{
    try
    {
        logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason);
        ChatComponentText chatcomponenttext = new ChatComponentText(reason);
        this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
        this.networkManager.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error((String)"Error whilst disconnecting player", (Throwable)exception);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerHandshakeTCP.java   
/**
 * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The
 * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention
 * must pass a versioncheck or receive a disconnect otherwise
 */
public void processHandshake(C00Handshake packetIn)
{
    switch (packetIn.getRequestedState())
    {
        case LOGIN:
            this.networkManager.setConnectionState(EnumConnectionState.LOGIN);

            if (packetIn.getProtocolVersion() > 47)
            {
                ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
                this.networkManager.closeChannel(chatcomponenttext);
            }
            else if (packetIn.getProtocolVersion() < 47)
            {
                ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1));
                this.networkManager.closeChannel(chatcomponenttext1);
            }
            else
            {
                this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager));
            }

            break;

        case STATUS:
            this.networkManager.setConnectionState(EnumConnectionState.STATUS);
            this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager));
            break;

        default:
            throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState());
    }
}
项目:BaseClient    文件:NetHandlerLoginServer.java   
public void closeConnection(String reason)
{
    try
    {
        logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason);
        ChatComponentText chatcomponenttext = new ChatComponentText(reason);
        this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
        this.networkManager.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error((String)"Error whilst disconnecting player", (Throwable)exception);
    }
}
项目:BaseClient    文件:NetHandlerHandshakeTCP.java   
/**
 * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The
 * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention
 * must pass a versioncheck or receive a disconnect otherwise
 */
public void processHandshake(C00Handshake packetIn)
{
    switch (packetIn.getRequestedState())
    {
        case LOGIN:
            this.networkManager.setConnectionState(EnumConnectionState.LOGIN);

            if (packetIn.getProtocolVersion() > 47)
            {
                ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
                this.networkManager.closeChannel(chatcomponenttext);
            }
            else if (packetIn.getProtocolVersion() < 47)
            {
                ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1));
                this.networkManager.closeChannel(chatcomponenttext1);
            }
            else
            {
                this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager));
            }

            break;

        case STATUS:
            this.networkManager.setConnectionState(EnumConnectionState.STATUS);
            this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager));
            break;

        default:
            throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState());
    }
}
项目:BaseClient    文件:NetHandlerLoginServer.java   
public void closeConnection(String reason)
{
    try
    {
        logger.info("Disconnecting " + this.getConnectionInfo() + ": " + reason);
        ChatComponentText chatcomponenttext = new ChatComponentText(reason);
        this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
        this.networkManager.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error((String)"Error whilst disconnecting player", (Throwable)exception);
    }
}
项目:BaseClient    文件:NetHandlerHandshakeTCP.java   
/**
 * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The
 * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention
 * must pass a versioncheck or receive a disconnect otherwise
 */
public void processHandshake(C00Handshake packetIn)
{
    switch (packetIn.getRequestedState())
    {
        case LOGIN:
            this.networkManager.setConnectionState(EnumConnectionState.LOGIN);

            if (packetIn.getProtocolVersion() > 47)
            {
                ChatComponentText chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext));
                this.networkManager.closeChannel(chatcomponenttext);
            }
            else if (packetIn.getProtocolVersion() < 47)
            {
                ChatComponentText chatcomponenttext1 = new ChatComponentText("Outdated client! Please use 1.8.8");
                this.networkManager.sendPacket(new S00PacketDisconnect(chatcomponenttext1));
                this.networkManager.closeChannel(chatcomponenttext1);
            }
            else
            {
                this.networkManager.setNetHandler(new NetHandlerLoginServer(this.server, this.networkManager));
            }

            break;

        case STATUS:
            this.networkManager.setConnectionState(EnumConnectionState.STATUS);
            this.networkManager.setNetHandler(new NetHandlerStatusServer(this.server, this.networkManager));
            break;

        default:
            throw new UnsupportedOperationException("Invalid intention " + packetIn.getRequestedState());
    }
}
项目:Resilience-Client-Source    文件:NetHandlerLoginServer.java   
public void func_147322_a(String p_147322_1_)
{
    try
    {
        logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_);
        ChatComponentText var2 = new ChatComponentText(p_147322_1_);
        this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]);
        this.field_147333_a.closeChannel(var2);
    }
    catch (Exception var3)
    {
        logger.error("Error whilst disconnecting player", var3);
    }
}
项目:Resilience-Client-Source    文件:NetHandlerHandshakeTCP.java   
/**
 * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The
 * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention
 * must pass a versioncheck or receive a disconnect otherwise
 */
public void processHandshake(C00Handshake p_147383_1_)
{
    switch (NetHandlerHandshakeTCP.SwitchEnumConnectionState.field_151291_a[p_147383_1_.func_149594_c().ordinal()])
    {
        case 1:
            this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN);
            ChatComponentText var2;

            if (p_147383_1_.func_149595_d() > 4)
            {
                var2 = new ChatComponentText("Outdated server! I\'m still on 1.7.2");
                this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]);
                this.field_147386_b.closeChannel(var2);
            }
            else if (p_147383_1_.func_149595_d() < 4)
            {
                var2 = new ChatComponentText("Outdated client! Please use 1.7.2");
                this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(var2), new GenericFutureListener[0]);
                this.field_147386_b.closeChannel(var2);
            }
            else
            {
                this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b));
            }

            break;

        case 2:
            this.field_147386_b.setConnectionState(EnumConnectionState.STATUS);
            this.field_147386_b.setNetHandler(new NetHandlerStatusServer(this.field_147387_a, this.field_147386_b));
            break;

        default:
            throw new UnsupportedOperationException("Invalid intention " + p_147383_1_.func_149594_c());
    }
}
项目:Cauldron    文件:NetHandlerLoginServer.java   
public void func_147322_a(String p_147322_1_)
{
    try
    {
        logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_);
        ChatComponentText chatcomponenttext = new ChatComponentText(p_147322_1_);
        this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]);
        this.field_147333_a.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error("Error whilst disconnecting player", exception);
    }
}
项目:Cauldron    文件:NetHandlerLoginServer.java   
public void func_147322_a(String p_147322_1_)
{
    try
    {
        logger.info("Disconnecting " + this.func_147317_d() + ": " + p_147322_1_);
        ChatComponentText chatcomponenttext = new ChatComponentText(p_147322_1_);
        this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]);
        this.field_147333_a.closeChannel(chatcomponenttext);
    }
    catch (Exception exception)
    {
        logger.error("Error whilst disconnecting player", exception);
    }
}
项目:nailed    文件:ServerStartingConnectionDestroyer.java   
@Override
protected void channelRead0(ChannelHandlerContext ctx, C00Handshake packet) throws Exception {
    if(!NettyChannelInitializer.serverStarting){
        ctx.fireChannelRead(packet);
        ctx.pipeline().remove(this);
    }else{
        ctx.writeAndFlush(new S00PacketDisconnect(new ChatComponentText("Server is still starting! Please wait before connecting!"))).addListener(ChannelFutureListener.CLOSE);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect packetIn)
{
    this.networkManager.closeChannel(packetIn.func_149603_c());
}
项目:BaseClient    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect packetIn)
{
    this.networkManager.closeChannel(packetIn.func_149603_c());
}
项目:BaseClient    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect packetIn)
{
    this.networkManager.closeChannel(packetIn.func_149603_c());
}
项目:Resilience-Client-Source    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect p_147388_1_)
{
    this.field_147393_d.closeChannel(p_147388_1_.func_149603_c());
}
项目:Cauldron    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect p_147388_1_)
{
    this.field_147393_d.closeChannel(p_147388_1_.func_149603_c());
}
项目:Cauldron    文件:NetHandlerLoginClient.java   
public void handleDisconnect(S00PacketDisconnect p_147388_1_)
{
    this.field_147393_d.closeChannel(p_147388_1_.func_149603_c());
}
项目:DecompiledMinecraft    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect packetIn);
项目:DecompiledMinecraft    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect packetIn);
项目:BaseClient    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect packetIn);
项目:BaseClient    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect packetIn);
项目:Resilience-Client-Source    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect var1);
项目:Cauldron    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect p_147388_1_);
项目:Cauldron    文件:INetHandlerLoginClient.java   
void handleDisconnect(S00PacketDisconnect p_147388_1_);