Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit 4fb30fe

Browse files
committed
Update protocol to 1.2.10
1 parent 090d5fc commit 4fb30fe

File tree

4 files changed

+48
-24
lines changed

4 files changed

+48
-24
lines changed

src/main/java/org/dragonet/proxy/protocol/ProtocolInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ public class ProtocolInfo {
1010
/**
1111
* Actual Minecraft: PE protocol version
1212
*/
13-
public static final int CURRENT_PROTOCOL = 160;
13+
public static final int CURRENT_PROTOCOL = 201;
1414
/**
1515
* Current Minecraft PE version reported by the server. This is usually the
1616
* earliest currently supported version.
1717
*/
18-
public static final String MINECRAFT_VERSION = "v1.2.8";
18+
public static final String MINECRAFT_VERSION = "v1.2.10";
1919
/**
2020
* Version number sent to clients in ping responses.
2121
*/
22-
public static final String MINECRAFT_VERSION_NETWORK = "1.2.8";
22+
public static final String MINECRAFT_VERSION_NETWORK = "1.2.10";
2323

2424
public static final byte LOGIN_PACKET = (byte) 0x01;
2525
public static final byte PLAY_STATUS_PACKET = (byte) 0x02;

src/main/java/org/dragonet/proxy/protocol/packets/AddPlayerPacket.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ public class AddPlayerPacket extends PEPacket {
1616

1717
public UUID uuid;
1818
public String username;
19+
public String thirdpartyName;
20+
public int platformID;
1921
public long eid;
2022
public long rtid;
23+
public String platformChatID;
2124
public Vector3F position;
2225
public Vector3F motion;
2326
public float pitch;
@@ -40,8 +43,11 @@ public int pid() {
4043
public void encodePayload() {
4144
putUUID(uuid);
4245
putString(username);
46+
putString(thirdpartyName);
47+
putVarInt(platformID);
4348
putVarLong(eid);
4449
putUnsignedVarLong(rtid);
50+
putString(platformChatID);
4551
putVector3F(position);
4652
putVector3F(motion);
4753
putLFloat(pitch);
@@ -54,12 +60,12 @@ public void encodePayload() {
5460
} else {
5561
putUnsignedVarInt(0);
5662
}
57-
putUnsignedVarInt(0);
58-
putUnsignedVarInt(0);
59-
putUnsignedVarInt(0);
60-
putUnsignedVarInt(0);
61-
putUnsignedVarInt(0);
62-
putLLong(0L);
63+
putUnsignedVarInt(0); //Flags
64+
putUnsignedVarInt(0); //Command permission
65+
putUnsignedVarInt(0); //Action Permissions
66+
putUnsignedVarInt(0); //Permission Level
67+
putUnsignedVarInt(0); //Custom stored permissions
68+
putLLong(0L); //User Id
6369
if (links != null && links.length > 0) {
6470
putUnsignedVarInt(links.length);
6571
for (PEEntityLink l : links) {
@@ -101,4 +107,4 @@ public void decodePayload() {
101107
}
102108
}
103109
}
104-
}
110+
}

src/main/java/org/dragonet/proxy/protocol/packets/PlayerHotbarPacket.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class PlayerHotbarPacket extends PEPacket {
99
public int selectedHotbarSlot;
1010
public int windowId = -1;
1111

12-
public int[] slots;
12+
// public int[] slots;
1313

1414
public boolean selectHotbarSlot = true;
1515

@@ -22,12 +22,12 @@ public int pid() {
2222
public void decodePayload() {
2323
this.selectedHotbarSlot = (int) this.getUnsignedVarInt();
2424
this.windowId = this.getByte();
25-
int count = (int) this.getUnsignedVarInt();
26-
slots = new int[count];
27-
28-
for (int i = 0; i < count; ++i) {
29-
this.slots[i] = Binary.signInt((int) this.getUnsignedVarInt());
30-
}
25+
// int count = (int) this.getUnsignedVarInt();
26+
// slots = new int[count];
27+
//
28+
// for (int i = 0; i < count; ++i) {
29+
// this.slots[i] = Binary.signInt((int) this.getUnsignedVarInt());
30+
// }
3131
this.selectHotbarSlot = this.getBoolean();
3232
}
3333

@@ -36,10 +36,10 @@ public void encodePayload() {
3636
this.reset();
3737
this.putUnsignedVarInt(this.selectedHotbarSlot);
3838
this.putByte((byte) this.windowId);
39-
this.putUnsignedVarInt(this.slots.length);
40-
for (int i : slots) {
41-
this.putUnsignedVarInt(i);
42-
}
39+
// this.putUnsignedVarInt(this.slots.length);
40+
// for (int i : slots) {
41+
// this.putUnsignedVarInt(i);
42+
// }
4343
this.putBoolean(this.selectHotbarSlot);
4444
}
45-
}
45+
}

src/main/java/org/dragonet/proxy/protocol/packets/StartGamePacket.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ public class StartGamePacket extends PEPacket {
4343
public boolean startWithMapEnabled;
4444
public boolean trustPlayersEnabled;
4545
public int defaultPlayerPermission;
46+
public int gamePublishSetting;
47+
public int serverChunkTickRadius = 4; //TODO (leave as default for now)
48+
public int serverChunkTickRange;
49+
public boolean hasPlatformBroadcast;
50+
public int platformBroadcastMode;
4651
public int xboxLiveBroadcastMode;
52+
public boolean xboxLiveBroadcastIntent;
4753

4854
public String levelId;
4955
public String worldName;
@@ -95,7 +101,13 @@ public void encodePayload() {
95101
putBoolean(startWithMapEnabled);
96102
putBoolean(trustPlayersEnabled);
97103
putVarInt(defaultPlayerPermission);
104+
putVarInt(gamePublishSetting);
105+
putVarInt(serverChunkTickRadius);
106+
putVarInt(serverChunkTickRange);
107+
putBoolean(hasPlatformBroadcast);
108+
putVarInt(platformBroadcastMode);
98109
putVarInt(xboxLiveBroadcastMode);
110+
putBoolean(xboxLiveBroadcastIntent);
99111

100112
putString(levelId);
101113
putString(worldName);
@@ -123,7 +135,7 @@ public void decodePayload() {
123135
generator = getVarInt();
124136
worldGamemode = getVarInt();
125137
difficulty = Difficulty.values()[getVarInt()];
126-
spawnPosition = getBlockPosition();
138+
spawnPosition = getSignedBlockPosition();
127139
achievementsDisabled = getBoolean();
128140
time = getVarInt();
129141
eduMode = getBoolean();
@@ -139,7 +151,13 @@ public void decodePayload() {
139151
startWithMapEnabled = getBoolean();
140152
trustPlayersEnabled = getBoolean();
141153
defaultPlayerPermission = getVarInt();
154+
gamePublishSetting = getVarInt();
155+
serverChunkTickRadius = getVarInt();
156+
serverChunkTickRange = getInt();
157+
hasPlatformBroadcast = getBoolean();
158+
platformBroadcastMode = getVarInt();
142159
xboxLiveBroadcastMode = getVarInt();
160+
xboxLiveBroadcastIntent = getBoolean();
143161

144162
levelId = getString();
145163
worldName = getString();
@@ -149,4 +167,4 @@ public void decodePayload() {
149167

150168
enchantmentSeed = getVarInt();
151169
}
152-
}
170+
}

0 commit comments

Comments
 (0)