mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 02:37:34 +02:00
Encode enums as integers
This commit is contained in:
@ -36,7 +36,7 @@ public class LoginActionMessage implements ChannelMessage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(ByteArrayDataInput input) {
|
public void readFrom(ByteArrayDataInput input) {
|
||||||
this.type = Type.valueOf(input.readUTF());
|
this.type = Type.values()[input.readInt()];
|
||||||
|
|
||||||
this.playerName = input.readUTF();
|
this.playerName = input.readUTF();
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class LoginActionMessage implements ChannelMessage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(ByteArrayDataOutput output) {
|
public void writeTo(ByteArrayDataOutput output) {
|
||||||
output.writeUTF(type.name());
|
output.writeInt(type.ordinal());
|
||||||
|
|
||||||
//Data is sent through a random player. We have to tell the Bukkit version of this plugin the target
|
//Data is sent through a random player. We have to tell the Bukkit version of this plugin the target
|
||||||
output.writeUTF(playerName);
|
output.writeUTF(playerName);
|
||||||
|
Reference in New Issue
Block a user