Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Apr 20, 2024
2 parents 59e9cc0 + ee02d98 commit bae7749
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 133 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ Binaries
--------
Precompiled binaries are available for end users on [Jenkins](https://www.spigotmc.org/go/bungeecord-dl).

(c) 2012-2023 SpigotMC Pty. Ltd.
(c) 2012-2024 SpigotMC Pty. Ltd.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.3</version>
<version>3.2.4</version>
<executions>
<execution>
<phase>verify</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.md_5.bungee.protocol.packet.ClearTitles;
import net.md_5.bungee.protocol.packet.ClientChat;
import net.md_5.bungee.protocol.packet.ClientCommand;
import net.md_5.bungee.protocol.packet.ClientCommandSigned;
import net.md_5.bungee.protocol.packet.ClientSettings;
import net.md_5.bungee.protocol.packet.ClientStatus;
import net.md_5.bungee.protocol.packet.Commands;
Expand Down Expand Up @@ -52,6 +51,7 @@
import net.md_5.bungee.protocol.packet.Title;
import net.md_5.bungee.protocol.packet.TitleTimes;
import net.md_5.bungee.protocol.packet.Transfer;
import net.md_5.bungee.protocol.packet.UnsignedClientCommand;
import net.md_5.bungee.protocol.packet.ViewDistance;

public abstract class AbstractPacketHandler
Expand Down Expand Up @@ -105,7 +105,7 @@ public void handle(ClientCommand command) throws Exception
{
}

public void handle(ClientCommandSigned command) throws Exception
public void handle(UnsignedClientCommand command) throws Exception
{
}

Expand Down
11 changes: 6 additions & 5 deletions protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.md_5.bungee.protocol.packet.ClearTitles;
import net.md_5.bungee.protocol.packet.ClientChat;
import net.md_5.bungee.protocol.packet.ClientCommand;
import net.md_5.bungee.protocol.packet.ClientCommandSigned;
import net.md_5.bungee.protocol.packet.ClientSettings;
import net.md_5.bungee.protocol.packet.Commands;
import net.md_5.bungee.protocol.packet.CookieRequest;
Expand Down Expand Up @@ -58,6 +57,7 @@
import net.md_5.bungee.protocol.packet.Title;
import net.md_5.bungee.protocol.packet.TitleTimes;
import net.md_5.bungee.protocol.packet.Transfer;
import net.md_5.bungee.protocol.packet.UnsignedClientCommand;
import net.md_5.bungee.protocol.packet.ViewDistance;

public enum Protocol
Expand Down Expand Up @@ -529,12 +529,13 @@ public enum Protocol
ClientCommand.class,
ClientCommand::new,
map( ProtocolConstants.MINECRAFT_1_19, 0x03 ),
map( ProtocolConstants.MINECRAFT_1_19_1, 0x04 )
map( ProtocolConstants.MINECRAFT_1_19_1, 0x04 ),
map( ProtocolConstants.MINECRAFT_1_20_5, 0x05 )
);
TO_SERVER.registerPacket(
ClientCommandSigned.class,
ClientCommandSigned::new,
map( ProtocolConstants.MINECRAFT_1_20_5, 0x05 )
UnsignedClientCommand.class,
UnsignedClientCommand::new,
map( ProtocolConstants.MINECRAFT_1_20_5, 0x04 )
);
TO_SERVER.registerPacket(
ClientChat.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_20 = 763;
public static final int MINECRAFT_1_20_2 = 764;
public static final int MINECRAFT_1_20_3 = 765;
public static final int MINECRAFT_1_20_5 = 1073742013;
public static final int MINECRAFT_1_20_5 = 1073742014;
public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public class ClientCommand extends DefinedPacket
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
command = readString( buf, 256 );
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
{
return;
}

timestamp = buf.readLong();
salt = buf.readLong();

Expand Down Expand Up @@ -79,11 +74,6 @@ public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protoco
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
writeString( command, buf );
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 )
{
return;
}

buf.writeLong( timestamp );
buf.writeLong( salt );

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.md_5.bungee.protocol.packet;

import io.netty.buffer.ByteBuf;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;
import net.md_5.bungee.protocol.ProtocolConstants;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class UnsignedClientCommand extends DefinedPacket
{

private String command;

@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
command = readString( buf, 256 );
}

@Override
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
writeString( command, buf );
}

@Override
public void handle(AbstractPacketHandler handler) throws Exception
{
handler.handle( this );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.md_5.bungee.protocol.packet.Chat;
import net.md_5.bungee.protocol.packet.ClientChat;
import net.md_5.bungee.protocol.packet.ClientCommand;
import net.md_5.bungee.protocol.packet.ClientCommandSigned;
import net.md_5.bungee.protocol.packet.ClientSettings;
import net.md_5.bungee.protocol.packet.CookieResponse;
import net.md_5.bungee.protocol.packet.FinishConfiguration;
Expand All @@ -43,6 +42,7 @@
import net.md_5.bungee.protocol.packet.StartConfiguration;
import net.md_5.bungee.protocol.packet.TabCompleteRequest;
import net.md_5.bungee.protocol.packet.TabCompleteResponse;
import net.md_5.bungee.protocol.packet.UnsignedClientCommand;
import net.md_5.bungee.util.AllowedCharacters;

public class UpstreamBridge extends PacketHandler
Expand Down Expand Up @@ -198,7 +198,7 @@ public void handle(ClientCommand command) throws Exception
}

@Override
public void handle(ClientCommandSigned command) throws Exception
public void handle(UnsignedClientCommand command) throws Exception
{
handleChat( "/" + command.getCommand() );
}
Expand Down

0 comments on commit bae7749

Please sign in to comment.