Add team packet.

This commit is contained in:
md_5 2013-03-23 20:32:37 +11:00
parent 14fcb90395
commit c97f113497
3 changed files with 55 additions and 0 deletions

View File

@ -229,6 +229,7 @@ public abstract class DefinedPacket implements DataOutput
classes[0xCE] = PacketCEScoreboardObjective.class;
classes[0xCF] = PacketCFScoreboardScore.class;
classes[0xD0] = PacketD0DisplayScoreboard.class;
classes[0xD1] = PacketD1Team.class;
classes[0xFA] = PacketFAPluginMessage.class;
classes[0xFC] = PacketFCEncryptionResponse.class;
classes[0xFD] = PacketFDEncryptionRequest.class;

View File

@ -0,0 +1,50 @@
package net.md_5.bungee.packet;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ToString
@EqualsAndHashCode(callSuper = false)
public class PacketD1Team extends DefinedPacket
{
public String name;
/**
* 0 - create, 1 remove, 2 info update, 3 player add, 4 player remove.
*/
public byte mode;
public String displayName;
public String prefix;
public String suffix;
public byte friendlyFire;
public short playerCount;
public String[] players;
public PacketD1Team(byte[] buf)
{
super( 0xD1, buf );
name = readUTF();
mode = readByte();
if ( mode == 0 || mode == 2 )
{
displayName = readUTF();
prefix = readUTF();
suffix = readUTF();
friendlyFire = readByte();
}
if ( mode == 0 || mode == 3 || mode == 4 )
{
players = new String[ readShort() ];
for ( int i = 0; i < players.length; i++ )
{
players[i] = readUTF();
}
}
}
@Override
public void handle(PacketHandler handler) throws Exception
{
handler.handle( this );
}
}

View File

@ -68,6 +68,10 @@ public abstract class PacketHandler
{
}
public void handle(PacketD1Team team) throws Exception
{
}
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
{
}