Permalink
Browse files

Worthless protocol update

Though you can't even see other players yet, you can join and see some grass now...
  • Loading branch information...
Tee7even committed Apr 8, 2017
1 parent 225fe43 commit 5a91898df8aa532827cce1a738e3854f8b0ddc8b
@@ -9,6 +9,7 @@
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
@SuppressWarnings("unchecked")
public class PacketRegistry {
private static final Class<? extends NetworkPackage>[] RAKNET_PACKETS = new Class[256];
private static final Class<? extends NetworkPackage>[] MCPE_PACKETS = new Class[256];
@@ -66,57 +67,63 @@
MCPE_PACKETS[0x20] = McpeMobEquipment.class;
// MOB_ARMOR_EQUIPMENT_PACKET = 0x21; // McpeMobArmorEquipment.class
MCPE_PACKETS[0x22] = McpeInteract.class;
MCPE_PACKETS[0x23] = McpeUseItem.class;
MCPE_PACKETS[0x24] = McpePlayerAction.class;
// 0x25 McpePlayerFall.class
// HURT_ARMOR_PACKET = 0x26; McpeHurtArmor.class
MCPE_PACKETS[0x27] = McpeSetEntityData.class;
MCPE_PACKETS[0x28] = McpeSetEntityMotion.class;
// SET_ENTITY_LINK_PACKET = 0x29; // McpeSetEntityLink.class
MCPE_PACKETS[0x2a] = McpeSetHealth.class;
MCPE_PACKETS[0x2b] = McpeSetSpawnPosition.class;
MCPE_PACKETS[0x2c] = McpeAnimate.class;
MCPE_PACKETS[0x2d] = McpeRespawn.class;
MCPE_PACKETS[0x2e] = McpeDropItem.class;
// INVENTORY_ACTION_PACKET = 0x2f; // McpeInventoryAction.class
MCPE_PACKETS[0x30] = McpeContainerOpen.class;
MCPE_PACKETS[0x31] = McpeContainerClose.class;
MCPE_PACKETS[0x32] = McpeContainerSetSlot.class;
MCPE_PACKETS[0x33] = McpeContainerSetData.class;
MCPE_PACKETS[0x34] = McpeContainerSetContents.class;
// CRAFTING_DATA_PACKET = 0x35; // McpeCraftingData.class
// CRAFTING_EVENT_PACKET = 0x36; // McpeCraftingEvent.class
MCPE_PACKETS[0x37] = McpeAdventureSettings.class;
MCPE_PACKETS[0x38] = McpeBlockEntityData.class;
// PLAYER_INPUT_PACKET = 0x39; // McpePlayerInput.class
MCPE_PACKETS[0x3a] = McpeFullChunkData.class;
MCPE_PACKETS[0x3b] = McpeSetCommandsEnabled.class;
// SET_DIFFICULTY_PACKET = 0x3c; // McpeSetDifficulty.class
MCPE_PACKETS[0x3d] = McpeChangeDimension.class;
MCPE_PACKETS[0x3e] = McpeSetPlayerGameMode.class;
MCPE_PACKETS[0x3f] = McpePlayerList.class;
// EVENT_PACKET = 0x40; //McpeEvent.class
// SPAWN_EXPERIENCE_ORB_PACKET = 0x41; // McpeSpawnExperienceOrb.class
// CLIENTBOUND_MAP_ITEM_DATA_PACKET = 0x42; // McpeClientboundMapItemData.class
// MAP_INFO_REQUEST_PACKET = 0x43; // McpeMapInfoRequest.class
MCPE_PACKETS[0x44] = McpeRequestChunkRadius.class;
MCPE_PACKETS[0x45] = McpeChunkRadiusUpdated.class;
// ITEM_FRAME_DROP_ITEM_PACKET = 0x46; // McpeItemFramDropItem.class
// REPLACE_SELECTED_ITEM_PACKET = 0x47; // McpeReplaceSelectedItem.class
// GAME_RULES_CHANGED_PACKET = 0x48; // McpeGameRulesChanged.class
// CAMERA_PACKET = 0x49; // McpeCamera.class
// ADD_ITEM_PACKET = 0x4a; // McpeAddItem.class
// BOSS_EVENT_PACKET = 0x4b; // McpeBossEvent.class
// 0x4c ????
MCPE_PACKETS[0x4d] = McpeAvailableCommands.class;
MCPE_PACKETS[0x4e] = McpeCommandStep.class;
// RESOURCE_PACK_DATA_INFO_PACKET = 0x4f; // McpeResourcePackDataInfo.class
// RESOURCE_PACK_CHUNK_DATA_PACKET = 0x50;// McpeResourcePackChunkData.class
// RESOURCE_PACK_CHUNK_REQUEST_PACKET = 0x51; //McpeResourcePackChunkRequest.class
//0x52 McpeTransfer.class
// BLOCK_PICK_REQUEST_PACKET = 0x23; // McpeBlockPickRequest.class
MCPE_PACKETS[0x24] = McpeUseItem.class;
MCPE_PACKETS[0x25] = McpePlayerAction.class;
// PLAYER_FALL_PACKET = 0x26; // McpePlayerFall.class
// HURT_ARMOR_PACKET = 0x27; // McpeHurtArmor.class
MCPE_PACKETS[0x28] = McpeSetEntityData.class;
MCPE_PACKETS[0x29] = McpeSetEntityMotion.class;
// SET_ENTITY_LINK_PACKET = 0x2a; // McpeSetEntityLink.class
MCPE_PACKETS[0x2b] = McpeSetHealth.class;
MCPE_PACKETS[0x2c] = McpeSetSpawnPosition.class;
MCPE_PACKETS[0x2d] = McpeAnimate.class;
MCPE_PACKETS[0x2e] = McpeRespawn.class;
MCPE_PACKETS[0x2f] = McpeDropItem.class;
// INVENTORY_ACTION_PACKET = 0x30; // McpeInventoryAction.class
MCPE_PACKETS[0x31] = McpeContainerOpen.class;
MCPE_PACKETS[0x32] = McpeContainerClose.class;
MCPE_PACKETS[0x33] = McpeContainerSetSlot.class;
MCPE_PACKETS[0x34] = McpeContainerSetData.class;
MCPE_PACKETS[0x35] = McpeContainerSetContents.class;
// CRAFTING_DATA_PACKET = 0x36; // McpeCraftingData.class
// CRAFTING_EVENT_PACKET = 0x37; // McpeCraftingEvent.class
MCPE_PACKETS[0x38] = McpeAdventureSettings.class;
MCPE_PACKETS[0x39] = McpeBlockEntityData.class;
// PLAYER_INPUT_PACKET = 0x3a; // McpePlayerInput.class
MCPE_PACKETS[0x3b] = McpeFullChunkData.class;
MCPE_PACKETS[0x3c] = McpeSetCommandsEnabled.class;
// SET_DIFFICULTY_PACKET = 0x3d; // McpeSetDifficulty.class
MCPE_PACKETS[0x3e] = McpeChangeDimension.class;
MCPE_PACKETS[0x3f] = McpeSetPlayerGameMode.class;
MCPE_PACKETS[0x40] = McpePlayerList.class;
// EVENT_PACKET = 0x41; //McpeEvent.class
// SPAWN_EXPERIENCE_ORB_PACKET = 0x42; // McpeSpawnExperienceOrb.class
// CLIENTBOUND_MAP_ITEM_DATA_PACKET = 0x43; // McpeClientboundMapItemData.class
// MAP_INFO_REQUEST_PACKET = 0x44; // McpeMapInfoRequest.class
MCPE_PACKETS[0x45] = McpeRequestChunkRadius.class;
MCPE_PACKETS[0x46] = McpeChunkRadiusUpdated.class;
// ITEM_FRAME_DROP_ITEM_PACKET = 0x47; // McpeItemFramDropItem.class
// REPLACE_SELECTED_ITEM_PACKET = 0x48; // McpeReplaceSelectedItem.class
// GAME_RULES_CHANGED_PACKET = 0x49; // McpeGameRulesChanged.class
// CAMERA_PACKET = 0x4a; // McpeCamera.class
// ADD_ITEM_PACKET = 0x4b; // McpeAddItem.class
// BOSS_EVENT_PACKET = 0x4c; // McpeBossEvent.class
// SHOW_CREDITS_PACKET = 0x4d; // McpeShowCredits.class
MCPE_PACKETS[0x4e] = McpeAvailableCommands.class;
MCPE_PACKETS[0x4f] = McpeCommandStep.class;
// COMMAND_BLOCK_UPDATE_PACKET = 0x50; // McpeCommandBlockUpdate.class
// UPDATE_TRADE_PACKET = 0x51; // McpeUpdateTrade.class
// RESOURCE_PACK_DATA_INFO_PACKET = 0x52; // McpeResourcePackDataInfo.class
// RESOURCE_PACK_CHUNK_DATA_PACKET = 0x53;// McpeResourcePackChunkData.class
// RESOURCE_PACK_CHUNK_REQUEST_PACKET = 0x54; //McpeResourcePackChunkRequest.class
// TRANSFER_PACKET = 0x52 // McpeTransfer.class
// PLAY_SOUND_PACKET = 0x56; // McpePlaySound.class
// STOP_SOUND_PACKET = 0x57; // MspeStopSound.class
// SET_TITLE_PACKET = 0x58; // McpeSetTitle.class
TObjectIntMap<Class<? extends NetworkPackage>> classToIdMap = new TObjectIntHashMap<>(64, 0.75f, -1);
for (int i = 0; i < RAKNET_PACKETS.length; i++) {
@@ -25,7 +25,6 @@
import com.voxelwind.server.network.util.LittleEndianByteBufInputStream;
import com.voxelwind.server.network.util.LittleEndianByteBufOutputStream;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.util.AsciiString;
import io.netty.util.CharsetUtil;
@@ -7,7 +7,7 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class VersionUtil {
private static final int[] COMPATIBLE_PROTOCOL_VERSIONS = new int[]{ 101 };
private static final int[] COMPATIBLE_PROTOCOL_VERSIONS = new int[]{ 105 };
public static int[] getCompatibleProtocolVersions() {
return COMPATIBLE_PROTOCOL_VERSIONS.clone();
@@ -25,6 +25,10 @@ public static String getHumanVersionName(int protocolVersion) {
return "1.0.0";
case 101:
return "1.0.3";
case 102:
return "1.0.4";
case 105:
return "1.0.5";
}
return null;
}
@@ -29,7 +29,7 @@ protected void channelRead0(ChannelHandlerContext ctx, DirectAddressedRakNetPack
UnconnectedPongPacket response = new UnconnectedPongPacket();
response.setPingId(request.getPingId());
response.setServerId(SERVER_ID);
response.setAdvertise("MCPE;Voxelwind server;91;0.16.0;" + server.getSessionManager().countConnected() + ";10000");
response.setAdvertise("MCPE;Voxelwind server;105;1.0.5;" + server.getSessionManager().countConnected() + ";9000");
ctx.writeAndFlush(new DirectAddressedRakNetPacket(response, packet.sender(), packet.recipient()), ctx.voidPromise());
return;
}

2 comments on commit 5a91898

@TheDiamondYT1

This comment has been minimized.

Show comment
Hide comment
@TheDiamondYT1

TheDiamondYT1 Apr 8, 2017

Contributor

Well, this is dead.

Contributor

TheDiamondYT1 replied Apr 8, 2017

Well, this is dead.

@vzlomka76

This comment has been minimized.

Show comment
Hide comment
@vzlomka76

vzlomka76 Apr 14, 2017

@TheDiamondYT1 I also think that the project is dead

vzlomka76 replied Apr 14, 2017

@TheDiamondYT1 I also think that the project is dead

Please sign in to comment.