Fixed rendering, simplified netcode

This commit is contained in:
StevenRS11
2013-12-22 16:53:13 -05:00
parent 4e0b7fa977
commit 9bd9cfb700
5 changed files with 66 additions and 19 deletions

View File

@@ -56,6 +56,32 @@ public class ServerPacketHandler implements IPacketHandler
}
}
public static Packet250CustomPayload createLinkPacket(ClientLinkData data)
{
try
{
Packet250CustomPayload packet = new Packet250CustomPayload();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
DataOutputStream writer = new DataOutputStream(buffer);
writer.writeByte(PacketConstants.CREATE_LINK_PACKET_ID);
data.write(writer);
writer.close();
packet.channel = PacketConstants.CHANNEL_NAME;
packet.data = buffer.toByteArray();
packet.length = packet.data.length;
return packet;
}
catch (IOException e)
{
//This shouldn't happen...
e.printStackTrace();
return null;
}
}
private static void sendDimPacket(byte id, ClientDimData data)
{
try