Changed onDataPacket for server use as well